chiark / gitweb /
hostname: split out hostname validation into util.c
[elogind.git] / src / util.h
index 72ddd36e556bc8954063c88767c73fb73a8f10e7..946179a90d3b27a505865ff901e2b3b4c807f6be 100644 (file)
@@ -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)