summaryrefslogtreecommitdiff
path: root/src/common/extstr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/extstr.h')
-rw-r--r--src/common/extstr.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/extstr.h b/src/common/extstr.h
index 6542d2f..e1d784d 100644
--- a/src/common/extstr.h
+++ b/src/common/extstr.h
@@ -25,6 +25,7 @@
#define _COMMON_EXTSTR_H
+#include <ctype.h>
#include <sys/types.h>
@@ -44,6 +45,12 @@ int strrcmp(const char *, const char *);
/* Remplace des éléments d'une chaîne par d'autres. */
char *strrpl(char *, const char *, const char *);
+/* Bascule toute une chaîne de caractères en (min|maj)uscules. */
+char *_strxxx(char *, int (* fn) (int));
+
+#define strlower(str) _strxxx(str, tolower)
+#define strupper(str) _strxxx(str, toupper)
+
/* Extrait une liste de mots d'une chaîne. */
char **strtoka(const char *, const char *, size_t *);