Cython has moved to github.

pyrex

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