Cython has moved to github.

pyrex

view Tests/Bugs/other/rovner_1.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 rovner_1 */
47 /* Declarations from implementation of rovner_1 */
49 struct __pyx_obj_8rovner_1_DD {
50 PyObject_HEAD
51 };
54 static PyTypeObject *__pyx_ptype_8rovner_1_DD = 0;
56 static char __pyx_k1[] = "close";
58 static PyObject *__pyx_n_close;
61 static __Pyx_StringTabEntry __pyx_string_tab[] = {
62 {&__pyx_n_close, 1, __pyx_k1, sizeof(__pyx_k1)},
63 {0, 0, 0, 0}
64 };
68 /* Implementation of rovner_1 */
70 static PyObject *__pyx_f_8rovner_1_2DD_term(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
71 static PyObject *__pyx_f_8rovner_1_2DD_term(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
72 PyObject *__pyx_r;
73 PyObject *__pyx_1 = 0;
74 PyObject *__pyx_2 = 0;
75 static char *__pyx_argnames[] = {0};
76 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
77 Py_INCREF(__pyx_v_self);
78 __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_close); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
79 __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
80 Py_DECREF(__pyx_1); __pyx_1 = 0;
81 Py_DECREF(__pyx_2); __pyx_2 = 0;
83 __pyx_r = Py_None; Py_INCREF(Py_None);
84 goto __pyx_L0;
85 __pyx_L1:;
86 Py_XDECREF(__pyx_1);
87 Py_XDECREF(__pyx_2);
88 __Pyx_AddTraceback("rovner_1.DD.term");
89 __pyx_r = 0;
90 __pyx_L0:;
91 Py_DECREF(__pyx_v_self);
92 return __pyx_r;
93 }
95 static PyObject *__pyx_f_8rovner_1_2DD_close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
96 static PyObject *__pyx_f_8rovner_1_2DD_close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
97 PyObject *__pyx_r;
98 static char *__pyx_argnames[] = {0};
99 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
100 Py_INCREF(__pyx_v_self);
102 __pyx_r = Py_None; Py_INCREF(Py_None);
103 Py_DECREF(__pyx_v_self);
104 return __pyx_r;
105 }
107 static PyObject *__pyx_tp_new_8rovner_1_DD(PyTypeObject *t, PyObject *a, PyObject *k) {
108 PyObject *o = (*t->tp_alloc)(t, 0);
109 if (!o) return 0;
110 return o;
111 }
113 static void __pyx_tp_dealloc_8rovner_1_DD(PyObject *o) {
114 (*o->ob_type->tp_free)(o);
115 }
117 static struct PyMethodDef __pyx_methods_8rovner_1_DD[] = {
118 {"term", (PyCFunction)__pyx_f_8rovner_1_2DD_term, METH_VARARGS|METH_KEYWORDS, 0},
119 {"close", (PyCFunction)__pyx_f_8rovner_1_2DD_close, METH_VARARGS|METH_KEYWORDS, 0},
120 {0, 0, 0, 0}
121 };
123 static PyNumberMethods __pyx_tp_as_number_DD = {
124 0, /*nb_add*/
125 0, /*nb_subtract*/
126 0, /*nb_multiply*/
127 0, /*nb_divide*/
128 0, /*nb_remainder*/
129 0, /*nb_divmod*/
130 0, /*nb_power*/
131 0, /*nb_negative*/
132 0, /*nb_positive*/
133 0, /*nb_absolute*/
134 0, /*nb_nonzero*/
135 0, /*nb_invert*/
136 0, /*nb_lshift*/
137 0, /*nb_rshift*/
138 0, /*nb_and*/
139 0, /*nb_xor*/
140 0, /*nb_or*/
141 0, /*nb_coerce*/
142 0, /*nb_int*/
143 0, /*nb_long*/
144 0, /*nb_float*/
145 0, /*nb_oct*/
146 0, /*nb_hex*/
147 0, /*nb_inplace_add*/
148 0, /*nb_inplace_subtract*/
149 0, /*nb_inplace_multiply*/
150 0, /*nb_inplace_divide*/
151 0, /*nb_inplace_remainder*/
152 0, /*nb_inplace_power*/
153 0, /*nb_inplace_lshift*/
154 0, /*nb_inplace_rshift*/
155 0, /*nb_inplace_and*/
156 0, /*nb_inplace_xor*/
157 0, /*nb_inplace_or*/
158 0, /*nb_floor_divide*/
159 0, /*nb_true_divide*/
160 0, /*nb_inplace_floor_divide*/
161 0, /*nb_inplace_true_divide*/
162 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
163 0, /*nb_index*/
164 #endif
165 };
167 static PySequenceMethods __pyx_tp_as_sequence_DD = {
168 0, /*sq_length*/
169 0, /*sq_concat*/
170 0, /*sq_repeat*/
171 0, /*sq_item*/
172 0, /*sq_slice*/
173 0, /*sq_ass_item*/
174 0, /*sq_ass_slice*/
175 0, /*sq_contains*/
176 0, /*sq_inplace_concat*/
177 0, /*sq_inplace_repeat*/
178 };
180 static PyMappingMethods __pyx_tp_as_mapping_DD = {
181 0, /*mp_length*/
182 0, /*mp_subscript*/
183 0, /*mp_ass_subscript*/
184 };
186 static PyBufferProcs __pyx_tp_as_buffer_DD = {
187 0, /*bf_getreadbuffer*/
188 0, /*bf_getwritebuffer*/
189 0, /*bf_getsegcount*/
190 0, /*bf_getcharbuffer*/
191 };
193 PyTypeObject __pyx_type_8rovner_1_DD = {
194 PyObject_HEAD_INIT(0)
195 0, /*ob_size*/
196 "rovner_1.DD", /*tp_name*/
197 sizeof(struct __pyx_obj_8rovner_1_DD), /*tp_basicsize*/
198 0, /*tp_itemsize*/
199 __pyx_tp_dealloc_8rovner_1_DD, /*tp_dealloc*/
200 0, /*tp_print*/
201 0, /*tp_getattr*/
202 0, /*tp_setattr*/
203 0, /*tp_compare*/
204 0, /*tp_repr*/
205 &__pyx_tp_as_number_DD, /*tp_as_number*/
206 &__pyx_tp_as_sequence_DD, /*tp_as_sequence*/
207 &__pyx_tp_as_mapping_DD, /*tp_as_mapping*/
208 0, /*tp_hash*/
209 0, /*tp_call*/
210 0, /*tp_str*/
211 0, /*tp_getattro*/
212 0, /*tp_setattro*/
213 &__pyx_tp_as_buffer_DD, /*tp_as_buffer*/
214 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
215 0, /*tp_doc*/
216 0, /*tp_traverse*/
217 0, /*tp_clear*/
218 0, /*tp_richcompare*/
219 0, /*tp_weaklistoffset*/
220 0, /*tp_iter*/
221 0, /*tp_iternext*/
222 __pyx_methods_8rovner_1_DD, /*tp_methods*/
223 0, /*tp_members*/
224 0, /*tp_getset*/
225 0, /*tp_base*/
226 0, /*tp_dict*/
227 0, /*tp_descr_get*/
228 0, /*tp_descr_set*/
229 0, /*tp_dictoffset*/
230 0, /*tp_init*/
231 0, /*tp_alloc*/
232 __pyx_tp_new_8rovner_1_DD, /*tp_new*/
233 0, /*tp_free*/
234 0, /*tp_is_gc*/
235 0, /*tp_bases*/
236 0, /*tp_mro*/
237 0, /*tp_cache*/
238 0, /*tp_subclasses*/
239 0, /*tp_weaklist*/
240 };
242 static struct PyMethodDef __pyx_methods[] = {
243 {0, 0, 0, 0}
244 };
246 static void __pyx_init_filenames(void); /*proto*/
248 PyMODINIT_FUNC initrovner_1(void); /*proto*/
249 PyMODINIT_FUNC initrovner_1(void) {
250 __pyx_init_filenames();
251 __pyx_m = Py_InitModule4("rovner_1", __pyx_methods, 0, 0, PYTHON_API_VERSION);
252 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
253 Py_INCREF(__pyx_m);
254 __pyx_b = PyImport_AddModule("__builtin__");
255 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
256 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
257 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
258 if (PyType_Ready(&__pyx_type_8rovner_1_DD) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
259 if (PyObject_SetAttrString(__pyx_m, "DD", (PyObject *)&__pyx_type_8rovner_1_DD) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
260 __pyx_ptype_8rovner_1_DD = &__pyx_type_8rovner_1_DD;
262 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/other/rovner_1.pyx":10 */
263 return;
264 __pyx_L1:;
265 __Pyx_AddTraceback("rovner_1");
266 }
268 static char *__pyx_filenames[] = {
269 "rovner_1.pyx",
270 };
272 /* Runtime support code */
274 static void __pyx_init_filenames(void) {
275 __pyx_f = __pyx_filenames;
276 }
278 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
279 while (t->p) {
280 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
281 if (!*t->p)
282 return -1;
283 if (t->i)
284 PyString_InternInPlace(t->p);
285 ++t;
286 }
287 return 0;
288 }
290 #include "compile.h"
291 #include "frameobject.h"
292 #include "traceback.h"
294 static void __Pyx_AddTraceback(char *funcname) {
295 PyObject *py_srcfile = 0;
296 PyObject *py_funcname = 0;
297 PyObject *py_globals = 0;
298 PyObject *empty_tuple = 0;
299 PyObject *empty_string = 0;
300 PyCodeObject *py_code = 0;
301 PyFrameObject *py_frame = 0;
303 py_srcfile = PyString_FromString(__pyx_filename);
304 if (!py_srcfile) goto bad;
305 py_funcname = PyString_FromString(funcname);
306 if (!py_funcname) goto bad;
307 py_globals = PyModule_GetDict(__pyx_m);
308 if (!py_globals) goto bad;
309 empty_tuple = PyTuple_New(0);
310 if (!empty_tuple) goto bad;
311 empty_string = PyString_FromString("");
312 if (!empty_string) goto bad;
313 py_code = PyCode_New(
314 0, /*int argcount,*/
315 0, /*int nlocals,*/
316 0, /*int stacksize,*/
317 0, /*int flags,*/
318 empty_string, /*PyObject *code,*/
319 empty_tuple, /*PyObject *consts,*/
320 empty_tuple, /*PyObject *names,*/
321 empty_tuple, /*PyObject *varnames,*/
322 empty_tuple, /*PyObject *freevars,*/
323 empty_tuple, /*PyObject *cellvars,*/
324 py_srcfile, /*PyObject *filename,*/
325 py_funcname, /*PyObject *name,*/
326 __pyx_lineno, /*int firstlineno,*/
327 empty_string /*PyObject *lnotab*/
328 );
329 if (!py_code) goto bad;
330 py_frame = PyFrame_New(
331 PyThreadState_Get(), /*PyThreadState *tstate,*/
332 py_code, /*PyCodeObject *code,*/
333 py_globals, /*PyObject *globals,*/
334 0 /*PyObject *locals*/
335 );
336 if (!py_frame) goto bad;
337 py_frame->f_lineno = __pyx_lineno;
338 PyTraceBack_Here(py_frame);
339 bad:
340 Py_XDECREF(py_srcfile);
341 Py_XDECREF(py_funcname);
342 Py_XDECREF(empty_tuple);
343 Py_XDECREF(empty_string);
344 Py_XDECREF(py_code);
345 Py_XDECREF(py_frame);
346 }