Cython has moved to github.

pyrex

view Tests/10/circularcimport1/Reference/blarg.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 cd56c0e5ebe0
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 PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
43 static PyObject *__Pyx_ImportModule(char *name); /*proto*/
45 static void __Pyx_AddTraceback(char *funcname); /*proto*/
47 /* Declarations from foo */
49 struct __pyx_t_3foo_Spam {
50 struct __pyx_t_5blarg_Eggs *eggs;
51 };
53 struct __pyx_obj_3foo_Foo {
54 PyObject_HEAD
55 PyObject *name;
56 struct __pyx_obj_5blarg_Blarg *blarg;
57 };
60 static PyTypeObject *__pyx_ptype_3foo_Foo = 0;
62 /* Declarations from blarg */
64 struct __pyx_t_5blarg_Eggs {
65 struct __pyx_t_3foo_Spam *spam;
66 };
68 struct __pyx_obj_5blarg_Blarg {
69 PyObject_HEAD
70 PyObject *name;
71 struct __pyx_obj_3foo_Foo *foo;
72 };
75 static PyTypeObject *__pyx_ptype_5blarg_Blarg = 0;
78 static __Pyx_StringTabEntry __pyx_string_tab[] = {
79 {0, 0, 0, 0}
80 };
82 /* Implementation of blarg */
84 static PyObject *__pyx_tp_new_5blarg_Blarg(PyTypeObject *t, PyObject *a, PyObject *k) {
85 struct __pyx_obj_5blarg_Blarg *p;
86 PyObject *o = (*t->tp_alloc)(t, 0);
87 if (!o) return 0;
88 p = ((struct __pyx_obj_5blarg_Blarg *)o);
89 p->name = Py_None; Py_INCREF(Py_None);
90 p->foo = ((struct __pyx_obj_3foo_Foo *)Py_None); Py_INCREF(Py_None);
91 return o;
92 }
94 static void __pyx_tp_dealloc_5blarg_Blarg(PyObject *o) {
95 struct __pyx_obj_5blarg_Blarg *p = (struct __pyx_obj_5blarg_Blarg *)o;
96 Py_XDECREF(p->name);
97 Py_XDECREF(((PyObject *)p->foo));
98 (*o->ob_type->tp_free)(o);
99 }
101 static int __pyx_tp_traverse_5blarg_Blarg(PyObject *o, visitproc v, void *a) {
102 int e;
103 struct __pyx_obj_5blarg_Blarg *p = (struct __pyx_obj_5blarg_Blarg *)o;
104 if (p->name) {
105 e = (*v)(p->name, a); if (e) return e;
106 }
107 if (p->foo) {
108 e = (*v)(((PyObject*)p->foo), a); if (e) return e;
109 }
110 return 0;
111 }
113 static int __pyx_tp_clear_5blarg_Blarg(PyObject *o) {
114 struct __pyx_obj_5blarg_Blarg *p = (struct __pyx_obj_5blarg_Blarg *)o;
115 PyObject *t;
116 t = p->name;
117 p->name = Py_None; Py_INCREF(Py_None);
118 Py_XDECREF(t);
119 t = ((PyObject *)p->foo);
120 p->foo = ((struct __pyx_obj_3foo_Foo *)Py_None); Py_INCREF(Py_None);
121 Py_XDECREF(t);
122 return 0;
123 }
125 static struct PyMethodDef __pyx_methods_5blarg_Blarg[] = {
126 {0, 0, 0, 0}
127 };
129 static PyNumberMethods __pyx_tp_as_number_Blarg = {
130 0, /*nb_add*/
131 0, /*nb_subtract*/
132 0, /*nb_multiply*/
133 0, /*nb_divide*/
134 0, /*nb_remainder*/
135 0, /*nb_divmod*/
136 0, /*nb_power*/
137 0, /*nb_negative*/
138 0, /*nb_positive*/
139 0, /*nb_absolute*/
140 0, /*nb_nonzero*/
141 0, /*nb_invert*/
142 0, /*nb_lshift*/
143 0, /*nb_rshift*/
144 0, /*nb_and*/
145 0, /*nb_xor*/
146 0, /*nb_or*/
147 0, /*nb_coerce*/
148 0, /*nb_int*/
149 0, /*nb_long*/
150 0, /*nb_float*/
151 0, /*nb_oct*/
152 0, /*nb_hex*/
153 0, /*nb_inplace_add*/
154 0, /*nb_inplace_subtract*/
155 0, /*nb_inplace_multiply*/
156 0, /*nb_inplace_divide*/
157 0, /*nb_inplace_remainder*/
158 0, /*nb_inplace_power*/
159 0, /*nb_inplace_lshift*/
160 0, /*nb_inplace_rshift*/
161 0, /*nb_inplace_and*/
162 0, /*nb_inplace_xor*/
163 0, /*nb_inplace_or*/
164 0, /*nb_floor_divide*/
165 0, /*nb_true_divide*/
166 0, /*nb_inplace_floor_divide*/
167 0, /*nb_inplace_true_divide*/
168 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
169 0, /*nb_index*/
170 #endif
171 };
173 static PySequenceMethods __pyx_tp_as_sequence_Blarg = {
174 0, /*sq_length*/
175 0, /*sq_concat*/
176 0, /*sq_repeat*/
177 0, /*sq_item*/
178 0, /*sq_slice*/
179 0, /*sq_ass_item*/
180 0, /*sq_ass_slice*/
181 0, /*sq_contains*/
182 0, /*sq_inplace_concat*/
183 0, /*sq_inplace_repeat*/
184 };
186 static PyMappingMethods __pyx_tp_as_mapping_Blarg = {
187 0, /*mp_length*/
188 0, /*mp_subscript*/
189 0, /*mp_ass_subscript*/
190 };
192 static PyBufferProcs __pyx_tp_as_buffer_Blarg = {
193 0, /*bf_getreadbuffer*/
194 0, /*bf_getwritebuffer*/
195 0, /*bf_getsegcount*/
196 0, /*bf_getcharbuffer*/
197 };
199 PyTypeObject __pyx_type_5blarg_Blarg = {
200 PyObject_HEAD_INIT(0)
201 0, /*ob_size*/
202 "blarg.Blarg", /*tp_name*/
203 sizeof(struct __pyx_obj_5blarg_Blarg), /*tp_basicsize*/
204 0, /*tp_itemsize*/
205 __pyx_tp_dealloc_5blarg_Blarg, /*tp_dealloc*/
206 0, /*tp_print*/
207 0, /*tp_getattr*/
208 0, /*tp_setattr*/
209 0, /*tp_compare*/
210 0, /*tp_repr*/
211 &__pyx_tp_as_number_Blarg, /*tp_as_number*/
212 &__pyx_tp_as_sequence_Blarg, /*tp_as_sequence*/
213 &__pyx_tp_as_mapping_Blarg, /*tp_as_mapping*/
214 0, /*tp_hash*/
215 0, /*tp_call*/
216 0, /*tp_str*/
217 0, /*tp_getattro*/
218 0, /*tp_setattro*/
219 &__pyx_tp_as_buffer_Blarg, /*tp_as_buffer*/
220 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
221 0, /*tp_doc*/
222 __pyx_tp_traverse_5blarg_Blarg, /*tp_traverse*/
223 __pyx_tp_clear_5blarg_Blarg, /*tp_clear*/
224 0, /*tp_richcompare*/
225 0, /*tp_weaklistoffset*/
226 0, /*tp_iter*/
227 0, /*tp_iternext*/
228 __pyx_methods_5blarg_Blarg, /*tp_methods*/
229 0, /*tp_members*/
230 0, /*tp_getset*/
231 0, /*tp_base*/
232 0, /*tp_dict*/
233 0, /*tp_descr_get*/
234 0, /*tp_descr_set*/
235 0, /*tp_dictoffset*/
236 0, /*tp_init*/
237 0, /*tp_alloc*/
238 __pyx_tp_new_5blarg_Blarg, /*tp_new*/
239 0, /*tp_free*/
240 0, /*tp_is_gc*/
241 0, /*tp_bases*/
242 0, /*tp_mro*/
243 0, /*tp_cache*/
244 0, /*tp_subclasses*/
245 0, /*tp_weaklist*/
246 };
248 static struct PyMethodDef __pyx_methods[] = {
249 {0, 0, 0, 0}
250 };
252 static void __pyx_init_filenames(void); /*proto*/
254 PyMODINIT_FUNC initblarg(void); /*proto*/
255 PyMODINIT_FUNC initblarg(void) {
256 __pyx_init_filenames();
257 __pyx_m = Py_InitModule4("blarg", __pyx_methods, 0, 0, PYTHON_API_VERSION);
258 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
259 Py_INCREF(__pyx_m);
260 __pyx_b = PyImport_AddModule("__builtin__");
261 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
262 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
263 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
264 __pyx_type_5blarg_Blarg.tp_free = _PyObject_GC_Del;
265 if (PyType_Ready(&__pyx_type_5blarg_Blarg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
266 if (PyObject_SetAttrString(__pyx_m, "Blarg", (PyObject *)&__pyx_type_5blarg_Blarg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
267 __pyx_ptype_5blarg_Blarg = &__pyx_type_5blarg_Blarg;
268 __pyx_ptype_3foo_Foo = __Pyx_ImportType("foo", "Foo", sizeof(struct __pyx_obj_3foo_Foo)); if (!__pyx_ptype_3foo_Foo) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; goto __pyx_L1;}
269 return;
270 __pyx_L1:;
271 __Pyx_AddTraceback("blarg");
272 }
274 static char *__pyx_filenames[] = {
275 "blarg.pyx",
276 "foo.pxd",
277 };
279 /* Runtime support code */
281 static void __pyx_init_filenames(void) {
282 __pyx_f = __pyx_filenames;
283 }
285 #ifndef __PYX_HAVE_RT_ImportType
286 #define __PYX_HAVE_RT_ImportType
287 static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,
288 long size)
289 {
290 PyObject *py_module = 0;
291 PyObject *result = 0;
293 py_module = __Pyx_ImportModule(module_name);
294 if (!py_module)
295 goto bad;
296 result = PyObject_GetAttrString(py_module, class_name);
297 if (!result)
298 goto bad;
299 if (!PyType_Check(result)) {
300 PyErr_Format(PyExc_TypeError,
301 "%s.%s is not a type object",
302 module_name, class_name);
303 goto bad;
304 }
305 if (((PyTypeObject *)result)->tp_basicsize != size) {
306 PyErr_Format(PyExc_ValueError,
307 "%s.%s does not appear to be the correct type object",
308 module_name, class_name);
309 goto bad;
310 }
311 return (PyTypeObject *)result;
312 bad:
313 Py_XDECREF(result);
314 return 0;
315 }
316 #endif
318 #ifndef __PYX_HAVE_RT_ImportModule
319 #define __PYX_HAVE_RT_ImportModule
320 static PyObject *__Pyx_ImportModule(char *name) {
321 PyObject *py_name = 0;
323 py_name = PyString_FromString(name);
324 if (!py_name)
325 goto bad;
326 return PyImport_Import(py_name);
327 bad:
328 Py_XDECREF(py_name);
329 return 0;
330 }
331 #endif
333 #include "compile.h"
334 #include "frameobject.h"
335 #include "traceback.h"
337 static void __Pyx_AddTraceback(char *funcname) {
338 PyObject *py_srcfile = 0;
339 PyObject *py_funcname = 0;
340 PyObject *py_globals = 0;
341 PyObject *empty_tuple = 0;
342 PyObject *empty_string = 0;
343 PyCodeObject *py_code = 0;
344 PyFrameObject *py_frame = 0;
346 py_srcfile = PyString_FromString(__pyx_filename);
347 if (!py_srcfile) goto bad;
348 py_funcname = PyString_FromString(funcname);
349 if (!py_funcname) goto bad;
350 py_globals = PyModule_GetDict(__pyx_m);
351 if (!py_globals) goto bad;
352 empty_tuple = PyTuple_New(0);
353 if (!empty_tuple) goto bad;
354 empty_string = PyString_FromString("");
355 if (!empty_string) goto bad;
356 py_code = PyCode_New(
357 0, /*int argcount,*/
358 0, /*int nlocals,*/
359 0, /*int stacksize,*/
360 0, /*int flags,*/
361 empty_string, /*PyObject *code,*/
362 empty_tuple, /*PyObject *consts,*/
363 empty_tuple, /*PyObject *names,*/
364 empty_tuple, /*PyObject *varnames,*/
365 empty_tuple, /*PyObject *freevars,*/
366 empty_tuple, /*PyObject *cellvars,*/
367 py_srcfile, /*PyObject *filename,*/
368 py_funcname, /*PyObject *name,*/
369 __pyx_lineno, /*int firstlineno,*/
370 empty_string /*PyObject *lnotab*/
371 );
372 if (!py_code) goto bad;
373 py_frame = PyFrame_New(
374 PyThreadState_Get(), /*PyThreadState *tstate,*/
375 py_code, /*PyCodeObject *code,*/
376 py_globals, /*PyObject *globals,*/
377 0 /*PyObject *locals*/
378 );
379 if (!py_frame) goto bad;
380 py_frame->f_lineno = __pyx_lineno;
381 PyTraceBack_Here(py_frame);
382 bad:
383 Py_XDECREF(py_srcfile);
384 Py_XDECREF(py_funcname);
385 Py_XDECREF(empty_tuple);
386 Py_XDECREF(empty_string);
387 Py_XDECREF(py_code);
388 Py_XDECREF(py_frame);
389 }