]>
diplodocus.org Git - nmh/blob - h/utils.h
3 * utils.h -- utility prototypes
6 void *mh_xmalloc(size_t);
7 void *mh_xrealloc(void *, size_t);
8 void *mh_xcalloc(size_t, size_t);
10 char *add(const char *, char *);
11 char *addlist(char *, const char *);
12 int folder_exists(const char *);
13 void create_folder(char *, int, void (*)(int));
17 * A vector of char array, used to hold a list of string message numbers
18 * or command arguments.
27 * Same as msgs_array, but for a vector of ints
36 * Add a argument to the given msgs_array or msgnum_array structure; extend
37 * the array size if necessary
40 void app_msgarg(struct msgs_array
*, char *);
41 void app_msgnum(struct msgnum_array
*, int);
43 int open_form(char **, char *);
44 char *find_str (const char [], size_t, const char *);
45 char *rfind_str (const char [], size_t, const char *);
46 char *nmh_strcasestr (const char *, const char *);
49 * See if a string contains 8 bit characters (use isascii() for the test).
52 * start - Pointer to start of string to test.
53 * end - End of string to test (test will stop before reaching
54 * this point). If NULL, continue until reaching '\0'.
56 * This function always stops at '\0' regardless of the value of 'end'.
57 * Returns 1 if the string contains an 8-bit character, 0 if it does not.
59 int contains8bit(const char *start
, const char *end
);