Miscellaneous fixes.
[bluesky.git] / bluesky / util.c
1 /* Blue Sky: File Systems in the Cloud
2  *
3  * Copyright (C) 2009  The Regents of the University of California
4  * Written by Michael Vrable <mvrable@cs.ucsd.edu>
5  *
6  * TODO: Licensing
7  */
8
9 #include <stdio.h>
10 #include <stdint.h>
11 #include <glib.h>
12 #include <string.h>
13
14 #include "bluesky.h"
15
16 /* Miscellaneous useful functions that don't really fit anywhere else. */
17
18
19 /* Convert a UTF-8 string to lowercase.  This can be used to implement
20  * case-insensitive lookups and comparisons, by normalizing all values to
21  * lowercase first.  Returns a newly-allocated string as a result. */
22 gchar *bluesky_lowercase(const gchar *s)
23 {
24     /* TODO: Unicode handling; for now just do ASCII. */
25     return g_ascii_strdown(s, -1);
26 }