home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- *
- * $Source: /unixb/home/unixlib/source/unixlib37/src/clib/h/RCS/string,v $
- * $Date: 1996/10/30 21:58:58 $
- * $Revision: 1.3 $
- * $State: Rel $
- * $Author: unixlib $
- *
- * $Log: string,v $
- * Revision 1.3 1996/10/30 21:58:58 unixlib
- * Massive changes made by Nick Burret and Peter Burwood.
- *
- * Revision 1.2 1996/05/06 09:01:33 unixlib
- * Updates to sources made by Nick Burrett, Peter Burwood and Simon Callan.
- * Saved for 3.7a release.
- *
- * Revision 1.1 1996/04/19 21:02:57 simon
- * Initial revision
- *
- ***************************************************************************/
-
- /* ANSI Standard 4.11: String Handling <string.h>. */
-
- #ifndef __STRING_H
- #define __STRING_H
-
- #ifndef __STDDEF_H
- #include <stddef.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /* Copy n bytes from src to dest. */
- extern void *memcpy (void *dest, const void *src, size_t n);
-
- /* Copy n bytes from src to dest, guaranteeing correct
- behaviour for overlapping data. */
- extern void *memmove (void *dest, const void *src, size_t n);
-
- /* Set n bytes of s to c. */
- extern void *memset (void *s, int c, size_t n);
-
- /* Compare n bytes of s1 and s2. */
- extern int memcmp (const void *s1, const void *s2, size_t n);
-
- /* Search n bytes of s for c. */
- extern void *memchr (const void *s, int c, size_t n);
-
- /* Copy src to dest. */
- extern char *strcpy (char *dest, const char *src);
-
- /* Copy no more than n chars of src to dest. */
- extern char *strncpy (char *dest, const char *src, size_t n);
-
- /* Append src onto dest. */
- extern char *strcat (char *dest, const char *src);
-
- /* Append no more than n chars from src to dest. */
- extern char *strncat (char *dest, const char *src, size_t n);
-
- /* Compare s1 and s2. */
- extern int strcmp (const char *s1, const char *s2);
-
- /* Compare n chars of s1 and s2. */
- extern int strncmp (const char *s1, const char *s2, size_t n);
-
- #if 0
- extern int strcoll (const char *s1, const char *s2);
- extern size_t strxfrm (char *dest, const char *src, size_t n);
- #endif
-
- /* Find the first occurrence of c in s. */
- extern char *strchr (const char *s, int c);
-
- /* Find the last occurrence of c in s. */
- extern char *strrchr (const char *s, int c);
-
- /* Return the length of the initial segment of s that consists
- entirely of chars in accept. */
- extern size_t strspn (const char *s, const char *accept);
-
- /* Return the length of the initial segment of s that consists
- entirely of chars not in reject. */
- extern size_t strcspn (const char *s, const char *reject);
-
- /* Find the first occurence in s of any char in accept. */
- extern char *strpbrk (const char *s, const char *accept);
-
- /* Find the first occurrence of s in s1. */
- extern char *strstr (const char *s, const char *s1);
-
- /* Divide s into tokens separated by chars in delim. */
- extern char *strtok (char *s, const char *delim);
-
- /* Return the length of s. */
- extern size_t strlen (const char *s);
-
- extern int stricmp(const char *,const char *);
- extern int strnicmp(const char *,const char *,size_t);
- extern char *strichr(const char *,int);
- extern char *strrichr(const char *,int);
-
-
-
- /* BSD enhancements. */
-
- #if 0
- /* Copy no more than n bytes of src to dest, stopping when c is found.
- Return the position in dest one byte past where c was copied,
- or null if C was not in the string. */
- extern void *memccpy (void *dest, const void *src, int c, size_t n);
- #endif
-
- /* Duplicate s, returning an identical malloc'd string. */
- extern char *strdup (const char *s);
-
- /* Same as strchr. */
- extern char *index (const char *s, int c);
-
- /* Same as strrchr. */
- extern char *rindex (const char *s, int c);
-
- /* Same as memcmp. */
- extern int bcmp (const void *s1,const void *s2, size_t n);
-
- /* Copy n bytes of src to dest. */
- extern void bcopy (const void *src, void *dest, size_t n);
-
- /* Set n bytes of s to 0. */
- extern void bzero (void *s, size_t n);
-
- #if 0
- /* Return the position of the first bit set in I, or 0 if none are set.
- The least-significant bit is position 1, the most-significant 32. */
- extern int ffs (int i);
-
- /* Compare S1 and S2, ignoring case. */
- extern int strcasecmp (const char *s1, const char *s2);
-
- /* Return the next DELIM-delimited token from *STRINGP,
- terminating it with a '\0', and update *STRINGP to point past it. */
- extern char *strsep (char **stringp, const char *delim);
- #endif
-
- /* GNU enhancements. */
-
- /* Return a string describing the meaning of the signal number sig. */
- extern char *strsignal (int sig);
-
- /* Return the descriptive error message string for an error code. */
- extern char *strerror (int errnum);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-