summaryrefslogtreecommitdiff
path: root/giscanner/giscannermodule.c
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2013-11-29 01:12:40 +0100
committerFlorian Müllner <fmuellner@gnome.org>2013-11-29 18:45:31 +0000
commite4efb97c8a20f5dcbf6cd2736bd5bcd92e1d814d (patch)
treebaa632338c6712a1582fe0711d4c46e4f2a13637 /giscanner/giscannermodule.c
parent9112ec1e845015a17bba49fb1dd385a2c6e9efd7 (diff)
downloadgobject-introspection-e4efb97c8a20f5dcbf6cd2736bd5bcd92e1d814d.tar.gz
scanner: Support boolean constants
Aliasing TRUE or FALSE is not very common, but done occasionally for extra clarity. Namely G_SOURCE_REMOVE / G_SOURCE_CONTINUE are self-explanatory, unlike the "raw" booleans. https://bugzilla.gnome.org/show_bug.cgi?id=719566
Diffstat (limited to 'giscanner/giscannermodule.c')
-rw-r--r--giscanner/giscannermodule.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/giscanner/giscannermodule.c b/giscanner/giscannermodule.c
index 2f413a02..925b3e0a 100644
--- a/giscanner/giscannermodule.c
+++ b/giscanner/giscannermodule.c
@@ -193,6 +193,19 @@ symbol_get_const_string (PyGISourceSymbol *self,
}
static PyObject *
+symbol_get_const_boolean (PyGISourceSymbol *self,
+ void *context)
+{
+ if (!self->symbol->const_boolean_set)
+ {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
+ return PyBool_FromLong (self->symbol->const_boolean);
+}
+
+static PyObject *
symbol_get_source_filename (PyGISourceSymbol *self,
void *context)
{
@@ -216,6 +229,8 @@ static const PyGetSetDef _PyGISourceSymbol_getsets[] = {
/* gboolean const_double_set; */
{ "const_double", (getter)symbol_get_const_double, NULL, NULL},
{ "const_string", (getter)symbol_get_const_string, NULL, NULL},
+ /* gboolean const_boolean_set; */
+ { "const_boolean", (getter)symbol_get_const_boolean, NULL, NULL},
{ "source_filename", (getter)symbol_get_source_filename, NULL, NULL},
{ "line", (getter)symbol_get_line, NULL, NULL},
{ "private", (getter)symbol_get_private, NULL, NULL},