Cython has moved to github.

pyrex

view Tests/Bugs/baas/Reference/baas6.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>
32 typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
33 typedef struct {PyObject **p; 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 void __Pyx_AddTraceback(char *funcname); /*proto*/
43 /* Declarations from baas6 */
45 struct __pyx_obj_5baas6_DoIHaveEmptyDel {
46 PyObject_HEAD
47 };
49 struct __pyx_obj_5baas6_DoIHaveGCDel {
50 PyObject_HEAD
51 PyObject *foo;
52 };
56 static PyTypeObject *__pyx_ptype_5baas6_DoIHaveEmptyDel = 0;
57 static PyTypeObject *__pyx_ptype_5baas6_DoIHaveGCDel = 0;
60 static __Pyx_StringTabEntry __pyx_string_tab[] = {
61 {0, 0, 0, 0}
62 };
64 /* Implementation of baas6 */
66 static PyObject *__pyx_tp_new_5baas6_DoIHaveEmptyDel(PyTypeObject *t, PyObject *a, PyObject *k) {
67 PyObject *o = (*t->tp_alloc)(t, 0);
68 if (!o) return 0;
69 return o;
70 }
72 static void __pyx_tp_dealloc_5baas6_DoIHaveEmptyDel(PyObject *o) {
73 (*o->ob_type->tp_free)(o);
74 }
76 static struct PyMethodDef __pyx_methods_5baas6_DoIHaveEmptyDel[] = {
77 {0, 0, 0, 0}
78 };
80 static PyNumberMethods __pyx_tp_as_number_DoIHaveEmptyDel = {
81 0, /*nb_add*/
82 0, /*nb_subtract*/
83 0, /*nb_multiply*/
84 0, /*nb_divide*/
85 0, /*nb_remainder*/
86 0, /*nb_divmod*/
87 0, /*nb_power*/
88 0, /*nb_negative*/
89 0, /*nb_positive*/
90 0, /*nb_absolute*/
91 0, /*nb_nonzero*/
92 0, /*nb_invert*/
93 0, /*nb_lshift*/
94 0, /*nb_rshift*/
95 0, /*nb_and*/
96 0, /*nb_xor*/
97 0, /*nb_or*/
98 0, /*nb_coerce*/
99 0, /*nb_int*/
100 0, /*nb_long*/
101 0, /*nb_float*/
102 0, /*nb_oct*/
103 0, /*nb_hex*/
104 0, /*nb_inplace_add*/
105 0, /*nb_inplace_subtract*/
106 0, /*nb_inplace_multiply*/
107 0, /*nb_inplace_divide*/
108 0, /*nb_inplace_remainder*/
109 0, /*nb_inplace_power*/
110 0, /*nb_inplace_lshift*/
111 0, /*nb_inplace_rshift*/
112 0, /*nb_inplace_and*/
113 0, /*nb_inplace_xor*/
114 0, /*nb_inplace_or*/
115 0, /*nb_floor_divide*/
116 0, /*nb_true_divide*/
117 0, /*nb_inplace_floor_divide*/
118 0, /*nb_inplace_true_divide*/
119 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
120 0, /*nb_index*/
121 #endif
122 };
124 static PySequenceMethods __pyx_tp_as_sequence_DoIHaveEmptyDel = {
125 0, /*sq_length*/
126 0, /*sq_concat*/
127 0, /*sq_repeat*/
128 0, /*sq_item*/
129 0, /*sq_slice*/
130 0, /*sq_ass_item*/
131 0, /*sq_ass_slice*/
132 0, /*sq_contains*/
133 0, /*sq_inplace_concat*/
134 0, /*sq_inplace_repeat*/
135 };
137 static PyMappingMethods __pyx_tp_as_mapping_DoIHaveEmptyDel = {
138 0, /*mp_length*/
139 0, /*mp_subscript*/
140 0, /*mp_ass_subscript*/
141 };
143 static PyBufferProcs __pyx_tp_as_buffer_DoIHaveEmptyDel = {
144 0, /*bf_getreadbuffer*/
145 0, /*bf_getwritebuffer*/
146 0, /*bf_getsegcount*/
147 0, /*bf_getcharbuffer*/
148 };
150 PyTypeObject __pyx_type_5baas6_DoIHaveEmptyDel = {
151 PyObject_HEAD_INIT(0)
152 0, /*ob_size*/
153 "baas6.DoIHaveEmptyDel", /*tp_name*/
154 sizeof(struct __pyx_obj_5baas6_DoIHaveEmptyDel), /*tp_basicsize*/
155 0, /*tp_itemsize*/
156 __pyx_tp_dealloc_5baas6_DoIHaveEmptyDel, /*tp_dealloc*/
157 0, /*tp_print*/
158 0, /*tp_getattr*/
159 0, /*tp_setattr*/
160 0, /*tp_compare*/
161 0, /*tp_repr*/
162 &__pyx_tp_as_number_DoIHaveEmptyDel, /*tp_as_number*/
163 &__pyx_tp_as_sequence_DoIHaveEmptyDel, /*tp_as_sequence*/
164 &__pyx_tp_as_mapping_DoIHaveEmptyDel, /*tp_as_mapping*/
165 0, /*tp_hash*/
166 0, /*tp_call*/
167 0, /*tp_str*/
168 0, /*tp_getattro*/
169 0, /*tp_setattro*/
170 &__pyx_tp_as_buffer_DoIHaveEmptyDel, /*tp_as_buffer*/
171 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
172 0, /*tp_doc*/
173 0, /*tp_traverse*/
174 0, /*tp_clear*/
175 0, /*tp_richcompare*/
176 0, /*tp_weaklistoffset*/
177 0, /*tp_iter*/
178 0, /*tp_iternext*/
179 __pyx_methods_5baas6_DoIHaveEmptyDel, /*tp_methods*/
180 0, /*tp_members*/
181 0, /*tp_getset*/
182 0, /*tp_base*/
183 0, /*tp_dict*/
184 0, /*tp_descr_get*/
185 0, /*tp_descr_set*/
186 0, /*tp_dictoffset*/
187 0, /*tp_init*/
188 0, /*tp_alloc*/
189 __pyx_tp_new_5baas6_DoIHaveEmptyDel, /*tp_new*/
190 0, /*tp_free*/
191 0, /*tp_is_gc*/
192 0, /*tp_bases*/
193 0, /*tp_mro*/
194 0, /*tp_cache*/
195 0, /*tp_subclasses*/
196 0, /*tp_weaklist*/
197 };
199 static PyObject *__pyx_tp_new_5baas6_DoIHaveGCDel(PyTypeObject *t, PyObject *a, PyObject *k) {
200 struct __pyx_obj_5baas6_DoIHaveGCDel *p;
201 PyObject *o = (*t->tp_alloc)(t, 0);
202 if (!o) return 0;
203 p = ((struct __pyx_obj_5baas6_DoIHaveGCDel *)o);
204 p->foo = Py_None; Py_INCREF(Py_None);
205 return o;
206 }
208 static void __pyx_tp_dealloc_5baas6_DoIHaveGCDel(PyObject *o) {
209 struct __pyx_obj_5baas6_DoIHaveGCDel *p = (struct __pyx_obj_5baas6_DoIHaveGCDel *)o;
210 Py_XDECREF(p->foo);
211 (*o->ob_type->tp_free)(o);
212 }
214 static int __pyx_tp_traverse_5baas6_DoIHaveGCDel(PyObject *o, visitproc v, void *a) {
215 int e;
216 struct __pyx_obj_5baas6_DoIHaveGCDel *p = (struct __pyx_obj_5baas6_DoIHaveGCDel *)o;
217 if (p->foo) {
218 e = (*v)(p->foo, a); if (e) return e;
219 }
220 return 0;
221 }
223 static int __pyx_tp_clear_5baas6_DoIHaveGCDel(PyObject *o) {
224 struct __pyx_obj_5baas6_DoIHaveGCDel *p = (struct __pyx_obj_5baas6_DoIHaveGCDel *)o;
225 PyObject *t;
226 t = p->foo;
227 p->foo = Py_None; Py_INCREF(Py_None);
228 Py_XDECREF(t);
229 return 0;
230 }
232 static struct PyMethodDef __pyx_methods_5baas6_DoIHaveGCDel[] = {
233 {0, 0, 0, 0}
234 };
236 static PyNumberMethods __pyx_tp_as_number_DoIHaveGCDel = {
237 0, /*nb_add*/
238 0, /*nb_subtract*/
239 0, /*nb_multiply*/
240 0, /*nb_divide*/
241 0, /*nb_remainder*/
242 0, /*nb_divmod*/
243 0, /*nb_power*/
244 0, /*nb_negative*/
245 0, /*nb_positive*/
246 0, /*nb_absolute*/
247 0, /*nb_nonzero*/
248 0, /*nb_invert*/
249 0, /*nb_lshift*/
250 0, /*nb_rshift*/
251 0, /*nb_and*/
252 0, /*nb_xor*/
253 0, /*nb_or*/
254 0, /*nb_coerce*/
255 0, /*nb_int*/
256 0, /*nb_long*/
257 0, /*nb_float*/
258 0, /*nb_oct*/
259 0, /*nb_hex*/
260 0, /*nb_inplace_add*/
261 0, /*nb_inplace_subtract*/
262 0, /*nb_inplace_multiply*/
263 0, /*nb_inplace_divide*/
264 0, /*nb_inplace_remainder*/
265 0, /*nb_inplace_power*/
266 0, /*nb_inplace_lshift*/
267 0, /*nb_inplace_rshift*/
268 0, /*nb_inplace_and*/
269 0, /*nb_inplace_xor*/
270 0, /*nb_inplace_or*/
271 0, /*nb_floor_divide*/
272 0, /*nb_true_divide*/
273 0, /*nb_inplace_floor_divide*/
274 0, /*nb_inplace_true_divide*/
275 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
276 0, /*nb_index*/
277 #endif
278 };
280 static PySequenceMethods __pyx_tp_as_sequence_DoIHaveGCDel = {
281 0, /*sq_length*/
282 0, /*sq_concat*/
283 0, /*sq_repeat*/
284 0, /*sq_item*/
285 0, /*sq_slice*/
286 0, /*sq_ass_item*/
287 0, /*sq_ass_slice*/
288 0, /*sq_contains*/
289 0, /*sq_inplace_concat*/
290 0, /*sq_inplace_repeat*/
291 };
293 static PyMappingMethods __pyx_tp_as_mapping_DoIHaveGCDel = {
294 0, /*mp_length*/
295 0, /*mp_subscript*/
296 0, /*mp_ass_subscript*/
297 };
299 static PyBufferProcs __pyx_tp_as_buffer_DoIHaveGCDel = {
300 0, /*bf_getreadbuffer*/
301 0, /*bf_getwritebuffer*/
302 0, /*bf_getsegcount*/
303 0, /*bf_getcharbuffer*/
304 };
306 PyTypeObject __pyx_type_5baas6_DoIHaveGCDel = {
307 PyObject_HEAD_INIT(0)
308 0, /*ob_size*/
309 "baas6.DoIHaveGCDel", /*tp_name*/
310 sizeof(struct __pyx_obj_5baas6_DoIHaveGCDel), /*tp_basicsize*/
311 0, /*tp_itemsize*/
312 __pyx_tp_dealloc_5baas6_DoIHaveGCDel, /*tp_dealloc*/
313 0, /*tp_print*/
314 0, /*tp_getattr*/
315 0, /*tp_setattr*/
316 0, /*tp_compare*/
317 0, /*tp_repr*/
318 &__pyx_tp_as_number_DoIHaveGCDel, /*tp_as_number*/
319 &__pyx_tp_as_sequence_DoIHaveGCDel, /*tp_as_sequence*/
320 &__pyx_tp_as_mapping_DoIHaveGCDel, /*tp_as_mapping*/
321 0, /*tp_hash*/
322 0, /*tp_call*/
323 0, /*tp_str*/
324 0, /*tp_getattro*/
325 0, /*tp_setattro*/
326 &__pyx_tp_as_buffer_DoIHaveGCDel, /*tp_as_buffer*/
327 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
328 0, /*tp_doc*/
329 __pyx_tp_traverse_5baas6_DoIHaveGCDel, /*tp_traverse*/
330 __pyx_tp_clear_5baas6_DoIHaveGCDel, /*tp_clear*/
331 0, /*tp_richcompare*/
332 0, /*tp_weaklistoffset*/
333 0, /*tp_iter*/
334 0, /*tp_iternext*/
335 __pyx_methods_5baas6_DoIHaveGCDel, /*tp_methods*/
336 0, /*tp_members*/
337 0, /*tp_getset*/
338 0, /*tp_base*/
339 0, /*tp_dict*/
340 0, /*tp_descr_get*/
341 0, /*tp_descr_set*/
342 0, /*tp_dictoffset*/
343 0, /*tp_init*/
344 0, /*tp_alloc*/
345 __pyx_tp_new_5baas6_DoIHaveGCDel, /*tp_new*/
346 0, /*tp_free*/
347 0, /*tp_is_gc*/
348 0, /*tp_bases*/
349 0, /*tp_mro*/
350 0, /*tp_cache*/
351 0, /*tp_subclasses*/
352 0, /*tp_weaklist*/
353 };
355 static struct PyMethodDef __pyx_methods[] = {
356 {0, 0, 0, 0}
357 };
359 static void __pyx_init_filenames(void); /*proto*/
361 PyMODINIT_FUNC initbaas6(void); /*proto*/
362 PyMODINIT_FUNC initbaas6(void) {
363 __pyx_init_filenames();
364 __pyx_m = Py_InitModule4("baas6", __pyx_methods, 0, 0, PYTHON_API_VERSION);
365 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
366 Py_INCREF(__pyx_m);
367 __pyx_b = PyImport_AddModule("__builtin__");
368 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
369 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
370 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
371 if (PyType_Ready(&__pyx_type_5baas6_DoIHaveEmptyDel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
372 if (PyObject_SetAttrString(__pyx_m, "DoIHaveEmptyDel", (PyObject *)&__pyx_type_5baas6_DoIHaveEmptyDel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
373 __pyx_ptype_5baas6_DoIHaveEmptyDel = &__pyx_type_5baas6_DoIHaveEmptyDel;
374 __pyx_type_5baas6_DoIHaveGCDel.tp_free = _PyObject_GC_Del;
375 if (PyType_Ready(&__pyx_type_5baas6_DoIHaveGCDel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
376 if (PyObject_SetAttrString(__pyx_m, "DoIHaveGCDel", (PyObject *)&__pyx_type_5baas6_DoIHaveGCDel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
377 __pyx_ptype_5baas6_DoIHaveGCDel = &__pyx_type_5baas6_DoIHaveGCDel;
379 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/baas/baas6.pyx":4 */
380 return;
381 __pyx_L1:;
382 __Pyx_AddTraceback("baas6");
383 }
385 static char *__pyx_filenames[] = {
386 "baas6.pyx",
387 };
389 /* Runtime support code */
391 static void __pyx_init_filenames(void) {
392 __pyx_f = __pyx_filenames;
393 }
395 #include "compile.h"
396 #include "frameobject.h"
397 #include "traceback.h"
399 static void __Pyx_AddTraceback(char *funcname) {
400 PyObject *py_srcfile = 0;
401 PyObject *py_funcname = 0;
402 PyObject *py_globals = 0;
403 PyObject *empty_tuple = 0;
404 PyObject *empty_string = 0;
405 PyCodeObject *py_code = 0;
406 PyFrameObject *py_frame = 0;
408 py_srcfile = PyString_FromString(__pyx_filename);
409 if (!py_srcfile) goto bad;
410 py_funcname = PyString_FromString(funcname);
411 if (!py_funcname) goto bad;
412 py_globals = PyModule_GetDict(__pyx_m);
413 if (!py_globals) goto bad;
414 empty_tuple = PyTuple_New(0);
415 if (!empty_tuple) goto bad;
416 empty_string = PyString_FromString("");
417 if (!empty_string) goto bad;
418 py_code = PyCode_New(
419 0, /*int argcount,*/
420 0, /*int nlocals,*/
421 0, /*int stacksize,*/
422 0, /*int flags,*/
423 empty_string, /*PyObject *code,*/
424 empty_tuple, /*PyObject *consts,*/
425 empty_tuple, /*PyObject *names,*/
426 empty_tuple, /*PyObject *varnames,*/
427 empty_tuple, /*PyObject *freevars,*/
428 empty_tuple, /*PyObject *cellvars,*/
429 py_srcfile, /*PyObject *filename,*/
430 py_funcname, /*PyObject *name,*/
431 __pyx_lineno, /*int firstlineno,*/
432 empty_string /*PyObject *lnotab*/
433 );
434 if (!py_code) goto bad;
435 py_frame = PyFrame_New(
436 PyThreadState_Get(), /*PyThreadState *tstate,*/
437 py_code, /*PyCodeObject *code,*/
438 py_globals, /*PyObject *globals,*/
439 0 /*PyObject *locals*/
440 );
441 if (!py_frame) goto bad;
442 py_frame->f_lineno = __pyx_lineno;
443 PyTraceBack_Here(py_frame);
444 bad:
445 Py_XDECREF(py_srcfile);
446 Py_XDECREF(py_funcname);
447 Py_XDECREF(empty_tuple);
448 Py_XDECREF(empty_string);
449 Py_XDECREF(py_code);
450 Py_XDECREF(py_frame);
451 }