diff options
Diffstat (limited to 'lib/util/nstring.h')
-rw-r--r-- | lib/util/nstring.h | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/lib/util/nstring.h b/lib/util/nstring.h index 8829617d..1aa486c6 100644 --- a/lib/util/nstring.h +++ b/lib/util/nstring.h @@ -22,17 +22,15 @@ extern "C" { array. */ #define STRSCPY(A,B) \ - (strncpy((A), (B), sizeof(A)), *((A)+sizeof(A)-1) = '\0') + (strncpy((A), (B), sizeof(A)), *((A)+sizeof(A)-1) = '\0') #define STRSCMP(A,B) \ - (strncmp((A), (B), sizeof(A))) + (strncmp((A), (B), sizeof(A))) #define STRSCAT(A,B) \ (strncpy(A+strlen(A), B, sizeof(A)-strlen(A)), *((A)+sizeof(A)-1) = '\0') #define STRSEQ(A, B) \ - (strneq((A), (B), sizeof(A))) + (strneq((A), (B), sizeof(A))) -#define MEMEQ(a,b,c) (memcmp(a, b, c) == 0) - -#define MEMSEQ(a,b) (memeq(a, b, sizeof(*(a))) == 0) +#define MEMSEQ(a,b) (memeq(a, b, sizeof(*(a)))) #define MEMSSET(a,b) (memset(a, b, sizeof(*(a)))) @@ -126,15 +124,11 @@ strncaseeq(const char * const comparand, #define TOUPPER(C) ((char)toupper((unsigned char)(C))) -/* These are all private versions of commonly available standard C - library subroutines whose names are the same except with the N at - the end. Because not all standard C libraries have them all, - Netpbm must include them in its own libraries, and because some - standard C libraries have some of them, Netpbm must use different - names for them. +/* Most of these are private versions of commonly available standard C library + subroutines whose names are similar. They're here because not all standard + C libraries have them. - The GNU C library has all of them. All but the oldest standard C libraries - have snprintf(). + The GNU C library has all of them. There are slight differences between the asprintf() family and that found in other libraries: @@ -160,19 +154,6 @@ size_t pm_strnlen(const char * const s, size_t const maxlen); -int -pm_snprintf(char * const dest, - size_t const str_m, - const char * const fmt, - ...) PM_GNU_PRINTF_ATTR(3,4); - -void -pm_vsnprintf(char * const str, - size_t const str_m, - const char * const fmt, - va_list ap, - size_t * const sizeP); - const char * pm_strdup(const char * const arg); |