Cython has moved to github.
pyrex
view Tests/Bugs/grabler/grabler1/Reference/config.c @ 86:da6e97bb7e6d
Multiple compilation fixed
| author | Gregory Ewing <greg.ewing@canterbury.ac.nz> |
|---|---|
| date | Sat May 24 15:50:12 2008 +1200 (4 years ago) |
| parents | 6c5f5271ebab |
| children | 3b20cb4923eb |
line source
1 /* Generated by Pyrex */
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #include "structmember.h"
6 #ifndef PY_LONG_LONG
7 #define PY_LONG_LONG LONG_LONG
8 #endif
9 #if PY_VERSION_HEX < 0x02050000
10 typedef int Py_ssize_t;
11 #define PY_SSIZE_T_MAX INT_MAX
12 #define PY_SSIZE_T_MIN INT_MIN
13 #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
14 #define PyInt_AsSsize_t(o) PyInt_AsLong(o)
15 #endif
16 #ifndef WIN32
17 #ifndef __stdcall
18 #define __stdcall
19 #endif
20 #ifndef __cdecl
21 #define __cdecl
22 #endif
23 #endif
24 #ifdef __cplusplus
25 #define __PYX_EXTERN_C extern "C"
26 #else
27 #define __PYX_EXTERN_C extern
28 #endif
29 #include <math.h>
30 #include "stdlib.h"
33 typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
34 typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
36 static PyObject *__pyx_m;
37 static PyObject *__pyx_b;
38 static int __pyx_lineno;
39 static char *__pyx_filename;
40 static char **__pyx_f;
42 static void __Pyx_AddTraceback(char *funcname); /*proto*/
44 /* Declarations from t_config */
46 struct __pyx_t_8t_config_pyalpm_list {
47 char *pkgname;
48 struct __pyx_t_8t_config_pyalpm_list *next;
49 };
52 /* Declarations from config */
54 struct __pyx_obj_6config_config {
55 PyObject_HEAD
56 struct __pyx_t_8t_config_pyalpm_list *NoUpgrade;
57 struct __pyx_t_8t_config_pyalpm_list *IgnorePkg;
58 };
61 static PyTypeObject *__pyx_ptype_6config_config = 0;
64 static __Pyx_StringTabEntry __pyx_string_tab[] = {
65 {0, 0, 0, 0}
66 };
68 /* Implementation of config */
70 static PyObject *__pyx_f_6config_6config_addIgnorePkg(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
71 static PyObject *__pyx_f_6config_6config_addIgnorePkg(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
72 char *__pyx_v_in_pkgname;
73 struct __pyx_t_8t_config_pyalpm_list *__pyx_v_ptr;
74 PyObject *__pyx_r;
75 int __pyx_1;
76 static char *__pyx_argnames[] = {"in_pkgname",0};
77 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "s", __pyx_argnames, &__pyx_v_in_pkgname)) return 0;
78 Py_INCREF(__pyx_v_self);
80 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":12 */
81 __pyx_1 = (((struct __pyx_obj_6config_config *)__pyx_v_self)->IgnorePkg != 0);
82 if (__pyx_1) {
84 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":13 */
85 __pyx_v_ptr = ((struct __pyx_obj_6config_config *)__pyx_v_self)->IgnorePkg;
87 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":14 */
88 while (1) {
89 __pyx_1 = (__pyx_v_ptr->next != 0);
90 if (!__pyx_1) break;
91 __pyx_v_ptr = __pyx_v_ptr->next;
92 }
94 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":18 */
95 __pyx_v_ptr->next = ((struct __pyx_t_8t_config_pyalpm_list *)malloc((sizeof(struct __pyx_t_8t_config_pyalpm_list))));
97 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":19 */
98 __pyx_v_ptr = __pyx_v_ptr->next;
100 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":20 */
101 __pyx_v_ptr->pkgname = __pyx_v_in_pkgname;
102 goto __pyx_L2;
103 }
104 /*else*/ {
106 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":23 */
107 ((struct __pyx_obj_6config_config *)__pyx_v_self)->IgnorePkg = ((struct __pyx_t_8t_config_pyalpm_list *)malloc((sizeof(struct __pyx_t_8t_config_pyalpm_list))));
109 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":24 */
110 ((struct __pyx_obj_6config_config *)__pyx_v_self)->IgnorePkg->pkgname = __pyx_v_in_pkgname;
111 }
112 __pyx_L2:;
114 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":26 */
115 __pyx_r = Py_None; Py_INCREF(Py_None);
116 goto __pyx_L0;
118 __pyx_r = Py_None; Py_INCREF(Py_None);
119 __pyx_L0:;
120 Py_DECREF(__pyx_v_self);
121 return __pyx_r;
122 }
124 static PyObject *__pyx_f_6config_6config_remIgnorePkg(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
125 static PyObject *__pyx_f_6config_6config_remIgnorePkg(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
126 char *__pyx_v_pkgname;
127 PyObject *__pyx_r;
128 PyObject *__pyx_1 = 0;
129 static char *__pyx_argnames[] = {"pkgname",0};
130 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "s", __pyx_argnames, &__pyx_v_pkgname)) return 0;
131 Py_INCREF(__pyx_v_self);
132 __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;}
133 __pyx_r = __pyx_1;
134 __pyx_1 = 0;
135 goto __pyx_L0;
137 __pyx_r = Py_None; Py_INCREF(Py_None);
138 goto __pyx_L0;
139 __pyx_L1:;
140 Py_XDECREF(__pyx_1);
141 __Pyx_AddTraceback("config.config.remIgnorePkg");
142 __pyx_r = 0;
143 __pyx_L0:;
144 Py_DECREF(__pyx_v_self);
145 return __pyx_r;
146 }
148 static PyObject *__pyx_tp_new_6config_config(PyTypeObject *t, PyObject *a, PyObject *k) {
149 PyObject *o = (*t->tp_alloc)(t, 0);
150 if (!o) return 0;
151 return o;
152 }
154 static void __pyx_tp_dealloc_6config_config(PyObject *o) {
155 (*o->ob_type->tp_free)(o);
156 }
158 static struct PyMethodDef __pyx_methods_6config_config[] = {
159 {"addIgnorePkg", (PyCFunction)__pyx_f_6config_6config_addIgnorePkg, METH_VARARGS|METH_KEYWORDS, 0},
160 {"remIgnorePkg", (PyCFunction)__pyx_f_6config_6config_remIgnorePkg, METH_VARARGS|METH_KEYWORDS, 0},
161 {0, 0, 0, 0}
162 };
164 static PyNumberMethods __pyx_tp_as_number_config = {
165 0, /*nb_add*/
166 0, /*nb_subtract*/
167 0, /*nb_multiply*/
168 0, /*nb_divide*/
169 0, /*nb_remainder*/
170 0, /*nb_divmod*/
171 0, /*nb_power*/
172 0, /*nb_negative*/
173 0, /*nb_positive*/
174 0, /*nb_absolute*/
175 0, /*nb_nonzero*/
176 0, /*nb_invert*/
177 0, /*nb_lshift*/
178 0, /*nb_rshift*/
179 0, /*nb_and*/
180 0, /*nb_xor*/
181 0, /*nb_or*/
182 0, /*nb_coerce*/
183 0, /*nb_int*/
184 0, /*nb_long*/
185 0, /*nb_float*/
186 0, /*nb_oct*/
187 0, /*nb_hex*/
188 0, /*nb_inplace_add*/
189 0, /*nb_inplace_subtract*/
190 0, /*nb_inplace_multiply*/
191 0, /*nb_inplace_divide*/
192 0, /*nb_inplace_remainder*/
193 0, /*nb_inplace_power*/
194 0, /*nb_inplace_lshift*/
195 0, /*nb_inplace_rshift*/
196 0, /*nb_inplace_and*/
197 0, /*nb_inplace_xor*/
198 0, /*nb_inplace_or*/
199 0, /*nb_floor_divide*/
200 0, /*nb_true_divide*/
201 0, /*nb_inplace_floor_divide*/
202 0, /*nb_inplace_true_divide*/
203 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
204 0, /*nb_index*/
205 #endif
206 };
208 static PySequenceMethods __pyx_tp_as_sequence_config = {
209 0, /*sq_length*/
210 0, /*sq_concat*/
211 0, /*sq_repeat*/
212 0, /*sq_item*/
213 0, /*sq_slice*/
214 0, /*sq_ass_item*/
215 0, /*sq_ass_slice*/
216 0, /*sq_contains*/
217 0, /*sq_inplace_concat*/
218 0, /*sq_inplace_repeat*/
219 };
221 static PyMappingMethods __pyx_tp_as_mapping_config = {
222 0, /*mp_length*/
223 0, /*mp_subscript*/
224 0, /*mp_ass_subscript*/
225 };
227 static PyBufferProcs __pyx_tp_as_buffer_config = {
228 0, /*bf_getreadbuffer*/
229 0, /*bf_getwritebuffer*/
230 0, /*bf_getsegcount*/
231 0, /*bf_getcharbuffer*/
232 };
234 PyTypeObject __pyx_type_6config_config = {
235 PyObject_HEAD_INIT(0)
236 0, /*ob_size*/
237 "config.config", /*tp_name*/
238 sizeof(struct __pyx_obj_6config_config), /*tp_basicsize*/
239 0, /*tp_itemsize*/
240 __pyx_tp_dealloc_6config_config, /*tp_dealloc*/
241 0, /*tp_print*/
242 0, /*tp_getattr*/
243 0, /*tp_setattr*/
244 0, /*tp_compare*/
245 0, /*tp_repr*/
246 &__pyx_tp_as_number_config, /*tp_as_number*/
247 &__pyx_tp_as_sequence_config, /*tp_as_sequence*/
248 &__pyx_tp_as_mapping_config, /*tp_as_mapping*/
249 0, /*tp_hash*/
250 0, /*tp_call*/
251 0, /*tp_str*/
252 0, /*tp_getattro*/
253 0, /*tp_setattro*/
254 &__pyx_tp_as_buffer_config, /*tp_as_buffer*/
255 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
256 0, /*tp_doc*/
257 0, /*tp_traverse*/
258 0, /*tp_clear*/
259 0, /*tp_richcompare*/
260 0, /*tp_weaklistoffset*/
261 0, /*tp_iter*/
262 0, /*tp_iternext*/
263 __pyx_methods_6config_config, /*tp_methods*/
264 0, /*tp_members*/
265 0, /*tp_getset*/
266 0, /*tp_base*/
267 0, /*tp_dict*/
268 0, /*tp_descr_get*/
269 0, /*tp_descr_set*/
270 0, /*tp_dictoffset*/
271 0, /*tp_init*/
272 0, /*tp_alloc*/
273 __pyx_tp_new_6config_config, /*tp_new*/
274 0, /*tp_free*/
275 0, /*tp_is_gc*/
276 0, /*tp_bases*/
277 0, /*tp_mro*/
278 0, /*tp_cache*/
279 0, /*tp_subclasses*/
280 0, /*tp_weaklist*/
281 };
283 static struct PyMethodDef __pyx_methods[] = {
284 {0, 0, 0, 0}
285 };
287 static void __pyx_init_filenames(void); /*proto*/
289 PyMODINIT_FUNC initconfig(void); /*proto*/
290 PyMODINIT_FUNC initconfig(void) {
291 __pyx_init_filenames();
292 __pyx_m = Py_InitModule4("config", __pyx_methods, 0, 0, PYTHON_API_VERSION);
293 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
294 Py_INCREF(__pyx_m);
295 __pyx_b = PyImport_AddModule("__builtin__");
296 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
297 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
298 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
299 if (PyType_Ready(&__pyx_type_6config_config) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
300 if (PyObject_SetAttrString(__pyx_m, "config", (PyObject *)&__pyx_type_6config_config) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
301 __pyx_ptype_6config_config = &__pyx_type_6config_config;
303 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":28 */
304 return;
305 __pyx_L1:;
306 __Pyx_AddTraceback("config");
307 }
309 static char *__pyx_filenames[] = {
310 "config.pyx",
311 };
313 /* Runtime support code */
315 static void __pyx_init_filenames(void) {
316 __pyx_f = __pyx_filenames;
317 }
319 #include "compile.h"
320 #include "frameobject.h"
321 #include "traceback.h"
323 static void __Pyx_AddTraceback(char *funcname) {
324 PyObject *py_srcfile = 0;
325 PyObject *py_funcname = 0;
326 PyObject *py_globals = 0;
327 PyObject *empty_tuple = 0;
328 PyObject *empty_string = 0;
329 PyCodeObject *py_code = 0;
330 PyFrameObject *py_frame = 0;
332 py_srcfile = PyString_FromString(__pyx_filename);
333 if (!py_srcfile) goto bad;
334 py_funcname = PyString_FromString(funcname);
335 if (!py_funcname) goto bad;
336 py_globals = PyModule_GetDict(__pyx_m);
337 if (!py_globals) goto bad;
338 empty_tuple = PyTuple_New(0);
339 if (!empty_tuple) goto bad;
340 empty_string = PyString_FromString("");
341 if (!empty_string) goto bad;
342 py_code = PyCode_New(
343 0, /*int argcount,*/
344 0, /*int nlocals,*/
345 0, /*int stacksize,*/
346 0, /*int flags,*/
347 empty_string, /*PyObject *code,*/
348 empty_tuple, /*PyObject *consts,*/
349 empty_tuple, /*PyObject *names,*/
350 empty_tuple, /*PyObject *varnames,*/
351 empty_tuple, /*PyObject *freevars,*/
352 empty_tuple, /*PyObject *cellvars,*/
353 py_srcfile, /*PyObject *filename,*/
354 py_funcname, /*PyObject *name,*/
355 __pyx_lineno, /*int firstlineno,*/
356 empty_string /*PyObject *lnotab*/
357 );
358 if (!py_code) goto bad;
359 py_frame = PyFrame_New(
360 PyThreadState_Get(), /*PyThreadState *tstate,*/
361 py_code, /*PyCodeObject *code,*/
362 py_globals, /*PyObject *globals,*/
363 0 /*PyObject *locals*/
364 );
365 if (!py_frame) goto bad;
366 py_frame->f_lineno = __pyx_lineno;
367 PyTraceBack_Here(py_frame);
368 bad:
369 Py_XDECREF(py_srcfile);
370 Py_XDECREF(py_funcname);
371 Py_XDECREF(empty_tuple);
372 Py_XDECREF(empty_string);
373 Py_XDECREF(py_code);
374 Py_XDECREF(py_frame);
375 }
