/* What is interpreted as whitespace? */
#define WHITESPACE " \t\n\r"
+#define NEWLINE "\n\r"
usec_t now(clockid_t clock);
int reset_all_signal_handlers(void);
char *strstrip(char *s);
+char *delete_chars(char *s, const char *bad);
+char *truncate_nl(char *s);
+
char *file_in_same_dir(const char *path, const char *filename);
int mkdir_parents(const char *path, mode_t mode);
+int get_process_name(pid_t pid, char **name);
+
char hexchar(int x);
int unhexchar(char c);
char octchar(int x);
bool ignore_file(const char *filename);
+bool chars_intersect(const char *a, const char *b);
+
#define DEFINE_STRING_TABLE_LOOKUP(name,type) \
const char *name##_to_string(type i) { \
if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \
} \
type name##_from_string(const char *s) { \
type i; \
- unsigned u; \
+ unsigned u = 0; \
assert(s); \
for (i = 0; i < (type)ELEMENTSOF(name##_table); i++) \
if (streq(name##_table[i], s)) \