summaryrefslogtreecommitdiff
path: root/src/struct.c
blob: e09bbac7e699a5063045d7343733685acaabd89e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "module.h"
#include "except.h"
#include "struct.h"

/*
 * Helpers
 */


/*
 * Infrastructure
 */


/*
 * Members
 */


/*
 * Definition
 */

PyTypeObject xpybStruct_type = {
    PyObject_HEAD_INIT(NULL)
    .tp_name = "xcb.Struct",
    .tp_basicsize = sizeof(xpybStruct),
    .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    .tp_doc = "XCB generic struct object",
    .tp_base = &xpybProtobj_type,
};


/*
 * Module init
 */
int xpybStruct_modinit(PyObject *m)
{
    if (PyType_Ready(&xpybStruct_type) < 0)
        return -1;
    Py_INCREF(&xpybStruct_type);
    if (PyModule_AddObject(m, "Struct", (PyObject *)&xpybStruct_type) < 0)
	return -1;

    return 0;
}