summaryrefslogtreecommitdiff
path: root/src/basic/string-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/string-util.h')
-rw-r--r--src/basic/string-util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index 1209e1e2e1..d029d538bd 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -70,6 +70,10 @@ static inline const char *empty_to_null(const char *p) {
return isempty(p) ? NULL : p;
}
+static inline const char *strdash_if_empty(const char *str) {
+ return isempty(str) ? "-" : str;
+}
+
static inline char *startswith(const char *s, const char *prefix) {
size_t l;
@@ -137,6 +141,9 @@ char ascii_tolower(char x);
char *ascii_strlower(char *s);
char *ascii_strlower_n(char *s, size_t n);
+char ascii_toupper(char x);
+char *ascii_strupper(char *s);
+
int ascii_strcasecmp_n(const char *a, const char *b, size_t n);
int ascii_strcasecmp_nn(const char *a, size_t n, const char *b, size_t m);