X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib%2Fstr.h;h=140a4bac71f35513cb3ccc3223cb906a5396ab5e;hb=238b70e39b78f585c586bd51aef41988b3cc73d1;hp=3dc825edd103006b8831a190035e6c9ab1de9aa9;hpb=0f44dc85fc1280372ffab911d701e703d803fb4b;p=apps%2Fmadmutt.git diff --git a/lib/str.h b/lib/str.h index 3dc825e..140a4ba 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,25 +30,10 @@ # 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 /* 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++; -/* - * 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*); - /* * tools */ @@ -60,6 +42,9 @@ char *str_substrcpy (char*, const char*, const char*, size_t); char *str_substrdup (const char*, const char*); void str_replace (char**, const char*); void str_adjust (char**); +int str_eq (const char*, const char*); const char *str_isstr (const char*, const char*); +char* str_skip_initws (char*); +void str_skip_trailws (char*); #endif /* !_LIB_STR_H */