summaryrefslogtreecommitdiff
path: root/giscanner/giscannermodule.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-02-23 23:04:35 -0500
committerColin Walters <walters@verbum.org>2009-02-24 14:23:37 -0500
commitf3f8de20114405bae29a354d67c38a7bf0b096a2 (patch)
treeae6a6917db11c909f84771da264f7f5930154d09 /giscanner/giscannermodule.c
parent7bd4bc6807dc829f6e8ea4db1b58a85e365b8b97 (diff)
downloadgobject-introspection-f3f8de20114405bae29a354d67c38a7bf0b096a2.tar.gz
Bug 572790 - Don't register #defines from .c files as constants
We keep track of the source filename for every symbol. This enables us to later filter symbols based on that name.
Diffstat (limited to 'giscanner/giscannermodule.c')
-rw-r--r--giscanner/giscannermodule.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/giscanner/giscannermodule.c b/giscanner/giscannermodule.c
index b7ac3167..7d637845 100644
--- a/giscanner/giscannermodule.c
+++ b/giscanner/giscannermodule.c
@@ -151,6 +151,19 @@ symbol_get_const_string (PyGISourceSymbol *self,
return PyString_FromString (self->symbol->const_string);
}
+static PyObject *
+symbol_get_source_filename (PyGISourceSymbol *self,
+ void *context)
+{
+ if (!self->symbol->source_filename)
+ {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
+ return PyString_FromString (self->symbol->source_filename);
+}
+
static const PyGetSetDef _PyGISourceSymbol_getsets[] = {
/* int ref_count; */
{ "type", (getter)symbol_get_type, NULL, NULL},
@@ -159,7 +172,8 @@ static const PyGetSetDef _PyGISourceSymbol_getsets[] = {
{ "base_type", (getter)symbol_get_base_type, NULL, NULL},
/* gboolean const_int_set; */
{ "const_int", (getter)symbol_get_const_int, NULL, NULL},
- { "const_string", (getter)symbol_get_const_string, NULL, NULL},
+ { "const_string", (getter)symbol_get_const_string, NULL, NULL},
+ { "source_filename", (getter)symbol_get_source_filename, NULL, NULL},
{ 0 }
};