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