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