summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5168f69)
raw | patch | inline | side by side (parent: 5168f69)
author | Florian Forster <ff@octo.it> | |
Sun, 20 Jun 2010 19:39:05 +0000 (21:39 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 20 Jun 2010 19:39:05 +0000 (21:39 +0200) |
src/common.c | patch | blob | history | |
src/common.h | patch | blob | history |
diff --git a/src/common.c b/src/common.c
index 2b6b5eb9180efa2272695de031d0d3d4c6d49ac0..4916b3ca0cb0b507038a22dc3bfb7613c301339a 100644 (file)
--- a/src/common.c
+++ b/src/common.c
#include <stdint.h>
#include <inttypes.h>
#include <string.h>
+#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
return (status);
} /* }}} int print_debug */
+char *strtolower (char *str) /* {{{ */
+{
+ unsigned int i;
+
+ if (str == NULL)
+ return (NULL);
+
+ for (i = 0; str[i] != 0; i++)
+ str[i] = (char) tolower ((int) str[i]);
+
+ return (str);
+} /* }}} char *strtolower */
+
+char *strtolower_copy (const char *str)
+{
+ if (str == NULL)
+ return (NULL);
+
+ return (strdup (str));
+}
+
/* vim: set sw=2 sts=2 et fdm=marker : */
diff --git a/src/common.h b/src/common.h
index 2b5662f6b5eb5a57d277b07e02c3bec0c6cdadfa..ad589e7bfd717bf786cf32fd5bbc12895255d6e8 100644 (file)
--- a/src/common.h
+++ b/src/common.h
uint32_t get_random_color (void);
+char *strtolower (char *str);
+char *strtolower_copy (const char *str);
+
#endif /* COMMON_H */
/* vim: set sw=2 sts=2 et fdm=marker : */