commit 40ad12db3a2506706f06e59e277495635aba5561
Author: John Stowers <john.stowers@gmail.com>
Date:   Fri Sep 24 22:49:46 2010 +1200

    Wrap g_get_system_{config,data}_dirs ()

diff --git a/glib/glibmodule.c b/glib/glibmodule.c
index d78ff82..93c86a4 100644
--- a/glib/glibmodule.c
+++ b/glib/glibmodule.c
@@ -634,6 +634,40 @@ pyglib_uri_list_extract_uris(PyObject *self, PyObject *args, PyObject *kwargs)
     return ret;
 }
 
+static PyObject *
+tuple_of_strings_from_dirs(const gchar* const *dirs)
+{
+    char **tmp;
+    int i = 0, j;
+    PyObject *ret;
+
+    if (!dirs) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+
+    tmp = (char **)dirs;
+    while (*tmp)
+        tmp++, i++;
+
+    ret = PyTuple_New(i);
+    for (j = 0; j < i; j++)
+        PyTuple_SetItem(ret, j, PYGLIB_PyUnicode_FromString(dirs[j]));
+
+    return ret;
+}
+
+static PyObject*
+pyglib_get_system_config_dirs(PyObject *self)
+{
+    return tuple_of_strings_from_dirs(g_get_system_config_dirs());
+}
+
+static PyObject*
+pyglib_get_system_data_dirs(PyObject *self)
+{
+    return tuple_of_strings_from_dirs(g_get_system_data_dirs());
+}
 
 static PyMethodDef _glib_functions[] = {
     { "threads_init",
@@ -736,6 +770,10 @@ static PyMethodDef _glib_functions[] = {
       "Splits an string containing an URI list conforming to the \n"
       "text/uri-list mime type defined in RFC 2483 into individual URIs, \n"
       "discarding any comments. The URIs are not validated." },
+    { "get_system_config_dirs",
+      (PyCFunction)pyglib_get_system_config_dirs, METH_NOARGS },
+    { "get_system_data_dirs",
+      (PyCFunction)pyglib_get_system_data_dirs, METH_NOARGS },
     { NULL, NULL, 0 }
 };
 
