STRING.H(7) Miscellaneous Information Manual STRING.H(7)

string.hstring operations

#include <string.h>

[CX] Some of the functionality described on this reference page extends the ISO C standard. Applications shall define the appropriate feature test macro (see XSH V2_chap02(3) ) to enable the visibility of these symbols in this header.

The <string.h> header shall define NULL and as described in <stddef.h>.

[CX] The <string.h> header shall define the locale_t type as described in <locale.h>.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided for use with ISO C standard compilers.

[XSI]
void    *memccpy(void *restrict, const void *restrict, int, size_t);

void    *memchr(const void *, int, size_t);
int      memcmp(const void *, const void *, size_t);
void    *memcpy(void *restrict, const void *restrict, size_t);
void    *memmove(void *, const void *, size_t);
void    *memset(void *, int, size_t);
[CX]
char    *stpcpy(char *restrict, const char *restrict);
char    *stpncpy(char *restrict, const char *restrict, size_t);

char    *strcat(char *restrict, const char *restrict);
char    *strchr(const char *, int);
int      strcmp(const char *, const char *);
int      strcoll(const char *, const char *);
[CX]
int      strcoll_l(const char *, const char *, locale_t);

char    *strcpy(char *restrict, const char *restrict);
size_t   strcspn(const char *, const char *);
[CX]
char    *strdup(const char *);

char    *strerror(int);
[CX]
char    *strerror_l(int, locale_t);
int      strerror_r(int, char *, size_t);

size_t   strlen(const char *);
char    *strncat(char *restrict, const char *restrict, size_t);
int      strncmp(const char *, const char *, size_t);
char    *strncpy(char *restrict, const char *restrict, size_t);
[CX]
char    *strndup(const char *, size_t);
size_t   strnlen(const char *, size_t);

char    *strpbrk(const char *, const char *);
char    *strrchr(const char *, int);
[CX]
char    *strsignal(int);

size_t   strspn(const char *, const char *);
char    *strstr(const char *, const char *);
char    *strtok(char *restrict, const char *restrict);
[CX]
char    *strtok_r(char *restrict, const char *restrict, char **restrict);

size_t   strxfrm(char *restrict, const char *restrict, size_t);
[CX]
size_t   strxfrm_l(char *restrict, const char *restrict,
             size_t, locale_t);

[CX] Inclusion of the <string.h> header may also make visible all symbols from <stddef.h>.

None.

None.

None.

<locale.h> , <stddef.h> , <sys/types.h>

XSH V2_chap02(3) , memccpy(3) , memchr(3) , memcmp(3) , memcpy(3) , memmove(3) , memset(3) , strcat(3) , strchr(3) , strcmp(3) , strcoll(3) , strcpy(3) , strcspn(3) , strdup(3) , strerror(3) , strlen(3) , strncat(3) , strncmp(3) , strncpy(3) , strpbrk(3) , strrchr(3) , strsignal(3) , strspn(3) , strstr(3) , strtok(3) , strxfrm(3)

First released in Issue 1. Derived from Issue 1 of the SVID.

The DESCRIPTION is updated for alignment with the POSIX Threads Extension.

The strtok_r(3) function is marked as part of the Thread-Safe Functions option.

This reference page is updated to align with the ISO/IEC 9899:1999 (“ISO C99”) standard.

The strerror_r(3) function is added in response to IEEE PASC Interpretation 1003.1c #39.

SD5-XBD-ERN-15 is applied, correcting the prototype for the strerror_r(3) function.

The stpcpy(3), stpncpy(3), strndup(3), strnlen(3), and strsignal(3) functions are added from The Open Group Technical Standard, 2006, Extended API Set Part 1.

The strcoll_l(3), strerror_l(3), and strxfrm_l(3) functions are added from The Open Group Technical Standard, 2006, Extended API Set Part 4.

This reference page is clarified with respect to macros and symbolic constants, and a declaration for the locale_t type is added.

January 1, 2008 posix.fail