Cython has moved to github.

pyrex

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