Source code of Windows XP (NT5)
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.

213 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. #ifdef _M_ALPHA
  64. typedef struct {
  65. char *a0; /* pointer to first homed integer argument */
  66. int offset; /* byte offset of next parameter */
  67. } va_list;
  68. #else
  69. typedef char * va_list;
  70. #endif
  71. #define _VA_LIST_DEFINED
  72. #endif
  73. #ifndef _FILE_DEFINED
  74. struct _iobuf {
  75. char *_ptr;
  76. int _cnt;
  77. char *_base;
  78. int _flag;
  79. int _file;
  80. int _charbuf;
  81. int _bufsiz;
  82. char *_tmpfname;
  83. };
  84. typedef struct _iobuf FILE;
  85. #define _FILE_DEFINED
  86. #endif
  87. /*
  88. * MBCS - Multi-Byte Character Set
  89. */
  90. #ifndef _MBSTRING_DEFINED
  91. /* function prototypes */
  92. _CRTIMP unsigned int __cdecl _mbbtombc(unsigned int);
  93. _CRTIMP int __cdecl _mbbtype(unsigned char, int);
  94. _CRTIMP unsigned int __cdecl _mbctombb(unsigned int);
  95. _CRTIMP int __cdecl _mbsbtype(const unsigned char *, size_t);
  96. _CRTIMP unsigned char * __cdecl _mbscat(unsigned char *, const unsigned char *);
  97. _CRTIMP unsigned char * __cdecl _mbschr(const unsigned char *, unsigned int);
  98. _CRTIMP int __cdecl _mbscmp(const unsigned char *, const unsigned char *);
  99. _CRTIMP int __cdecl _mbscoll(const unsigned char *, const unsigned char *);
  100. _CRTIMP unsigned char * __cdecl _mbscpy(unsigned char *, const unsigned char *);
  101. _CRTIMP size_t __cdecl _mbscspn(const unsigned char *, const unsigned char *);
  102. _CRTIMP unsigned char * __cdecl _mbsdec(const unsigned char *, const unsigned char *);
  103. _CRTIMP unsigned char * __cdecl _mbsdup(const unsigned char *);
  104. _CRTIMP int __cdecl _mbsicmp(const unsigned char *, const unsigned char *);
  105. _CRTIMP int __cdecl _mbsicoll(const unsigned char *, const unsigned char *);
  106. _CRTIMP unsigned char * __cdecl _mbsinc(const unsigned char *);
  107. _CRTIMP size_t __cdecl _mbslen(const unsigned char *);
  108. _CRTIMP unsigned char * __cdecl _mbslwr(unsigned char *);
  109. _CRTIMP unsigned char * __cdecl _mbsnbcat(unsigned char *, const unsigned char *, size_t);
  110. _CRTIMP int __cdecl _mbsnbcmp(const unsigned char *, const unsigned char *, size_t);
  111. _CRTIMP int __cdecl _mbsnbcoll(const unsigned char *, const unsigned char *, size_t);
  112. _CRTIMP size_t __cdecl _mbsnbcnt(const unsigned char *, size_t);
  113. _CRTIMP unsigned char * __cdecl _mbsnbcpy(unsigned char *, const unsigned char *, size_t);
  114. _CRTIMP int __cdecl _mbsnbicmp(const unsigned char *, const unsigned char *, size_t);
  115. _CRTIMP int __cdecl _mbsnbicoll(const unsigned char *, const unsigned char *, size_t);
  116. _CRTIMP unsigned char * __cdecl _mbsnbset(unsigned char *, unsigned int, size_t);
  117. _CRTIMP unsigned char * __cdecl _mbsncat(unsigned char *, const unsigned char *, size_t);
  118. _CRTIMP size_t __cdecl _mbsnccnt(const unsigned char *, size_t);
  119. _CRTIMP int __cdecl _mbsncmp(const unsigned char *, const unsigned char *, size_t);
  120. _CRTIMP int __cdecl _mbsncoll(const unsigned char *, const unsigned char *, size_t);
  121. _CRTIMP unsigned char * __cdecl _mbsncpy(unsigned char *, const unsigned char *, size_t);
  122. _CRTIMP unsigned int __cdecl _mbsnextc (const unsigned char *);
  123. _CRTIMP int __cdecl _mbsnicmp(const unsigned char *, const unsigned char *, size_t);
  124. _CRTIMP int __cdecl _mbsnicoll(const unsigned char *, const unsigned char *, size_t);
  125. _CRTIMP unsigned char * __cdecl _mbsninc(const unsigned char *, size_t);
  126. _CRTIMP unsigned char * __cdecl _mbsnset(unsigned char *, unsigned int, size_t);
  127. _CRTIMP unsigned char * __cdecl _mbspbrk(const unsigned char *, const unsigned char *);
  128. _CRTIMP unsigned char * __cdecl _mbsrchr(const unsigned char *, unsigned int);
  129. _CRTIMP unsigned char * __cdecl _mbsrev(unsigned char *);
  130. _CRTIMP unsigned char * __cdecl _mbsset(unsigned char *, unsigned int);
  131. _CRTIMP size_t __cdecl _mbsspn(const unsigned char *, const unsigned char *);
  132. _CRTIMP unsigned char * __cdecl _mbsspnp(const unsigned char *, const unsigned char *);
  133. _CRTIMP unsigned char * __cdecl _mbsstr(const unsigned char *, const unsigned char *);
  134. _CRTIMP unsigned char * __cdecl _mbstok(unsigned char *, const unsigned char *);
  135. _CRTIMP unsigned char * __cdecl _mbsupr(unsigned char *);
  136. _CRTIMP size_t __cdecl _mbclen(const unsigned char *);
  137. _CRTIMP void __cdecl _mbccpy(unsigned char *, const unsigned char *);
  138. #define _mbccmp(_cpc1, _cpc2) _mbsncmp((_cpc1),(_cpc2),1)
  139. /* character routines */
  140. _CRTIMP int __cdecl _ismbcalnum(unsigned int);
  141. _CRTIMP int __cdecl _ismbcalpha(unsigned int);
  142. _CRTIMP int __cdecl _ismbcdigit(unsigned int);
  143. _CRTIMP int __cdecl _ismbcgraph(unsigned int);
  144. _CRTIMP int __cdecl _ismbclegal(unsigned int);
  145. _CRTIMP int __cdecl _ismbclower(unsigned int);
  146. _CRTIMP int __cdecl _ismbcprint(unsigned int);
  147. _CRTIMP int __cdecl _ismbcpunct(unsigned int);
  148. _CRTIMP int __cdecl _ismbcspace(unsigned int);
  149. _CRTIMP int __cdecl _ismbcupper(unsigned int);
  150. _CRTIMP unsigned int __cdecl _mbctolower(unsigned int);
  151. _CRTIMP unsigned int __cdecl _mbctoupper(unsigned int);
  152. #define _MBSTRING_DEFINED
  153. #endif
  154. #ifndef _MBLEADTRAIL_DEFINED
  155. _CRTIMP int __cdecl _ismbblead(unsigned int);
  156. _CRTIMP int __cdecl _ismbbtrail(unsigned int);
  157. _CRTIMP int __cdecl _ismbslead(const unsigned char *, const unsigned char *);
  158. _CRTIMP int __cdecl _ismbstrail(const unsigned char *, const unsigned char *);
  159. #define _MBLEADTRAIL_DEFINED
  160. #endif
  161. /* Kanji specific prototypes. */
  162. _CRTIMP int __cdecl _ismbchira(unsigned int);
  163. _CRTIMP int __cdecl _ismbckata(unsigned int);
  164. _CRTIMP int __cdecl _ismbcsymbol(unsigned int);
  165. _CRTIMP int __cdecl _ismbcl0(unsigned int);
  166. _CRTIMP int __cdecl _ismbcl1(unsigned int);
  167. _CRTIMP int __cdecl _ismbcl2(unsigned int);
  168. _CRTIMP unsigned int __cdecl _mbcjistojms(unsigned int);
  169. _CRTIMP unsigned int __cdecl _mbcjmstojis(unsigned int);
  170. _CRTIMP unsigned int __cdecl _mbctohira(unsigned int);
  171. _CRTIMP unsigned int __cdecl _mbctokata(unsigned int);
  172. #ifdef __cplusplus
  173. }
  174. #endif
  175. #ifdef _MSC_VER
  176. #pragma pack(pop)
  177. #endif /* _MSC_VER */
  178. #endif /* _INC_MBSTRING */