#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "sourcescanner.h"
#include <Python.h>
+#include "sourcescanner.h"
+#include "grealpath.h"
#ifdef _WIN32
#include <fcntl.h>
return PyInt_FromLong (self->symbol->type);
}
+static PyObject *
+symbol_get_line (PyGISourceSymbol *self,
+ void *context)
+{
+ return PyInt_FromLong (self->symbol->line);
+}
+
static PyObject *
symbol_get_ident (PyGISourceSymbol *self,
void *context)
symbol_get_const_int (PyGISourceSymbol *self,
void *context)
{
+ if (!self->symbol->const_int_set)
+ {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
return PyInt_FromLong (self->symbol->const_int);
}
+static PyObject *
+symbol_get_const_double (PyGISourceSymbol *self,
+ void *context)
+{
+ if (!self->symbol->const_double_set)
+ {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ return PyFloat_FromDouble (self->symbol->const_double);
+}
+
static PyObject *
symbol_get_const_string (PyGISourceSymbol *self,
void *context)
{ "ident", (getter)symbol_get_ident, NULL, NULL},
{ "base_type", (getter)symbol_get_base_type, NULL, NULL},
/* gboolean const_int_set; */
- { "const_int", (getter)symbol_get_const_int, NULL, NULL},
+ { "const_int", (getter)symbol_get_const_int, NULL, NULL},
+ /* gboolean const_double_set; */
+ { "const_double", (getter)symbol_get_const_double, NULL, NULL},
{ "const_string", (getter)symbol_get_const_string, NULL, NULL},
{ "source_filename", (getter)symbol_get_source_filename, NULL, NULL},
+ { "line", (getter)symbol_get_line, NULL, NULL},
{ 0 }
};
return NULL;
self->scanner->filenames = g_list_append (self->scanner->filenames,
- g_strdup (filename));
+ g_realpath (filename));
Py_INCREF (Py_None);
return Py_None;