findlocale.h 962 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __findlocale_h_
  2. #define __findlocale_h_
  3. typedef const char* FL_Lang;
  4. typedef const char* FL_Country;
  5. typedef const char* FL_Variant;
  6. typedef struct {
  7. FL_Lang lang;
  8. FL_Country country;
  9. FL_Variant variant;
  10. } FL_Locale;
  11. typedef enum {
  12. /* for some reason we failed to even guess: this should never happen */
  13. FL_FAILED = 0,
  14. /* couldn't query locale -- returning a guess (almost always English) */
  15. FL_DEFAULT_GUESS = 1,
  16. /* the returned locale type was found by successfully asking the system */
  17. FL_CONFIDENT = 2
  18. } FL_Success;
  19. typedef enum {
  20. FL_MESSAGES = 0
  21. } FL_Domain;
  22. /* This allocates/fills in a FL_Locale structure with pointers to
  23. strings (which should be treated as static), or NULL for inappropriate /
  24. undetected fields. */
  25. FL_Success FL_FindLocale(FL_Locale **locale);
  26. /* This should be used to free the struct written by FL_FindLocale */
  27. void FL_FreeLocale(FL_Locale **locale);
  28. #endif /*__findlocale_h_*/