summaryrefslogtreecommitdiff
path: root/navit/binding/python/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'navit/binding/python/route.c')
-rw-r--r--navit/binding/python/route.c55
1 files changed, 25 insertions, 30 deletions
diff --git a/navit/binding/python/route.c b/navit/binding/python/route.c
index dfbd08cf9..8010b416f 100644
--- a/navit/binding/python/route.c
+++ b/navit/binding/python/route.c
@@ -23,62 +23,57 @@
#include "route.h"
typedef struct {
- PyObject_HEAD
- struct route *route;
+ PyObject_HEAD
+ struct route *route;
} routeObject;
static PyObject *
-route_get_map_py(routeObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- return map_py_ref(route_get_map(self->route));
+route_get_map_py(routeObject *self, PyObject *args) {
+ if (!PyArg_ParseTuple(args, ""))
+ return NULL;
+ return map_py_ref(route_get_map(self->route));
}
static PyMethodDef route_methods[] = {
- {"get_map", (PyCFunction) route_get_map_py, METH_VARARGS },
- {NULL, NULL },
+ {"get_map", (PyCFunction) route_get_map_py, METH_VARARGS },
+ {NULL, NULL },
};
static PyObject *
-route_getattr_py(PyObject *self, char *name)
-{
- return Py_FindMethod(route_methods, self, name);
+route_getattr_py(PyObject *self, char *name) {
+ return Py_FindMethod(route_methods, self, name);
}
static void
-route_destroy_py(routeObject *self)
-{
+route_destroy_py(routeObject *self) {
}
PyTypeObject route_Type = {
- Obj_HEAD
- .tp_name="route",
- .tp_basicsize=sizeof(routeObject),
- .tp_dealloc=(destructor)route_destroy_py,
- .tp_getattr=route_getattr_py,
+ Obj_HEAD
+ .tp_name="route",
+ .tp_basicsize=sizeof(routeObject),
+ .tp_dealloc=(destructor)route_destroy_py,
+ .tp_getattr=route_getattr_py,
};
PyObject *
-route_py(PyObject *self, PyObject *args)
-{
- routeObject *ret;
+route_py(PyObject *self, PyObject *args) {
+ routeObject *ret;
- ret=PyObject_NEW(routeObject, &route_Type);
- return (PyObject *)ret;
+ ret=PyObject_NEW(routeObject, &route_Type);
+ return (PyObject *)ret;
}
PyObject *
-route_py_ref(struct route *route)
-{
- routeObject *ret;
+route_py_ref(struct route *route) {
+ routeObject *ret;
- ret=PyObject_NEW(routeObject, &route_Type);
- ret->route=route;
- return (PyObject *)ret;
+ ret=PyObject_NEW(routeObject, &route_Type);
+ ret->route=route;
+ return (PyObject *)ret;
}