chiark / gitweb /
build-sys: fix built with --disable-logind
[elogind.git] / src / shared / util.h
index 272ab48651119b6a6e6db13b3f86a567130752cd..35ff2e3547f42e22f42ab10a677c79c090dadeb2 100644 (file)
@@ -73,6 +73,7 @@ typedef struct dual_timestamp {
 #define ANSI_HIGHLIGHT_ON "\x1B[1;39m"
 #define ANSI_HIGHLIGHT_RED_ON "\x1B[1;31m"
 #define ANSI_HIGHLIGHT_GREEN_ON "\x1B[1;32m"
+#define ANSI_HIGHLIGHT_YELLOW_ON "\x1B[1;33m"
 #define ANSI_HIGHLIGHT_OFF "\x1B[0m"
 
 usec_t now(clockid_t clock);
@@ -102,7 +103,7 @@ bool streq_ptr(const char *a, const char *b);
 
 #define newa(t, n) ((t*) alloca(sizeof(t)*(n)))
 
-#define newdup(t, p, n) ((t*) memdup(p, sizeof(t)*(n))
+#define newdup(t, p, n) ((t*) memdup(p, sizeof(t)*(n)))
 
 #define malloc0(n) (calloc((n), 1))
 
@@ -336,6 +337,7 @@ void rename_process(const char name[8]);
 void sigset_add_many(sigset_t *ss, ...);
 
 char* gethostname_malloc(void);
+bool hostname_is_set(void);
 char* getlogname_malloc(void);
 
 int getttyname_malloc(int fd, char **r);
@@ -347,6 +349,7 @@ int get_ctty(pid_t, dev_t *_devnr, char **r);
 int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid);
 int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid);
 
+int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev);
 int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_sticky);
 
 int pipe_eof(int fd);
@@ -507,4 +510,10 @@ int getenv_for_pid(pid_t pid, const char *field, char **_value);
 
 int can_sleep(const char *type);
 
+bool is_valid_documentation_url(const char *url);
+
+bool in_initrd(void);
+
+void warn_melody(void);
+
 #endif