This macro is used to create collate blocks used when sorting ASCII characters. The definition from rt_locale.h, the definition of a macro for creating an empty table, and sample code are shown in Example 2.17 and Example 2.18. These examples are incomplete, so see the rt_locale.h include file for more information.
For all the macros, the first two arguments are a symbol prefix and a locale name. The resulting locale block is addressed by the expression &symprefix_start, and the index entry by the expression &symprefix_index.
Example 2.17. Macro for use with array
#define __LC_COLLATE_DEF(sym,ln) static const int sym##_index = ~3&(3+(268+(~3&(3+sizeof(ln))))); static const char sym##_lname[~3 & (3 + sizeof(ln))] = ln; static const int sym##_pname = ‑4‑(~3 & (3 + sizeof(ln))); static const int sym##_start = 4; static const char sym##_table[] =
Example 2.18. Macro that generates default table
#define __LC_COLLATE_TRIVIAL_DEF(sym,ln) static const int sym##_index = ~3&(3+(12+(~3&(3+sizeof(ln))))); static const char sym##_lname[~3 & (3 + sizeof(ln))] = ln; static const int sym##_pname = ‑4‑(~3 & (3 + sizeof(ln))); static const int sym##_start = 0;