home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c220 / 4.ddi / INC / STRING.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-16  |  4.3 KB  |  141 lines

  1. /*
  2.  *   string.h -- ANSI 
  3.  *
  4.  *   Functions, types, and macros for manipulating strings and
  5.  *   arbitrary areas of memory.
  6.  *
  7.  *           Copyright (c) 1990, MetaWare Incorporated
  8.  */
  9.  
  10. #ifndef _STRING_H
  11. #define _STRING_H
  12.  
  13. #ifndef _SIZE_T_DEFINED
  14. #define _SIZE_T_DEFINED
  15. typedef unsigned int size_t;
  16. #endif
  17. #define _MAXSTRING (sizeof(int) == 2 ? 65535 : 4294967295)
  18. #define NULL      ((void *)0)
  19.  
  20. extern void *memchr(void *__s, int __c, size_t __n);
  21.  
  22. #undef memcmp
  23. extern int memcmp(const void *__s1, const void *__s2, size_t __n);
  24. #if __HIGHC__  
  25. #define memcmp(s1, s2, n) (_compare(s1, s2, n))
  26. #endif
  27.  
  28. extern void *memcpy(void *__s1, const void *__s2, size_t __n);
  29. extern void *memmove(void *__s1, const void *__s2, size_t __n);
  30. extern void *memset(void *__s, int __c, size_t __n);
  31.  
  32. #ifdef __HIGHC__
  33. extern void * memccpy(void *, void *, int, unsigned int);
  34. extern int memicmp(void *, void *, unsigned int);
  35. extern void movedata(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
  36. #endif
  37.  
  38. #undef strcat
  39. extern char *strcat(char *__s1, const char *__s2);
  40. #if 0   
  41. /* USE THIS MACRO FOR SPEED 
  42.  * only if you don't mind multiple evaluation of the arguments. 
  43. */
  44. #define strcat(s1, s2) \
  45.   (_move(s2, ((char *)s1)+_find_char(s1, _MAXSTRING, 0), _find_char(s2,_MAXSTRING,0)+1), s1)
  46. #endif
  47.  
  48. extern char *strchr(const char *__s, int __c);
  49.  
  50. #undef strcmp
  51. extern int strcmp(const char *__s1, const char *__s2);
  52. #define strcmp(s1, s2) (strncmp(s1,s2,_MAXSTRING))
  53. #ifdef __HIGHC__
  54. extern int strcmpi(const char *s1, const char *s2);
  55. extern int stricmp(const char *s1, const char *s2);
  56. extern char *strdup(const char *s1);
  57. extern char *strlwr(char *s1);
  58. extern char *strupr(char *s1);
  59. #endif
  60.  
  61. #undef strcpy
  62. extern char *strcpy(char *__s1, const char *__s2);
  63. #if 0   
  64. /* USE THIS MACRO FOR SPEED 
  65.  * only if you don't mind multiple evaluation of the arguments. 
  66. */
  67. #define strcpy(s1, s2) (_move(s2, s1, _find_char(s2, _MAXSTRING, 0)+1), s1)
  68. #endif
  69.  
  70. extern size_t strcspn(const char *__s1, const char *__s2);
  71.  
  72. extern size_t strlen(const char *__s);
  73.  
  74. extern char *strncat(char *__s1, const char *__s2, size_t __n);
  75.  
  76. extern int strncmp(const char *__s1, const char *__s2, size_t __n);
  77.  
  78. #ifdef __HIGHC__
  79. extern int strnicmp(const char *__s1, const char *__s2, size_t __n);
  80. #endif
  81.  
  82. extern char *strncpy(char *__s1, const char *__s2, size_t __n);
  83.  
  84. #ifdef __HIGHC__
  85. extern char *strnset(char *__s, int __character, size_t __kount);
  86. #endif
  87.  
  88. extern char *strpbrk(const char *__s1, const char *__s2);
  89.  
  90. extern char *strrchr(const char *__s, int __c);
  91.  
  92. #ifdef __HIGHC__
  93. extern char *strrev(char *__s);
  94.  
  95. extern char *strset(char *__s, int __c);
  96. #endif
  97.  
  98. extern size_t strspn(const char *__s1, const char *__s2);
  99.  
  100. extern char * strstr(const char *__s1, const char *__s2);
  101.  
  102. extern char *strtok(char *__s1, const char *__s2);
  103.  
  104. #undef _rmemcpy
  105. extern void *_rmemcpy(void *__dest, const void *__source, size_t __n);
  106. #if __HIGHC__
  107. #define _rmemcpy(dest, source, size) (_move_right(source, dest, size), dest)
  108. #endif
  109.  
  110. #undef _rstrcpy
  111. extern char *_rstrcpy(char *__dest, const char *__source);
  112. #if __HIGHC__
  113. #define _rstrcpy(dest, source) \
  114.    (_move_right(source, dest, _find_char(source, _MAXSTRING, 0)+1), dest)
  115. #endif
  116.  
  117. extern char *_rstrncpy(char *__dest, const char *__source, size_t __n);
  118.  
  119. extern char *_strcats(size_t __n, char *__s1, char *__s2, ...);
  120. extern char *_strncat(char *__s1, const char *__s2, size_t __n);
  121.  
  122. extern char * _strerror(char *);
  123. extern char * strerror(int __errnum);
  124. extern size_t strxfrm(char *__s1, const char *__s2, size_t __n);
  125. extern int strcoll(const char *__s1, const char *__s2);
  126.  
  127. extern void * _memccpy(void *, void *, int, unsigned int);
  128. extern int _memicmp(void *, void *, unsigned int);
  129. extern void _movedata(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
  130. extern int _strcmpi(const char *s1, const char *s2);
  131. extern int _stricmp(const char *s1, const char *s2);
  132. extern char *_strdup(const char *s1);
  133. extern char *_strlwr(char *s1);
  134. extern char *_strupr(char *s1);
  135. extern int _strnicmp(const char *__s1, const char *__s2, size_t __n);
  136. extern char *_strnset(char *__s, int __character, size_t __kount);
  137. extern char *_strrev(char *__s);
  138. extern char *_strset(char *__s, int __c);
  139.  
  140. #endif /* _STRING_H */
  141.