summaryrefslogtreecommitdiff
path: root/giscanner/giscannermodule.c
diff options
context:
space:
mode:
authorJohan Bilien <jobi@litl.com>2008-10-11 23:19:59 +0000
committerLucas Almeida Rocha <lucasr@src.gnome.org>2008-10-11 23:19:59 +0000
commite36cf2f246a5e65c8fa9ed8b3b18d73c1b9ce470 (patch)
tree17ddfc31a142d124e853e8d398c76fba2bb90f4d /giscanner/giscannermodule.c
parent8d37e2cb7be78a40ca3649a48f405db29d2cabcc (diff)
downloadgobject-introspection-e36cf2f246a5e65c8fa9ed8b3b18d73c1b9ce470.tar.gz
ignore non-UTF-8 string constants
2008-10-11 Johan Bilien <jobi@litl.com> * giscanner/scannerparser.y: ignore non-UTF-8 string constants 2008-10-11 Johan Bilien <jobi@litl.com> Bug 552347: Parse #defines constants * girepository/gtypelib.c: update the list of value_size with recently defined type tags * giscanner/scannerparser.y: brought back parsing of #defined, as present in older version * giscanner/giscannermodule.c: bind gi_source_scanner_append_filename * giscanner/girwriter.py: write out constant tags in the gir * giscanner/sourcescanner.py: add accessor for const_string * giscanner/transformer.py, giscanner/glibtransformer.py: handle constant svn path=/trunk/; revision=673
Diffstat (limited to 'giscanner/giscannermodule.c')
-rw-r--r--giscanner/giscannermodule.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/giscanner/giscannermodule.c b/giscanner/giscannermodule.c
index 8159c599..e33b597d 100644
--- a/giscanner/giscannermodule.c
+++ b/giscanner/giscannermodule.c
@@ -392,6 +392,41 @@ pygi_source_scanner_append_filename (PyGISourceScanner *self,
}
static PyObject *
+pygi_source_scanner_parse_macros (PyGISourceScanner *self,
+ PyObject *args)
+{
+ GList *filenames;
+ int i;
+ PyObject *list;
+
+ list = PyTuple_GET_ITEM (args, 0);
+
+ if (!PyList_Check (list))
+ {
+ PyErr_SetString (PyExc_RuntimeError, "parse macro takes a list of filenames");
+ return NULL;
+ }
+
+ filenames = NULL;
+ for (i = 0; i < PyList_Size (list); ++i)
+ {
+ PyObject *obj;
+ char *filename;
+
+ obj = PyList_GetItem (list, i);
+ filename = PyString_AsString (obj);
+
+ filenames = g_list_append (filenames, filename);
+ }
+
+ gi_source_scanner_parse_macros (self->scanner, filenames);
+ g_list_free (filenames);
+
+ Py_INCREF (Py_None);
+ return Py_None;
+}
+
+static PyObject *
pygi_source_scanner_parse_file (PyGISourceScanner *self,
PyObject *args)
{
@@ -548,6 +583,7 @@ static const PyMethodDef _PyGISourceScanner_methods[] = {
{ "get_symbols", (PyCFunction) pygi_source_scanner_get_symbols, METH_NOARGS },
{ "append_filename", (PyCFunction) pygi_source_scanner_append_filename, METH_VARARGS },
{ "parse_file", (PyCFunction) pygi_source_scanner_parse_file, METH_VARARGS },
+ { "parse_macros", (PyCFunction) pygi_source_scanner_parse_macros, METH_VARARGS },
{ "lex_filename", (PyCFunction) pygi_source_scanner_lex_filename, METH_VARARGS },
{ "set_macro_scan", (PyCFunction) pygi_source_scanner_set_macro_scan, METH_VARARGS },
{ NULL, NULL, 0 }