mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:23:01 +00:00
[LIBXSLT] Update to version 1.1.32. CORE-14291
This commit is contained in:
parent
5c72e50fd0
commit
5c0faa58cf
24 changed files with 945 additions and 911 deletions
25
dll/3rdparty/libxslt/xsltlocale.c
vendored
25
dll/3rdparty/libxslt/xsltlocale.c
vendored
|
@ -14,13 +14,6 @@
|
|||
|
||||
#include "xsltlocale.h"
|
||||
|
||||
#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ <= 2
|
||||
#define newlocale __newlocale
|
||||
#define freelocale __freelocale
|
||||
#define strxfrm_l __strxfrm_l
|
||||
#define LC_COLLATE_MASK (1 << LC_COLLATE)
|
||||
#endif
|
||||
|
||||
#define TOUPPER(c) (c & ~0x20)
|
||||
#define TOLOWER(c) (c | 0x20)
|
||||
#define ISALPHA(c) ((unsigned)(TOUPPER(c) - 'A') < 26)
|
||||
|
@ -87,7 +80,7 @@ xsltFreeLocales(void) {
|
|||
*/
|
||||
xsltLocale
|
||||
xsltNewLocale(const xmlChar *languageTag) {
|
||||
#ifdef XSLT_LOCALE_XLOCALE
|
||||
#ifdef XSLT_LOCALE_POSIX
|
||||
xsltLocale locale;
|
||||
char localeName[XSLTMAX_LANGTAGLEN+6]; /* 6 chars for ".utf8\0" */
|
||||
const xmlChar *p = languageTag;
|
||||
|
@ -189,7 +182,7 @@ xsltNewLocale(const xmlChar *languageTag) {
|
|||
region = xsltDefaultRegion(localeName);
|
||||
if (region == NULL) goto end;
|
||||
|
||||
strcpy(localeName + llen + 1, region);
|
||||
strcpy((char *) localeName + llen + 1, (char *) region);
|
||||
locale = xslt_locale_WINAPI(localeName);
|
||||
end:
|
||||
return(locale);
|
||||
|
@ -347,7 +340,7 @@ xsltDefaultRegion(const xmlChar *localeName) {
|
|||
*/
|
||||
void
|
||||
xsltFreeLocale(xsltLocale locale) {
|
||||
#ifdef XSLT_LOCALE_XLOCALE
|
||||
#ifdef XSLT_LOCALE_POSIX
|
||||
freelocale(locale);
|
||||
#endif
|
||||
}
|
||||
|
@ -371,7 +364,7 @@ xsltStrxfrm(xsltLocale locale, const xmlChar *string)
|
|||
size_t xstrlen, r;
|
||||
xsltLocaleChar *xstr;
|
||||
|
||||
#ifdef XSLT_LOCALE_XLOCALE
|
||||
#ifdef XSLT_LOCALE_POSIX
|
||||
xstrlen = strxfrm_l(NULL, (const char *)string, 0, locale) + 1;
|
||||
xstr = (xsltLocaleChar *) xmlMalloc(xstrlen);
|
||||
if (xstr == NULL) {
|
||||
|
@ -384,7 +377,7 @@ xsltStrxfrm(xsltLocale locale, const xmlChar *string)
|
|||
#endif
|
||||
|
||||
#ifdef XSLT_LOCALE_WINAPI
|
||||
xstrlen = MultiByteToWideChar(CP_UTF8, 0, string, -1, NULL, 0);
|
||||
xstrlen = MultiByteToWideChar(CP_UTF8, 0, (char *) string, -1, NULL, 0);
|
||||
if (xstrlen == 0) {
|
||||
xsltTransformError(NULL, NULL, NULL, "xsltStrxfrm : MultiByteToWideChar check failed\n");
|
||||
return(NULL);
|
||||
|
@ -394,7 +387,7 @@ xsltStrxfrm(xsltLocale locale, const xmlChar *string)
|
|||
xsltTransformError(NULL, NULL, NULL, "xsltStrxfrm : out of memory\n");
|
||||
return(NULL);
|
||||
}
|
||||
r = MultiByteToWideChar(CP_UTF8, 0, string, -1, xstr, xstrlen);
|
||||
r = MultiByteToWideChar(CP_UTF8, 0, (char *) string, -1, xstr, xstrlen);
|
||||
if (r == 0) {
|
||||
xsltTransformError(NULL, NULL, NULL, "xsltStrxfrm : MultiByteToWideChar failed\n");
|
||||
xmlFree(xstr);
|
||||
|
@ -481,9 +474,11 @@ xsltIterateSupportedLocales(LPSTR lcid) {
|
|||
k = sscanf(lcid, "%lx", (long*)&p->lcid);
|
||||
if (k < 1) goto end;
|
||||
/*don't count terminating null character*/
|
||||
k = GetLocaleInfoA(p->lcid, LOCALE_SISO639LANGNAME , iso639lang , sizeof(iso639lang ));
|
||||
k = GetLocaleInfoA(p->lcid, LOCALE_SISO639LANGNAME,
|
||||
(char *) iso639lang, sizeof(iso639lang));
|
||||
if (--k < 1) goto end;
|
||||
l = GetLocaleInfoA(p->lcid, LOCALE_SISO3166CTRYNAME, iso3136ctry, sizeof(iso3136ctry));
|
||||
l = GetLocaleInfoA(p->lcid, LOCALE_SISO3166CTRYNAME,
|
||||
(char *) iso3136ctry, sizeof(iso3136ctry));
|
||||
if (--l < 1) goto end;
|
||||
|
||||
{ /*fill results*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue