X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Futil.h;h=3b3a0564379d67ba80f5b858f5ce850fcfcd1828;hb=5806784b5c7618d2a0407effe013b8734ce6917d;hp=749bd0ea853c61f3c4a28b8d139c5de2ff48dea8;hpb=031886edfc6e96ab778c241035a8d00fb0de99d3;p=elogind.git diff --git a/src/shared/util.h b/src/shared/util.h index 749bd0ea8..3b3a05643 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -183,6 +183,7 @@ static inline char *startswith_no_case(const char *s, const char *prefix) { } char *endswith(const char *s, const char *postfix) _pure_; +char *endswith_no_case(const char *s, const char *postfix) _pure_; char *first_word(const char *s, const char *word) _pure_; @@ -549,6 +550,8 @@ int kill_and_sigcont(pid_t pid, int sig); bool nulstr_contains(const char*nulstr, const char *needle); +bool plymouth_running(void); + bool hostname_is_valid(const char *s) _pure_; char* hostname_cleanup(char *s, bool lowercase); @@ -1015,8 +1018,13 @@ int take_password_lock(const char *root); int is_symlink(const char *path); int is_dir(const char *path, bool follow); -int unquote_first_word(const char **p, char **ret, bool relax); -int unquote_many_words(const char **p, ...) _sentinel_; +typedef enum UnquoteFlags{ + UNQUOTE_RELAX = 1, + UNQUOTE_CUNESCAPE = 2, +} UnquoteFlags; + +int unquote_first_word(const char **p, char **ret, UnquoteFlags flags); +int unquote_many_words(const char **p, UnquoteFlags flags, ...) _sentinel_; int free_and_strdup(char **p, const char *s); @@ -1047,10 +1055,9 @@ int fd_getcrtime(int fd, usec_t *usec); int path_getcrtime(const char *p, usec_t *usec); int fd_getcrtime_at(int dirfd, const char *name, usec_t *usec, int flags); -int same_fd(int a, int b); - int chattr_fd(int fd, bool b, unsigned mask); int chattr_path(const char *p, bool b, unsigned mask); +int change_attr_fd(int fd, unsigned value, unsigned mask); int read_attr_fd(int fd, unsigned *ret); int read_attr_path(const char *p, unsigned *ret);