Cython has moved to github.

pyrex

view Tests/Bugs/pointdexter/pointdexter1_b.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 PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
44 static PyObject *__Pyx_ImportModule(char *name); /*proto*/
46 static void __Pyx_AddTraceback(char *funcname); /*proto*/
48 /* Declarations from pointdexter1_a */
50 struct __pyx_obj_14pointdexter1_a_A {
51 PyObject_HEAD
52 int length;
53 };
56 static PyTypeObject *__pyx_ptype_14pointdexter1_a_A = 0;
58 /* Declarations from pointdexter1_b */
60 struct __pyx_obj_14pointdexter1_b_B {
61 struct __pyx_obj_14pointdexter1_a_A __pyx_base;
62 int width;
63 };
66 static PyTypeObject *__pyx_ptype_14pointdexter1_b_B = 0;
68 /* Declarations from implementation of pointdexter1_b */
71 static char __pyx_k1[] = "__init__";
73 static PyObject *__pyx_n___init__;
76 static __Pyx_StringTabEntry __pyx_string_tab[] = {
77 {&__pyx_n___init__, 1, __pyx_k1, sizeof(__pyx_k1)},
78 {0, 0, 0, 0}
79 };
83 /* Implementation of pointdexter1_b */
85 static int __pyx_f_14pointdexter1_b_1B___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
86 static int __pyx_f_14pointdexter1_b_1B___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
87 PyObject *__pyx_v_length = 0;
88 PyObject *__pyx_v_width = 0;
89 int __pyx_r;
90 PyObject *__pyx_1 = 0;
91 PyObject *__pyx_2 = 0;
92 PyObject *__pyx_3 = 0;
93 int __pyx_4;
94 static char *__pyx_argnames[] = {"length","width",0};
95 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_length, &__pyx_v_width)) return -1;
96 Py_INCREF((PyObject *)__pyx_v_self);
97 Py_INCREF(__pyx_v_length);
98 Py_INCREF(__pyx_v_width);
100 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/pointdexter/pointdexter1_b.pyx":3 */
101 __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_ptype_14pointdexter1_a_A), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
102 __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
103 Py_INCREF(__pyx_v_self);
104 PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
105 Py_INCREF(__pyx_v_length);
106 PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_length);
107 __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
108 Py_DECREF(__pyx_1); __pyx_1 = 0;
109 Py_DECREF(__pyx_2); __pyx_2 = 0;
110 Py_DECREF(__pyx_3); __pyx_3 = 0;
112 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/pointdexter/pointdexter1_b.pyx":4 */
113 __pyx_4 = PyInt_AsLong(__pyx_v_width); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
114 ((struct __pyx_obj_14pointdexter1_b_B *)__pyx_v_self)->width = __pyx_4;
116 __pyx_r = 0;
117 goto __pyx_L0;
118 __pyx_L1:;
119 Py_XDECREF(__pyx_1);
120 Py_XDECREF(__pyx_2);
121 Py_XDECREF(__pyx_3);
122 __Pyx_AddTraceback("pointdexter1_b.B.__init__");
123 __pyx_r = -1;
124 __pyx_L0:;
125 Py_DECREF((PyObject *)__pyx_v_self);
126 Py_DECREF(__pyx_v_length);
127 Py_DECREF(__pyx_v_width);
128 return __pyx_r;
129 }
131 static PyObject *__pyx_tp_new_14pointdexter1_b_B(PyTypeObject *t, PyObject *a, PyObject *k) {
132 PyObject *o = __pyx_ptype_14pointdexter1_a_A->tp_new(t, a, k);
133 if (!o) return 0;
134 return o;
135 }
137 static void __pyx_tp_dealloc_14pointdexter1_b_B(PyObject *o) {
138 __pyx_ptype_14pointdexter1_a_A->tp_dealloc(o);
139 }
141 static struct PyMethodDef __pyx_methods_14pointdexter1_b_B[] = {
142 {0, 0, 0, 0}
143 };
145 static PyNumberMethods __pyx_tp_as_number_B = {
146 0, /*nb_add*/
147 0, /*nb_subtract*/
148 0, /*nb_multiply*/
149 0, /*nb_divide*/
150 0, /*nb_remainder*/
151 0, /*nb_divmod*/
152 0, /*nb_power*/
153 0, /*nb_negative*/
154 0, /*nb_positive*/
155 0, /*nb_absolute*/
156 0, /*nb_nonzero*/
157 0, /*nb_invert*/
158 0, /*nb_lshift*/
159 0, /*nb_rshift*/
160 0, /*nb_and*/
161 0, /*nb_xor*/
162 0, /*nb_or*/
163 0, /*nb_coerce*/
164 0, /*nb_int*/
165 0, /*nb_long*/
166 0, /*nb_float*/
167 0, /*nb_oct*/
168 0, /*nb_hex*/
169 0, /*nb_inplace_add*/
170 0, /*nb_inplace_subtract*/
171 0, /*nb_inplace_multiply*/
172 0, /*nb_inplace_divide*/
173 0, /*nb_inplace_remainder*/
174 0, /*nb_inplace_power*/
175 0, /*nb_inplace_lshift*/
176 0, /*nb_inplace_rshift*/
177 0, /*nb_inplace_and*/
178 0, /*nb_inplace_xor*/
179 0, /*nb_inplace_or*/
180 0, /*nb_floor_divide*/
181 0, /*nb_true_divide*/
182 0, /*nb_inplace_floor_divide*/
183 0, /*nb_inplace_true_divide*/
184 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
185 0, /*nb_index*/
186 #endif
187 };
189 static PySequenceMethods __pyx_tp_as_sequence_B = {
190 0, /*sq_length*/
191 0, /*sq_concat*/
192 0, /*sq_repeat*/
193 0, /*sq_item*/
194 0, /*sq_slice*/
195 0, /*sq_ass_item*/
196 0, /*sq_ass_slice*/
197 0, /*sq_contains*/
198 0, /*sq_inplace_concat*/
199 0, /*sq_inplace_repeat*/
200 };
202 static PyMappingMethods __pyx_tp_as_mapping_B = {
203 0, /*mp_length*/
204 0, /*mp_subscript*/
205 0, /*mp_ass_subscript*/
206 };
208 static PyBufferProcs __pyx_tp_as_buffer_B = {
209 0, /*bf_getreadbuffer*/
210 0, /*bf_getwritebuffer*/
211 0, /*bf_getsegcount*/
212 0, /*bf_getcharbuffer*/
213 };
215 PyTypeObject __pyx_type_14pointdexter1_b_B = {
216 PyObject_HEAD_INIT(0)
217 0, /*ob_size*/
218 "pointdexter1_b.B", /*tp_name*/
219 sizeof(struct __pyx_obj_14pointdexter1_b_B), /*tp_basicsize*/
220 0, /*tp_itemsize*/
221 __pyx_tp_dealloc_14pointdexter1_b_B, /*tp_dealloc*/
222 0, /*tp_print*/
223 0, /*tp_getattr*/
224 0, /*tp_setattr*/
225 0, /*tp_compare*/
226 0, /*tp_repr*/
227 &__pyx_tp_as_number_B, /*tp_as_number*/
228 &__pyx_tp_as_sequence_B, /*tp_as_sequence*/
229 &__pyx_tp_as_mapping_B, /*tp_as_mapping*/
230 0, /*tp_hash*/
231 0, /*tp_call*/
232 0, /*tp_str*/
233 0, /*tp_getattro*/
234 0, /*tp_setattro*/
235 &__pyx_tp_as_buffer_B, /*tp_as_buffer*/
236 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
237 0, /*tp_doc*/
238 0, /*tp_traverse*/
239 0, /*tp_clear*/
240 0, /*tp_richcompare*/
241 0, /*tp_weaklistoffset*/
242 0, /*tp_iter*/
243 0, /*tp_iternext*/
244 __pyx_methods_14pointdexter1_b_B, /*tp_methods*/
245 0, /*tp_members*/
246 0, /*tp_getset*/
247 0, /*tp_base*/
248 0, /*tp_dict*/
249 0, /*tp_descr_get*/
250 0, /*tp_descr_set*/
251 0, /*tp_dictoffset*/
252 __pyx_f_14pointdexter1_b_1B___init__, /*tp_init*/
253 0, /*tp_alloc*/
254 __pyx_tp_new_14pointdexter1_b_B, /*tp_new*/
255 0, /*tp_free*/
256 0, /*tp_is_gc*/
257 0, /*tp_bases*/
258 0, /*tp_mro*/
259 0, /*tp_cache*/
260 0, /*tp_subclasses*/
261 0, /*tp_weaklist*/
262 };
264 static struct PyMethodDef __pyx_methods[] = {
265 {0, 0, 0, 0}
266 };
268 static void __pyx_init_filenames(void); /*proto*/
270 PyMODINIT_FUNC initpointdexter1_b(void); /*proto*/
271 PyMODINIT_FUNC initpointdexter1_b(void) {
272 __pyx_init_filenames();
273 __pyx_m = Py_InitModule4("pointdexter1_b", __pyx_methods, 0, 0, PYTHON_API_VERSION);
274 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
275 Py_INCREF(__pyx_m);
276 __pyx_b = PyImport_AddModule("__builtin__");
277 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
278 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
279 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
280 __pyx_ptype_14pointdexter1_a_A = __Pyx_ImportType("pointdexter1_a", "A", sizeof(struct __pyx_obj_14pointdexter1_a_A)); if (!__pyx_ptype_14pointdexter1_a_A) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
281 __pyx_type_14pointdexter1_b_B.tp_base = __pyx_ptype_14pointdexter1_a_A;
282 if (PyType_Ready(&__pyx_type_14pointdexter1_b_B) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
283 if (PyObject_SetAttrString(__pyx_m, "B", (PyObject *)&__pyx_type_14pointdexter1_b_B) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
284 __pyx_ptype_14pointdexter1_b_B = &__pyx_type_14pointdexter1_b_B;
285 return;
286 __pyx_L1:;
287 __Pyx_AddTraceback("pointdexter1_b");
288 }
290 static char *__pyx_filenames[] = {
291 "pointdexter1_b.pyx",
292 };
294 /* Runtime support code */
296 static void __pyx_init_filenames(void) {
297 __pyx_f = __pyx_filenames;
298 }
300 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
301 while (t->p) {
302 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
303 if (!*t->p)
304 return -1;
305 if (t->i)
306 PyString_InternInPlace(t->p);
307 ++t;
308 }
309 return 0;
310 }
312 #ifndef __PYX_HAVE_RT_ImportType
313 #define __PYX_HAVE_RT_ImportType
314 static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,
315 long size)
316 {
317 PyObject *py_module = 0;
318 PyObject *result = 0;
320 py_module = __Pyx_ImportModule(module_name);
321 if (!py_module)
322 goto bad;
323 result = PyObject_GetAttrString(py_module, class_name);
324 if (!result)
325 goto bad;
326 if (!PyType_Check(result)) {
327 PyErr_Format(PyExc_TypeError,
328 "%s.%s is not a type object",
329 module_name, class_name);
330 goto bad;
331 }
332 if (((PyTypeObject *)result)->tp_basicsize != size) {
333 PyErr_Format(PyExc_ValueError,
334 "%s.%s does not appear to be the correct type object",
335 module_name, class_name);
336 goto bad;
337 }
338 return (PyTypeObject *)result;
339 bad:
340 Py_XDECREF(result);
341 return 0;
342 }
343 #endif
345 #ifndef __PYX_HAVE_RT_ImportModule
346 #define __PYX_HAVE_RT_ImportModule
347 static PyObject *__Pyx_ImportModule(char *name) {
348 PyObject *py_name = 0;
350 py_name = PyString_FromString(name);
351 if (!py_name)
352 goto bad;
353 return PyImport_Import(py_name);
354 bad:
355 Py_XDECREF(py_name);
356 return 0;
357 }
358 #endif
360 #include "compile.h"
361 #include "frameobject.h"
362 #include "traceback.h"
364 static void __Pyx_AddTraceback(char *funcname) {
365 PyObject *py_srcfile = 0;
366 PyObject *py_funcname = 0;
367 PyObject *py_globals = 0;
368 PyObject *empty_tuple = 0;
369 PyObject *empty_string = 0;
370 PyCodeObject *py_code = 0;
371 PyFrameObject *py_frame = 0;
373 py_srcfile = PyString_FromString(__pyx_filename);
374 if (!py_srcfile) goto bad;
375 py_funcname = PyString_FromString(funcname);
376 if (!py_funcname) goto bad;
377 py_globals = PyModule_GetDict(__pyx_m);
378 if (!py_globals) goto bad;
379 empty_tuple = PyTuple_New(0);
380 if (!empty_tuple) goto bad;
381 empty_string = PyString_FromString("");
382 if (!empty_string) goto bad;
383 py_code = PyCode_New(
384 0, /*int argcount,*/
385 0, /*int nlocals,*/
386 0, /*int stacksize,*/
387 0, /*int flags,*/
388 empty_string, /*PyObject *code,*/
389 empty_tuple, /*PyObject *consts,*/
390 empty_tuple, /*PyObject *names,*/
391 empty_tuple, /*PyObject *varnames,*/
392 empty_tuple, /*PyObject *freevars,*/
393 empty_tuple, /*PyObject *cellvars,*/
394 py_srcfile, /*PyObject *filename,*/
395 py_funcname, /*PyObject *name,*/
396 __pyx_lineno, /*int firstlineno,*/
397 empty_string /*PyObject *lnotab*/
398 );
399 if (!py_code) goto bad;
400 py_frame = PyFrame_New(
401 PyThreadState_Get(), /*PyThreadState *tstate,*/
402 py_code, /*PyCodeObject *code,*/
403 py_globals, /*PyObject *globals,*/
404 0 /*PyObject *locals*/
405 );
406 if (!py_frame) goto bad;
407 py_frame->f_lineno = __pyx_lineno;
408 PyTraceBack_Here(py_frame);
409 bad:
410 Py_XDECREF(py_srcfile);
411 Py_XDECREF(py_funcname);
412 Py_XDECREF(empty_tuple);
413 Py_XDECREF(empty_string);
414 Py_XDECREF(py_code);
415 Py_XDECREF(py_frame);
416 }