X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=util.h;h=bdbaa36e13b0719756c0a98f92d4ce3edf5ebbb6;hp=476b5ae8abefe68e84b959adb0379f33d348c45b;hb=ea4309869e75497ba6a97c540646cb66a157a4d9;hpb=1dccbe197cc480c1f161f967d180cbc3cc3d2d66 diff --git a/util.h b/util.h index 476b5ae8a..bdbaa36e1 100644 --- a/util.h +++ b/util.h @@ -60,6 +60,8 @@ 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); +bool first_word(const char *s, const char *word); + int close_nointr(int fd); void close_nointr_nofail(int fd); @@ -119,6 +121,9 @@ char *ascii_strlower(char *path); char *xescape(const char *s, const char *bad); +char *bus_path_escape(const char *s); +char *bus_path_unescape(const char *s); + #define DEFINE_STRING_TABLE_LOOKUP(name,type) \ const char *name##_to_string(type i) { \ if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \