Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
7.0 KiB

  1. /***
  2. * mbstring.h - MBCS string manipulation macros and functions
  3. *
  4. * Copyright (c) 1990-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * This file contains macros and function declarations for the MBCS
  8. * string manipulation functions.
  9. *
  10. * [Public]
  11. *
  12. ****/
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif
  16. #ifndef _INC_MBSTRING
  17. #define _INC_MBSTRING
  18. #if !defined(_WIN32)
  19. #error ERROR: Only Win32 target supported!
  20. #endif
  21. #ifdef _MSC_VER
  22. /*
  23. * Currently, all MS C compilers for Win32 platforms default to 8 byte
  24. * alignment.
  25. */
  26. #pragma pack(push,8)
  27. #endif /* _MSC_VER */
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #if !defined(_W64)
  32. #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
  33. #define _W64 __w64
  34. #else
  35. #define _W64
  36. #endif
  37. #endif
  38. /* Define _CRTIMP */
  39. #ifndef _CRTIMP
  40. #ifdef _DLL
  41. #define _CRTIMP __declspec(dllimport)
  42. #else /* ndef _DLL */
  43. #define _CRTIMP
  44. #endif /* _DLL */
  45. #endif /* _CRTIMP */
  46. /* Define __cdecl for non-Microsoft compilers */
  47. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  48. #define __cdecl
  49. #endif
  50. #ifndef _SIZE_T_DEFINED
  51. #ifdef _WIN64
  52. typedef unsigned __int64 size_t;
  53. #else
  54. typedef _W64 unsigned int size_t;
  55. #endif
  56. #define _SIZE_T_DEFINED
  57. #endif
  58. #ifndef _NLSCMP_DEFINED
  59. #define _NLSCMPERROR 2147483647 /* currently == INT_MAX */
  60. #define _NLSCMP_DEFINED
  61. #endif
  62. #ifndef _VA_LIST_DEFINED
  63. typedef char * va_list;
  64. #define _VA_LIST_DEFINED
  65. #endif
  66. #ifndef _FILE_DEFINED
  67. struct _iobuf {
  68. char *_ptr;
  69. int _cnt;
  70. char *_base;
  71. int _flag;
  72. int _file;
  73. int _charbuf;
  74. int _bufsiz;
  75. char *_tmpfname;
  76. };
  77. typedef struct _iobuf FILE;
  78. #define _FILE_DEFINED
  79. #endif
  80. /*
  81. * MBCS - Multi-Byte Character Set
  82. */
  83. #ifndef _MBSTRING_DEFINED
  84. /* function prototypes */
  85. _CRTIMP unsigned int __cdecl _mbbtombc(unsigned int);
  86. _CRTIMP int __cdecl _mbbtype(unsigned char, int);
  87. _CRTIMP unsigned int __cdecl _mbctombb(unsigned int);
  88. _CRTIMP int __cdecl _mbsbtype(const unsigned char *, size_t);
  89. _CRTIMP unsigned char * __cdecl _mbscat(unsigned char *, const unsigned char *);
  90. _CRTIMP unsigned char * __cdecl _mbschr(const unsigned char *, unsigned int);
  91. _CRTIMP int __cdecl _mbscmp(const unsigned char *, const unsigned char *);
  92. _CRTIMP int __cdecl _mbscoll(const unsigned char *, const unsigned char *);
  93. _CRTIMP unsigned char * __cdecl _mbscpy(unsigned char *, const unsigned char *);
  94. _CRTIMP size_t __cdecl _mbscspn(const unsigned char *, const unsigned char *);
  95. _CRTIMP unsigned char * __cdecl _mbsdec(const unsigned char *, const unsigned char *);
  96. _CRTIMP unsigned char * __cdecl _mbsdup(const unsigned char *);
  97. _CRTIMP int __cdecl _mbsicmp(const unsigned char *, const unsigned char *);
  98. _CRTIMP int __cdecl _mbsicoll(const unsigned char *, const unsigned char *);
  99. _CRTIMP unsigned char * __cdecl _mbsinc(const unsigned char *);
  100. _CRTIMP size_t __cdecl _mbslen(const unsigned char *);
  101. _CRTIMP unsigned char * __cdecl _mbslwr(unsigned char *);
  102. _CRTIMP unsigned char * __cdecl _mbsnbcat(unsigned char *, const unsigned char *, size_t);
  103. _CRTIMP int __cdecl _mbsnbcmp(const unsigned char *, const unsigned char *, size_t);
  104. _CRTIMP int __cdecl _mbsnbcoll(const unsigned char *, const unsigned char *, size_t);
  105. _CRTIMP size_t __cdecl _mbsnbcnt(const unsigned char *, size_t);
  106. _CRTIMP unsigned char * __cdecl _mbsnbcpy(unsigned char *, const unsigned char *, size_t);
  107. _CRTIMP int __cdecl _mbsnbicmp(const unsigned char *, const unsigned char *, size_t);
  108. _CRTIMP int __cdecl _mbsnbicoll(const unsigned char *, const unsigned char *, size_t);
  109. _CRTIMP unsigned char * __cdecl _mbsnbset(unsigned char *, unsigned int, size_t);
  110. _CRTIMP unsigned char * __cdecl _mbsncat(unsigned char *, const unsigned char *, size_t);
  111. _CRTIMP size_t __cdecl _mbsnccnt(const unsigned char *, size_t);
  112. _CRTIMP int __cdecl _mbsncmp(const unsigned char *, const unsigned char *, size_t);
  113. _CRTIMP int __cdecl _mbsncoll(const unsigned char *, const unsigned char *, size_t);
  114. _CRTIMP unsigned char * __cdecl _mbsncpy(unsigned char *, const unsigned char *, size_t);
  115. _CRTIMP unsigned int __cdecl _mbsnextc (const unsigned char *);
  116. _CRTIMP int __cdecl _mbsnicmp(const unsigned char *, const unsigned char *, size_t);
  117. _CRTIMP int __cdecl _mbsnicoll(const unsigned char *, const unsigned char *, size_t);
  118. _CRTIMP unsigned char * __cdecl _mbsninc(const unsigned char *, size_t);
  119. _CRTIMP unsigned char * __cdecl _mbsnset(unsigned char *, unsigned int, size_t);
  120. _CRTIMP unsigned char * __cdecl _mbspbrk(const unsigned char *, const unsigned char *);
  121. _CRTIMP unsigned char * __cdecl _mbsrchr(const unsigned char *, unsigned int);
  122. _CRTIMP unsigned char * __cdecl _mbsrev(unsigned char *);
  123. _CRTIMP unsigned char * __cdecl _mbsset(unsigned char *, unsigned int);
  124. _CRTIMP size_t __cdecl _mbsspn(const unsigned char *, const unsigned char *);
  125. _CRTIMP unsigned char * __cdecl _mbsspnp(const unsigned char *, const unsigned char *);
  126. _CRTIMP unsigned char * __cdecl _mbsstr(const unsigned char *, const unsigned char *);
  127. _CRTIMP unsigned char * __cdecl _mbstok(unsigned char *, const unsigned char *);
  128. _CRTIMP unsigned char * __cdecl _mbsupr(unsigned char *);
  129. _CRTIMP size_t __cdecl _mbclen(const unsigned char *);
  130. _CRTIMP void __cdecl _mbccpy(unsigned char *, const unsigned char *);
  131. #define _mbccmp(_cpc1, _cpc2) _mbsncmp((_cpc1),(_cpc2),1)
  132. /* character routines */
  133. _CRTIMP int __cdecl _ismbcalnum(unsigned int);
  134. _CRTIMP int __cdecl _ismbcalpha(unsigned int);
  135. _CRTIMP int __cdecl _ismbcdigit(unsigned int);
  136. _CRTIMP int __cdecl _ismbcgraph(unsigned int);
  137. _CRTIMP int __cdecl _ismbclegal(unsigned int);
  138. _CRTIMP int __cdecl _ismbclower(unsigned int);
  139. _CRTIMP int __cdecl _ismbcprint(unsigned int);
  140. _CRTIMP int __cdecl _ismbcpunct(unsigned int);
  141. _CRTIMP int __cdecl _ismbcspace(unsigned int);
  142. _CRTIMP int __cdecl _ismbcupper(unsigned int);
  143. _CRTIMP unsigned int __cdecl _mbctolower(unsigned int);
  144. _CRTIMP unsigned int __cdecl _mbctoupper(unsigned int);
  145. #define _MBSTRING_DEFINED
  146. #endif
  147. #ifndef _MBLEADTRAIL_DEFINED
  148. _CRTIMP int __cdecl _ismbblead(unsigned int);
  149. _CRTIMP int __cdecl _ismbbtrail(unsigned int);
  150. _CRTIMP int __cdecl _ismbslead(const unsigned char *, const unsigned char *);
  151. _CRTIMP int __cdecl _ismbstrail(const unsigned char *, const unsigned char *);
  152. #define _MBLEADTRAIL_DEFINED
  153. #endif
  154. /* Kanji specific prototypes. */
  155. _CRTIMP int __cdecl _ismbchira(unsigned int);
  156. _CRTIMP int __cdecl _ismbckata(unsigned int);
  157. _CRTIMP int __cdecl _ismbcsymbol(unsigned int);
  158. _CRTIMP int __cdecl _ismbcl0(unsigned int);
  159. _CRTIMP int __cdecl _ismbcl1(unsigned int);
  160. _CRTIMP int __cdecl _ismbcl2(unsigned int);
  161. _CRTIMP unsigned int __cdecl _mbcjistojms(unsigned int);
  162. _CRTIMP unsigned int __cdecl _mbcjmstojis(unsigned int);
  163. _CRTIMP unsigned int __cdecl _mbctohira(unsigned int);
  164. _CRTIMP unsigned int __cdecl _mbctokata(unsigned int);
  165. #ifdef __cplusplus
  166. }
  167. #endif
  168. #ifdef _MSC_VER
  169. #pragma pack(pop)
  170. #endif /* _MSC_VER */
  171. #endif /* _INC_MBSTRING */