paulo@0: #ifndef LJLOCALE_H paulo@0: #define LJLOCALE_H paulo@0: #include paulo@0: paulo@0: /* paulo@0: A FourCC, or four-character code, is a short string that fits in a paulo@0: 32-bit word. paulo@0: */ paulo@0: typedef union FourCC { paulo@0: char c[4]; paulo@0: uint32_t i; paulo@0: } FourCC; paulo@0: paulo@0: /* When abusing union, test that the types that the compiler uses are paulo@0: the same types the developer's compiler uses. */ paulo@0: extern char sizeof_uint32_t_equals_4[(sizeof(uint32_t) == 4) ? 1 : -1]; paulo@0: paulo@0: typedef struct FourCCLocaleEntry { paulo@0: FourCC code; paulo@0: const char *name; paulo@0: const char *desc; paulo@0: } FourCCLocaleEntry; paulo@0: paulo@0: void ljSetLocale(const FourCCLocaleEntry *locale); paulo@0: paulo@0: #define _4CC(i) (ljGetFourCCName((FourCC){i})) paulo@0: const char *ljGetFourCCName(FourCC i); paulo@0: paulo@0: #define _4CCDESC(i) (ljGetFourCCDesc((FourCC){i})) paulo@0: const char *ljGetFourCCDesc(FourCC i); paulo@0: paulo@0: extern const FourCCLocaleEntry englishLocale[]; paulo@0: #endif