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