home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 November / VPR9611B.ISO / vabasic / ntclnt.exe / DISK8 / data.8 / datab / INCLUDE / STRUTIL.H < prev    next >
C/C++ Source or Header  |  1996-07-29  |  4KB  |  95 lines

  1. /*--------------------------------------------------------------
  2. // $Source: /rcs/crcs/general/strutil.h,v $
  3. // Checked in by: $Author: marc $
  4. // $Date: 1996/06/10 18:01:11 $             $Revision: 1.18 $
  5. //--------------------------------------------------------------
  6. //       Copyright(c) 1992, Visual Edge Software Ltd.
  7. //
  8. // ALL RIGHTS RESERVED. This notice is intended as a precaution
  9. // against inadvertent publication, and shall not be deemed to
  10. // consitute an acknowledgment that publication has occurred
  11. // nor to imply any waiver of confidentiality. The year included
  12. // in the notice is the year of the creation of the work.
  13. //--------------------------------------------------------------
  14. // DESCRIPTION:
  15. //            This file declares string utility functions 
  16. //------------------------------------------------------------*/
  17.  
  18. #ifndef STRUTIL_H
  19. #define STRUTIL_H
  20.  
  21. #include <os.h>
  22. #include <string.h>
  23. #include <visedge.h>
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. /* The following functions were replaced by an equivalent but faster macro: */
  30. #define VStrIEqual(s1,s2)    (VeStrICmp(s1,s2) == 0)
  31. #define VStrEqual(s1,s2)    (VeStrCmp(s1,s2) == 0)
  32.  
  33. /* used for float format conversion */
  34. typedef enum {
  35.     INTL_FLOAT=0,
  36.     ENGLISH_FLOAT
  37. } VTFloatFormat;
  38.  
  39. VFUNCDECL(int) VeStrCharLen    (const char*);
  40. VFUNCDECL(int) VeStrLen        (const char*);
  41. VFUNCDECL(int) VeStrNIEqual    (const char*, const char*, unsigned int);
  42.  
  43. VFUNCDECL(int) VeStrCmp        (const char*, const char*);
  44. VFUNCDECL(int) VeStrICmp        (const char*, const char*);
  45. VFUNCDECL(int) VeStrColl        (const char*, const char*);
  46. VFUNCDECL(int) VeMemCmp        (const void*, const void*, unsigned int);
  47. VFUNCDECL(int) VeMemICmp        (const void*, const void*, unsigned int);
  48.  
  49. /* Equivalent to strdup. */
  50. VFUNCDECL(char*) VeStrCopy    (const char*); 
  51.  
  52. VFUNCDECL(char*) VeAsciiToPointer (char *p, void **aRetPtr); 
  53. VFUNCDECL(char*) VeAsciiToLongHex (char *p, unsigned long *aRet);
  54.  
  55. VFUNCDECL(char*) VeStrChr    (const char *src, const char *key);
  56. VFUNCDECL(char*) VeStrRChr    (const char *src, const char *key);
  57. VFUNCDECL(char*) VeStrIChr    (const char *s1, const char *s2);
  58.  
  59. VFUNCDECL(char*) VeStrStr    (const char *s1, const char *s2);
  60. VFUNCDECL(char*) VeStrIStr    (const char *s1, const char *s2);
  61.  
  62. VFUNCDECL(char*) VeStrTok    (char *str, const char *chars);
  63. VFUNCDECL(char*) VeStrPBrk    (const char *str, const char *chars);
  64. VFUNCDECL(char*) VeStrGet    (const char *str, unsigned int index);
  65.  
  66.  
  67. VFUNCDECL(void *) VePatternMemSet(void *pArea, void *pPattern,
  68.                 unsigned long PatternLength,
  69.                 unsigned long AreaLength);
  70.  
  71. /*
  72.  * - Faster case insensitive compare functions.  These functions assumes that
  73.  *   the 2nd parameter (strcst) is a constant constaining no upper case letters.
  74.  */
  75. VFUNCDECL(int) VeStrCstNIEqual    (const char* var, const char* cst, unsigned);
  76. VFUNCDECL(int) VeStrCstIEqual    (const char* var, const char* cst);
  77. VFUNCDECL(int) VeStrCstICmp    (const char* var, const char* cst);
  78. VFUNCDECL(int) VeMemCstICmp    (const void* var, const void* cst, unsigned);
  79. VFUNCDECL(char*) VeStrCstIStr    (const char *s1, const char *s2);
  80. VFUNCDECL(char*) VeStrCstIChr    (const char *s1, const char *s2);
  81. VFUNCDECL(char*) VeBinaryStrStr    (const char*, const char*, long size);
  82. VFUNCDECL(char*) VeStripLeadingAndTrailingSpaces (char *str);
  83. VFUNCDECL(int) VeStrCharIndex       (const char *str, unsigned int index);
  84. VFUNCDECL(bool_t) VeStrFormatFloat (const char *pFloat, 
  85.                 char *pBuffer,
  86.                 VTFloatFormat typeConv);
  87.  
  88. #ifdef __cplusplus
  89. }
  90. VCLASS    VeString;
  91. VFUNCDECL(VeString) VeReplaceNonPrintChars(char *aStr,const char *aRepChar);
  92. #endif
  93.  
  94. #endif  /* STRUTIL_H */
  95.