Cython has moved to github.

pyrex

view Tests/9/Reference/ia_cdefblock.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_ExportFunction(char *n, void *f, char *s); /*proto*/
43 static void __Pyx_AddTraceback(char *funcname); /*proto*/
45 /* Declarations from ia_cdefblock */
47 struct __pyx_t_12ia_cdefblock_PrivFoo {
48 int i;
49 };
51 struct PubFoo {
52 int i;
53 };
55 struct PubBlargObj {
56 PyObject_HEAD
57 };
59 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PubBlargType;
61 static PyTypeObject *__pyx_ptype_12ia_cdefblock_PubBlarg = 0;
62 static int __pyx_v_12ia_cdefblock_priv_i;
63 DL_EXPORT(int) pub_v;
64 static void __pyx_f_12ia_cdefblock_priv_f(void); /*proto*/
65 __PYX_EXTERN_C DL_EXPORT(void) pub_f(void); /*proto*/
66 static void api_f(void); /*proto*/
67 __PYX_EXTERN_C DL_EXPORT(void) pub_api_f(void); /*proto*/
70 static __Pyx_StringTabEntry __pyx_string_tab[] = {
71 {0, 0, 0, 0}
72 };
74 /* Implementation of ia_cdefblock */
76 static void __pyx_f_12ia_cdefblock_priv_f(void) {
78 /* "/Local/Projects/D/Pyrex/Source/Tests/9/ia_cdefblock.pyx":10 */
79 __pyx_v_12ia_cdefblock_priv_i = 42;
81 }
83 __PYX_EXTERN_C DL_EXPORT(void) pub_f(void) {
85 }
87 static void api_f(void) {
89 }
91 __PYX_EXTERN_C DL_EXPORT(void) pub_api_f(void) {
93 }
95 static PyObject *__pyx_tp_new_12ia_cdefblock_PubBlarg(PyTypeObject *t, PyObject *a, PyObject *k) {
96 PyObject *o = (*t->tp_alloc)(t, 0);
97 if (!o) return 0;
98 return o;
99 }
101 static void __pyx_tp_dealloc_12ia_cdefblock_PubBlarg(PyObject *o) {
102 (*o->ob_type->tp_free)(o);
103 }
105 static struct PyMethodDef __pyx_methods_12ia_cdefblock_PubBlarg[] = {
106 {0, 0, 0, 0}
107 };
109 static PyNumberMethods __pyx_tp_as_number_PubBlarg = {
110 0, /*nb_add*/
111 0, /*nb_subtract*/
112 0, /*nb_multiply*/
113 0, /*nb_divide*/
114 0, /*nb_remainder*/
115 0, /*nb_divmod*/
116 0, /*nb_power*/
117 0, /*nb_negative*/
118 0, /*nb_positive*/
119 0, /*nb_absolute*/
120 0, /*nb_nonzero*/
121 0, /*nb_invert*/
122 0, /*nb_lshift*/
123 0, /*nb_rshift*/
124 0, /*nb_and*/
125 0, /*nb_xor*/
126 0, /*nb_or*/
127 0, /*nb_coerce*/
128 0, /*nb_int*/
129 0, /*nb_long*/
130 0, /*nb_float*/
131 0, /*nb_oct*/
132 0, /*nb_hex*/
133 0, /*nb_inplace_add*/
134 0, /*nb_inplace_subtract*/
135 0, /*nb_inplace_multiply*/
136 0, /*nb_inplace_divide*/
137 0, /*nb_inplace_remainder*/
138 0, /*nb_inplace_power*/
139 0, /*nb_inplace_lshift*/
140 0, /*nb_inplace_rshift*/
141 0, /*nb_inplace_and*/
142 0, /*nb_inplace_xor*/
143 0, /*nb_inplace_or*/
144 0, /*nb_floor_divide*/
145 0, /*nb_true_divide*/
146 0, /*nb_inplace_floor_divide*/
147 0, /*nb_inplace_true_divide*/
148 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
149 0, /*nb_index*/
150 #endif
151 };
153 static PySequenceMethods __pyx_tp_as_sequence_PubBlarg = {
154 0, /*sq_length*/
155 0, /*sq_concat*/
156 0, /*sq_repeat*/
157 0, /*sq_item*/
158 0, /*sq_slice*/
159 0, /*sq_ass_item*/
160 0, /*sq_ass_slice*/
161 0, /*sq_contains*/
162 0, /*sq_inplace_concat*/
163 0, /*sq_inplace_repeat*/
164 };
166 static PyMappingMethods __pyx_tp_as_mapping_PubBlarg = {
167 0, /*mp_length*/
168 0, /*mp_subscript*/
169 0, /*mp_ass_subscript*/
170 };
172 static PyBufferProcs __pyx_tp_as_buffer_PubBlarg = {
173 0, /*bf_getreadbuffer*/
174 0, /*bf_getwritebuffer*/
175 0, /*bf_getsegcount*/
176 0, /*bf_getcharbuffer*/
177 };
179 DL_EXPORT(PyTypeObject) PubBlargType = {
180 PyObject_HEAD_INIT(0)
181 0, /*ob_size*/
182 "ia_cdefblock.PubBlarg", /*tp_name*/
183 sizeof(struct PubBlargObj), /*tp_basicsize*/
184 0, /*tp_itemsize*/
185 __pyx_tp_dealloc_12ia_cdefblock_PubBlarg, /*tp_dealloc*/
186 0, /*tp_print*/
187 0, /*tp_getattr*/
188 0, /*tp_setattr*/
189 0, /*tp_compare*/
190 0, /*tp_repr*/
191 &__pyx_tp_as_number_PubBlarg, /*tp_as_number*/
192 &__pyx_tp_as_sequence_PubBlarg, /*tp_as_sequence*/
193 &__pyx_tp_as_mapping_PubBlarg, /*tp_as_mapping*/
194 0, /*tp_hash*/
195 0, /*tp_call*/
196 0, /*tp_str*/
197 0, /*tp_getattro*/
198 0, /*tp_setattro*/
199 &__pyx_tp_as_buffer_PubBlarg, /*tp_as_buffer*/
200 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
201 0, /*tp_doc*/
202 0, /*tp_traverse*/
203 0, /*tp_clear*/
204 0, /*tp_richcompare*/
205 0, /*tp_weaklistoffset*/
206 0, /*tp_iter*/
207 0, /*tp_iternext*/
208 __pyx_methods_12ia_cdefblock_PubBlarg, /*tp_methods*/
209 0, /*tp_members*/
210 0, /*tp_getset*/
211 0, /*tp_base*/
212 0, /*tp_dict*/
213 0, /*tp_descr_get*/
214 0, /*tp_descr_set*/
215 0, /*tp_dictoffset*/
216 0, /*tp_init*/
217 0, /*tp_alloc*/
218 __pyx_tp_new_12ia_cdefblock_PubBlarg, /*tp_new*/
219 0, /*tp_free*/
220 0, /*tp_is_gc*/
221 0, /*tp_bases*/
222 0, /*tp_mro*/
223 0, /*tp_cache*/
224 0, /*tp_subclasses*/
225 0, /*tp_weaklist*/
226 };
228 static struct PyMethodDef __pyx_methods[] = {
229 {0, 0, 0, 0}
230 };
232 static void __pyx_init_filenames(void); /*proto*/
234 PyMODINIT_FUNC initia_cdefblock(void); /*proto*/
235 PyMODINIT_FUNC initia_cdefblock(void) {
236 __pyx_init_filenames();
237 __pyx_m = Py_InitModule4("ia_cdefblock", __pyx_methods, 0, 0, PYTHON_API_VERSION);
238 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
239 Py_INCREF(__pyx_m);
240 __pyx_b = PyImport_AddModule("__builtin__");
241 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
242 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
243 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
244 if (__Pyx_ExportFunction("api_f", (void*)api_f, "void (void)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
245 if (__Pyx_ExportFunction("pub_api_f", (void*)pub_api_f, "void (void)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
246 if (PyType_Ready(&PubBlargType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
247 if (PyObject_SetAttrString(__pyx_m, "PubBlarg", (PyObject *)&PubBlargType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
248 __pyx_ptype_12ia_cdefblock_PubBlarg = &PubBlargType;
250 /* "/Local/Projects/D/Pyrex/Source/Tests/9/ia_cdefblock.pyx":32 */
251 return;
252 __pyx_L1:;
253 __Pyx_AddTraceback("ia_cdefblock");
254 }
256 static char *__pyx_filenames[] = {
257 "ia_cdefblock.pyx",
258 };
260 /* Runtime support code */
262 static void __pyx_init_filenames(void) {
263 __pyx_f = __pyx_filenames;
264 }
266 static int __Pyx_ExportFunction(char *n, void *f, char *s) {
267 PyObject *d = 0;
268 PyObject *p = 0;
269 d = PyObject_GetAttrString(__pyx_m, "__pyx_capi__");
270 if (!d) {
271 PyErr_Clear();
272 d = PyDict_New();
273 if (!d)
274 goto bad;
275 Py_INCREF(d);
276 if (PyModule_AddObject(__pyx_m, "__pyx_capi__", d) < 0)
277 goto bad;
278 }
279 p = PyCObject_FromVoidPtrAndDesc(f, s, 0);
280 if (!p)
281 goto bad;
282 if (PyDict_SetItemString(d, n, p) < 0)
283 goto bad;
284 Py_DECREF(d);
285 return 0;
286 bad:
287 Py_XDECREF(p);
288 Py_XDECREF(d);
289 return -1;
290 }
292 #include "compile.h"
293 #include "frameobject.h"
294 #include "traceback.h"
296 static void __Pyx_AddTraceback(char *funcname) {
297 PyObject *py_srcfile = 0;
298 PyObject *py_funcname = 0;
299 PyObject *py_globals = 0;
300 PyObject *empty_tuple = 0;
301 PyObject *empty_string = 0;
302 PyCodeObject *py_code = 0;
303 PyFrameObject *py_frame = 0;
305 py_srcfile = PyString_FromString(__pyx_filename);
306 if (!py_srcfile) goto bad;
307 py_funcname = PyString_FromString(funcname);
308 if (!py_funcname) goto bad;
309 py_globals = PyModule_GetDict(__pyx_m);
310 if (!py_globals) goto bad;
311 empty_tuple = PyTuple_New(0);
312 if (!empty_tuple) goto bad;
313 empty_string = PyString_FromString("");
314 if (!empty_string) goto bad;
315 py_code = PyCode_New(
316 0, /*int argcount,*/
317 0, /*int nlocals,*/
318 0, /*int stacksize,*/
319 0, /*int flags,*/
320 empty_string, /*PyObject *code,*/
321 empty_tuple, /*PyObject *consts,*/
322 empty_tuple, /*PyObject *names,*/
323 empty_tuple, /*PyObject *varnames,*/
324 empty_tuple, /*PyObject *freevars,*/
325 empty_tuple, /*PyObject *cellvars,*/
326 py_srcfile, /*PyObject *filename,*/
327 py_funcname, /*PyObject *name,*/
328 __pyx_lineno, /*int firstlineno,*/
329 empty_string /*PyObject *lnotab*/
330 );
331 if (!py_code) goto bad;
332 py_frame = PyFrame_New(
333 PyThreadState_Get(), /*PyThreadState *tstate,*/
334 py_code, /*PyCodeObject *code,*/
335 py_globals, /*PyObject *globals,*/
336 0 /*PyObject *locals*/
337 );
338 if (!py_frame) goto bad;
339 py_frame->f_lineno = __pyx_lineno;
340 PyTraceBack_Here(py_frame);
341 bad:
342 Py_XDECREF(py_srcfile);
343 Py_XDECREF(py_funcname);
344 Py_XDECREF(empty_tuple);
345 Py_XDECREF(empty_string);
346 Py_XDECREF(py_code);
347 Py_XDECREF(py_frame);
348 }