2 * Copyright notice from original mutt:
3 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
4 * Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
6 * This file is part of mutt-ng, see http://www.muttng.org/.
7 * It's licensed under the GNU General Public License,
8 * please see the file GPL in the top level source directory.
14 #include <sys/types.h>
16 #define NONULL(x) x?x:""
18 # define HUGE_STRING 5120
19 # define LONG_STRING 1024
21 # define SHORT_STRING 128
24 * Create a format string to be used with scanf.
25 * To use it, write, for instance, MUTT_FORMAT(HUGE_STRING).
27 * See K&R 2nd ed, p. 231 for an explanation.
29 # define _MUTT_FORMAT_2(a,b) "%" a b
30 # define _MUTT_FORMAT_1(a, b) _MUTT_FORMAT_2(#a, b)
31 # define MUTT_FORMAT(a) _MUTT_FORMAT_1(a, "s")
32 # define MUTT_FORMAT2(a,b) _MUTT_FORMAT_1(a, b)
34 # define ISSPACE(c) isspace((unsigned char)c)
35 # define strfcpy(A,B,C) strncpy(A,B,C), *(A+(C)-1)=0
37 /* this macro must check for *c == 0 since isspace(0) has unreliable behavior
39 # define SKIPWS(c) while (*(c) && isspace ((unsigned char) *(c))) c++;
41 #define ISBLANK(c) (c == ' ' || c == '\t')
43 * These functions aren't defined in lib.c, but
44 * they are used there.
46 * A non-mutt "implementation" (ahem) can be found in extlib.c.
49 char *mutt_strlower (char *);
50 char *mutt_substrcpy (char *, const char *, const char *, size_t);
51 char *mutt_substrdup (const char *, const char *);
52 char *safe_strcat (char *, size_t, const char *);
53 char *safe_strncat (char *, size_t, const char *, size_t);
54 char *safe_strdup (const char *);
55 int mutt_strcasecmp (const char *, const char *);
56 int mutt_strcmp (const char *, const char *);
57 int mutt_strncasecmp (const char *, const char *, size_t);
58 int mutt_strncmp (const char *, const char *, size_t);
59 int mutt_strcoll (const char *, const char *);
60 void mutt_str_replace (char **p, const char *s);
61 void mutt_str_adjust (char **p);
62 size_t mutt_strlen (const char *a);
64 #endif /* !_LIB_STR_H */