diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-04-16 01:57:23 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-04-16 02:03:35 +0200 |
commit | 9beb3f4d5c527f995e0e44308d7372fa4ea5470f (patch) | |
tree | 09c81142ac28e90e330caf0987dce341b93a5966 /src/util.h | |
parent | f653f683d8994ca4b33f48d6adf2c6ee3c58e13e (diff) |
hostname: split out hostname validation into util.c
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h index 72ddd36e55..946179a90d 100644 --- a/src/util.h +++ b/src/util.h @@ -117,6 +117,10 @@ static inline bool is_path_absolute(const char *p) { return *p == '/'; } +static inline bool isempty(const char *p) { + return !p || !p[0]; +} + bool endswith(const char *s, const char *postfix); bool startswith(const char *s, const char *prefix); bool startswith_no_case(const char *s, const char *prefix); @@ -398,6 +402,11 @@ void parse_syslog_priority(char **p, int *priority); int have_effective_cap(int value); +bool hostname_is_valid(const char *s); +char* hostname_cleanup(char *s); + +char* strshorten(char *s, size_t l); + #define NULSTR_FOREACH(i, l) \ for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) |