diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2013-06-06 00:18:45 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2013-06-06 00:18:45 -0400 |
commit | 6f8f3edfe8dd70e24105d889f664ff033eb0555e (patch) | |
tree | c9a74b97b9c9cc01cd2608ba1506f8c70f2d8df6 /src/libudev/util.h | |
parent | ac6af1454474115a0105f07c5704e13e40d0ff0e (diff) |
Round 3 of remove unused functions from src/libudev/{conf-files,hashmap,util}
The following functions were removed:
strv_env_get_n
strv_env_get
conf_files_list
hashmap_remove
hashmap_move
log_dump_internal
parse_uid
read_full_file
strstrip
file_in_same_dir
cunescape
cunescape_length
cunescape_length_with_prefix
xescape
dirent_is_file
close_all_fds
read_one_char
ask
reset_terminal_fd
reset_terminal
flush_fd
loop_read
get_ctty_devnr
get_ctty
rm_rf_children
rm_rf_children_dangerous
rm_rf
status_vprintf
fd_columns
columns
fd_lines
lines
on_tty
ellipsize
ellipsize_mem
touch
unquote
resolve_dev_console
tty_is_vc
vtnr_from_tty
terminal_vhangup_fd
terminal_vhangup
file_is_priv_sticky
signal_from_string
fd_wait_for_event
memdup
memdup_multiply
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev/util.h')
-rw-r--r-- | src/libudev/util.h | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/libudev/util.h b/src/libudev/util.h index 0920082613..80a0c436ad 100644 --- a/src/libudev/util.h +++ b/src/libudev/util.h @@ -145,9 +145,6 @@ char *startswith(const char *s, const char *prefix) _pure_; int close_nointr(int fd); void close_nointr_nofail(int fd); -int parse_uid(const char *s, uid_t* ret_uid); -#define parse_gid(s, ret_uid) parse_uid(s, ret_uid) - int safe_atou(const char *s, unsigned *ret_u); int safe_atoi(const char *s, int *ret_i); @@ -208,30 +205,19 @@ char *split_quoted(const char *c, size_t *l, char **state); int write_one_line_file(const char *fn, const char *line); int read_one_line_file(const char *fn, char **line); -int read_full_file(const char *fn, char **contents, size_t *size); char *strappend(const char *s, const char *suffix); char *strnappend(const char *s, const char *suffix, size_t length); int readlink_malloc(const char *p, char **r); -char *strstrip(char *s); char *truncate_nl(char *s); -char *file_in_same_dir(const char *path, const char *filename); - char hexchar(int x) _const_; int unhexchar(char c) _const_; char octchar(int x) _const_; int unoctchar(char c) _const_; -char *cunescape(const char *s); -char *cunescape_length(const char *s, size_t length); -char *cunescape_length_with_prefix(const char *s, size_t length, const char *prefix); - -char *xescape(const char *s, const char *bad); - -bool dirent_is_file(const struct dirent *de) _pure_; bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) _pure_; bool ignore_file(const char *filename) _pure_; @@ -292,65 +278,21 @@ char *format_timespan(char *buf, size_t l, usec_t t); } \ struct __useless_struct_to_allow_trailing_semicolon__ -int close_all_fds(const int except[], unsigned n_except); - -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_attr_(3, 4); - -int reset_terminal_fd(int fd, bool switch_to_text); -int reset_terminal(const char *name); - int open_terminal(const char *name, int mode); -int flush_fd(int fd); - int fopen_temporary(const char *path, FILE **_f, char **_temp_path); -ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll); - -int get_ctty_devnr(pid_t pid, dev_t *d); -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 rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev); -int rm_rf_children_dangerous(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 status_vprintf(const char *status, bool ellipse, bool ephemeral, const char *format, va_list ap) _printf_attr_(4,0); - -int fd_columns(int fd); -unsigned columns(void); -int fd_lines(int fd); -unsigned lines(void); - -bool on_tty(void); - -char *ellipsize(const char *s, size_t length, unsigned percent); -char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent); - -int touch(const char *path); - -char *unquote(const char *s, const char *quotes); - bool null_or_empty(struct stat *st) _pure_; int null_or_empty_path(const char *fn); -char *resolve_dev_console(char **active); -bool tty_is_vc(const char *tty); -int vtnr_from_tty(const char *tty); - int execute_command(const char *command, char *const argv[]); -int terminal_vhangup_fd(int fd); -int terminal_vhangup(const char *name); - char *strjoin(const char *x, ...) _sentinel_; bool is_main_thread(void); -int file_is_priv_sticky(const char *p); - #define NULSTR_FOREACH(i, l) \ for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) @@ -379,15 +321,10 @@ int ip_tos_to_string_alloc(int i, char **s); int ip_tos_from_string(const char *s); const char *signal_to_string(int i) _const_; -int signal_from_string(const char *s) _pure_; extern int saved_argc; extern char **saved_argv; -int fd_wait_for_event(int fd, int event, usec_t timeout); - -void* memdup(const void *p, size_t l) _alloc_(2); - int fd_inc_sndbuf(int fd, size_t n); bool in_initrd(void); @@ -435,13 +372,6 @@ _malloc_ _alloc_(1, 2) static inline void *malloc_multiply(size_t a, size_t b) return malloc(a * b); } -_alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t a, size_t b) { - if (_unlikely_(b == 0 || a > ((size_t) -1) / b)) - return NULL; - - return memdup(p, a * b); -} - void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size, int (*compar) (const void *, const void *, void *), void *arg); |