diff options
Diffstat (limited to 'utils/utils.h')
-rw-r--r-- | utils/utils.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/utils.h b/utils/utils.h index f58a2632b..5b06d9caa 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -78,6 +78,18 @@ typedef struct #define nsmkdir(dir, mode) mkdir((dir)) #endif +/** + * Private-word-capable realloc() implementation which + * behaves as most NS libraries expect in the face of + * realloc(ptr, 0) and realloc(NULL, size). + * + * \param ptr The pointer for reallocation + * \param size The number of bytes for the allocation + * \param pw A "private word" which we ignore. + * \return The new pointer (NULL on frees or errors) + */ +void *ns_realloc(void *ptr, size_t size, void *pw); + char * strip(char * const s); int whitespace(const char * str); char * squash_whitespace(const char * s); |