00001 00032 #ifndef __findlocale_h_ 00033 #define __findlocale_h_ 00034 00035 typedef const char* FL_Lang; 00036 typedef const char* FL_Country; 00037 typedef const char* FL_Variant; 00038 00039 typedef struct { 00040 FL_Lang lang; 00041 FL_Country country; 00042 FL_Variant variant; 00043 } FL_Locale; 00044 00045 typedef enum { 00046 /* for some reason we failed to even guess: this should never happen */ 00047 FL_FAILED = 0, 00048 /* couldn't query locale -- returning a guess (almost always English) */ 00049 FL_DEFAULT_GUESS = 1, 00050 /* the returned locale type was found by successfully asking the system */ 00051 FL_CONFIDENT = 2 00052 } FL_Success; 00053 00054 typedef enum { 00055 FL_MESSAGES = 0 00056 } FL_Domain; 00057 00058 /* This allocates/fills in a FL_Locale structure with pointers to 00059 strings (which should be treated as static), or NULL for inappropriate / 00060 undetected fields. */ 00061 FL_Success FL_FindLocale(FL_Locale **locale, FL_Domain domain); 00062 /* This should be used to free the struct written by FL_FindLocale */ 00063 void FL_FreeLocale(FL_Locale **locale); 00064 00065 #endif /*__findlocale_h_*/