chiark / gitweb /
Add _cleanup_pclose_ and fix mismatching pipe close opened by popen()
[elogind.git] / src / shared / util.h
index af18d0b657f4ebe70c347ba17efaf0255c675175..223617c3ff6284f17fc329ce1134cce98c402ff8 100644 (file)
@@ -46,7 +46,6 @@ union dirent_storage {
                         ((NAME_MAX + 1 + sizeof(long)) & ~(sizeof(long) - 1))];
 };
 
-
 /* What is interpreted as whitespace? */
 #define WHITESPACE " \t\n\r"
 #define NEWLINE "\n\r"
@@ -61,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())
 
@@ -434,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);
@@ -523,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);
@@ -542,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,
@@ -554,9 +555,14 @@ typedef enum DrawSpecialChar {
         DRAW_TREE_VERT,
         DRAW_TREE_BRANCH,
         DRAW_TREE_RIGHT,
+        DRAW_TREE_SPACE,
         DRAW_TRIANGULAR_BULLET,
         _DRAW_SPECIAL_CHAR_MAX
 } DrawSpecialChar;
 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);