X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=util.h;h=30a0616d542060d8c98aa3028c0eab95a914d727;hp=3ee536add5694f572cd29eb05c31042007cde808;hb=70123e68a04016efca9266fc22dd05a0a7fd2d51;hpb=ee9b5e011857ff4a75ceaa9aaf3b2ed8ceacfadf diff --git a/util.h b/util.h index 3ee536add..30a0616d5 100644 --- a/util.h +++ b/util.h @@ -39,6 +39,7 @@ typedef uint64_t usec_t; /* What is interpreted as whitespace? */ #define WHITESPACE " \t\n\r" +#define NEWLINE "\n\r" usec_t now(clockid_t clock); @@ -130,10 +131,13 @@ int reset_all_signal_handlers(void); char *strstrip(char *s); char *delete_chars(char *s, const char *bad); +char *truncate_nl(char *s); char *file_in_same_dir(const char *path, const char *filename); int mkdir_parents(const char *path, mode_t mode); +int get_process_name(pid_t pid, char **name); + char hexchar(int x); int unhexchar(char c); char octchar(int x); @@ -157,6 +161,8 @@ char *bus_path_unescape(const char *s); bool ignore_file(const char *filename); +bool chars_intersect(const char *a, const char *b); + #define DEFINE_STRING_TABLE_LOOKUP(name,type) \ const char *name##_to_string(type i) { \ if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \