X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Futil.h;h=35ff2e3547f42e22f42ab10a677c79c090dadeb2;hb=ba1261bc02693ac8a7712ade14aab8e22989ba88;hp=59a69a898a3b47281de7e4a7d631a7a41b40c0c6;hpb=9eb977db5b89b44f254ab40c1876a76b7d7ea2d0;p=elogind.git diff --git a/src/shared/util.h b/src/shared/util.h index 59a69a898..35ff2e354 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -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); @@ -505,4 +508,12 @@ int setrlimit_closest(int resource, const struct rlimit *rlim); 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