diff src/ljlocale.h @ 0:c84446dfb3f5

initial add
author paulo@localhost
date Fri, 13 Mar 2009 00:39:12 -0700
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/ljlocale.h	Fri Mar 13 00:39:12 2009 -0700
     1.3 @@ -0,0 +1,33 @@
     1.4 +#ifndef LJLOCALE_H
     1.5 +#define LJLOCALE_H
     1.6 +#include <stdint.h>
     1.7 +
     1.8 +/*
     1.9 +A FourCC, or four-character code, is a short string that fits in a
    1.10 +32-bit word.
    1.11 +*/
    1.12 +typedef union FourCC {
    1.13 +  char c[4];
    1.14 +  uint32_t i;
    1.15 +} FourCC;
    1.16 +
    1.17 +/* When abusing union, test that the types that the compiler uses are
    1.18 +   the same types the developer's compiler uses. */
    1.19 +extern char sizeof_uint32_t_equals_4[(sizeof(uint32_t) == 4) ? 1 : -1];
    1.20 +
    1.21 +typedef struct FourCCLocaleEntry {
    1.22 +  FourCC code;
    1.23 +  const char *name;
    1.24 +  const char *desc;
    1.25 +} FourCCLocaleEntry;
    1.26 +
    1.27 +void ljSetLocale(const FourCCLocaleEntry *locale);
    1.28 +
    1.29 +#define _4CC(i) (ljGetFourCCName((FourCC){i}))
    1.30 +const char *ljGetFourCCName(FourCC i);
    1.31 +
    1.32 +#define _4CCDESC(i) (ljGetFourCCDesc((FourCC){i}))
    1.33 +const char *ljGetFourCCDesc(FourCC i);
    1.34 +
    1.35 +extern const FourCCLocaleEntry englishLocale[];
    1.36 +#endif