X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib%2Fstr.h;h=bc3cb82a8856b65b42eef1a3cae5d9afe69690f8;hp=6c05b15b9aef8b0abf2f60c1902b5d7f4b9a3041;hb=c6b9d35ed9361e4defab9762a7480d5126405ae9;hpb=93f817273e1c70071cd5471594600bc70f12f0ff diff --git a/lib/str.h b/lib/str.h index 6c05b15..bc3cb82 100644 --- a/lib/str.h +++ b/lib/str.h @@ -7,14 +7,11 @@ * It's licensed under the GNU General Public License, * please see the file GPL in the top level source directory. */ - #ifndef _LIB_STR_H #define _LIB_STR_H #include -#define NONULL(x) x?x:"" - # define HUGE_STRING 5120 # define LONG_STRING 1024 # define STRING 256 @@ -33,7 +30,7 @@ # define ISSPACE(c) isspace((unsigned char)c) # define ISBLANK(c) (c == ' ' || c == '\t') -# define strfcpy(A,B,C) strncpy(A,B,C), *(A+(C)-1)=0 +# define strfcpy(A,B,C) m_strcpy(A,C,B) /* this macro must check for *c == 0 since isspace(0) has * unreliable behavior on some systems */ # define SKIPWS(c) while (*(c) && isspace ((unsigned char) *(c))) c++; @@ -42,15 +39,12 @@ * safety wrappers/replacements * (mostly only difference: safely handle NULL strings) */ -char *safe_strdup (const char*); -char *safe_strcat (char*, size_t, const char*); -char *safe_strncat (char*, size_t, const char*, size_t); -int safe_strcmp (const char*, const char*); -int safe_strcasecmp (const char*, const char*); -int safe_strncmp (const char*, const char*, size_t); -int safe_strncasecmp (const char*, const char*, size_t); -int safe_strcoll (const char*, const char*); -size_t safe_strlen (const char*); +char *str_cat (char*, size_t, const char*); +char *str_ncat (char*, size_t, const char*, size_t); +int str_casecmp (const char*, const char*); +int str_ncmp (const char*, const char*, size_t); +int str_ncasecmp (const char*, const char*, size_t); +int str_coll (const char*, const char*); /* * tools