root/trunk/midgard/apis/python/py_midgard_dbobject.c

Revision 18883, 3.3 kB (checked in by piotras, 2 weeks ago)

Missed function implementation.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /*
2  * Copyright (C) 2007 Piotr Pokora <piotrek.pokora@gmail.com>
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published
6  * by the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifdef HAVE_CONFIG_H
20 #include "config.h"
21 #endif
22
23 #define NO_IMPORT_PYGOBJECT
24 #include "py_midgard.h"
25
26 PyTypeObject G_GNUC_INTERNAL Pymidgard_dbobject_Type = {
27     PyObject_HEAD_INIT(NULL)
28     0,                                 /* ob_size */
29     "midgard_dbobject",                   /* tp_name */
30     sizeof(PyGObject),          /* tp_basicsize */
31     0,                                 /* tp_itemsize */
32     /* methods */
33     (destructor)0,        /* tp_dealloc */
34     (printfunc)0,                      /* tp_print */
35     (getattrfunc)0,       /* tp_getattr */
36     (setattrfunc)0,       /* tp_setattr */
37     (cmpfunc)0,           /* tp_compare */
38     (reprfunc)0,             /* tp_repr */
39     (PyNumberMethods*)0,     /* tp_as_number */
40     (PySequenceMethods*)0, /* tp_as_sequence */
41     (PyMappingMethods*)0,   /* tp_as_mapping */
42     (hashfunc)0,             /* tp_hash */
43     (ternaryfunc)0,          /* tp_call */
44     (reprfunc)0,              /* tp_str */
45     (getattrofunc)0,     /* tp_getattro */
46     (setattrofunc)0,     /* tp_setattro */
47     (PyBufferProcs*)0,  /* tp_as_buffer */
48     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                      /* tp_flags */
49     NULL,                        /* Documentation string */
50     (traverseproc)0,     /* tp_traverse */
51     (inquiry)0,             /* tp_clear */
52     (richcmpfunc)0,   /* tp_richcompare */
53     offsetof(PyGObject, weakreflist),             /* tp_weaklistoffset */
54     (getiterfunc)0,          /* tp_iter */
55     (iternextfunc)0,     /* tp_iternext */
56     (struct PyMethodDef*)NULL, /* tp_methods */
57     (struct PyMemberDef*)0,              /* tp_members */
58     (struct PyGetSetDef*)0,  /* tp_getset */
59     NULL,                              /* tp_base */
60     NULL,                              /* tp_dict */
61     (descrgetfunc)0,    /* tp_descr_get */
62     (descrsetfunc)0,    /* tp_descr_set */
63     offsetof(PyGObject, inst_dict),                 /* tp_dictoffset */
64     (initproc)0,             /* tp_init */
65     (allocfunc)0,           /* tp_alloc */
66     (newfunc)0,               /* tp_new */
67     (freefunc)0,             /* tp_free */
68     (inquiry)0              /* tp_is_gc */
69 };
70
71 PyTypeObject py_midgard_dbobject_get_type_object(void)
72 {
73         return Pymidgard_dbobject_Type;
74 }
75
76 void py_midgard_dbobject_register_class(
77                 PyObject *d, gpointer pygobject_type)
78 {
79         pygobject_register_class(d,
80                         "midgard_dbobject",
81                         MIDGARD_TYPE_DBOBJECT,
82                         &Pymidgard_dbobject_Type,
83                         Py_BuildValue("(O)", pygobject_type));
84
85         pyg_set_object_has_new_constructor(MIDGARD_TYPE_DBOBJECT);
86 }
Note: See TracBrowser for help on using the browser.