home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / SHCRT.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  6KB  |  119 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT (C) Microsoft Corporation, 1989                                 */
  4. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  5. /*                                                                           */
  6. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  7. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  8. /*    drivers. You may use this code in accordance with the IBM License      */
  9. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  10. /*    Copyright statement may not be removed.                                */
  11. /*                                                                           */
  12. /*****************************************************************************/
  13. /* SCCSID = @(#)shcrt.h    6.3 91/11/14 */
  14. /**********************************************************************\
  15.  *                                                                    *
  16.  *                                                                    *
  17.  *                                                                    *
  18. \**********************************************************************/
  19.  
  20. /**********************************************************************\
  21.  * C RunTime Header File for PMWP DLL                                 *
  22. \**********************************************************************/
  23.  
  24. #define STRIP_LEADING  1
  25. #define STRIP_TRAILING 2
  26. VOID APIENTRY stripblanks( PSZ pszString, USHORT flags );
  27.  
  28. USHORT APIENTRY strlen( PSZ pszString );
  29. PSZ    APIENTRY strchr( PSZ pszString, UCHAR c );
  30. PSZ    APIENTRY strrchr( PSZ pszString, UCHAR c );
  31. VOID   APIENTRY strcpy( PSZ pszDestination, PSZ pszSource );
  32. VOID   APIENTRY memcpy( PSZ pbDestination, PSZ pbSource, USHORT cb );
  33. USHORT APIENTRY memcmp( PSZ pbDestination, PSZ pbSource, USHORT cb );
  34. VOID   APIENTRY memset( PSZ pbDestination, UCHAR ch, USHORT cb);
  35. VOID   APIENTRY strcat( PSZ pszDestination, PSZ pszSource );
  36. SHORT  APIENTRY strcmp( PSZ pszString1, PSZ pszString2 );
  37. VOID   APIENTRY itoa( USHORT n, PSZ s );
  38. VOID   APIENTRY itoah( USHORT usValue, PSZ szValue );
  39. SHORT  APIENTRY atoi( PSZ szValue );                 /* @sign */
  40. BOOL   APIENTRY isnumber( PSZ pszValue );             /* JudyL */
  41. VOID   APIENTRY ultoa( ULONG n, PSZ s );
  42. VOID   APIENTRY ultoac( ULONG n, PSZ s );
  43. USHORT APIENTRY isdbcs (UCHAR ch);
  44. PCH APIENTRY nextpch (PCH pszString);
  45. PCH APIENTRY prevpch (PCH pszBegin, PCH pszString);
  46. USHORT APIENTRY strcmpi (PCH pszString1, PCH pszString2);
  47. USHORT APIENTRY strncmpi (PCH pszString1, PCH pszString2, USHORT n);
  48. PCH APIENTRY strncat_trunc (PCH pszString1, PCH pszString2, USHORT n);
  49. PCH APIENTRY strncat (PCH pszString, PCH pszString2, USHORT n);
  50. PCH APIENTRY strncpy_trunc (PCH pszString1, PCH pszString2, USHORT n);
  51. PCH APIENTRY strncpy (PCH pszString, PCH pszString2, USHORT n);
  52. PCH APIENTRY strstr (PCH pszString1, PCH pszString2);
  53. PCH APIENTRY strupr (PCH pszString);
  54. VOID APIENTRY xlatblank (PCH pszString);
  55. USHORT APIENTRY strncmp (PCH pszString1, PCH pszString2, USHORT n);
  56. ULONG  APIENTRY atol  (PSZ pszString);
  57. PSZ APIENTRY strpbrk (PSZ, PSZ);
  58. #define decpch(pszBegin,pszString) (pszString=prevpch(pszBegin,pszString))
  59. #define incpch(pszString) (pszString=nextpch(pszString))
  60.  
  61.  
  62. /* Macros */
  63. #define max(a,b)    (((a) > (b)) ? (a) : (b))
  64. #define min(a,b)    (((a) < (b)) ? (a) : (b))
  65. #define toupper(c) (((c >= 'a') && (c <= 'z')) ? c + 'A' - 'a' : c )
  66.  
  67. /* Macros for isalpha, isupper, etc. */
  68. #ifndef _INC_CTYPE
  69.  
  70. /* Look-up array, _ctype, is in ctype.obj. */
  71.  
  72. extern unsigned char _cdecl _ctype[];
  73.  
  74.  
  75. /* set bit masks for the possible character types */
  76.  
  77. #define _UPPER          0x1     /* upper case letter */
  78. #define _LOWER          0x2     /* lower case letter */
  79. #define _DIGIT          0x4     /* digit[0-9] */
  80. #define _SPACE          0x8     /* tab, carriage return, newline, */
  81.                                 /* vertical tab or form feed */
  82. #define _PUNCT          0x10    /* punctuation character */
  83. #define _CONTROL        0x20    /* control character */
  84. #define _BLANK          0x40    /* space char */
  85. #define _HEX            0x80    /* hexadecimal digit */
  86.  
  87.  
  88. /* the character classification macro definitions */
  89.  
  90. #define isalpha(_c)     ( (_ctype+1)[_c] & (_UPPER|_LOWER) )
  91. #define isupper(_c)     ( (_ctype+1)[_c] & _UPPER )
  92. #define islower(_c)     ( (_ctype+1)[_c] & _LOWER )
  93. #define isdigit(_c)     ( (_ctype+1)[_c] & _DIGIT )
  94. #define isxdigit(_c)    ( (_ctype+1)[_c] & _HEX )
  95. #define isspace(_c)     ( (_ctype+1)[_c] & _SPACE )
  96. #define ispunct(_c)     ( (_ctype+1)[_c] & _PUNCT )
  97. #define isalnum(_c)     ( (_ctype+1)[_c] & (_UPPER|_LOWER|_DIGIT) )
  98. #define isprint(_c)     ( (_ctype+1)[_c] & (_BLANK|_PUNCT|_UPPER|_LOWER|_DIGIT) )
  99. #define isgraph(_c)     ( (_ctype+1)[_c] & (_PUNCT|_UPPER|_LOWER|_DIGIT) )
  100. #define iscntrl(_c)     ( (_ctype+1)[_c] & _CONTROL )
  101. #ifndef NO_EXT_KEYS
  102. #undef  toupper
  103. #define toupper(_c)     ( (islower(_c)) ? _toupper(_c) : (_c) )
  104. #define tolower(_c)     ( (isupper(_c)) ? _tolower(_c) : (_c) )
  105. #endif
  106. #define _tolower(_c)    ( (_c)-'A'+'a' )
  107. #define _toupper(_c)    ( (_c)-'a'+'A' )
  108. #define isascii(_c)     ( (unsigned)(_c) < 0x80 )
  109. #define toascii(_c)     ( (_c) & 0x7f )
  110.  
  111. /* 2.0 extended ctype macros */
  112.  
  113. #define iscsymf(_c)     (isalpha(_c) || ((_c) == '_'))
  114. #define iscsym(_c)      (isalnum(_c) || ((_c) == '_'))
  115.  
  116. #define _INC_CTYPE
  117.  
  118. #endif  /* _INC_CTYPE */
  119.