home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / mm / ultimoio / mmiocrt.h < prev    next >
C/C++ Source or Header  |  1999-05-11  |  4KB  |  102 lines

  1.  
  2. /**********************************************************************\
  3.  * C RunTime DBCS                                                     *
  4. \**********************************************************************/
  5.  
  6. #define STRIP_LEADING  1
  7. #define STRIP_TRAILING 2
  8.  
  9. VOID APIENTRY stripblanks( PSZ pszString, USHORT flags );
  10.  
  11. VOID GetDbcsInfo (VOID);
  12.  
  13. BOOL  APIENTRY isdbcs (UCHAR ch);
  14. PCH   APIENTRY nextpch (PCH pszString);
  15. PCH   APIENTRY prevpch (PCH pszBegin, PCH pszString);
  16.  
  17. #define decpch(pszBegin,pszString) (pszString=prevpch(pszBegin, pszString))
  18. #define incpch(pszString) (pszString=nextpch(pszString))
  19.  
  20. #define max(a,b)    (((a) > (b)) ? (a) : (b))
  21. #define min(a,b)    (((a) < (b)) ? (a) : (b))
  22. #define toupper(c) (((c >= 'a') && (c <= 'z')) ? c + 'A' - 'a' : c )
  23.  
  24. #ifndef INCL_DBCSCRT_NOSTRINGS
  25.  
  26. ULONG APIENTRY SWstrlen( PSZ pszString );
  27. PSZ   APIENTRY SWstrchr( PSZ pszString, UCHAR c );
  28. PSZ   APIENTRY SWstrrchr( PSZ pszString, UCHAR c );
  29. PSZ   APIENTRY SWstrcpy( PSZ pszDestination, PSZ pszSource );
  30. PSZ   APIENTRY SWstrcat( PSZ pszDestination, PSZ pszSource );
  31. LONG  APIENTRY SWstrcmp( PSZ pszString1, PSZ pszString2 );
  32.  
  33. /*
  34.  * Mem functions should be used out of the C runtime library.
  35.  * They are optimized assembly routines.
  36.  */
  37.  
  38. PVOID _Optlink memcpy( PVOID pvDest, PVOID pvSource, ULONG cb );
  39. PVOID _Optlink memmove( PVOID pvDest, PVOID pvSource, ULONG cb );
  40. PVOID _Optlink memset( PVOID pvDest, ULONG uch, ULONG cb );
  41.  
  42. LONG  APIENTRY SWstrcmpi (PCH pszString1, PCH pszString2);
  43. LONG  APIENTRY SWstrnicmp (PCH pszString1, PCH pszString2, USHORT n);
  44. PCH   APIENTRY SWstrncat_trunc (PCH pszString1, PCH pszString2, USHORT n);
  45. PCH   APIENTRY SWstrncat (PCH pszString1, PCH pszString2, USHORT n);
  46. PCH   APIENTRY SWstrncpy_trunc (PCH pszString1, PCH pszString2, USHORT n);
  47. PCH   APIENTRY SWstrncpy (PCH pszString1, PCH pszString2, USHORT n);
  48. PCH   APIENTRY SWstrstr (PCH pszString1, PCH pszString2);
  49. PCH   APIENTRY SWstrupr (PCH pszString);
  50. VOID  APIENTRY xlatblank (PCH pszString);
  51. LONG  APIENTRY SWstrncmp (PCH pszString1, PCH pszString2, ULONG n);
  52. PSZ   APIENTRY SWstrpbrk (PSZ, PSZ);
  53. ULONG APIENTRY SWstrspn( PSZ, PSZ );
  54. PCH   APIENTRY SWstrstri( PCH pszString1, PCH pszString2 );
  55.  
  56. /*
  57.  * SW Backward Compatibility.
  58.  */
  59.  
  60. VOID APIENTRY  SWmemcpy( PSZ pszDest, PSZ pszSource, USHORT usCb );
  61. VOID APIENTRY  SWmemset( PSZ pszDest, UCHAR uch, USHORT usCb );
  62.  
  63. #define strncmpi      (SWstrnicmp)
  64. #define strlen        (SWstrlen)
  65. #define strchr        (SWstrchr)
  66. #define strrchr       (SWstrrchr)
  67. #define strcpy        (SWstrcpy)
  68. #define strcat        (SWstrcat)
  69. #define strcmp        (SWstrcmp)
  70. #define strcmpi       (SWstrcmpi)
  71. #define strnicmp      (SWstrnicmp)
  72. #define strncat_trunc (SWstrncat_trunc)
  73. #define strncat       (SWstrncat)
  74. #define strncpy_trunc (SWstrncpy_trunc)
  75. #define strncpy       (SWstrncpy)
  76. #define strstr        (SWstrstr)
  77. #define strupr        (SWstrupr)
  78. #define strncmp       (SWstrncmp)
  79. #define strpbrk       (SWstrpbrk)
  80. #define strstri       (SWstrstri)
  81. #define strspn        (SWstrspn)
  82.  
  83. /*
  84.  * Replacement for C _splitpath for DBCS awareness.
  85.  */
  86.  
  87. VOID  APIENTRY DBCS_splitpath( PSZ pszPath,
  88.                                PSZ szDrive,
  89.                                PSZ szDir,
  90.                                PSZ szName,
  91.                                PSZ szExt );
  92.  
  93. #endif
  94.  
  95. /*
  96.  * Unique file generation routine.
  97.  */
  98.  
  99. ULONG APIENTRY DBCSGenerateUniqueFile( PSZ pszPathName,
  100.                                        PULONG pulPathLength,
  101.                                        PHFILE phfile );
  102.