Cython has moved to github.
pyrex
view Tests/Bugs/belchenko/Reference/belchenko2.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>
30 #include "module.h"
33 typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
34 typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
36 static PyObject *__pyx_m;
37 static PyObject *__pyx_b;
38 static int __pyx_lineno;
39 static char *__pyx_filename;
40 static char **__pyx_f;
42 static void __Pyx_AddTraceback(char *funcname); /*proto*/
44 /* Declarations from belchenko2 */
48 static __Pyx_StringTabEntry __pyx_string_tab[] = {
49 {0, 0, 0, 0}
50 };
52 /* Implementation of belchenko2 */
54 static PyObject *__pyx_f_10belchenko2_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
55 static PyObject *__pyx_f_10belchenko2_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
56 unsigned char __pyx_v_pixel;
57 PyObject *__pyx_r;
58 static char *__pyx_argnames[] = {"pixel",0};
59 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "B", __pyx_argnames, &__pyx_v_pixel)) return 0;
60 c_func(__pyx_v_pixel);
62 __pyx_r = Py_None; Py_INCREF(Py_None);
63 return __pyx_r;
64 }
66 static PyObject *__pyx_f_10belchenko2_g(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
67 static PyObject *__pyx_f_10belchenko2_g(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
68 signed char __pyx_v_pixel;
69 PyObject *__pyx_r;
70 static char *__pyx_argnames[] = {"pixel",0};
71 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "b", __pyx_argnames, &__pyx_v_pixel)) return 0;
72 c_func(__pyx_v_pixel);
74 __pyx_r = Py_None; Py_INCREF(Py_None);
75 return __pyx_r;
76 }
78 static PyObject *__pyx_f_10belchenko2_h(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
79 static PyObject *__pyx_f_10belchenko2_h(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
80 char __pyx_v_pixel;
81 PyObject *__pyx_r;
82 static char *__pyx_argnames[] = {"pixel",0};
83 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "b", __pyx_argnames, &__pyx_v_pixel)) return 0;
84 c_func(__pyx_v_pixel);
86 __pyx_r = Py_None; Py_INCREF(Py_None);
87 return __pyx_r;
88 }
90 static struct PyMethodDef __pyx_methods[] = {
91 {"f", (PyCFunction)__pyx_f_10belchenko2_f, METH_VARARGS|METH_KEYWORDS, 0},
92 {"g", (PyCFunction)__pyx_f_10belchenko2_g, METH_VARARGS|METH_KEYWORDS, 0},
93 {"h", (PyCFunction)__pyx_f_10belchenko2_h, METH_VARARGS|METH_KEYWORDS, 0},
94 {0, 0, 0, 0}
95 };
97 static void __pyx_init_filenames(void); /*proto*/
99 PyMODINIT_FUNC initbelchenko2(void); /*proto*/
100 PyMODINIT_FUNC initbelchenko2(void) {
101 __pyx_init_filenames();
102 __pyx_m = Py_InitModule4("belchenko2", __pyx_methods, 0, 0, PYTHON_API_VERSION);
103 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
104 Py_INCREF(__pyx_m);
105 __pyx_b = PyImport_AddModule("__builtin__");
106 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
107 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
108 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
110 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/belchenko/belchenko2.pyx":10 */
111 return;
112 __pyx_L1:;
113 __Pyx_AddTraceback("belchenko2");
114 }
116 static char *__pyx_filenames[] = {
117 "belchenko2.pyx",
118 };
120 /* Runtime support code */
122 static void __pyx_init_filenames(void) {
123 __pyx_f = __pyx_filenames;
124 }
126 #include "compile.h"
127 #include "frameobject.h"
128 #include "traceback.h"
130 static void __Pyx_AddTraceback(char *funcname) {
131 PyObject *py_srcfile = 0;
132 PyObject *py_funcname = 0;
133 PyObject *py_globals = 0;
134 PyObject *empty_tuple = 0;
135 PyObject *empty_string = 0;
136 PyCodeObject *py_code = 0;
137 PyFrameObject *py_frame = 0;
139 py_srcfile = PyString_FromString(__pyx_filename);
140 if (!py_srcfile) goto bad;
141 py_funcname = PyString_FromString(funcname);
142 if (!py_funcname) goto bad;
143 py_globals = PyModule_GetDict(__pyx_m);
144 if (!py_globals) goto bad;
145 empty_tuple = PyTuple_New(0);
146 if (!empty_tuple) goto bad;
147 empty_string = PyString_FromString("");
148 if (!empty_string) goto bad;
149 py_code = PyCode_New(
150 0, /*int argcount,*/
151 0, /*int nlocals,*/
152 0, /*int stacksize,*/
153 0, /*int flags,*/
154 empty_string, /*PyObject *code,*/
155 empty_tuple, /*PyObject *consts,*/
156 empty_tuple, /*PyObject *names,*/
157 empty_tuple, /*PyObject *varnames,*/
158 empty_tuple, /*PyObject *freevars,*/
159 empty_tuple, /*PyObject *cellvars,*/
160 py_srcfile, /*PyObject *filename,*/
161 py_funcname, /*PyObject *name,*/
162 __pyx_lineno, /*int firstlineno,*/
163 empty_string /*PyObject *lnotab*/
164 );
165 if (!py_code) goto bad;
166 py_frame = PyFrame_New(
167 PyThreadState_Get(), /*PyThreadState *tstate,*/
168 py_code, /*PyCodeObject *code,*/
169 py_globals, /*PyObject *globals,*/
170 0 /*PyObject *locals*/
171 );
172 if (!py_frame) goto bad;
173 py_frame->f_lineno = __pyx_lineno;
174 PyTraceBack_Here(py_frame);
175 bad:
176 Py_XDECREF(py_srcfile);
177 Py_XDECREF(py_funcname);
178 Py_XDECREF(empty_tuple);
179 Py_XDECREF(empty_string);
180 Py_XDECREF(py_code);
181 Py_XDECREF(py_frame);
182 }
