Cython has moved to github.

pyrex

view Tests/7/Reference/pyextattrref.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 pyextattrref */
45 struct __pyx_obj_12pyextattrref_Eggs {
46 PyObject_HEAD
47 PyObject *ham;
48 };
50 struct __pyx_obj_12pyextattrref_Spam {
51 PyObject_HEAD
52 struct __pyx_obj_12pyextattrref_Eggs *eggs;
53 };
57 static PyTypeObject *__pyx_ptype_12pyextattrref_Eggs = 0;
58 static PyTypeObject *__pyx_ptype_12pyextattrref_Spam = 0;
59 static void __pyx_f_12pyextattrref_tomato(struct __pyx_obj_12pyextattrref_Spam *); /*proto*/
62 static __Pyx_StringTabEntry __pyx_string_tab[] = {
63 {0, 0, 0, 0}
64 };
66 /* Implementation of pyextattrref */
68 static void __pyx_f_12pyextattrref_tomato(struct __pyx_obj_12pyextattrref_Spam *__pyx_v_s) {
69 PyObject *__pyx_v_food;
70 Py_INCREF(__pyx_v_s);
71 __pyx_v_food = Py_None; Py_INCREF(Py_None);
72 Py_INCREF(__pyx_v_s->eggs->ham);
73 Py_DECREF(__pyx_v_food);
74 __pyx_v_food = __pyx_v_s->eggs->ham;
76 Py_DECREF(__pyx_v_food);
77 Py_DECREF(__pyx_v_s);
78 }
80 static PyObject *__pyx_tp_new_12pyextattrref_Eggs(PyTypeObject *t, PyObject *a, PyObject *k) {
81 struct __pyx_obj_12pyextattrref_Eggs *p;
82 PyObject *o = (*t->tp_alloc)(t, 0);
83 if (!o) return 0;
84 p = ((struct __pyx_obj_12pyextattrref_Eggs *)o);
85 p->ham = Py_None; Py_INCREF(Py_None);
86 return o;
87 }
89 static void __pyx_tp_dealloc_12pyextattrref_Eggs(PyObject *o) {
90 struct __pyx_obj_12pyextattrref_Eggs *p = (struct __pyx_obj_12pyextattrref_Eggs *)o;
91 Py_XDECREF(p->ham);
92 (*o->ob_type->tp_free)(o);
93 }
95 static int __pyx_tp_traverse_12pyextattrref_Eggs(PyObject *o, visitproc v, void *a) {
96 int e;
97 struct __pyx_obj_12pyextattrref_Eggs *p = (struct __pyx_obj_12pyextattrref_Eggs *)o;
98 if (p->ham) {
99 e = (*v)(p->ham, a); if (e) return e;
100 }
101 return 0;
102 }
104 static int __pyx_tp_clear_12pyextattrref_Eggs(PyObject *o) {
105 struct __pyx_obj_12pyextattrref_Eggs *p = (struct __pyx_obj_12pyextattrref_Eggs *)o;
106 PyObject *t;
107 t = p->ham;
108 p->ham = Py_None; Py_INCREF(Py_None);
109 Py_XDECREF(t);
110 return 0;
111 }
113 static struct PyMethodDef __pyx_methods_12pyextattrref_Eggs[] = {
114 {0, 0, 0, 0}
115 };
117 static PyNumberMethods __pyx_tp_as_number_Eggs = {
118 0, /*nb_add*/
119 0, /*nb_subtract*/
120 0, /*nb_multiply*/
121 0, /*nb_divide*/
122 0, /*nb_remainder*/
123 0, /*nb_divmod*/
124 0, /*nb_power*/
125 0, /*nb_negative*/
126 0, /*nb_positive*/
127 0, /*nb_absolute*/
128 0, /*nb_nonzero*/
129 0, /*nb_invert*/
130 0, /*nb_lshift*/
131 0, /*nb_rshift*/
132 0, /*nb_and*/
133 0, /*nb_xor*/
134 0, /*nb_or*/
135 0, /*nb_coerce*/
136 0, /*nb_int*/
137 0, /*nb_long*/
138 0, /*nb_float*/
139 0, /*nb_oct*/
140 0, /*nb_hex*/
141 0, /*nb_inplace_add*/
142 0, /*nb_inplace_subtract*/
143 0, /*nb_inplace_multiply*/
144 0, /*nb_inplace_divide*/
145 0, /*nb_inplace_remainder*/
146 0, /*nb_inplace_power*/
147 0, /*nb_inplace_lshift*/
148 0, /*nb_inplace_rshift*/
149 0, /*nb_inplace_and*/
150 0, /*nb_inplace_xor*/
151 0, /*nb_inplace_or*/
152 0, /*nb_floor_divide*/
153 0, /*nb_true_divide*/
154 0, /*nb_inplace_floor_divide*/
155 0, /*nb_inplace_true_divide*/
156 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
157 0, /*nb_index*/
158 #endif
159 };
161 static PySequenceMethods __pyx_tp_as_sequence_Eggs = {
162 0, /*sq_length*/
163 0, /*sq_concat*/
164 0, /*sq_repeat*/
165 0, /*sq_item*/
166 0, /*sq_slice*/
167 0, /*sq_ass_item*/
168 0, /*sq_ass_slice*/
169 0, /*sq_contains*/
170 0, /*sq_inplace_concat*/
171 0, /*sq_inplace_repeat*/
172 };
174 static PyMappingMethods __pyx_tp_as_mapping_Eggs = {
175 0, /*mp_length*/
176 0, /*mp_subscript*/
177 0, /*mp_ass_subscript*/
178 };
180 static PyBufferProcs __pyx_tp_as_buffer_Eggs = {
181 0, /*bf_getreadbuffer*/
182 0, /*bf_getwritebuffer*/
183 0, /*bf_getsegcount*/
184 0, /*bf_getcharbuffer*/
185 };
187 PyTypeObject __pyx_type_12pyextattrref_Eggs = {
188 PyObject_HEAD_INIT(0)
189 0, /*ob_size*/
190 "pyextattrref.Eggs", /*tp_name*/
191 sizeof(struct __pyx_obj_12pyextattrref_Eggs), /*tp_basicsize*/
192 0, /*tp_itemsize*/
193 __pyx_tp_dealloc_12pyextattrref_Eggs, /*tp_dealloc*/
194 0, /*tp_print*/
195 0, /*tp_getattr*/
196 0, /*tp_setattr*/
197 0, /*tp_compare*/
198 0, /*tp_repr*/
199 &__pyx_tp_as_number_Eggs, /*tp_as_number*/
200 &__pyx_tp_as_sequence_Eggs, /*tp_as_sequence*/
201 &__pyx_tp_as_mapping_Eggs, /*tp_as_mapping*/
202 0, /*tp_hash*/
203 0, /*tp_call*/
204 0, /*tp_str*/
205 0, /*tp_getattro*/
206 0, /*tp_setattro*/
207 &__pyx_tp_as_buffer_Eggs, /*tp_as_buffer*/
208 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
209 0, /*tp_doc*/
210 __pyx_tp_traverse_12pyextattrref_Eggs, /*tp_traverse*/
211 __pyx_tp_clear_12pyextattrref_Eggs, /*tp_clear*/
212 0, /*tp_richcompare*/
213 0, /*tp_weaklistoffset*/
214 0, /*tp_iter*/
215 0, /*tp_iternext*/
216 __pyx_methods_12pyextattrref_Eggs, /*tp_methods*/
217 0, /*tp_members*/
218 0, /*tp_getset*/
219 0, /*tp_base*/
220 0, /*tp_dict*/
221 0, /*tp_descr_get*/
222 0, /*tp_descr_set*/
223 0, /*tp_dictoffset*/
224 0, /*tp_init*/
225 0, /*tp_alloc*/
226 __pyx_tp_new_12pyextattrref_Eggs, /*tp_new*/
227 0, /*tp_free*/
228 0, /*tp_is_gc*/
229 0, /*tp_bases*/
230 0, /*tp_mro*/
231 0, /*tp_cache*/
232 0, /*tp_subclasses*/
233 0, /*tp_weaklist*/
234 };
236 static PyObject *__pyx_tp_new_12pyextattrref_Spam(PyTypeObject *t, PyObject *a, PyObject *k) {
237 struct __pyx_obj_12pyextattrref_Spam *p;
238 PyObject *o = (*t->tp_alloc)(t, 0);
239 if (!o) return 0;
240 p = ((struct __pyx_obj_12pyextattrref_Spam *)o);
241 p->eggs = ((struct __pyx_obj_12pyextattrref_Eggs *)Py_None); Py_INCREF(Py_None);
242 return o;
243 }
245 static void __pyx_tp_dealloc_12pyextattrref_Spam(PyObject *o) {
246 struct __pyx_obj_12pyextattrref_Spam *p = (struct __pyx_obj_12pyextattrref_Spam *)o;
247 Py_XDECREF(((PyObject *)p->eggs));
248 (*o->ob_type->tp_free)(o);
249 }
251 static int __pyx_tp_traverse_12pyextattrref_Spam(PyObject *o, visitproc v, void *a) {
252 int e;
253 struct __pyx_obj_12pyextattrref_Spam *p = (struct __pyx_obj_12pyextattrref_Spam *)o;
254 if (p->eggs) {
255 e = (*v)(((PyObject*)p->eggs), a); if (e) return e;
256 }
257 return 0;
258 }
260 static int __pyx_tp_clear_12pyextattrref_Spam(PyObject *o) {
261 struct __pyx_obj_12pyextattrref_Spam *p = (struct __pyx_obj_12pyextattrref_Spam *)o;
262 PyObject *t;
263 t = ((PyObject *)p->eggs);
264 p->eggs = ((struct __pyx_obj_12pyextattrref_Eggs *)Py_None); Py_INCREF(Py_None);
265 Py_XDECREF(t);
266 return 0;
267 }
269 static struct PyMethodDef __pyx_methods_12pyextattrref_Spam[] = {
270 {0, 0, 0, 0}
271 };
273 static PyNumberMethods __pyx_tp_as_number_Spam = {
274 0, /*nb_add*/
275 0, /*nb_subtract*/
276 0, /*nb_multiply*/
277 0, /*nb_divide*/
278 0, /*nb_remainder*/
279 0, /*nb_divmod*/
280 0, /*nb_power*/
281 0, /*nb_negative*/
282 0, /*nb_positive*/
283 0, /*nb_absolute*/
284 0, /*nb_nonzero*/
285 0, /*nb_invert*/
286 0, /*nb_lshift*/
287 0, /*nb_rshift*/
288 0, /*nb_and*/
289 0, /*nb_xor*/
290 0, /*nb_or*/
291 0, /*nb_coerce*/
292 0, /*nb_int*/
293 0, /*nb_long*/
294 0, /*nb_float*/
295 0, /*nb_oct*/
296 0, /*nb_hex*/
297 0, /*nb_inplace_add*/
298 0, /*nb_inplace_subtract*/
299 0, /*nb_inplace_multiply*/
300 0, /*nb_inplace_divide*/
301 0, /*nb_inplace_remainder*/
302 0, /*nb_inplace_power*/
303 0, /*nb_inplace_lshift*/
304 0, /*nb_inplace_rshift*/
305 0, /*nb_inplace_and*/
306 0, /*nb_inplace_xor*/
307 0, /*nb_inplace_or*/
308 0, /*nb_floor_divide*/
309 0, /*nb_true_divide*/
310 0, /*nb_inplace_floor_divide*/
311 0, /*nb_inplace_true_divide*/
312 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
313 0, /*nb_index*/
314 #endif
315 };
317 static PySequenceMethods __pyx_tp_as_sequence_Spam = {
318 0, /*sq_length*/
319 0, /*sq_concat*/
320 0, /*sq_repeat*/
321 0, /*sq_item*/
322 0, /*sq_slice*/
323 0, /*sq_ass_item*/
324 0, /*sq_ass_slice*/
325 0, /*sq_contains*/
326 0, /*sq_inplace_concat*/
327 0, /*sq_inplace_repeat*/
328 };
330 static PyMappingMethods __pyx_tp_as_mapping_Spam = {
331 0, /*mp_length*/
332 0, /*mp_subscript*/
333 0, /*mp_ass_subscript*/
334 };
336 static PyBufferProcs __pyx_tp_as_buffer_Spam = {
337 0, /*bf_getreadbuffer*/
338 0, /*bf_getwritebuffer*/
339 0, /*bf_getsegcount*/
340 0, /*bf_getcharbuffer*/
341 };
343 PyTypeObject __pyx_type_12pyextattrref_Spam = {
344 PyObject_HEAD_INIT(0)
345 0, /*ob_size*/
346 "pyextattrref.Spam", /*tp_name*/
347 sizeof(struct __pyx_obj_12pyextattrref_Spam), /*tp_basicsize*/
348 0, /*tp_itemsize*/
349 __pyx_tp_dealloc_12pyextattrref_Spam, /*tp_dealloc*/
350 0, /*tp_print*/
351 0, /*tp_getattr*/
352 0, /*tp_setattr*/
353 0, /*tp_compare*/
354 0, /*tp_repr*/
355 &__pyx_tp_as_number_Spam, /*tp_as_number*/
356 &__pyx_tp_as_sequence_Spam, /*tp_as_sequence*/
357 &__pyx_tp_as_mapping_Spam, /*tp_as_mapping*/
358 0, /*tp_hash*/
359 0, /*tp_call*/
360 0, /*tp_str*/
361 0, /*tp_getattro*/
362 0, /*tp_setattro*/
363 &__pyx_tp_as_buffer_Spam, /*tp_as_buffer*/
364 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
365 0, /*tp_doc*/
366 __pyx_tp_traverse_12pyextattrref_Spam, /*tp_traverse*/
367 __pyx_tp_clear_12pyextattrref_Spam, /*tp_clear*/
368 0, /*tp_richcompare*/
369 0, /*tp_weaklistoffset*/
370 0, /*tp_iter*/
371 0, /*tp_iternext*/
372 __pyx_methods_12pyextattrref_Spam, /*tp_methods*/
373 0, /*tp_members*/
374 0, /*tp_getset*/
375 0, /*tp_base*/
376 0, /*tp_dict*/
377 0, /*tp_descr_get*/
378 0, /*tp_descr_set*/
379 0, /*tp_dictoffset*/
380 0, /*tp_init*/
381 0, /*tp_alloc*/
382 __pyx_tp_new_12pyextattrref_Spam, /*tp_new*/
383 0, /*tp_free*/
384 0, /*tp_is_gc*/
385 0, /*tp_bases*/
386 0, /*tp_mro*/
387 0, /*tp_cache*/
388 0, /*tp_subclasses*/
389 0, /*tp_weaklist*/
390 };
392 static struct PyMethodDef __pyx_methods[] = {
393 {0, 0, 0, 0}
394 };
396 static void __pyx_init_filenames(void); /*proto*/
398 PyMODINIT_FUNC initpyextattrref(void); /*proto*/
399 PyMODINIT_FUNC initpyextattrref(void) {
400 __pyx_init_filenames();
401 __pyx_m = Py_InitModule4("pyextattrref", __pyx_methods, 0, 0, PYTHON_API_VERSION);
402 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
403 Py_INCREF(__pyx_m);
404 __pyx_b = PyImport_AddModule("__builtin__");
405 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
406 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
407 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
408 __pyx_type_12pyextattrref_Eggs.tp_free = _PyObject_GC_Del;
409 if (PyType_Ready(&__pyx_type_12pyextattrref_Eggs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
410 if (PyObject_SetAttrString(__pyx_m, "Eggs", (PyObject *)&__pyx_type_12pyextattrref_Eggs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
411 __pyx_ptype_12pyextattrref_Eggs = &__pyx_type_12pyextattrref_Eggs;
412 __pyx_type_12pyextattrref_Spam.tp_free = _PyObject_GC_Del;
413 if (PyType_Ready(&__pyx_type_12pyextattrref_Spam) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
414 if (PyObject_SetAttrString(__pyx_m, "Spam", (PyObject *)&__pyx_type_12pyextattrref_Spam) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
415 __pyx_ptype_12pyextattrref_Spam = &__pyx_type_12pyextattrref_Spam;
417 /* "/Local/Projects/D/Pyrex/Source/Tests/7/pyextattrref.pyx":7 */
418 return;
419 __pyx_L1:;
420 __Pyx_AddTraceback("pyextattrref");
421 }
423 static char *__pyx_filenames[] = {
424 "pyextattrref.pyx",
425 };
427 /* Runtime support code */
429 static void __pyx_init_filenames(void) {
430 __pyx_f = __pyx_filenames;
431 }
433 #include "compile.h"
434 #include "frameobject.h"
435 #include "traceback.h"
437 static void __Pyx_AddTraceback(char *funcname) {
438 PyObject *py_srcfile = 0;
439 PyObject *py_funcname = 0;
440 PyObject *py_globals = 0;
441 PyObject *empty_tuple = 0;
442 PyObject *empty_string = 0;
443 PyCodeObject *py_code = 0;
444 PyFrameObject *py_frame = 0;
446 py_srcfile = PyString_FromString(__pyx_filename);
447 if (!py_srcfile) goto bad;
448 py_funcname = PyString_FromString(funcname);
449 if (!py_funcname) goto bad;
450 py_globals = PyModule_GetDict(__pyx_m);
451 if (!py_globals) goto bad;
452 empty_tuple = PyTuple_New(0);
453 if (!empty_tuple) goto bad;
454 empty_string = PyString_FromString("");
455 if (!empty_string) goto bad;
456 py_code = PyCode_New(
457 0, /*int argcount,*/
458 0, /*int nlocals,*/
459 0, /*int stacksize,*/
460 0, /*int flags,*/
461 empty_string, /*PyObject *code,*/
462 empty_tuple, /*PyObject *consts,*/
463 empty_tuple, /*PyObject *names,*/
464 empty_tuple, /*PyObject *varnames,*/
465 empty_tuple, /*PyObject *freevars,*/
466 empty_tuple, /*PyObject *cellvars,*/
467 py_srcfile, /*PyObject *filename,*/
468 py_funcname, /*PyObject *name,*/
469 __pyx_lineno, /*int firstlineno,*/
470 empty_string /*PyObject *lnotab*/
471 );
472 if (!py_code) goto bad;
473 py_frame = PyFrame_New(
474 PyThreadState_Get(), /*PyThreadState *tstate,*/
475 py_code, /*PyCodeObject *code,*/
476 py_globals, /*PyObject *globals,*/
477 0 /*PyObject *locals*/
478 );
479 if (!py_frame) goto bad;
480 py_frame->f_lineno = __pyx_lineno;
481 PyTraceBack_Here(py_frame);
482 bad:
483 Py_XDECREF(py_srcfile);
484 Py_XDECREF(py_funcname);
485 Py_XDECREF(empty_tuple);
486 Py_XDECREF(empty_string);
487 Py_XDECREF(py_code);
488 Py_XDECREF(py_frame);
489 }