X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Futil.h;h=223617c3ff6284f17fc329ce1134cce98c402ff8;hp=25b349a17a0c1ff9be109963635b7a69ee521186;hb=e985665d2d226cb42b52bfcad6fd5b1586ad57d7;hpb=e8bc0ea2b100158bf35c635039226235aa879068 diff --git a/src/shared/util.h b/src/shared/util.h index 25b349a17..223617c3f 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -60,8 +60,6 @@ union dirent_storage { #define ANSI_HIGHLIGHT_YELLOW_ON "\x1B[1;33m" #define ANSI_HIGHLIGHT_OFF "\x1B[0m" -bool is_efiboot(void); - size_t page_size(void); #define PAGE_ALIGN(l) ALIGN_TO((l), page_size()) @@ -433,6 +431,8 @@ int get_group_creds(const char **groupname, gid_t *gid); int in_group(const char *name); +char* uid_to_name(uid_t uid); + int glob_exists(const char *path); int dirent_ensure_type(DIR *d, struct dirent *de); @@ -522,6 +522,7 @@ int get_home_dir(char **ret); void freep(void *p); void fclosep(FILE **f); +void pclosep(FILE **f); void closep(int *fd); void closedirp(DIR **d); void umaskp(mode_t *u); @@ -541,6 +542,7 @@ _malloc_ static inline void *memdup_multiply(const void *p, size_t a, size_t b) } bool filename_is_safe(const char *p); +bool path_is_safe(const char *p); bool string_is_safe(const char *p); void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size, @@ -553,6 +555,7 @@ typedef enum DrawSpecialChar { DRAW_TREE_VERT, DRAW_TREE_BRANCH, DRAW_TREE_RIGHT, + DRAW_TREE_SPACE, DRAW_TRIANGULAR_BULLET, _DRAW_SPECIAL_CHAR_MAX } DrawSpecialChar; @@ -561,3 +564,5 @@ const char *draw_special_char(DrawSpecialChar ch); char *strreplace(const char *text, const char *old_string, const char *new_string); char *strip_tab_ansi(char **p, size_t *l); + +int on_ac_power(void);