1 /*
2  * Copyright (c) 1999
3  * Silicon Graphics Computer Systems, Inc.
4  *
5  * Copyright (c) 1999
6  * Boris Fomitchev
7  *
8  * This material is provided "as is", with absolutely no warranty expressed
9  * or implied. Any use is at your own risk.
10  *
11  * Permission to use or copy this software for any purpose is hereby granted
12  * without fee, provided the above notices are retained on all copies.
13  * Permission to modify the code and to distribute modified code is granted,
14  * provided the above notices are retained, and a notice that the code was
15  * modified is included with the above copyright notice.
16  *
17  */
18 
19 #include "stlport_prefix.h"
20 
21 #include <stdlib.h>
22 
23 #include <limits.h>
24 #include "c_locale.h"
25 
26 #if defined (_STLP_REAL_LOCALE_IMPLEMENTED)
27 #  if defined (WIN32) || defined (_WIN32)
28 #    include "c_locale_win32/c_locale_win32.c"
29 #  elif defined (_STLP_USE_GLIBC) && ! defined (__CYGWIN__)
30 #    if (__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2))
31 #      include "c_locale_glibc/c_locale_glibc2.c"
32 /* #      define _STLP_GLIBC_LOCALE_2 */ /* glibc 1.90 and newer */
33 /* #      include "c_locale_glibc/c_locale_glibc.c" */
34 #    else
35 #      include "c_locale_glibc/c_locale_glibc.c"
36 #    endif
37 #  elif defined __ISCPP__
38 #    include "c_locale_is/c_locale_is.cpp"
39 #  endif
40 #else /* !_STLP_REAL_LOCALE_IMPLEMENTED */
41 #  include "c_locale_dummy/c_locale_dummy.c"
42 #endif
43 
44 #if defined(N_PLAT_NLM)
wcslen(const wchar_t * _wc)45 int wcslen( const wchar_t *_wc )
46 { return unilen( (const unicode *)_wc ); }
47 
wcscmp(const wchar_t * _wc1,const wchar_t * _wc2)48 int wcscmp( const wchar_t *_wc1, const wchar_t *_wc2 )
49 { return unicmp( (const unicode *)_wc1, (const unicode *)_wc2 ); }
50 
wcsncmp(const wchar_t * _wc1,const wchar_t * _wc2,size_t n)51 int wcsncmp( const wchar_t *_wc1, const wchar_t *_wc2, size_t n )
52 { return unicmp( (const unicode *)_wc1, (const unicode *)_wc2, n ); }
53 
wcsstr(const wchar_t * _wc1,const wchar_t * _wc2)54 wchar_t *wcsstr( const wchar_t *_wc1, const wchar_t *_wc2 )
55 { return (wchar_t *)unistr( (const unicode *)_wc1, (const unicode *)_wc2 ); }
56 
wcschr(const wchar_t * _wc1,wchar_t _wc2)57 wchar_t *wcschr( const wchar_t *_wc1, wchar_t _wc2 )
58 { return (wchar_t *)unichr((const unicode_t *)_wc1, (unicode_t)_wc2 ); }
59 
wcsrchr(const wchar_t * _wc1,wchar_t _wc2)60 wchar_t *wcsrchr( const wchar_t *_wc1, wchar_t _wc2 )
61 { return (wchar_t *)unirchr((const unicode_t *)_wc1, (unicode_t)_wc2 ); }
62 
wcscpy(wchar_t * _wc1,const wchar_t * _wc2)63 wchar_t *wcscpy( wchar_t *_wc1, const wchar_t *_wc2 )
64 { return (wchar_t *)unicpy((unicode_t *)_wc1, (const unicode_t *)_wc2 ); }
65 
wcsncpy(wchar_t * _wc1,const wchar_t * _wc2,size_t n)66 wchar_t *wcsncpy( wchar_t *_wc1, const wchar_t *_wc2, size_t n )
67 { return (wchar_t *)unincpy((unicode_t *)_wc1, (const unicode_t *)_wc2, n ); }
68 
wcspbrk(const wchar_t * _wc,const wchar_t * _wc2)69 wchar_t *wcspbrk( const wchar_t *_wc, const wchar_t *_wc2 )
70 { return (wchar_t *)unipbrk( (const unicode *)_wc, (const unicode *)_wc2 ); }
71 #endif
72