Home | History | Annotate | Download | only in libxslt
      1 /*
      2  * Summary: Locale handling
      3  * Description: Interfaces for locale handling. Needed for language dependent
      4  *              sorting.
      5  *
      6  * Copy: See Copyright for the status of this software.
      7  *
      8  * Author: Nick Wellnhofer
      9  */
     10 
     11 #ifndef __XML_XSLTLOCALE_H__
     12 #define __XML_XSLTLOCALE_H__
     13 
     14 #include <libxml/xmlstring.h>
     15 
     16 #ifdef XSLT_LOCALE_XLOCALE
     17 
     18 #include <locale.h>
     19 #include <xlocale.h>
     20 
     21 #ifdef __GLIBC__
     22 /*locale_t is defined only if _GNU_SOURCE is defined*/
     23 typedef __locale_t xsltLocale;
     24 #else
     25 typedef locale_t xsltLocale;
     26 #endif
     27 typedef xmlChar xsltLocaleChar;
     28 
     29 #elif defined(XSLT_LOCALE_WINAPI)
     30 
     31 #include <windows.h>
     32 #include <winnls.h>
     33 
     34 typedef LCID xsltLocale;
     35 typedef wchar_t xsltLocaleChar;
     36 
     37 #else
     38 
     39 /*
     40  * XSLT_LOCALE_NONE:
     41  * Macro indicating that locale are not supported
     42  */
     43 #ifndef XSLT_LOCALE_NONE
     44 #define XSLT_LOCALE_NONE
     45 #endif
     46 
     47 typedef void *xsltLocale;
     48 typedef xmlChar xsltLocaleChar;
     49 
     50 #endif
     51 
     52 xsltLocale xsltNewLocale(const xmlChar *langName);
     53 void xsltFreeLocale(xsltLocale locale);
     54 xsltLocaleChar *xsltStrxfrm(xsltLocale locale, const xmlChar *string);
     55 int xsltLocaleStrcmp(xsltLocale locale, const xsltLocaleChar *str1, const xsltLocaleChar *str2);
     56 
     57 #endif /* __XML_XSLTLOCALE_H__ */
     58