~ubuntu-branches/ubuntu/natty/pytables/natty-updates

« back to all changes in this revision

Viewing changes to src/_comp_lzo.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexandre Fayolle
  • Date: 2006-06-28 10:45:03 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20060628104503-cc251q5o5j3e2k10
  * Fixed call to pyversions in debian/rules which failed on recent versions 
    of pyversions
  * Fixed clean rule in debian/rules which left the stamp files behind
  * Acknowledge NMU
  * Added Alexandre Fayolle to uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Generated by Pyrex 0.9.4 on Tue Jun 20 16:45:13 2006 */
 
2
 
 
3
#include "Python.h"
 
4
#include "structmember.h"
 
5
#ifndef PY_LONG_LONG
 
6
  #define PY_LONG_LONG LONG_LONG
 
7
#endif
 
8
#ifdef __cplusplus
 
9
#define __PYX_EXTERN_C extern "C"
 
10
#else
 
11
#define __PYX_EXTERN_C extern
 
12
#endif
 
13
__PYX_EXTERN_C double pow(double, double);
 
14
#include "stdlib.h"
 
15
#include "H5Zlzo.h"
 
16
 
 
17
 
 
18
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
 
19
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
 
20
static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
 
21
static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
 
22
static int __Pyx_PrintItem(PyObject *); /*proto*/
 
23
static int __Pyx_PrintNewline(void); /*proto*/
 
24
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
25
static void __Pyx_ReRaise(void); /*proto*/
 
26
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
 
27
static PyObject *__Pyx_GetExcValue(void); /*proto*/
 
28
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
 
29
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
 
30
static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
 
31
static void __Pyx_WriteUnraisable(char *name); /*proto*/
 
32
static void __Pyx_AddTraceback(char *funcname); /*proto*/
 
33
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/
 
34
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
 
35
static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
 
36
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
 
37
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
 
38
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
 
39
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
40
 
 
41
static PyObject *__pyx_m;
 
42
static PyObject *__pyx_b;
 
43
static int __pyx_lineno;
 
44
static char *__pyx_filename;
 
45
static char **__pyx_f;
 
46
 
 
47
/* Declarations from _comp_lzo */
 
48
 
 
49
 
 
50
/* Implementation of _comp_lzo */
 
51
 
 
52
static PyObject *__pyx_n_register_;
 
53
 
 
54
static PyObject *__pyx_f_9_comp_lzo_register_(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
55
static PyObject *__pyx_f_9_comp_lzo_register_(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
56
  char (*__pyx_v_version);
 
57
  char (*__pyx_v_date);
 
58
  PyObject *__pyx_v_compinfo;
 
59
  PyObject *__pyx_r;
 
60
  int __pyx_1;
 
61
  PyObject *__pyx_2 = 0;
 
62
  PyObject *__pyx_3 = 0;
 
63
  PyObject *__pyx_4 = 0;
 
64
  static char *__pyx_argnames[] = {0};
 
65
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
 
66
  __pyx_v_compinfo = Py_None; Py_INCREF(Py_None);
 
67
 
 
68
  /* "/tmp/pytables-1.3.2/src/_comp_lzo.pyx":10 */
 
69
  __pyx_1 = (!register_lzo((&__pyx_v_version),(&__pyx_v_date)));
 
70
  if (__pyx_1) {
 
71
 
 
72
    /* "/tmp/pytables-1.3.2/src/_comp_lzo.pyx":11 */
 
73
    Py_INCREF(Py_None);
 
74
    __pyx_r = Py_None;
 
75
    goto __pyx_L0;
 
76
    goto __pyx_L2;
 
77
  }
 
78
  __pyx_L2:;
 
79
 
 
80
  /* "/tmp/pytables-1.3.2/src/_comp_lzo.pyx":13 */
 
81
  __pyx_2 = PyString_FromString(__pyx_v_version); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
 
82
  __pyx_3 = PyString_FromString(__pyx_v_date); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
 
83
  __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
 
84
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
 
85
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
 
86
  __pyx_2 = 0;
 
87
  __pyx_3 = 0;
 
88
  Py_DECREF(__pyx_v_compinfo);
 
89
  __pyx_v_compinfo = __pyx_4;
 
90
  __pyx_4 = 0;
 
91
 
 
92
  /* "/tmp/pytables-1.3.2/src/_comp_lzo.pyx":14 */
 
93
  free(__pyx_v_version);
 
94
 
 
95
  /* "/tmp/pytables-1.3.2/src/_comp_lzo.pyx":15 */
 
96
  free(__pyx_v_date);
 
97
 
 
98
  /* "/tmp/pytables-1.3.2/src/_comp_lzo.pyx":16 */
 
99
  Py_INCREF(__pyx_v_compinfo);
 
100
  __pyx_r = __pyx_v_compinfo;
 
101
  goto __pyx_L0;
 
102
 
 
103
  __pyx_r = Py_None; Py_INCREF(Py_None);
 
104
  goto __pyx_L0;
 
105
  __pyx_L1:;
 
106
  Py_XDECREF(__pyx_2);
 
107
  Py_XDECREF(__pyx_3);
 
108
  Py_XDECREF(__pyx_4);
 
109
  __Pyx_AddTraceback("_comp_lzo.register_");
 
110
  __pyx_r = 0;
 
111
  __pyx_L0:;
 
112
  Py_DECREF(__pyx_v_compinfo);
 
113
  return __pyx_r;
 
114
}
 
115
 
 
116
static __Pyx_InternTabEntry __pyx_intern_tab[] = {
 
117
  {&__pyx_n_register_, "register_"},
 
118
  {0, 0}
 
119
};
 
120
 
 
121
static struct PyMethodDef __pyx_methods[] = {
 
122
  {"register_", (PyCFunction)__pyx_f_9_comp_lzo_register_, METH_VARARGS|METH_KEYWORDS, 0},
 
123
  {0, 0, 0, 0}
 
124
};
 
125
 
 
126
static void __pyx_init_filenames(void); /*proto*/
 
127
 
 
128
PyMODINIT_FUNC init_comp_lzo(void); /*proto*/
 
129
PyMODINIT_FUNC init_comp_lzo(void) {
 
130
  __pyx_init_filenames();
 
131
  __pyx_m = Py_InitModule4("_comp_lzo", __pyx_methods, 0, 0, PYTHON_API_VERSION);
 
132
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
 
133
  __pyx_b = PyImport_AddModule("__builtin__");
 
134
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
 
135
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
 
136
  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
 
137
 
 
138
  /* "/tmp/pytables-1.3.2/src/_comp_lzo.pyx":7 */
 
139
  return;
 
140
  __pyx_L1:;
 
141
  __Pyx_AddTraceback("_comp_lzo");
 
142
}
 
143
 
 
144
static char *__pyx_filenames[] = {
 
145
  "_comp_lzo.pyx",
 
146
};
 
147
 
 
148
/* Runtime support code */
 
149
 
 
150
static void __pyx_init_filenames(void) {
 
151
  __pyx_f = __pyx_filenames;
 
152
}
 
153
 
 
154
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
 
155
    while (t->p) {
 
156
        *t->p = PyString_InternFromString(t->s);
 
157
        if (!*t->p)
 
158
            return -1;
 
159
        ++t;
 
160
    }
 
161
    return 0;
 
162
}
 
