home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / unix / unixlib_1 / !UnixLib37_src_clib_h_string < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-09  |  4.6 KB  |  160 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/clib/h/RCS/string,v $
  4.  * $Date: 1996/10/30 21:58:58 $
  5.  * $Revision: 1.3 $
  6.  * $State: Rel $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: string,v $
  10.  * Revision 1.3  1996/10/30 21:58:58  unixlib
  11.  * Massive changes made by Nick Burret and Peter Burwood.
  12.  *
  13.  * Revision 1.2  1996/05/06 09:01:33  unixlib
  14.  * Updates to sources made by Nick Burrett, Peter Burwood and Simon Callan.
  15.  * Saved for 3.7a release.
  16.  *
  17.  * Revision 1.1  1996/04/19 21:02:57  simon
  18.  * Initial revision
  19.  *
  20.  ***************************************************************************/
  21.  
  22. /* ANSI Standard 4.11: String Handling <string.h>.  */
  23.  
  24. #ifndef __STRING_H
  25. #define __STRING_H
  26.  
  27. #ifndef __STDDEF_H
  28. #include <stddef.h>
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. /* Copy n bytes from src to dest.  */
  36. extern void *memcpy (void *dest, const void *src, size_t n);
  37.  
  38. /* Copy n bytes from src to dest, guaranteeing correct
  39.    behaviour for overlapping data.  */
  40. extern void *memmove (void *dest, const void *src, size_t n);
  41.  
  42. /* Set n bytes of s to c.  */
  43. extern void *memset (void *s, int c, size_t n);
  44.  
  45. /* Compare n bytes of s1 and s2.  */
  46. extern int memcmp (const void *s1, const void *s2, size_t n);
  47.  
  48. /* Search n bytes of s for c.  */
  49. extern void *memchr (const void *s, int c, size_t n);
  50.  
  51. /* Copy src to dest. */
  52. extern char *strcpy (char *dest, const char *src);
  53.  
  54. /* Copy no more than n chars of src to dest.  */
  55. extern char *strncpy (char *dest, const char *src, size_t n);
  56.  
  57. /* Append src onto dest.  */
  58. extern char *strcat (char *dest, const char *src);
  59.  
  60. /* Append no more than n chars from src to dest. */
  61. extern char *strncat (char *dest, const char *src, size_t n);
  62.  
  63. /* Compare s1 and s2.  */
  64. extern int strcmp (const char *s1, const char *s2);
  65.  
  66. /* Compare n chars of s1 and s2.  */
  67. extern int strncmp (const char *s1, const char *s2, size_t n);
  68.  
  69. #if 0
  70. extern int strcoll (const char *s1, const char *s2);
  71. extern size_t strxfrm (char *dest, const char *src, size_t n);
  72. #endif
  73.  
  74. /* Find the first occurrence of c in s. */
  75. extern char *strchr (const char *s, int c);
  76.  
  77. /* Find the last occurrence of c in s.  */
  78. extern char *strrchr (const char *s, int c);
  79.  
  80. /* Return the length of the initial segment of s that consists
  81.    entirely of chars in accept.  */
  82. extern size_t strspn (const char *s, const char *accept);
  83.  
  84. /* Return the length of the initial segment of s that consists
  85.    entirely of chars not in reject.  */
  86. extern size_t strcspn (const char *s, const char *reject);
  87.  
  88. /* Find the first occurence in s of any char in accept.  */
  89. extern char *strpbrk (const char *s, const char *accept);
  90.  
  91. /* Find the first occurrence of s in s1.  */
  92. extern char *strstr (const char *s, const char *s1);
  93.  
  94. /* Divide s into tokens separated by chars in delim.  */
  95. extern char *strtok (char *s, const char *delim);
  96.  
  97. /* Return the length of s. */
  98. extern size_t strlen (const char *s);
  99.  
  100. extern    int    stricmp(const char *,const char *);
  101. extern    int    strnicmp(const char *,const char *,size_t);
  102. extern    char    *strichr(const char *,int);
  103. extern    char    *strrichr(const char *,int);
  104.  
  105.  
  106.  
  107. /* BSD enhancements.  */
  108.  
  109. #if 0
  110. /* Copy no more than n bytes of src to dest, stopping when c is found.
  111.    Return the position in dest one byte past where c was copied,
  112.    or null if C was not in the string.  */
  113. extern void *memccpy (void *dest, const void *src, int c, size_t n);
  114. #endif
  115.  
  116. /* Duplicate s, returning an identical malloc'd string.  */
  117. extern char *strdup (const char *s);
  118.  
  119. /* Same as strchr.  */
  120. extern char *index (const char *s, int c);
  121.  
  122. /* Same as strrchr.  */
  123. extern char *rindex (const char *s, int c);
  124.  
  125. /* Same as memcmp.  */
  126. extern int bcmp (const void *s1,const void *s2, size_t n);
  127.  
  128. /* Copy n bytes of src to dest.  */
  129. extern void bcopy (const void *src, void *dest, size_t n);
  130.  
  131. /* Set n bytes of s to 0.  */
  132. extern void bzero (void *s, size_t n);
  133.  
  134. #if 0
  135. /* Return the position of the first bit set in I, or 0 if none are set.
  136.    The least-significant bit is position 1, the most-significant 32.  */
  137. extern int ffs (int i);
  138.  
  139. /* Compare S1 and S2, ignoring case.  */
  140. extern int strcasecmp (const char *s1, const char *s2);
  141.  
  142. /* Return the next DELIM-delimited token from *STRINGP,
  143.    terminating it with a '\0', and update *STRINGP to point past it.  */
  144. extern char *strsep (char **stringp, const char *delim);
  145. #endif
  146.  
  147. /* GNU enhancements.  */
  148.  
  149. /* Return a string describing the meaning of the signal number sig.  */
  150. extern char *strsignal (int sig);
  151.  
  152. /* Return the descriptive error message string for an error code.  */
  153. extern char *strerror (int errnum);
  154.  
  155. #ifdef __cplusplus
  156.     }
  157. #endif
  158.  
  159. #endif
  160.