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.

94 lines
3.4 KiB

  1. /*+---------------------------------------------------------------------------
  2. **
  3. ** File: WChar.h
  4. **
  5. ** Contents: Defines wide character equivalents for standard functions
  6. ** usually in strings.h and ctypes.h
  7. **
  8. ** Note: These routines uses WCHAR which is unsigned short (2 bytes)
  9. ** They are not compatible with some systems that uses 4 bytes
  10. ** wide characters
  11. **--------------------------------------------------------------------------*/
  12. #ifndef __WCHAR__H__
  13. #define __WCHAR__H__
  14. #define _WSTRING_DEFINED // prevent incompatibility with <string.h>
  15. #include <stdlib.h>
  16. #if !defined(FLAT) || defined(OLE32)
  17. #include <stdarg.h>
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. typedef unsigned short WCHAR, *LPWSTR;
  22. typedef const WCHAR* LPCWSTR;
  23. /* use an alias */
  24. #define _wcsnicmp wcsnicmp
  25. /* Unicode Byte Order Mark (BOM) for Unicode text files */
  26. #define BOM 0xFEFF
  27. /* Padding constant and macro for localized buffer allocation*/
  28. #define INTL_PADDING_VALUE 3
  29. #define INTL_PADDING(cb) (INTL_PADDING_VALUE * (cb))
  30. long __cdecl wcsatol(const WCHAR *wsz);
  31. int __cdecl wcsatoi(const WCHAR *wsz);
  32. WCHAR * __cdecl wcscat(WCHAR *wsz1, const WCHAR *wsz2);
  33. WCHAR * __cdecl wcschr ( const WCHAR * string, WCHAR ch );
  34. int __cdecl wcscmp(const WCHAR *wsz1, const WCHAR *wsz2);
  35. int __cdecl wcsicmp(const WCHAR *wsz1, const WCHAR *wsz2);
  36. int __cdecl wcscoll(const WCHAR * wsz1, const WCHAR * wsz2);
  37. WCHAR * __cdecl wcscpy(WCHAR *wsz1, WCHAR const *wsz2);
  38. WCHAR * __cdecl wcsitoa(int ival, WCHAR *wsz, int radix);
  39. size_t __cdecl wcslen(WCHAR const *wsz);
  40. WCHAR * __cdecl wcsltoa(long lval, WCHAR *wsz, int radix);
  41. WCHAR * __cdecl wcslwr(WCHAR *wsz);
  42. int __cdecl wcsncmp(const WCHAR *wsz1, const WCHAR *wsz2, size_t count);
  43. int __cdecl wcsnicmp(const WCHAR *wsz1, const WCHAR *wsz2, size_t count);
  44. WCHAR * __cdecl wcsncpy ( WCHAR * dest, const WCHAR * source, size_t count );
  45. WCHAR * __cdecl wcsrchr(const WCHAR * wcs, WCHAR wc);
  46. WCHAR * __cdecl wcsupr(WCHAR *wsz);
  47. WCHAR * __cdecl wcswcs(const WCHAR *wsz1, const WCHAR *wsz2);
  48. size_t __cdecl wcstosbs( char * s, const WCHAR * pwcs, size_t n);
  49. size_t __cdecl sbstowcs(WCHAR *wcstr, const char *mbstr, size_t count);
  50. #ifndef STDCALL
  51. #ifdef _WIN32
  52. #define STDCALL __stdcall
  53. #else
  54. #define STDCALL
  55. #endif
  56. #endif
  57. extern int STDCALL MultiByteToWideChar(
  58. unsigned int CodePage, /* code page */
  59. unsigned long dwFlags, /* character-type options */
  60. const char * lpMultiByteStr, /* address of string to map */
  61. int cchMultiByte, /* number of characters in string */
  62. WCHAR* lpWideCharStr, /* address of wide-character buffer */
  63. int cchWideChar /* size of buffer */
  64. );
  65. extern int STDCALL WideCharToMultiByte(
  66. unsigned int CodePage, /* code page */
  67. unsigned long dwFlags, /* performance and mapping flags */
  68. const WCHAR* lpWideCharStr, /* address of wide-character string */
  69. int cchWideChar, /* number of characters in string */
  70. char* lpMultiByteStr, /* address of buffer for new string */
  71. int cchMultiByte, /* size of buffer */
  72. const char* lpDefaultChar, /* addr of default for unmappable chars */
  73. int* lpUsedDefaultChar /* addr of flag set when default char. used */
  74. );
  75. #ifdef __cplusplus
  76. }
  77. #endif
  78. #endif /* !defined(FLAT) || defined(OLE32) */
  79. #endif /* __WCHAR__H__ */