Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

efun(3) [netbsd man page]

EFUN(3) 						   BSD Library Functions Manual 						   EFUN(3)

NAME
esetfunc, easprintf, efopen, emalloc, ecalloc, erealloc, estrdup, estrndup, estrlcat, estrlcpy, evasprintf -- error-checked utility functions LIBRARY
System Utilities Library (libutil, -lutil) SYNOPSIS
#include <util.h> void (*)(int, const char *, ...) esetfunc(void (*)(int, const char *, ...)); int easprintf(char ** restrict str, const char * restrict fmt, ...); FILE * efopen(const char *p, const char *m); void * ecalloc(size_t n, size_t c); void * emalloc(size_t n); void * erealloc(void *p, size_t n); char * estrdup(const char *s); char * estrndup(const char *s, size_t len); size_t estrlcat(char *dst, const char *src, size_t len); size_t estrlcpy(char *dst, const char *src, size_t len); int evasprintf(char ** restrict str, const char * restrict fmt, ...); DESCRIPTION
The easprintf(), efopen(), ecalloc(), emalloc(), erealloc(), estrdup(), estrndup(), estrlcat(), estrlcpy(), and evasprintf() functions oper- ate exactly as the corresponding functions that do not start with an 'e' except that in case of an error, they call the installed error han- dler that can be configured with esetfunc(). For the string handling functions, it is an error when the destination buffer is not large enough to hold the complete string. For functions that allocate memory or open a file, it is an error when they would return a null pointer. The default error handler is err(3). The func- tion esetfunc() returns the previous error handler function. A NULL error handler will just call exit(3). SEE ALSO
asprintf(3), calloc(3), err(3), exit(3), fopen(3), malloc(3), realloc(3), strdup(3), strlcat(3), strlcpy(3), strndup(3), vasprintf(3) BSD
May 3, 2010 BSD

Check Out this Related Man Page

STRING(3)						   BSD Library Functions Manual 						 STRING(3)

NAME
stpcpy, stpncpy, strcat, strlcat, strncat, strchr, strrchr, strcmp, strncmp, strcasecmp, strncasecmp, strcoll, strcpy, strlcpy, strncpy, strerror, strerror_r, strlen, strnlen, strpbrk, strsep, stresep, strspn, strcspn, strdup, strndup, strstr, strcasestr, strtok, strtok_r, strxfrm -- string specific functions LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <string.h> char * stpcpy(char *dst, const char *src); char * stpncpy(char *dst, const char *src, size_t count); char * strcat(char *s, const char * append); size_t strlcat(char *dst, const char *src, size_t size); char * strncat(char *s, const char *append, size_t count); char * strchr(const char *s, int c); char * strrchr(const char *s, int c); int strcmp(const char *s1, const char *s2); int strncmp(const char *s1, const char *s2, size_t count); int strcasecmp(const char *s1, const char *s2); int strncasecmp(const char *s1, const char *s2, size_t count); int strcoll(const char *s1, const char *s2); char * strcpy(char *dst, const char *src); size_t strlcpy(char *dst, const char *src, size_t size); char * strncpy(char *dst, const char *src, size_t count); char * strerror(int errno); int strerror_r(int errnum, char *strerrbuf, size_t buflen); size_t strlen(const char *s); size_t strnlen(const char *s, size_t count); char * strpbrk(const char *s, const char *charset); char * strsep(char **stringp, const char *delim); char * stresep(char **stringp, const char *delim, int escape); size_t strspn(const char *s, const char *charset); size_t strcspn(const char *s, const char *charset); char * strdup(const char *str); char * strndup(const char *str, size_t len); char * strstr(const char *big, const char *little); char * strcasestr(const char *big, const char *little); char * strtok(char *s, const char *delim); char * strtok_r(char *s, const char *delim, char **lasts); size_t strxfrm(char *dst, const char *src, size_t n); DESCRIPTION
The string functions manipulate strings terminated by a nul byte. See the specific manual pages for more information. For manipulating variable length generic objects as byte strings (without the nul byte check), see bstring(3). Except as noted in their specific manual pages, the string functions do not test the destination for size limitations. SEE ALSO
bstring(3), strcat(3), strchr(3), strcmp(3), strcoll(3), strcpy(3), strcspn(3), strdup(3), strerror(3), strings(3), strlcat(3), strlen(3), strpbrk(3), strrchr(3), strsep(3), strspn(3), strstr(3), strtok(3), strxfrm(3) STANDARDS
The strcat(), strncat(), strchr(), strrchr(), strcmp(), strncmp(), strcpy(), strncpy(), strcoll(), strerror(), strlen(), strpbrk(), strsep(), strspn(), strcspn(), strstr(), strtok(), and strxfrm() functions conform to ANSI X3.159-1989 (``ANSI C89''). The strtok_r() function conforms to IEEE Std 1003.1c-1995 (``POSIX.1''). The strerror_r() function conform to IEEE Std 1003.1-2001 (``POSIX.1''). BSD
May 1, 2009 BSD
Man Page