aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/string-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/string-utils.h')
-rw-r--r--src/string-utils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/string-utils.h b/src/string-utils.h
index 4eee958..559e590 100644
--- a/src/string-utils.h
+++ b/src/string-utils.h
@@ -27,6 +27,18 @@ namespace SciTECO {
namespace String {
/**
+ * Upper-case ASCII character.
+ *
+ * There are implementations in glib and libc,
+ * but defining it here ensures it can be inlined.
+ */
+static inline gchar
+toupper(gchar chr)
+{
+ return chr >= 'a' && chr <= 'z' ? chr & ~0x20 : chr;
+}
+
+/**
* Allocate a string containing a single character chr.
*/
static inline gchar *