25 #define XSLT_LOCALE_POSIX
36 #define XSLT_LOCALE_WINAPI
43 #define XSLT_LOCALE_NONE
47#define TOUPPER(c) (c & ~0x20)
48#define TOLOWER(c) (c | 0x20)
49#define ISALPHA(c) ((unsigned)(TOUPPER(c) - 'A') < 26)
52#define XSLTMAX_ISO639LANGLEN 8
53#define XSLTMAX_ISO3166CNTRYLEN 8
55#define XSLTMAX_LANGTAGLEN (XSLTMAX_ISO639LANGLEN+1+XSLTMAX_ISO3166CNTRYLEN)
59#ifdef XSLT_LOCALE_WINAPI
62struct xsltRFC1766Info_s {
67typedef struct xsltRFC1766Info_s xsltRFC1766Info;
69static int xsltLocaleListSize = 0;
70static xsltRFC1766Info *xsltLocaleList =
NULL;
74xslt_locale_WINAPI(
const xmlChar *languageTag) {
76 xsltRFC1766Info *
p = xsltLocaleList;
78 for (
k=0;
k<xsltLocaleListSize;
k++,
p++)
84static void xsltEnumSupportedLocales(
void);
94#ifdef XSLT_LOCALE_WINAPI
97 xsltLocaleList =
NULL;
113#ifdef XSLT_LOCALE_POSIX
117 const char *region =
NULL;
118 char *
q = localeName;
123 if (languageTag ==
NULL)
146 locale = newlocale(LC_ALL_MASK, localeName,
NULL);
152 q = localeName + llen;
158 locale = newlocale(LC_ALL_MASK, localeName,
NULL);
171 q = localeName + llen;
176 locale = newlocale(LC_ALL_MASK, localeName,
NULL);
181#ifdef XSLT_LOCALE_WINAPI
190 if (languageTag ==
NULL)
goto end;
192 xsltEnumSupportedLocales();
196 if (
i == 0)
goto end;
201 if (*
p++ !=
'-')
goto end;
205 if (
i == 0 || *
p)
goto end;
208 locale = xslt_locale_WINAPI(localeName);
215 strcpy((
char *) localeName + llen + 1, (
char *) region);
216 locale = xslt_locale_WINAPI(localeName);
222#ifdef XSLT_LOCALE_NONE
231 const char *region =
NULL;
236 switch (localeName[0]) {
238 if (
c ==
'a' ||
c ==
'm') region =
"ET";
239 else if (
c ==
'f') region =
"ZA";
240 else if (
c ==
'n') region =
"ES";
241 else if (
c ==
'r') region =
"AE";
242 else if (
c ==
'z') region =
"AZ";
245 if (
c ==
'e') region =
"BY";
246 else if (
c ==
'g') region =
"BG";
247 else if (
c ==
'n') region =
"BD";
248 else if (
c ==
'r') region =
"FR";
249 else if (
c ==
's') region =
"BA";
252 if (
c ==
'a') region =
"ES";
253 else if (
c ==
's') region =
"CZ";
254 else if (
c ==
'y') region =
"GB";
257 if (
c ==
'a') region =
"DK";
258 else if (
c ==
'e') region =
"DE";
261 if (
c ==
'l') region =
"GR";
262 else if (
c ==
'n' ||
c ==
'o') region =
"US";
263 else if (
c ==
's' ||
c ==
'u') region =
"ES";
264 else if (
c ==
't') region =
"EE";
267 if (
c ==
'a') region =
"IR";
268 else if (
c ==
'i') region =
"FI";
269 else if (
c ==
'o') region =
"FO";
270 else if (
c ==
'r') region =
"FR";
273 if (
c ==
'a') region =
"IE";
274 else if (
c ==
'l') region =
"ES";
275 else if (
c ==
'v') region =
"GB";
278 if (
c ==
'e') region =
"IL";
279 else if (
c ==
'i') region =
"IN";
280 else if (
c ==
'r') region =
"HT";
281 else if (
c ==
'u') region =
"HU";
284 if (
c ==
'd') region =
"ID";
285 else if (
c ==
's') region =
"IS";
286 else if (
c ==
't') region =
"IT";
287 else if (
c ==
'w') region =
"IL";
290 if (
c ==
'a') region =
"JP";
293 if (
c ==
'l') region =
"GL";
294 else if (
c ==
'o') region =
"KR";
295 else if (
c ==
'w') region =
"GB";
298 if (
c ==
't') region =
"LT";
299 else if (
c ==
'v') region =
"LV";
302 if (
c ==
'k') region =
"MK";
303 else if (
c ==
'l' ||
c ==
'r') region =
"IN";
304 else if (
c ==
'n') region =
"MN";
305 else if (
c ==
's') region =
"MY";
306 else if (
c ==
't') region =
"MT";
309 if (
c ==
'b' ||
c ==
'n' ||
c ==
'o') region =
"NO";
310 else if (
c ==
'e') region =
"NP";
311 else if (
c ==
'l') region =
"NL";
314 if (
c ==
'm') region =
"ET";
317 if (
c ==
'a') region =
"IN";
318 else if (
c ==
'l') region =
"PL";
319 else if (
c ==
't') region =
"PT";
322 if (
c ==
'o') region =
"RO";
323 else if (
c ==
'u') region =
"RU";
327 case 'e': region =
"NO";
break;
328 case 'h': region =
"YU";
break;
329 case 'k': region =
"SK";
break;
330 case 'l': region =
"SI";
break;
331 case 'o': region =
"ET";
break;
332 case 'q': region =
"AL";
break;
333 case 't': region =
"ZA";
break;
334 case 'v': region =
"SE";
break;
338 if (
c ==
'a' ||
c ==
'e') region =
"IN";
339 else if (
c ==
'h') region =
"TH";
340 else if (
c ==
'i') region =
"ER";
341 else if (
c ==
'r') region =
"TR";
342 else if (
c ==
't') region =
"RU";
345 if (
c ==
'k') region =
"UA";
346 else if (
c ==
'r') region =
"PK";
349 if (
c ==
'i') region =
"VN";
352 if (
c ==
'a') region =
"BE";
355 if (
c ==
'h') region =
"ZA";
358 if (
c ==
'h') region =
"CN";
359 else if (
c ==
'u') region =
"ZA";
373#ifdef XSLT_LOCALE_POSIX
394#ifdef XSLT_LOCALE_NONE
399#ifdef XSLT_LOCALE_POSIX
402 xstrlen = strxfrm_l(
NULL, (
const char *)
string, 0, vlocale) + 1;
406 "xsltStrxfrm : out of memory error\n");
410 r = strxfrm_l((
char *)xstr, (
const char *)
string, xstrlen, vlocale);
419#ifdef XSLT_LOCALE_WINAPI
420 int wstrlen, xstrlen,
r;
429 wstr = (
wchar_t *)
xmlMalloc(wstrlen *
sizeof(
wchar_t));
487#ifdef XSLT_LOCALE_WINAPI
499 ++xsltLocaleListSize;
513 static int count = 0;
517 xsltRFC1766Info *
p = xsltLocaleList +
count;
523 (
char *) iso639lang,
sizeof(iso639lang));
524 if (--
k < 1)
goto end;
526 (
char *) iso3136ctry,
sizeof(iso3136ctry));
527 if (--
l < 1)
goto end;
545xsltEnumSupportedLocales(
void) {
547 if (xsltLocaleListSize <= 0) {
552 len = xsltLocaleListSize *
sizeof(xsltRFC1766Info);
#define MultiByteToWideChar
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA lpfnLocaleEnum, DWORD dwFlags)
INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
_ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl sscanf(const char *, const char *,...) __WINE_CRT_SCANF_ATTR(2
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble q
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
XMLPUBFUN void xmlRMutexLock(xmlRMutexPtr tok)
XMLPUBFUN void xmlRMutexUnlock(xmlRMutexPtr tok)
#define memcpy(s1, s2, n)
XML_HIDDEN void xmlParserErrors const char const xmlChar const xmlChar * str2
XML_HIDDEN void xmlParserErrors const char const xmlChar * str1
#define LOCALE_SISO639LANGNAME
#define LOCALE_SISO3166CTRYNAME
XMLPUBFUN int xmlStrcmp(const xmlChar *str1, const xmlChar *str2)
void xsltFreeLocales(void)
int xsltLocaleStrcmp(void *locale, const xmlChar *str1, const xmlChar *str2)
static const xmlChar * xsltDefaultRegion(const xmlChar *localeName)
#define XSLTMAX_LANGTAGLEN
#define XSLTMAX_ISO3166CNTRYLEN
#define XSLTMAX_ISO639LANGLEN
xmlChar * xsltStrxfrm(void *vlocale, const xmlChar *string)
void * xsltNewLocale(const xmlChar *languageTag, int lowerFirst ATTRIBUTE_UNUSED)
void xsltFreeLocale(void *locale)
void xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)