]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/python/as.c
python: Access ASes from database
[people/ms/libloc.git] / src / python / as.c
index 4aad074fc653add9c7aab9d06ec2d74475f9ff76..a28727d6f36d1de1aed3f8249e28a0b5b845a33a 100644 (file)
 #include "locationmodule.h"
 #include "as.h"
 
+PyObject* new_as(PyTypeObject* type, struct loc_as* as) {
+       ASObject* self = (ASObject*)type->tp_alloc(type, 0);
+       if (self) {
+               self->as = loc_as_ref(as);
+       }
+
+       return (PyObject*)self;
+}
+
 static PyObject* AS_new(PyTypeObject* type, PyObject* args, PyObject* kwds) {
        // Create stringpool
        struct loc_stringpool* pool;