restore trunk
[supertux.git] / src / tinygettext / findlocale.hpp
1 /*
2  findlocale-0.46.tar.gz from http://icculus.org/~aspirin/findlocale/
3
4 Copyright (C) 2004 Adam D. Moss (the "Author").  All Rights Reserved.
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is fur-
11 nished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
18 NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
19 AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
21 NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 Except as contained in this notice, the name of the Author of the
24 Software shall not be used in advertising or otherwise to promote the sale,
25 use or other dealings in this Software without prior written authorization
26 from the Author.
27
28 */
29
30 #ifndef __findlocale_h_
31 #define __findlocale_h_
32
33 typedef const char* FL_Lang;
34 typedef const char* FL_Country;
35 typedef const char* FL_Variant;
36
37 typedef struct {
38   FL_Lang    lang;
39   FL_Country country;
40   FL_Variant variant;
41 } FL_Locale;
42
43 typedef enum {
44   /* for some reason we failed to even guess: this should never happen */
45   FL_FAILED        = 0,
46   /* couldn't query locale -- returning a guess (almost always English) */
47   FL_DEFAULT_GUESS = 1,
48   /* the returned locale type was found by successfully asking the system */
49   FL_CONFIDENT     = 2
50 } FL_Success;
51
52 typedef enum {
53   FL_MESSAGES = 0
54 } FL_Domain;
55
56 /* This allocates/fills in a FL_Locale structure with pointers to
57    strings (which should be treated as static), or NULL for inappropriate /
58    undetected fields. */
59 FL_Success FL_FindLocale(FL_Locale **locale, FL_Domain domain);
60 /* This should be used to free the struct written by FL_FindLocale */
61 void FL_FreeLocale(FL_Locale **locale);
62
63 #endif /*__findlocale_h_*/