Cython has moved to github.
pyrex
view Tests/Bugs/grabler/grabler1/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 | 12072e0e4fd5 |
| children | 94d46b3c5354 |
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; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
35 static PyObject *__pyx_m;
36 static PyObject *__pyx_b;
37 static int __pyx_lineno;
38 static char *__pyx_filename;
39 static char **__pyx_f;
41 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
43 static void __Pyx_AddTraceback(char *funcname); /*proto*/
45 /* Declarations from t_config */
47 struct __pyx_t_8t_config_pyalpm_list {
48 char *pkgname;
49 struct __pyx_t_8t_config_pyalpm_list *next;
50 };
53 /* Declarations from config */
55 struct __pyx_obj_6config_config {
56 PyObject_HEAD
57 struct __pyx_t_8t_config_pyalpm_list *NoUpgrade;
58 struct __pyx_t_8t_config_pyalpm_list *IgnorePkg;
59 };
62 static PyTypeObject *__pyx_ptype_6config_config = 0;
64 /* Declarations from implementation of config */
70 static __Pyx_StringTabEntry __pyx_string_tab[] = {
71 {0, 0, 0, 0}
72 };
76 /* Implementation of config */
78 static PyObject *__pyx_f_6config_6config_addIgnorePkg(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
79 static PyObject *__pyx_f_6config_6config_addIgnorePkg(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
80 char *__pyx_v_in_pkgname;
81 struct __pyx_t_8t_config_pyalpm_list *__pyx_v_ptr;
82 PyObject *__pyx_r;
83 int __pyx_1;
84 static char *__pyx_argnames[] = {"in_pkgname",0};
85 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "s", __pyx_argnames, &__pyx_v_in_pkgname)) return 0;
86 Py_INCREF(__pyx_v_self);
88 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":12 */
89 __pyx_1 = (((struct __pyx_obj_6config_config *)__pyx_v_self)->IgnorePkg != 0);
90 if (__pyx_1) {
92 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":13 */
93 __pyx_v_ptr = ((struct __pyx_obj_6config_config *)__pyx_v_self)->IgnorePkg;
95 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":14 */
96 while (1) {
97 __pyx_1 = (__pyx_v_ptr->next != 0);
98 if (!__pyx_1) break;
99 __pyx_v_ptr = __pyx_v_ptr->next;
100 }
102 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":18 */
103 __pyx_v_ptr->next = ((struct __pyx_t_8t_config_pyalpm_list *)malloc((sizeof(struct __pyx_t_8t_config_pyalpm_list))));
105 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":19 */
106 __pyx_v_ptr = __pyx_v_ptr->next;
108 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":20 */
109 __pyx_v_ptr->pkgname = __pyx_v_in_pkgname;
110 goto __pyx_L2;
111 }
112 /*else*/ {
114 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":23 */
115 ((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))));
117 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":24 */
118 ((struct __pyx_obj_6config_config *)__pyx_v_self)->IgnorePkg->pkgname = __pyx_v_in_pkgname;
119 }
120 __pyx_L2:;
122 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":26 */
123 __pyx_r = Py_None; Py_INCREF(Py_None);
124 goto __pyx_L0;
126 __pyx_r = Py_None; Py_INCREF(Py_None);
127 __pyx_L0:;
128 Py_DECREF(__pyx_v_self);
129 return __pyx_r;
130 }
132 static PyObject *__pyx_f_6config_6config_remIgnorePkg(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
133 static PyObject *__pyx_f_6config_6config_remIgnorePkg(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
134 char *__pyx_v_pkgname;
135 PyObject *__pyx_r;
136 PyObject *__pyx_1 = 0;
137 static char *__pyx_argnames[] = {"pkgname",0};
138 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "s", __pyx_argnames, &__pyx_v_pkgname)) return 0;
139 Py_INCREF(__pyx_v_self);
140 __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;}
141 __pyx_r = __pyx_1;
142 __pyx_1 = 0;
143 goto __pyx_L0;
145 __pyx_r = Py_None; Py_INCREF(Py_None);
146 goto __pyx_L0;
147 __pyx_L1:;
148 Py_XDECREF(__pyx_1);
149 __Pyx_AddTraceback("config.config.remIgnorePkg");
150 __pyx_r = 0;
151 __pyx_L0:;
152 Py_DECREF(__pyx_v_self);
153 return __pyx_r;
154 }
156 static PyObject *__pyx_tp_new_6config_config(PyTypeObject *t, PyObject *a, PyObject *k) {
157 PyObject *o = (*t->tp_alloc)(t, 0);
158 if (!o) return 0;
159 return o;
160 }
162 static void __pyx_tp_dealloc_6config_config(PyObject *o) {
163 (*o->ob_type->tp_free)(o);
164 }
166 static struct PyMethodDef __pyx_methods_6config_config[] = {
167 {"addIgnorePkg", (PyCFunction)__pyx_f_6config_6config_addIgnorePkg, METH_VARARGS|METH_KEYWORDS, 0},
168 {"remIgnorePkg", (PyCFunction)__pyx_f_6config_6config_remIgnorePkg, METH_VARARGS|METH_KEYWORDS, 0},
169 {0, 0, 0, 0}
170 };
172 static PyNumberMethods __pyx_tp_as_number_config = {
173 0, /*nb_add*/
174 0, /*nb_subtract*/
175 0, /*nb_multiply*/
176 0, /*nb_divide*/
177 0, /*nb_remainder*/
178 0, /*nb_divmod*/
179 0, /*nb_power*/
180 0, /*nb_negative*/
181 0, /*nb_positive*/
182 0, /*nb_absolute*/
183 0, /*nb_nonzero*/
184 0, /*nb_invert*/
185 0, /*nb_lshift*/
186 0, /*nb_rshift*/
187 0, /*nb_and*/
188 0, /*nb_xor*/
189 0, /*nb_or*/
190 0, /*nb_coerce*/
191 0, /*nb_int*/
192 0, /*nb_long*/
193 0, /*nb_float*/
194 0, /*nb_oct*/
195 0, /*nb_hex*/
196 0, /*nb_inplace_add*/
197 0, /*nb_inplace_subtract*/
198 0, /*nb_inplace_multiply*/
199 0, /*nb_inplace_divide*/
200 0, /*nb_inplace_remainder*/
201 0, /*nb_inplace_power*/
202 0, /*nb_inplace_lshift*/
203 0, /*nb_inplace_rshift*/
204 0, /*nb_inplace_and*/
205 0, /*nb_inplace_xor*/
206 0, /*nb_inplace_or*/
207 0, /*nb_floor_divide*/
208 0, /*nb_true_divide*/
209 0, /*nb_inplace_floor_divide*/
210 0, /*nb_inplace_true_divide*/
211 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
212 0, /*nb_index*/
213 #endif
214 };
216 static PySequenceMethods __pyx_tp_as_sequence_config = {
217 0, /*sq_length*/
218 0, /*sq_concat*/
219 0, /*sq_repeat*/
220 0, /*sq_item*/
221 0, /*sq_slice*/
222 0, /*sq_ass_item*/
223 0, /*sq_ass_slice*/
224 0, /*sq_contains*/
225 0, /*sq_inplace_concat*/
226 0, /*sq_inplace_repeat*/
227 };
229 static PyMappingMethods __pyx_tp_as_mapping_config = {
230 0, /*mp_length*/
231 0, /*mp_subscript*/
232 0, /*mp_ass_subscript*/
233 };
235 static PyBufferProcs __pyx_tp_as_buffer_config = {
236 0, /*bf_getreadbuffer*/
237 0, /*bf_getwritebuffer*/
238 0, /*bf_getsegcount*/
239 0, /*bf_getcharbuffer*/
240 };
242 PyTypeObject __pyx_type_6config_config = {
243 PyObject_HEAD_INIT(0)
244 0, /*ob_size*/
245 "config.config", /*tp_name*/
246 sizeof(struct __pyx_obj_6config_config), /*tp_basicsize*/
247 0, /*tp_itemsize*/
248 __pyx_tp_dealloc_6config_config, /*tp_dealloc*/
249 0, /*tp_print*/
250 0, /*tp_getattr*/
251 0, /*tp_setattr*/
252 0, /*tp_compare*/
253 0, /*tp_repr*/
254 &__pyx_tp_as_number_config, /*tp_as_number*/
255 &__pyx_tp_as_sequence_config, /*tp_as_sequence*/
256 &__pyx_tp_as_mapping_config, /*tp_as_mapping*/
257 0, /*tp_hash*/
258 0, /*tp_call*/
259 0, /*tp_str*/
260 0, /*tp_getattro*/
261 0, /*tp_setattro*/
262 &__pyx_tp_as_buffer_config, /*tp_as_buffer*/
263 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
264 0, /*tp_doc*/
265 0, /*tp_traverse*/
266 0, /*tp_clear*/
267 0, /*tp_richcompare*/
268 0, /*tp_weaklistoffset*/
269 0, /*tp_iter*/
270 0, /*tp_iternext*/
271 __pyx_methods_6config_config, /*tp_methods*/
272 0, /*tp_members*/
273 0, /*tp_getset*/
274 0, /*tp_base*/
275 0, /*tp_dict*/
276 0, /*tp_descr_get*/
277 0, /*tp_descr_set*/
278 0, /*tp_dictoffset*/
279 0, /*tp_init*/
280 0, /*tp_alloc*/
281 __pyx_tp_new_6config_config, /*tp_new*/
282 0, /*tp_free*/
283 0, /*tp_is_gc*/
284 0, /*tp_bases*/
285 0, /*tp_mro*/
286 0, /*tp_cache*/
287 0, /*tp_subclasses*/
288 0, /*tp_weaklist*/
289 };
291 static struct PyMethodDef __pyx_methods[] = {
292 {0, 0, 0, 0}
293 };
295 static void __pyx_init_filenames(void); /*proto*/
297 PyMODINIT_FUNC initconfig(void); /*proto*/
298 PyMODINIT_FUNC initconfig(void) {
299 __pyx_init_filenames();
300 __pyx_m = Py_InitModule4("config", __pyx_methods, 0, 0, PYTHON_API_VERSION);
301 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
302 Py_INCREF(__pyx_m);
303 __pyx_b = PyImport_AddModule("__builtin__");
304 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
305 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
306 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
307 if (PyType_Ready(&__pyx_type_6config_config) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
308 if (PyObject_SetAttrString(__pyx_m, "config", (PyObject *)&__pyx_type_6config_config) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
309 __pyx_ptype_6config_config = &__pyx_type_6config_config;
311 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/grabler/grabler1/config.pyx":28 */
312 return;
313 __pyx_L1:;
314 __Pyx_AddTraceback("config");
315 }
317 static char *__pyx_filenames[] = {
318 "config.pyx",
319 };
321 /* Runtime support code */
323 static void __pyx_init_filenames(void) {
324 __pyx_f = __pyx_filenames;
325 }
327 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
328 while (t->p) {
329 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
330 if (!*t->p)
331 return -1;
332 if (t->i)
333 PyString_InternInPlace(t->p);
334 ++t;
335 }
336 return 0;
337 }
339 #include "compile.h"
340 #include "frameobject.h"
341 #include "traceback.h"
343 static void __Pyx_AddTraceback(char *funcname) {
344 PyObject *py_srcfile = 0;
345 PyObject *py_funcname = 0;
346 PyObject *py_globals = 0;
347 PyObject *empty_tuple = 0;
348 PyObject *empty_string = 0;
349 PyCodeObject *py_code = 0;
350 PyFrameObject *py_frame = 0;
352 py_srcfile = PyString_FromString(__pyx_filename);
353 if (!py_srcfile) goto bad;
354 py_funcname = PyString_FromString(funcname);
355 if (!py_funcname) goto bad;
356 py_globals = PyModule_GetDict(__pyx_m);
357 if (!py_globals) goto bad;
358 empty_tuple = PyTuple_New(0);
359 if (!empty_tuple) goto bad;
360 empty_string = PyString_FromString("");
361 if (!empty_string) goto bad;
362 py_code = PyCode_New(
363 0, /*int argcount,*/
364 0, /*int nlocals,*/
365 0, /*int stacksize,*/
366 0, /*int flags,*/
367 empty_string, /*PyObject *code,*/
368 empty_tuple, /*PyObject *consts,*/
369 empty_tuple, /*PyObject *names,*/
370 empty_tuple, /*PyObject *varnames,*/
371 empty_tuple, /*PyObject *freevars,*/
372 empty_tuple, /*PyObject *cellvars,*/
373 py_srcfile, /*PyObject *filename,*/
374 py_funcname, /*PyObject *name,*/
375 __pyx_lineno, /*int firstlineno,*/
376 empty_string /*PyObject *lnotab*/
377 );
378 if (!py_code) goto bad;
379 py_frame = PyFrame_New(
380 PyThreadState_Get(), /*PyThreadState *tstate,*/
381 py_code, /*PyCodeObject *code,*/
382 py_globals, /*PyObject *globals,*/
383 0 /*PyObject *locals*/
384 );
385 if (!py_frame) goto bad;
386 py_frame->f_lineno = __pyx_lineno;
387 PyTraceBack_Here(py_frame);
388 bad:
389 Py_XDECREF(py_srcfile);
390 Py_XDECREF(py_funcname);
391 Py_XDECREF(empty_tuple);
392 Py_XDECREF(empty_string);
393 Py_XDECREF(py_code);
394 Py_XDECREF(py_frame);
395 }
