Cython has moved to github.

pyrex

view Tests/Runnable1/Reference/r_argdefault.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 fe7bb820834c
children
line source
1 #include "Python.h"
3 #define const
6 static PyObject *__Pyx_UnpackItem(PyObject *, int);
7 static int __Pyx_EndUnpack(PyObject *, int);
8 static int __Pyx_PrintItem(PyObject *);
9 static int __Pyx_PrintNewline(void);
10 static void __Pyx_ReRaise(void);
11 static void __Pyx_RaiseWithTraceback(PyObject *, PyObject *, PyObject *);
12 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list);
13 static PyObject *__Pyx_GetExcValue(void);
14 static PyObject *__Pyx_GetName(PyObject *dict, char *name);
15 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, char *name);
16 static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
18 static PyObject *__pyx_m;
19 static PyObject *__pyx_b;
21 static char (__pyx_k4[]) = "This swallow is called";
22 static char (__pyx_k5[]) = "This swallow is flying at";
23 static char (__pyx_k6[]) = "furlongs per fortnight";
24 static char (__pyx_k7[]) = "This swallow is carrying";
25 static char (__pyx_k8[]) = "coconuts";
27 static PyObject *__pyx_f_swallow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28 static PyObject *__pyx_f_swallow(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29 PyObject *__pyx_v_name = 0;
30 PyObject *__pyx_v_airspeed = 0;
31 PyObject *__pyx_v_coconuts = 0;
32 PyObject *__pyx_r;
33 PyObject *__pyx_1 = 0;
34 int __pyx_2;
35 static char *__pyx_argnames[] = {"name","airspeed","coconuts",0};
36 __pyx_v_name = __pyx_k1;
37 __pyx_v_airspeed = __pyx_k2;
38 __pyx_v_coconuts = __pyx_k3;
39 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_name, &__pyx_v_airspeed, &__pyx_v_coconuts)) return 0;
40 Py_INCREF(__pyx_v_name);
41 Py_INCREF(__pyx_v_airspeed);
42 Py_INCREF(__pyx_v_coconuts);
44 /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":2 */
45 __pyx_1 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_1) goto __pyx_L1;
46 __pyx_2 = __pyx_v_name != __pyx_1;
47 Py_DECREF(__pyx_1); __pyx_1 = 0;
48 if (__pyx_2) {
50 /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":3 */
51 __pyx_1 = PyString_FromString(__pyx_k4); if (!__pyx_1) goto __pyx_L1;
52 if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
53 Py_DECREF(__pyx_1); __pyx_1 = 0;
54 if (__Pyx_PrintItem(__pyx_v_name) < 0) goto __pyx_L1;
55 if (__Pyx_PrintNewline() < 0) goto __pyx_L1;
56 goto __pyx_L2;
57 }
58 __pyx_L2:;
60 /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":4 */
61 __pyx_1 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_1) goto __pyx_L1;
62 __pyx_2 = __pyx_v_airspeed != __pyx_1;
63 Py_DECREF(__pyx_1); __pyx_1 = 0;
64 if (__pyx_2) {
66 /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":5 */
67 __pyx_1 = PyString_FromString(__pyx_k5); if (!__pyx_1) goto __pyx_L1;
68 if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
69 Py_DECREF(__pyx_1); __pyx_1 = 0;
70 if (__Pyx_PrintItem(__pyx_v_airspeed) < 0) goto __pyx_L1;
71 __pyx_1 = PyString_FromString(__pyx_k6); if (!__pyx_1) goto __pyx_L1;
72 if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
73 Py_DECREF(__pyx_1); __pyx_1 = 0;
74 if (__Pyx_PrintNewline() < 0) goto __pyx_L1;
75 goto __pyx_L3;
76 }
77 __pyx_L3:;
79 /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":6 */
80 __pyx_1 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_1) goto __pyx_L1;
81 __pyx_2 = __pyx_v_coconuts != __pyx_1;
82 Py_DECREF(__pyx_1); __pyx_1 = 0;
83 if (__pyx_2) {
85 /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":7 */
86 __pyx_1 = PyString_FromString(__pyx_k7); if (!__pyx_1) goto __pyx_L1;
87 if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
88 Py_DECREF(__pyx_1); __pyx_1 = 0;
89 if (__Pyx_PrintItem(__pyx_v_coconuts) < 0) goto __pyx_L1;
90 __pyx_1 = PyString_FromString(__pyx_k8); if (!__pyx_1) goto __pyx_L1;
91 if (__Pyx_PrintItem(__pyx_1) < 0) goto __pyx_L1;
92 Py_DECREF(__pyx_1); __pyx_1 = 0;
93 if (__Pyx_PrintNewline() < 0) goto __pyx_L1;
94 goto __pyx_L4;
95 }
96 __pyx_L4:;
98 __pyx_r = Py_None; Py_INCREF(__pyx_r);
99 goto __pyx_L0;
100 __pyx_L1:;
101 Py_XDECREF(__pyx_1);
102 __pyx_r = 0;
103 __pyx_L0:;
104 Py_DECREF(__pyx_v_name);
105 Py_DECREF(__pyx_v_airspeed);
106 Py_DECREF(__pyx_v_coconuts);
107 return __pyx_r;
108 }
110 static struct PyMethodDef __pyx_methods[] = {
111 {"swallow", (PyCFunction)__pyx_f_swallow, METH_VARARGS|METH_KEYWORDS, 0},
112 {0, 0, 0, 0}
113 };
116 void initr_argdefault(void); /*proto*/
117 void initr_argdefault(void) {
118 PyObject *__pyx_1 = 0;
119 PyObject *__pyx_2 = 0;
120 PyObject *__pyx_3 = 0;
121 __pyx_m = Py_InitModule4("r_argdefault", __pyx_methods, 0, 0, PYTHON_API_VERSION);
122 __pyx_b = PyImport_AddModule("__builtin__");
123 PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b);
125 /* "ProjectsA:Python:Pyrex:Tests:Runnable:r_argdefault.pyx":1 */
126 __pyx_1 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_1) goto __pyx_L1;
127 __pyx_k1 = __pyx_1;
128 __pyx_1 = 0;
129 __pyx_2 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_2) goto __pyx_L1;
130 __pyx_k2 = __pyx_2;
131 __pyx_2 = 0;
132 __pyx_3 = __Pyx_GetName(__pyx_b, "None"); if (!__pyx_3) goto __pyx_L1;
133 __pyx_k3 = __pyx_3;
134 __pyx_3 = 0;
135 return;
136 __pyx_L1:;
137 Py_XDECREF(__pyx_1);
138 Py_XDECREF(__pyx_2);
139 Py_XDECREF(__pyx_3);
140 }
142 /* Runtime support code */
144 static PyObject *__Pyx_GetName(PyObject *dict, char *name) {
145 PyObject *result;
146 result = PyObject_GetAttrString(dict, name);
147 if (!result)
148 PyErr_SetString(PyExc_NameError, name);
149 return result;
150 }
152 static PyObject *__Pyx_GetStdout(void) {
153 PyObject *f = PySys_GetObject("stdout");
154 if (!f) {
155 PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
156 }
157 return f;
158 }
160 static int __Pyx_PrintItem(PyObject *v) {
161 PyObject *f;
163 if (!(f = __Pyx_GetStdout()))
164 return -1;
165 if (PyFile_SoftSpace(f, 1)) {
166 if (PyFile_WriteString(" ", f) < 0)
167 return -1;
168 }
169 if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
170 return -1;
171 if (PyString_Check(v)) {
172 char *s = PyString_AsString(v);
173 int len = PyString_Size(v);
174 if (len > 0 &&
175 isspace(Py_CHARMASK(s[len-1])) &&
176 s[len-1] != ' ')
177 PyFile_SoftSpace(f, 0);
178 }
179 return 0;
180 }
182 static int __Pyx_PrintNewline(void) {
183 PyObject *f;
185 if (!(f = __Pyx_GetStdout()))
186 return -1;
187 if (PyFile_WriteString("\n", f) < 0)
188 return -1;
189 PyFile_SoftSpace(f, 0);
190 return 0;
191 }