Cython has moved to github.

pyrex

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