chiark / gitweb /
add test for garbage collector
[elogind.git] / util.h
diff --git a/util.h b/util.h
index 60dc04e961cadb778a1617041bf48d559091c5d8..f5aaf704d6cee0ab3edab66af0dcf240fccc7e4a 100644 (file)
--- a/util.h
+++ b/util.h
@@ -52,11 +52,16 @@ static inline bool is_path_absolute(const char *p) {
 bool endswith(const char *s, const char *postfix);
 bool startswith(const char *s, const char *prefix);
 
-int nointr_close(int fd);
+int close_nointr(int fd);
 
 int parse_boolean(const char *v);
 
 int safe_atou(const char *s, unsigned *ret_u);
 int safe_atoi(const char *s, int *ret_i);
 
+char *split_spaces(const char *c, size_t *l, char **state);
+
+#define FOREACH_WORD(word, length, s, state)    \
+        for ((state) = NULL, (word) = split_spaces((s), &(l), &(state)); (word); (word) = split_spaces((s), &(l), &(state)))
+
 #endif