home *** CD-ROM | disk | FTP | other *** search
/ Programming Win32 Under the API / ProgrammingWin32UnderTheApiPatVillani.iso / gcc-2.95.2-msvcrt.exe / i386-mingw32msvc / include / ctype.h < prev    next >
C/C++ Source or Header  |  1999-11-07  |  3KB  |  149 lines

  1. /* 
  2.  * ctype.h
  3.  *
  4.  * Functions for testing character types and converting characters.
  5.  *
  6.  * This file is part of the Mingw32 package.
  7.  *
  8.  * Contributors:
  9.  *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
  10.  *
  11.  *  THIS SOFTWARE IS NOT COPYRIGHTED
  12.  *
  13.  *  This source code is offered for use in the public domain. You may
  14.  *  use, modify or distribute it freely.
  15.  *
  16.  *  This code is distributed in the hope that it will be useful but
  17.  *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  18.  *  DISCLAMED. This includes but is not limited to warranties of
  19.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20.  *
  21.  * $Revision: 1.2 $
  22.  * $Author: khan $
  23.  * $Date: 1998/09/04 20:10:44 $
  24.  *
  25.  */
  26.  
  27. #ifndef _CTYPE_H_
  28. #define _CTYPE_H_
  29.  
  30. /* All the headers include this file. */
  31. #include <_mingw.h>
  32.  
  33. #define    __need_wchar_t
  34. #define    __need_wint_t
  35. #ifndef RC_INVOKED
  36. #include <stddef.h>
  37. #endif    /* Not RC_INVOKED */
  38.  
  39.  
  40. /*
  41.  * The following flags are used to tell iswctype and _isctype what character
  42.  * types you are looking for.
  43.  */
  44. #define    _UPPER        0x0001
  45. #define    _LOWER        0x0002
  46. #define    _DIGIT        0x0004
  47. #define    _SPACE        0x0008
  48. #define    _PUNCT        0x0010
  49. #define    _CONTROL    0x0020
  50. #define    _BLANK        0x0040
  51. #define    _HEX        0x0080
  52. #define    _LEADBYTE    0x8000
  53.  
  54. #define    _ALPHA        0x0103
  55.  
  56. #ifndef RC_INVOKED
  57.  
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif
  61.  
  62. int    isalnum(int c);
  63. int    isalpha(int c);
  64. int    iscntrl(int c);
  65. int    isdigit(int c);
  66. int    isgraph(int c);
  67. int    islower(int c);
  68. int    isprint(int c);
  69. int    ispunct(int c);
  70. int    isspace(int c);
  71. int    isupper(int c);
  72. int    isxdigit(int c);
  73.  
  74. #ifndef    __STRICT_ANSI__
  75. int    _isctype (int c, int ctypeFlags);
  76. #endif
  77.  
  78. int    tolower(int c);
  79. int    toupper(int c);
  80.  
  81. /*
  82.  * NOTE: The above are not old name type wrappers, but functions exported
  83.  * explicitly by CRTDLL. However, underscored versions are also exported.
  84.  */
  85. #ifndef    __STRICT_ANSI__
  86. int    _tolower(int c);
  87. int    _toupper(int c);
  88. #endif
  89.  
  90. #ifndef WEOF
  91. #define    WEOF    (wchar_t)(0xFFFF)
  92. #endif
  93.  
  94. /*
  95.  * TODO: MB_CUR_MAX should be defined here (if not already defined, since
  96.  *       it should also be defined in stdlib.h). It is supposed to be the
  97.  *       maximum number of bytes in a multi-byte character in the current
  98.  *       locale. Perhaps accessible through the __mb_curr_max_dll entry point,
  99.  *       but I think (again) that that is a variable pointer, which leads to
  100.  *       problems under the current Cygwin compiler distribution.
  101.  */
  102.  
  103. typedef int    wctype_t;
  104.  
  105. /* Wide character equivalents */
  106. int    iswalnum(wint_t wc);
  107. int    iswalpha(wint_t wc);
  108. int    iswascii(wint_t wc);
  109. int    iswcntrl(wint_t wc);
  110. int    iswctype(wint_t wc, wctype_t wctypeFlags);
  111. int    is_wctype(wint_t wc, wctype_t wctypeFlags);    /* Obsolete! */
  112. int    iswdigit(wint_t wc);
  113. int    iswgraph(wint_t wc);
  114. int    iswlower(wint_t wc);
  115. int    iswprint(wint_t wc);
  116. int    iswpunct(wint_t wc);
  117. int    iswspace(wint_t wc);
  118. int    iswupper(wint_t wc);
  119. int    iswxdigit(wint_t wc);
  120.  
  121. wchar_t    towlower(wchar_t c);
  122. wchar_t    towupper(wchar_t c);
  123.  
  124. int    isleadbyte (int c);
  125.  
  126. #ifndef    __STRICT_ANSI__
  127. int    __isascii (int c);
  128. int    __toascii (int c);
  129. int    __iscsymf (int c);    /* Valid first character in C symbol */
  130. int    __iscsym (int c);    /* Valid character in C symbol (after first) */
  131.  
  132. #ifndef    _NO_OLDNAMES
  133. int    isascii (int c);
  134. int    toascii (int c);
  135. int    iscsymf (int c);
  136. int    iscsym (int c);
  137. #endif    /* Not _NO_OLDNAMES */
  138.  
  139. #endif    /* Not __STRICT_ANSI__ */
  140.  
  141. #ifdef __cplusplus
  142. }
  143. #endif
  144.  
  145. #endif    /* Not RC_INVOKED */
  146.  
  147. #endif    /* Not _CTYPE_H_ */
  148.  
  149.