1e1051a39Sopenharmony_ciobjects.txt syntax 2e1051a39Sopenharmony_ci================== 3e1051a39Sopenharmony_ci 4e1051a39Sopenharmony_ciTo cover all the naming hacks that were previously in `objects.h` needed some 5e1051a39Sopenharmony_cikind of hacks in `objects.txt`. 6e1051a39Sopenharmony_ci 7e1051a39Sopenharmony_ciThe basic syntax for adding an object is as follows: 8e1051a39Sopenharmony_ci 9e1051a39Sopenharmony_ci 1 2 3 4 : shortName : Long Name 10e1051a39Sopenharmony_ci 11e1051a39Sopenharmony_ci If Long Name contains only word characters and hyphen-minus 12e1051a39Sopenharmony_ci (0x2D) or full stop (0x2E) then Long Name is used as basis 13e1051a39Sopenharmony_ci for the base name in C. Otherwise, the shortName is used. 14e1051a39Sopenharmony_ci 15e1051a39Sopenharmony_ci The base name (let's call it 'base') will then be used to 16e1051a39Sopenharmony_ci create the C macros SN_base, LN_base, NID_base and OBJ_base. 17e1051a39Sopenharmony_ci 18e1051a39Sopenharmony_ci Note that if the base name contains spaces, dashes or periods, 19e1051a39Sopenharmony_ci those will be converted to underscore. 20e1051a39Sopenharmony_ci 21e1051a39Sopenharmony_ciThen there are some extra commands: 22e1051a39Sopenharmony_ci 23e1051a39Sopenharmony_ci !Alias foo 1 2 3 4 24e1051a39Sopenharmony_ci 25e1051a39Sopenharmony_ci This just makes a name foo for an OID. The C macro 26e1051a39Sopenharmony_ci OBJ_foo will be created as a result. 27e1051a39Sopenharmony_ci 28e1051a39Sopenharmony_ci !Cname foo 29e1051a39Sopenharmony_ci 30e1051a39Sopenharmony_ci This makes sure that the name foo will be used as base name 31e1051a39Sopenharmony_ci in C. 32e1051a39Sopenharmony_ci 33e1051a39Sopenharmony_ci !module foo 34e1051a39Sopenharmony_ci 1 2 3 4 : shortName : Long Name 35e1051a39Sopenharmony_ci !global 36e1051a39Sopenharmony_ci 37e1051a39Sopenharmony_ci The !module command was meant to define a kind of modularity. 38e1051a39Sopenharmony_ci What it does is to make sure the module name is prepended 39e1051a39Sopenharmony_ci to the base name. !global turns this off. This construction 40e1051a39Sopenharmony_ci is not recursive. 41e1051a39Sopenharmony_ci 42e1051a39Sopenharmony_ciLines starting with `#` are treated as comments, as well as any line starting 43e1051a39Sopenharmony_ciwith ! and not matching the commands above. 44