163
 
 
164
#include "compile.h"
 
165
#include "frameobject.h"
 
166
#include "traceback.h"
 
167
 
 
168
static void __Pyx_AddTraceback(char *funcname) {
 
169
    PyObject *py_srcfile = 0;
 
170
    PyObject *py_funcname = 0;
 
171
    PyObject *py_globals = 0;
 
172
    PyObject *empty_tuple = 0;
 
173
    PyObject *empty_string = 0;
 
174
    PyCodeObject *py_code = 0;
 
175
    PyFrameObject *py_frame = 0;
 
176
    
 
177
    py_srcfile = PyString_FromString(__pyx_filename);
 
178
    if (!py_srcfile) goto bad;
 
179
    py_funcname = PyString_FromString(funcname);
 
180
    if (!py_funcname) goto bad;
 
181
    py_globals = PyModule_GetDict(__pyx_m);
 
182
    if (!py_globals) goto bad;
 
183
    empty_tuple = PyTuple_New(0);
 
184
    if (!empty_tuple) goto bad;
 
185
    empty_string = PyString_FromString("");
 
186
    if (!empty_string) goto bad;
 
187
    py_code = PyCode_New(
 
188
        0,            /*int argcount,*/
 
189
        0,            /*int nlocals,*/
 
190
        0,            /*int stacksize,*/
 
191
        0,            /*int flags,*/
 
192
        empty_string, /*PyObject *code,*/
 
193
        empty_tuple,  /*PyObject *consts,*/
 
194
        empty_tuple,  /*PyObject *names,*/
 
195
        empty_tuple,  /*PyObject *varnames,*/
 
196
        empty_tuple,  /*PyObject *freevars,*/
 
197
        empty_tuple,  /*PyObject *cellvars,*/
 
198
        py_srcfile,   /*PyObject *filename,*/
 
199
        py_funcname,  /*PyObject *name,*/
 
200
        __pyx_lineno,   /*int firstlineno,*/
 
201
        empty_string  /*PyObject *lnotab*/
 
202
    );
 
203
    if (!py_code) goto bad;
 
204
    py_frame = PyFrame_New(
 
205
        PyThreadState_Get(), /*PyThreadState *tstate,*/
 
206
        py_code,             /*PyCodeObject *code,*/
 
207
        py_globals,          /*PyObject *globals,*/
 
208
        0                    /*PyObject *locals*/
 
209
    );
 
210
    if (!py_frame) goto bad;
 
211
    py_frame->f_lineno = __pyx_lineno;
 
212
    PyTraceBack_Here(py_frame);
 
213
bad:
 
214
    Py_XDECREF(py_srcfile);
 
215
    Py_XDECREF(py_funcname);
 
216
    Py_XDECREF(empty_tuple);
 
217
    Py_XDECREF(empty_string);
 
218
    Py_XDECREF(py_code);
 
219
    Py_XDECREF(py_frame);
 
220
}