Cython has moved to github.

pyrex

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