diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2015-05-26 12:55:32 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-05-26 12:55:38 -0400 |
commit | 7b6429823bcdcdc62568a4090d4698771ad8bc14 (patch) | |
tree | 42f5d586bf70e07b93b1573aa17549c4d6b8ce65 /src/shared/util.h | |
parent | 5519f19a27f4b5e78f3018953166ccd70c319667 (diff) |
src/shared/util.[ch]: import functions from upstream for previous commits
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/shared/util.h')
-rw-r--r-- | src/shared/util.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h index 2aa8da0989..f6c8f75649 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -140,7 +140,9 @@ char *truncate_nl(char *s); int rmdir_parents(const char *path, const char *stop); char hexchar(int x) _const_; +int unhexchar(char c) _const_; char octchar(int x) _const_; +int unoctchar(char c) _const_; char *cescape(const char *s); size_t cescape_char(char c, char *buf); @@ -390,6 +392,7 @@ static inline void qsort_safe(void *base, size_t nmemb, size_t size, } int proc_cmdline(char **ret); +int parse_proc_cmdline(int (*parse_word)(const char *key, const char *value)); int getpeercred(int fd, struct ucred *ucred); #if HAVE_DECL_MKOSTEMP @@ -408,6 +411,13 @@ int tempfn_xxxxxx(const char *p, char **ret); int is_dir(const char *path, bool follow); +typedef enum UnquoteFlags { + UNQUOTE_RELAX = 1, + UNQUOTE_CUNESCAPE = 2, +} UnquoteFlags; + +int unquote_first_word(const char **p, char **ret, UnquoteFlags flags); + int execute_command(const char *command, char *const argv[]); #define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1) |