Cython has moved to github.
pyrex
view Tests/Bugs/other/Reference/rodriguez_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 PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
43 static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
45 static void __Pyx_AddTraceback(char *funcname); /*proto*/
47 /* Declarations from rodriguez_1 */
51 static __Pyx_StringTabEntry __pyx_string_tab[] = {
52 {&__pyx_n_B, 1, __pyx_k1, sizeof(__pyx_k1)},
53 {&__pyx_n___init__, 1, __pyx_k2, sizeof(__pyx_k2)},
54 {&__pyx_n_t, 1, __pyx_k3, sizeof(__pyx_k3)},
55 {0, 0, 0, 0}
56 };
58 /* Implementation of rodriguez_1 */
63 static PyObject *__pyx_f_11rodriguez_1_1B___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
64 static PyMethodDef __pyx_mdef_11rodriguez_1_1B___init__ = {"__init__", (PyCFunction)__pyx_f_11rodriguez_1_1B___init__, METH_VARARGS|METH_KEYWORDS, 0};
65 static PyObject *__pyx_f_11rodriguez_1_1B___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
66 PyObject *__pyx_v_self = 0;
67 PyObject *__pyx_r;
68 PyObject *__pyx_1 = 0;
69 PyObject *__pyx_2 = 0;
70 PyObject *__pyx_3 = 0;
71 PyObject *__pyx_4 = 0;
72 PyObject *__pyx_5 = 0;
73 PyObject *__pyx_6 = 0;
74 static char *__pyx_argnames[] = {"self",0};
75 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_self)) return 0;
76 Py_INCREF(__pyx_v_self);
77 __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
78 __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
79 __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
80 __pyx_4 = PyInt_FromLong(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
81 __pyx_5 = PyInt_FromLong(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
82 __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
83 PyTuple_SET_ITEM(__pyx_6, 0, __pyx_3);
84 PyTuple_SET_ITEM(__pyx_6, 1, __pyx_4);
85 PyTuple_SET_ITEM(__pyx_6, 2, __pyx_5);
86 __pyx_3 = 0;
87 __pyx_4 = 0;
88 __pyx_5 = 0;
89 __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
90 PyTuple_SET_ITEM(__pyx_3, 0, __pyx_6);
91 __pyx_6 = 0;
92 if (PyDict_SetItem(__pyx_1, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
93 Py_DECREF(__pyx_2); __pyx_2 = 0;
94 Py_DECREF(__pyx_3); __pyx_3 = 0;
95 __pyx_4 = PyInt_FromLong(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
96 __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
97 __pyx_6 = PyInt_FromLong(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
98 __pyx_2 = PyInt_FromLong(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
99 __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
100 PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
101 PyTuple_SET_ITEM(__pyx_3, 1, __pyx_6);
102 PyTuple_SET_ITEM(__pyx_3, 2, __pyx_2);
103 __pyx_5 = 0;
104 __pyx_6 = 0;
105 __pyx_2 = 0;
106 if (PyDict_SetItem(__pyx_1, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
107 Py_DECREF(__pyx_4); __pyx_4 = 0;
108 Py_DECREF(__pyx_3); __pyx_3 = 0;
109 if (PyObject_SetAttr(__pyx_v_self, __pyx_n_t, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
110 Py_DECREF(__pyx_1); __pyx_1 = 0;
112 __pyx_r = Py_None; Py_INCREF(Py_None);
113 goto __pyx_L0;
114 __pyx_L1:;
115 Py_XDECREF(__pyx_1);
116 Py_XDECREF(__pyx_2);
117 Py_XDECREF(__pyx_3);
118 Py_XDECREF(__pyx_4);
119 Py_XDECREF(__pyx_5);
120 Py_XDECREF(__pyx_6);
121 __Pyx_AddTraceback("rodriguez_1.B.__init__");
122 __pyx_r = 0;
123 __pyx_L0:;
124 Py_DECREF(__pyx_v_self);
125 return __pyx_r;
126 }
129 static struct PyMethodDef __pyx_methods[] = {
130 {0, 0, 0, 0}
131 };
133 static void __pyx_init_filenames(void); /*proto*/
135 PyMODINIT_FUNC initrodriguez_1(void); /*proto*/
136 PyMODINIT_FUNC initrodriguez_1(void) {
137 PyObject *__pyx_1 = 0;
138 PyObject *__pyx_2 = 0;
139 PyObject *__pyx_3 = 0;
140 PyObject *__pyx_4 = 0;
141 __pyx_init_filenames();
142 __pyx_m = Py_InitModule4("rodriguez_1", __pyx_methods, 0, 0, PYTHON_API_VERSION);
143 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
144 Py_INCREF(__pyx_m);
145 __pyx_b = PyImport_AddModule("__builtin__");
146 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
147 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
148 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
149 __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
150 __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
151 __pyx_3 = __Pyx_CreateClass(__pyx_2, __pyx_1, __pyx_n_B, "rodriguez_1"); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
152 Py_DECREF(__pyx_2); __pyx_2 = 0;
153 __pyx_2 = PyCFunction_New(&__pyx_mdef_11rodriguez_1_1B___init__, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;}
154 __pyx_4 = PyMethod_New(__pyx_2, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;}
155 Py_DECREF(__pyx_2); __pyx_2 = 0;
156 if (PyObject_SetAttr(__pyx_3, __pyx_n___init__, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; goto __pyx_L1;}
157 Py_DECREF(__pyx_4); __pyx_4 = 0;
158 if (PyObject_SetAttr(__pyx_m, __pyx_n_B, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
159 Py_DECREF(__pyx_3); __pyx_3 = 0;
160 Py_DECREF(__pyx_1); __pyx_1 = 0;
161 return;
162 __pyx_L1:;
163 Py_XDECREF(__pyx_1);
164 Py_XDECREF(__pyx_2);
165 Py_XDECREF(__pyx_3);
166 Py_XDECREF(__pyx_4);
167 __Pyx_AddTraceback("rodriguez_1");
168 }
170 static char *__pyx_filenames[] = {
171 "rodriguez_1.pyx",
172 };
174 /* Runtime support code */
176 static void __pyx_init_filenames(void) {
177 __pyx_f = __pyx_filenames;
178 }
180 static PyObject *__Pyx_CreateClass(
181 PyObject *bases, PyObject *dict, PyObject *name, char *modname)
182 {
183 PyObject *py_modname;
184 PyObject *result = 0;
186 py_modname = PyString_FromString(modname);
187 if (!py_modname)
188 goto bad;
189 if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
190 goto bad;
191 result = PyClass_New(bases, dict, name);
192 bad:
193 Py_XDECREF(py_modname);
194 return result;
195 }
197 static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
198 while (t->p) {
199 *t->p = PyString_InternFromString(t->s);
200 if (!*t->p)
201 return -1;
202 ++t;
203 }
204 return 0;
205 }
207 #include "compile.h"
208 #include "frameobject.h"
209 #include "traceback.h"
211 static void __Pyx_AddTraceback(char *funcname) {
212 PyObject *py_srcfile = 0;
213 PyObject *py_funcname = 0;
214 PyObject *py_globals = 0;
215 PyObject *empty_tuple = 0;
216 PyObject *empty_string = 0;
217 PyCodeObject *py_code = 0;
218 PyFrameObject *py_frame = 0;
220 py_srcfile = PyString_FromString(__pyx_filename);
221 if (!py_srcfile) goto bad;
222 py_funcname = PyString_FromString(funcname);
223 if (!py_funcname) goto bad;
224 py_globals = PyModule_GetDict(__pyx_m);
225 if (!py_globals) goto bad;
226 empty_tuple = PyTuple_New(0);
227 if (!empty_tuple) goto bad;
228 empty_string = PyString_FromString("");
229 if (!empty_string) goto bad;
230 py_code = PyCode_New(
231 0, /*int argcount,*/
232 0, /*int nlocals,*/
233 0, /*int stacksize,*/
234 0, /*int flags,*/
235 empty_string, /*PyObject *code,*/
236 empty_tuple, /*PyObject *consts,*/
237 empty_tuple, /*PyObject *names,*/
238 empty_tuple, /*PyObject *varnames,*/
239 empty_tuple, /*PyObject *freevars,*/
240 empty_tuple, /*PyObject *cellvars,*/
241 py_srcfile, /*PyObject *filename,*/
242 py_funcname, /*PyObject *name,*/
243 __pyx_lineno, /*int firstlineno,*/
244 empty_string /*PyObject *lnotab*/
245 );
246 if (!py_code) goto bad;
247 py_frame = PyFrame_New(
248 PyThreadState_Get(), /*PyThreadState *tstate,*/
249 py_code, /*PyCodeObject *code,*/
250 py_globals, /*PyObject *globals,*/
251 0 /*PyObject *locals*/
252 );
253 if (!py_frame) goto bad;
254 py_frame->f_lineno = __pyx_lineno;
255 PyTraceBack_Here(py_frame);
256 bad:
257 Py_XDECREF(py_srcfile);
258 Py_XDECREF(py_funcname);
259 Py_XDECREF(empty_tuple);
260 Py_XDECREF(empty_string);
261 Py_XDECREF(py_code);
262 Py_XDECREF(py_frame);
263 }
