Free Electron
internal.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __pyfe_internal_h__
8 #define __pyfe_internal_h__
9 
10 namespace pyfe
11 {
12 
13 PyObject *createMaster(void);
14 static void Master_dealloc(PyObject* self);
15 
16 static PyTypeObject Master_T =
17 {
18  PyObject_HEAD_INIT(NULL)
19  0,
20  "pyfeMaster",
21  sizeof(Master),
22  0,
23  pyfe::Master_dealloc, /*tp_dealloc*/
24  0,/*tp_print*/
25  0,/*tp_getattr*/
26  0,/*tp_setattr*/
27  0,/*tp_compare*/
28  0,/*tp_repr*/
29  0,/*tp_as_number*/
30  0,/*tp_as_sequence*/
31  0,/*tp_as_mapping*/
32  0,/*tp_hash */
33 };
34 
35 static void Record_dealloc(PyObject* self);
36 static PyObject *Record_getattr(PyObject *self, char *name);
37 static int Record_setattr(PyObject *self, char *name, PyObject *value);
38 
39 static PyTypeObject Record_T =
40 {
41  PyObject_HEAD_INIT(NULL)
42  0,
43  "pyfeRecord",
44  sizeof(Record),
45  0,
46  Record_dealloc, /*tp_dealloc*/
47  0,/*tp_print*/
48  Record_getattr,/*tp_getattr*/
49  Record_setattr,/*tp_setattr*/
50  0,/*tp_compare*/
51  0,/*tp_repr*/
52  0,/*tp_as_number*/
53  0,/*tp_as_sequence*/
54  0,/*tp_as_mapping*/
55  0,/*tp_hash */
56 };
57 
58 static void RecordArray_dealloc(PyObject* self);
59 static int RecordArray_len(PyObject* self);
60 static PyObject *RecordArray_getitem(PyObject* self, int index);
61 static PyObject *RecordArray_getslice(PyObject* self, int start, int end);
62 static int RecordArray_setitem(PyObject* self, int index, PyObject* obj);
63 static PyObject *RecordArray_getattr(PyObject *self, char *name);
64 
65 static PySequenceMethods RecordArray_as_sequence =
66 {
67  RecordArray_len,/* __len__ */
68  0,/* __add__ */
69  0,/* __mul__ */
70  RecordArray_getitem,/* __getitem__ */
71  RecordArray_getslice,/* __getslice__ */
72  RecordArray_setitem,/* __setitem__ */
73  0,/* __setslice__ */
74 };
75 
76 static PyTypeObject RecordArray_T =
77 {
78  PyObject_HEAD_INIT(NULL)
79  0,
80  "pyfeRecordArray",
81  sizeof(RecordArray),
82  0,
83  RecordArray_dealloc, /*tp_dealloc*/
84  0,/*tp_print*/
85  RecordArray_getattr,/*tp_getattr*/
86  0,/*tp_setattr*/
87  0,/*tp_compare*/
88  0,/*tp_repr*/
89  0,/*tp_as_number*/
90  &RecordArray_as_sequence,/*tp_as_sequence*/
91  0,/*tp_as_mapping*/
92  0,/*tp_hash */
93 };
94 
95 static void Instance_dealloc(PyObject* self);
96 static PyTypeObject Instance_T =
97 {
98  PyObject_HEAD_INIT(NULL)
99  0,
100  "pyfeInstance",
101  sizeof(Instance),
102  0,
103  Instance_dealloc, /*tp_dealloc*/
104  0,/*tp_print*/
105  0,/*tp_getattr*/
106  0,/*tp_setattr*/
107  0,/*tp_compare*/
108  0,/*tp_repr*/
109  0,/*tp_as_number*/
110  0,/*tp_as_sequence*/
111  0,/*tp_as_mapping*/
112  0,/*tp_hash */
113 };
114 
115 
116 static void Component_dealloc(PyObject* self);
117 static PyTypeObject Component_T =
118 {
119  PyObject_HEAD_INIT(NULL)
120  0,
121  "pyfeComponent",
122  sizeof(Component),
123  0,
124  Component_dealloc, /*tp_dealloc*/
125  0,/*tp_print*/
126  0,/*tp_getattr*/
127  0,/*tp_setattr*/
128  0,/*tp_compare*/
129  0,/*tp_repr*/
130  0,/*tp_as_number*/
131  0,/*tp_as_sequence*/
132  0,/*tp_as_mapping*/
133  0,/*tp_hash */
134 };
135 
136 
137 static PyObject *registry_manage(PyObject* self, PyObject* args);
138 static PyObject *registry_create(PyObject* self, PyObject* args);
139 static PyObject *registry_prune(PyObject* self, PyObject* args);
140 static PyMethodDef PyFeMethods[] =
141 {
142  { "create", registry_create, 1 },
143  { "manage", registry_manage, 1 },
144  { "prune", registry_prune, 1 },
145  { NULL, NULL}
146 };
147 
148 static PyObject *Record_check(PyObject* self, PyObject* args);
149 static PyObject *Record_isValid(PyObject* self, PyObject* args);
150 static PyMethodDef Record_Methods[] =
151 {
152  { "check", Record_check, 1 },
153  { "isValid", Record_isValid, 1 },
154  { NULL, NULL}
155 };
156 
157 static PyObject *RecordArray_check(PyObject* self, PyObject* args);
158 static PyObject *RecordArray_add(PyObject* self, PyObject* args);
159 static PyMethodDef RecordArray_Methods[] =
160 {
161  { "check", RecordArray_check, 1 },
162  { "add", RecordArray_add, 1 },
163  { NULL, NULL}
164 };
165 
166 } /* namespace */
167 
168 #endif /* __pyfe_internal_h__ */
python binding
Definition: namespace.dox:7