1.1 --- a/vint.c Fri Sep 18 01:06:55 2009 +0200
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,224 +0,0 @@
1.4 -/* Generated by Pyrex 0.9.6.4 on Fri Sep 11 01:26:01 2009 */
1.5 -
1.6 -#define PY_SSIZE_T_CLEAN
1.7 -#include "Python.h"
1.8 -#include "structmember.h"
1.9 -#ifndef PY_LONG_LONG
1.10 - #define PY_LONG_LONG LONG_LONG
1.11 -#endif
1.12 -#if PY_VERSION_HEX < 0x02050000
1.13 - typedef int Py_ssize_t;
1.14 - #define PY_SSIZE_T_MAX INT_MAX
1.15 - #define PY_SSIZE_T_MIN INT_MIN
1.16 - #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
1.17 - #define PyInt_AsSsize_t(o) PyInt_AsLong(o)
1.18 -#endif
1.19 -#ifndef WIN32
1.20 - #ifndef __stdcall
1.21 - #define __stdcall
1.22 - #endif
1.23 - #ifndef __cdecl
1.24 - #define __cdecl
1.25 - #endif
1.26 -#endif
1.27 -#ifdef __cplusplus
1.28 -#define __PYX_EXTERN_C extern "C"
1.29 -#else
1.30 -#define __PYX_EXTERN_C extern
1.31 -#endif
1.32 -#include <math.h>
1.33 -
1.34 -
1.35 -typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
1.36 -typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
1.37 -
1.38 -static PyObject *__pyx_m;
1.39 -static PyObject *__pyx_b;
1.40 -static int __pyx_lineno;
1.41 -static char *__pyx_filename;
1.42 -static char **__pyx_f;
1.43 -
1.44 -static void __Pyx_AddTraceback(char *funcname); /*proto*/
1.45 -
1.46 -/* Declarations from vint */
1.47 -
1.48 -
1.49 -
1.50 -/* Implementation of vint */
1.51 -
1.52 -static PyObject *__pyx_f_4vint_vint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1.53 -static PyObject *__pyx_f_4vint_vint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1.54 - int __pyx_v_number;
1.55 - char __pyx_v_bytes[40];
1.56 - int __pyx_v_lsd;
1.57 - int __pyx_v_i;
1.58 - PyObject *__pyx_v_s;
1.59 - PyObject *__pyx_r;
1.60 - int __pyx_1;
1.61 - PyObject *__pyx_2 = 0;
1.62 - static char *__pyx_argnames[] = {"number",0};
1.63 - if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_number)) return 0;
1.64 - __pyx_v_s = Py_None; Py_INCREF(Py_None);
1.65 -
1.66 - /* "/home/paulb/Software/Python/iixr/vint.pyx":11 */
1.67 - __pyx_1 = (__pyx_v_number < 128);
1.68 - if (__pyx_1) {
1.69 -
1.70 - /* "/home/paulb/Software/Python/iixr/vint.pyx":12 */
1.71 - (__pyx_v_bytes[0]) = __pyx_v_number;
1.72 -
1.73 - /* "/home/paulb/Software/Python/iixr/vint.pyx":13 */
1.74 - __pyx_2 = PyString_FromStringAndSize(__pyx_v_bytes,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
1.75 - Py_DECREF(__pyx_v_s);
1.76 - __pyx_v_s = __pyx_2;
1.77 - __pyx_2 = 0;
1.78 -
1.79 - /* "/home/paulb/Software/Python/iixr/vint.pyx":14 */
1.80 - Py_INCREF(__pyx_v_s);
1.81 - __pyx_r = __pyx_v_s;
1.82 - goto __pyx_L0;
1.83 - goto __pyx_L2;
1.84 - }
1.85 - __pyx_L2:;
1.86 -
1.87 - /* "/home/paulb/Software/Python/iixr/vint.pyx":16 */
1.88 - __pyx_v_i = 0;
1.89 -
1.90 - /* "/home/paulb/Software/Python/iixr/vint.pyx":17 */
1.91 - while (1) {
1.92 - __pyx_1 = (__pyx_v_number != 0);
1.93 - if (!__pyx_1) break;
1.94 -
1.95 - /* "/home/paulb/Software/Python/iixr/vint.pyx":18 */
1.96 - __pyx_v_lsd = (__pyx_v_number & 127);
1.97 -
1.98 - /* "/home/paulb/Software/Python/iixr/vint.pyx":19 */
1.99 - __pyx_v_number = (__pyx_v_number >> 7);
1.100 -
1.101 - /* "/home/paulb/Software/Python/iixr/vint.pyx":20 */
1.102 - __pyx_1 = (__pyx_v_number != 0);
1.103 - if (__pyx_1) {
1.104 - __pyx_v_lsd = (__pyx_v_lsd | 128);
1.105 - goto __pyx_L5;
1.106 - }
1.107 - __pyx_L5:;
1.108 -
1.109 - /* "/home/paulb/Software/Python/iixr/vint.pyx":22 */
1.110 - (__pyx_v_bytes[__pyx_v_i]) = __pyx_v_lsd;
1.111 -
1.112 - /* "/home/paulb/Software/Python/iixr/vint.pyx":23 */
1.113 - __pyx_v_i = (__pyx_v_i + 1);
1.114 - }
1.115 -
1.116 - /* "/home/paulb/Software/Python/iixr/vint.pyx":25 */
1.117 - __pyx_2 = PyString_FromStringAndSize(__pyx_v_bytes,__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;}
1.118 - Py_DECREF(__pyx_v_s);
1.119 - __pyx_v_s = __pyx_2;
1.120 - __pyx_2 = 0;
1.121 -
1.122 - /* "/home/paulb/Software/Python/iixr/vint.pyx":26 */
1.123 - Py_INCREF(__pyx_v_s);
1.124 - __pyx_r = __pyx_v_s;
1.125 - goto __pyx_L0;
1.126 -
1.127 - __pyx_r = Py_None; Py_INCREF(Py_None);
1.128 - goto __pyx_L0;
1.129 - __pyx_L1:;
1.130 - Py_XDECREF(__pyx_2);
1.131 - __Pyx_AddTraceback("vint.vint");
1.132 - __pyx_r = 0;
1.133 - __pyx_L0:;
1.134 - Py_DECREF(__pyx_v_s);
1.135 - return __pyx_r;
1.136 -}
1.137 -
1.138 -static struct PyMethodDef __pyx_methods[] = {
1.139 - {"vint", (PyCFunction)__pyx_f_4vint_vint, METH_VARARGS|METH_KEYWORDS, 0},
1.140 - {0, 0, 0, 0}
1.141 -};
1.142 -
1.143 -static void __pyx_init_filenames(void); /*proto*/
1.144 -
1.145 -PyMODINIT_FUNC initvint(void); /*proto*/
1.146 -PyMODINIT_FUNC initvint(void) {
1.147 - __pyx_init_filenames();
1.148 - __pyx_m = Py_InitModule4("vint", __pyx_methods, 0, 0, PYTHON_API_VERSION);
1.149 - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
1.150 - Py_INCREF(__pyx_m);
1.151 - __pyx_b = PyImport_AddModule("__builtin__");
1.152 - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
1.153 - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
1.154 -
1.155 - /* "/home/paulb/Software/Python/iixr/vint.pyx":6 */
1.156 - return;
1.157 - __pyx_L1:;
1.158 - __Pyx_AddTraceback("vint");
1.159 -}
1.160 -
1.161 -static char *__pyx_filenames[] = {
1.162 - "vint.pyx",
1.163 -};
1.164 -
1.165 -/* Runtime support code */
1.166 -
1.167 -static void __pyx_init_filenames(void) {
1.168 - __pyx_f = __pyx_filenames;
1.169 -}
1.170 -
1.171 -#include "compile.h"
1.172 -#include "frameobject.h"
1.173 -#include "traceback.h"
1.174 -
1.175 -static void __Pyx_AddTraceback(char *funcname) {
1.176 - PyObject *py_srcfile = 0;
1.177 - PyObject *py_funcname = 0;
1.178 - PyObject *py_globals = 0;
1.179 - PyObject *empty_tuple = 0;
1.180 - PyObject *empty_string = 0;
1.181 - PyCodeObject *py_code = 0;
1.182 - PyFrameObject *py_frame = 0;
1.183 -
1.184 - py_srcfile = PyString_FromString(__pyx_filename);
1.185 - if (!py_srcfile) goto bad;
1.186 - py_funcname = PyString_FromString(funcname);
1.187 - if (!py_funcname) goto bad;
1.188 - py_globals = PyModule_GetDict(__pyx_m);
1.189 - if (!py_globals) goto bad;
1.190 - empty_tuple = PyTuple_New(0);
1.191 - if (!empty_tuple) goto bad;
1.192 - empty_string = PyString_FromString("");
1.193 - if (!empty_string) goto bad;
1.194 - py_code = PyCode_New(
1.195 - 0, /*int argcount,*/
1.196 - 0, /*int nlocals,*/
1.197 - 0, /*int stacksize,*/
1.198 - 0, /*int flags,*/
1.199 - empty_string, /*PyObject *code,*/
1.200 - empty_tuple, /*PyObject *consts,*/
1.201 - empty_tuple, /*PyObject *names,*/
1.202 - empty_tuple, /*PyObject *varnames,*/
1.203 - empty_tuple, /*PyObject *freevars,*/
1.204 - empty_tuple, /*PyObject *cellvars,*/
1.205 - py_srcfile, /*PyObject *filename,*/
1.206 - py_funcname, /*PyObject *name,*/
1.207 - __pyx_lineno, /*int firstlineno,*/
1.208 - empty_string /*PyObject *lnotab*/
1.209 - );
1.210 - if (!py_code) goto bad;
1.211 - py_frame = PyFrame_New(
1.212 - PyThreadState_Get(), /*PyThreadState *tstate,*/
1.213 - py_code, /*PyCodeObject *code,*/
1.214 - py_globals, /*PyObject *globals,*/
1.215 - 0 /*PyObject *locals*/
1.216 - );
1.217 - if (!py_frame) goto bad;
1.218 - py_frame->f_lineno = __pyx_lineno;
1.219 - PyTraceBack_Here(py_frame);
1.220 -bad:
1.221 - Py_XDECREF(py_srcfile);
1.222 - Py_XDECREF(py_funcname);
1.223 - Py_XDECREF(empty_tuple);
1.224 - Py_XDECREF(empty_string);
1.225 - Py_XDECREF(py_code);
1.226 - Py_XDECREF(py_frame);
1.227 -}