X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Futil.h;h=7c9842b3e6c2dcf2f96eb84d6d1add6c39a2372a;hb=30d7c9c472bd7be1b6a09d3bd5afd939988de990;hp=6d3791be7f096a8748c5540c2a6dfed3f2507f00;hpb=fecc80c1ba2eed9dadb9a10c15508c356bcc5fc1;p=elogind.git diff --git a/src/shared/util.h b/src/shared/util.h index 6d3791be7..7c9842b3e 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -382,7 +382,8 @@ bool fstype_is_network(const char *fstype); int chvt(int vt); int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl); -int ask(char *ret, const char *replies, const char *text, ...) _printf_(3, 4); +int ask_char(char *ret, const char *replies, const char *text, ...) _printf_(3, 4); +int ask_string(char **ret, const char *text, ...) _printf_(2, 3); int reset_terminal_fd(int fd, bool switch_to_text); int reset_terminal(const char *name); @@ -504,7 +505,7 @@ bool tty_is_console(const char *tty) _pure_; int vtnr_from_tty(const char *tty); const char *default_term_for_tty(const char *tty); -void execute_directory(const char *directory, DIR *_d, usec_t timeout, char *argv[]); +void execute_directory(const char *directory, DIR *_d, usec_t timeout, char *argv[], char *env[]); int kill_and_sigcont(pid_t pid, int sig); @@ -515,6 +516,8 @@ bool plymouth_running(void); bool hostname_is_valid(const char *s) _pure_; char* hostname_cleanup(char *s, bool lowercase); +bool machine_name_is_valid(const char *s) _pure_; + char* strshorten(char *s, size_t l); int terminal_vhangup_fd(int fd); @@ -690,7 +693,7 @@ _alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t a, size_ bool filename_is_safe(const char *p) _pure_; bool path_is_safe(const char *p) _pure_; bool string_is_safe(const char *p) _pure_; -bool string_has_cc(const char *p) _pure_; +bool string_has_cc(const char *p, const char *ok) _pure_; /** * Check if a string contains any glob patterns.