Cython has moved to github.
pyrex
view Tests/Bugs/behnel/behnel5/ia_etree.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 | 12072e0e4fd5 |
| children | 94d46b3c5354 |
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; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
34 static PyObject *__pyx_m;
35 static PyObject *__pyx_b;
36 static int __pyx_lineno;
37 static char *__pyx_filename;
38 static char **__pyx_f;
40 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
42 static int __Pyx_ExportFunction(char *n, void *f, char *s); /*proto*/
44 static void __Pyx_AddTraceback(char *funcname); /*proto*/
46 /* Declarations from tree */
49 /* Declarations from ia_etree */
51 struct LxmlDocument {
52 PyObject_HEAD
53 struct __pyx_t_4tree_xmlDoc *_c_doc;
54 struct __pyx_obj_8ia_etree__BaseParser *_parser;
55 };
57 struct LxmlElement {
58 PyObject_HEAD
59 struct LxmlDocument *_doc;
60 struct __pyx_t_4tree_xmlNode *_c_node;
61 };
64 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlDocumentType;
66 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementType;
68 static PyTypeObject *__pyx_ptype_8ia_etree__BaseParser = 0;
69 static PyTypeObject *__pyx_ptype_8ia_etree__Document = 0;
70 static PyTypeObject *__pyx_ptype_8ia_etree__Element = 0;
71 static PyObject *__pyx_f_8ia_etree_getAttributeValue(struct LxmlElement *,PyObject *,PyObject *); /*proto*/
73 /* Declarations from implementation of ia_etree */
75 struct __pyx_t_8ia_etree_Foo {
76 int spam;
77 };
79 struct __pyx_obj_8ia_etree_Vorpal {
80 PyObject_HEAD
81 };
83 struct __pyx_obj_8ia_etree__BaseParser {
84 PyObject_HEAD
85 struct __pyx_t_8ia_etree_Foo *foo;
86 struct __pyx_obj_8ia_etree_Vorpal *bunny;
87 };
90 static PyTypeObject *__pyx_ptype_8ia_etree_Vorpal = 0;
95 static __Pyx_StringTabEntry __pyx_string_tab[] = {
96 {0, 0, 0, 0}
97 };
101 /* Implementation of ia_etree */
103 static PyObject *__pyx_f_8ia_etree_getAttributeValue(struct LxmlElement *__pyx_v_element,PyObject *__pyx_v_key,PyObject *__pyx_v_default) {
104 PyObject *__pyx_r;
105 Py_INCREF(__pyx_v_element);
106 Py_INCREF(__pyx_v_key);
107 Py_INCREF(__pyx_v_default);
109 __pyx_r = Py_None; Py_INCREF(Py_None);
110 Py_DECREF(__pyx_v_element);
111 Py_DECREF(__pyx_v_key);
112 Py_DECREF(__pyx_v_default);
113 return __pyx_r;
114 }
116 static PyObject *__pyx_tp_new_8ia_etree__BaseParser(PyTypeObject *t, PyObject *a, PyObject *k) {
117 struct __pyx_obj_8ia_etree__BaseParser *p;
118 PyObject *o = (*t->tp_alloc)(t, 0);
119 if (!o) return 0;
120 p = ((struct __pyx_obj_8ia_etree__BaseParser *)o);
121 p->bunny = ((struct __pyx_obj_8ia_etree_Vorpal *)Py_None); Py_INCREF(Py_None);
122 return o;
123 }
125 static void __pyx_tp_dealloc_8ia_etree__BaseParser(PyObject *o) {
126 struct __pyx_obj_8ia_etree__BaseParser *p = (struct __pyx_obj_8ia_etree__BaseParser *)o;
127 Py_XDECREF(((PyObject *)p->bunny));
128 (*o->ob_type->tp_free)(o);
129 }
131 static int __pyx_tp_traverse_8ia_etree__BaseParser(PyObject *o, visitproc v, void *a) {
132 int e;
133 struct __pyx_obj_8ia_etree__BaseParser *p = (struct __pyx_obj_8ia_etree__BaseParser *)o;
134 if (p->bunny) {
135 e = (*v)(((PyObject*)p->bunny), a); if (e) return e;
136 }
137 return 0;
138 }
140 static int __pyx_tp_clear_8ia_etree__BaseParser(PyObject *o) {
141 struct __pyx_obj_8ia_etree__BaseParser *p = (struct __pyx_obj_8ia_etree__BaseParser *)o;
142 PyObject *t;
143 t = ((PyObject *)p->bunny);
144 p->bunny = ((struct __pyx_obj_8ia_etree_Vorpal *)Py_None); Py_INCREF(Py_None);
145 Py_XDECREF(t);
146 return 0;
147 }
149 static struct PyMethodDef __pyx_methods_8ia_etree__BaseParser[] = {
150 {0, 0, 0, 0}
151 };
153 static PyNumberMethods __pyx_tp_as_number__BaseParser = {
154 0, /*nb_add*/
155 0, /*nb_subtract*/
156 0, /*nb_multiply*/
157 0, /*nb_divide*/
158 0, /*nb_remainder*/
159 0, /*nb_divmod*/
160 0, /*nb_power*/
161 0, /*nb_negative*/
162 0, /*nb_positive*/
163 0, /*nb_absolute*/
164 0, /*nb_nonzero*/
165 0, /*nb_invert*/
166 0, /*nb_lshift*/
167 0, /*nb_rshift*/
168 0, /*nb_and*/
169 0, /*nb_xor*/
170 0, /*nb_or*/
171 0, /*nb_coerce*/
172 0, /*nb_int*/
173 0, /*nb_long*/
174 0, /*nb_float*/
175 0, /*nb_oct*/
176 0, /*nb_hex*/
177 0, /*nb_inplace_add*/
178 0, /*nb_inplace_subtract*/
179 0, /*nb_inplace_multiply*/
180 0, /*nb_inplace_divide*/
181 0, /*nb_inplace_remainder*/
182 0, /*nb_inplace_power*/
183 0, /*nb_inplace_lshift*/
184 0, /*nb_inplace_rshift*/
185 0, /*nb_inplace_and*/
186 0, /*nb_inplace_xor*/
187 0, /*nb_inplace_or*/
188 0, /*nb_floor_divide*/
189 0, /*nb_true_divide*/
190 0, /*nb_inplace_floor_divide*/
191 0, /*nb_inplace_true_divide*/
192 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
193 0, /*nb_index*/
194 #endif
195 };
197 static PySequenceMethods __pyx_tp_as_sequence__BaseParser = {
198 0, /*sq_length*/
199 0, /*sq_concat*/
200 0, /*sq_repeat*/
201 0, /*sq_item*/
202 0, /*sq_slice*/
203 0, /*sq_ass_item*/
204 0, /*sq_ass_slice*/
205 0, /*sq_contains*/
206 0, /*sq_inplace_concat*/
207 0, /*sq_inplace_repeat*/
208 };
210 static PyMappingMethods __pyx_tp_as_mapping__BaseParser = {
211 0, /*mp_length*/
212 0, /*mp_subscript*/
213 0, /*mp_ass_subscript*/
214 };
216 static PyBufferProcs __pyx_tp_as_buffer__BaseParser = {
217 0, /*bf_getreadbuffer*/
218 0, /*bf_getwritebuffer*/
219 0, /*bf_getsegcount*/
220 0, /*bf_getcharbuffer*/
221 };
223 PyTypeObject __pyx_type_8ia_etree__BaseParser = {
224 PyObject_HEAD_INIT(0)
225 0, /*ob_size*/
226 "ia_etree._BaseParser", /*tp_name*/
227 sizeof(struct __pyx_obj_8ia_etree__BaseParser), /*tp_basicsize*/
228 0, /*tp_itemsize*/
229 __pyx_tp_dealloc_8ia_etree__BaseParser, /*tp_dealloc*/
230 0, /*tp_print*/
231 0, /*tp_getattr*/
232 0, /*tp_setattr*/
233 0, /*tp_compare*/
234 0, /*tp_repr*/
235 &__pyx_tp_as_number__BaseParser, /*tp_as_number*/
236 &__pyx_tp_as_sequence__BaseParser, /*tp_as_sequence*/
237 &__pyx_tp_as_mapping__BaseParser, /*tp_as_mapping*/
238 0, /*tp_hash*/
239 0, /*tp_call*/
240 0, /*tp_str*/
241 0, /*tp_getattro*/
242 0, /*tp_setattro*/
243 &__pyx_tp_as_buffer__BaseParser, /*tp_as_buffer*/
244 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
245 0, /*tp_doc*/
246 __pyx_tp_traverse_8ia_etree__BaseParser, /*tp_traverse*/
247 __pyx_tp_clear_8ia_etree__BaseParser, /*tp_clear*/
248 0, /*tp_richcompare*/
249 0, /*tp_weaklistoffset*/
250 0, /*tp_iter*/
251 0, /*tp_iternext*/
252 __pyx_methods_8ia_etree__BaseParser, /*tp_methods*/
253 0, /*tp_members*/
254 0, /*tp_getset*/
255 0, /*tp_base*/
256 0, /*tp_dict*/
257 0, /*tp_descr_get*/
258 0, /*tp_descr_set*/
259 0, /*tp_dictoffset*/
260 0, /*tp_init*/
261 0, /*tp_alloc*/
262 __pyx_tp_new_8ia_etree__BaseParser, /*tp_new*/
263 0, /*tp_free*/
264 0, /*tp_is_gc*/
265 0, /*tp_bases*/
266 0, /*tp_mro*/
267 0, /*tp_cache*/
268 0, /*tp_subclasses*/
269 0, /*tp_weaklist*/
270 };
272 static PyObject *__pyx_tp_new_8ia_etree__Document(PyTypeObject *t, PyObject *a, PyObject *k) {
273 struct LxmlDocument *p;
274 PyObject *o = (*t->tp_alloc)(t, 0);
275 if (!o) return 0;
276 p = ((struct LxmlDocument *)o);
277 p->_parser = ((struct __pyx_obj_8ia_etree__BaseParser *)Py_None); Py_INCREF(Py_None);
278 return o;
279 }
281 static void __pyx_tp_dealloc_8ia_etree__Document(PyObject *o) {
282 struct LxmlDocument *p = (struct LxmlDocument *)o;
283 Py_XDECREF(((PyObject *)p->_parser));
284 (*o->ob_type->tp_free)(o);
285 }
287 static int __pyx_tp_traverse_8ia_etree__Document(PyObject *o, visitproc v, void *a) {
288 int e;
289 struct LxmlDocument *p = (struct LxmlDocument *)o;
290 if (p->_parser) {
291 e = (*v)(((PyObject*)p->_parser), a); if (e) return e;
292 }
293 return 0;
294 }
296 static int __pyx_tp_clear_8ia_etree__Document(PyObject *o) {
297 struct LxmlDocument *p = (struct LxmlDocument *)o;
298 PyObject *t;
299 t = ((PyObject *)p->_parser);
300 p->_parser = ((struct __pyx_obj_8ia_etree__BaseParser *)Py_None); Py_INCREF(Py_None);
301 Py_XDECREF(t);
302 return 0;
303 }
305 static struct PyMethodDef __pyx_methods_8ia_etree__Document[] = {
306 {0, 0, 0, 0}
307 };
309 static PyNumberMethods __pyx_tp_as_number__Document = {
310 0, /*nb_add*/
311 0, /*nb_subtract*/
312 0, /*nb_multiply*/
313 0, /*nb_divide*/
314 0, /*nb_remainder*/
315 0, /*nb_divmod*/
316 0, /*nb_power*/
317 0, /*nb_negative*/
318 0, /*nb_positive*/
319 0, /*nb_absolute*/
320 0, /*nb_nonzero*/
321 0, /*nb_invert*/
322 0, /*nb_lshift*/
323 0, /*nb_rshift*/
324 0, /*nb_and*/
325 0, /*nb_xor*/
326 0, /*nb_or*/
327 0, /*nb_coerce*/
328 0, /*nb_int*/
329 0, /*nb_long*/
330 0, /*nb_float*/
331 0, /*nb_oct*/
332 0, /*nb_hex*/
333 0, /*nb_inplace_add*/
334 0, /*nb_inplace_subtract*/
335 0, /*nb_inplace_multiply*/
336 0, /*nb_inplace_divide*/
337 0, /*nb_inplace_remainder*/
338 0, /*nb_inplace_power*/
339 0, /*nb_inplace_lshift*/
340 0, /*nb_inplace_rshift*/
341 0, /*nb_inplace_and*/
342 0, /*nb_inplace_xor*/
343 0, /*nb_inplace_or*/
344 0, /*nb_floor_divide*/
345 0, /*nb_true_divide*/
346 0, /*nb_inplace_floor_divide*/
347 0, /*nb_inplace_true_divide*/
348 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
349 0, /*nb_index*/
350 #endif
351 };
353 static PySequenceMethods __pyx_tp_as_sequence__Document = {
354 0, /*sq_length*/
355 0, /*sq_concat*/
356 0, /*sq_repeat*/
357 0, /*sq_item*/
358 0, /*sq_slice*/
359 0, /*sq_ass_item*/
360 0, /*sq_ass_slice*/
361 0, /*sq_contains*/
362 0, /*sq_inplace_concat*/
363 0, /*sq_inplace_repeat*/
364 };
366 static PyMappingMethods __pyx_tp_as_mapping__Document = {
367 0, /*mp_length*/
368 0, /*mp_subscript*/
369 0, /*mp_ass_subscript*/
370 };
372 static PyBufferProcs __pyx_tp_as_buffer__Document = {
373 0, /*bf_getreadbuffer*/
374 0, /*bf_getwritebuffer*/
375 0, /*bf_getsegcount*/
376 0, /*bf_getcharbuffer*/
377 };
379 DL_EXPORT(PyTypeObject) LxmlDocumentType = {
380 PyObject_HEAD_INIT(0)
381 0, /*ob_size*/
382 "ia_etree._Document", /*tp_name*/
383 sizeof(struct LxmlDocument), /*tp_basicsize*/
384 0, /*tp_itemsize*/
385 __pyx_tp_dealloc_8ia_etree__Document, /*tp_dealloc*/
386 0, /*tp_print*/
387 0, /*tp_getattr*/
388 0, /*tp_setattr*/
389 0, /*tp_compare*/
390 0, /*tp_repr*/
391 &__pyx_tp_as_number__Document, /*tp_as_number*/
392 &__pyx_tp_as_sequence__Document, /*tp_as_sequence*/
393 &__pyx_tp_as_mapping__Document, /*tp_as_mapping*/
394 0, /*tp_hash*/
395 0, /*tp_call*/
396 0, /*tp_str*/
397 0, /*tp_getattro*/
398 0, /*tp_setattro*/
399 &__pyx_tp_as_buffer__Document, /*tp_as_buffer*/
400 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
401 0, /*tp_doc*/
402 __pyx_tp_traverse_8ia_etree__Document, /*tp_traverse*/
403 __pyx_tp_clear_8ia_etree__Document, /*tp_clear*/
404 0, /*tp_richcompare*/
405 0, /*tp_weaklistoffset*/
406 0, /*tp_iter*/
407 0, /*tp_iternext*/
408 __pyx_methods_8ia_etree__Document, /*tp_methods*/
409 0, /*tp_members*/
410 0, /*tp_getset*/
411 0, /*tp_base*/
412 0, /*tp_dict*/
413 0, /*tp_descr_get*/
414 0, /*tp_descr_set*/
415 0, /*tp_dictoffset*/
416 0, /*tp_init*/
417 0, /*tp_alloc*/
418 __pyx_tp_new_8ia_etree__Document, /*tp_new*/
419 0, /*tp_free*/
420 0, /*tp_is_gc*/
421 0, /*tp_bases*/
422 0, /*tp_mro*/
423 0, /*tp_cache*/
424 0, /*tp_subclasses*/
425 0, /*tp_weaklist*/
426 };
428 static PyObject *__pyx_tp_new_8ia_etree__Element(PyTypeObject *t, PyObject *a, PyObject *k) {
429 struct LxmlElement *p;
430 PyObject *o = (*t->tp_alloc)(t, 0);
431 if (!o) return 0;
432 p = ((struct LxmlElement *)o);
433 p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
434 return o;
435 }
437 static void __pyx_tp_dealloc_8ia_etree__Element(PyObject *o) {
438 struct LxmlElement *p = (struct LxmlElement *)o;
439 Py_XDECREF(((PyObject *)p->_doc));
440 (*o->ob_type->tp_free)(o);
441 }
443 static int __pyx_tp_traverse_8ia_etree__Element(PyObject *o, visitproc v, void *a) {
444 int e;
445 struct LxmlElement *p = (struct LxmlElement *)o;
446 if (p->_doc) {
447 e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
448 }
449 return 0;
450 }
452 static int __pyx_tp_clear_8ia_etree__Element(PyObject *o) {
453 struct LxmlElement *p = (struct LxmlElement *)o;
454 PyObject *t;
455 t = ((PyObject *)p->_doc);
456 p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
457 Py_XDECREF(t);
458 return 0;
459 }
461 static struct PyMethodDef __pyx_methods_8ia_etree__Element[] = {
462 {0, 0, 0, 0}
463 };
465 static PyNumberMethods __pyx_tp_as_number__Element = {
466 0, /*nb_add*/
467 0, /*nb_subtract*/
468 0, /*nb_multiply*/
469 0, /*nb_divide*/
470 0, /*nb_remainder*/
471 0, /*nb_divmod*/
472 0, /*nb_power*/
473 0, /*nb_negative*/
474 0, /*nb_positive*/
475 0, /*nb_absolute*/
476 0, /*nb_nonzero*/
477 0, /*nb_invert*/
478 0, /*nb_lshift*/
479 0, /*nb_rshift*/
480 0, /*nb_and*/
481 0, /*nb_xor*/
482 0, /*nb_or*/
483 0, /*nb_coerce*/
484 0, /*nb_int*/
485 0, /*nb_long*/
486 0, /*nb_float*/
487 0, /*nb_oct*/
488 0, /*nb_hex*/
489 0, /*nb_inplace_add*/
490 0, /*nb_inplace_subtract*/
491 0, /*nb_inplace_multiply*/
492 0, /*nb_inplace_divide*/
493 0, /*nb_inplace_remainder*/
494 0, /*nb_inplace_power*/
495 0, /*nb_inplace_lshift*/
496 0, /*nb_inplace_rshift*/
497 0, /*nb_inplace_and*/
498 0, /*nb_inplace_xor*/
499 0, /*nb_inplace_or*/
500 0, /*nb_floor_divide*/
501 0, /*nb_true_divide*/
502 0, /*nb_inplace_floor_divide*/
503 0, /*nb_inplace_true_divide*/
504 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
505 0, /*nb_index*/
506 #endif
507 };
509 static PySequenceMethods __pyx_tp_as_sequence__Element = {
510 0, /*sq_length*/
511 0, /*sq_concat*/
512 0, /*sq_repeat*/
513 0, /*sq_item*/
514 0, /*sq_slice*/
515 0, /*sq_ass_item*/
516 0, /*sq_ass_slice*/
517 0, /*sq_contains*/
518 0, /*sq_inplace_concat*/
519 0, /*sq_inplace_repeat*/
520 };
522 static PyMappingMethods __pyx_tp_as_mapping__Element = {
523 0, /*mp_length*/
524 0, /*mp_subscript*/
525 0, /*mp_ass_subscript*/
526 };
528 static PyBufferProcs __pyx_tp_as_buffer__Element = {
529 0, /*bf_getreadbuffer*/
530 0, /*bf_getwritebuffer*/
531 0, /*bf_getsegcount*/
532 0, /*bf_getcharbuffer*/
533 };
535 DL_EXPORT(PyTypeObject) LxmlElementType = {
536 PyObject_HEAD_INIT(0)
537 0, /*ob_size*/
538 "ia_etree._Element", /*tp_name*/
539 sizeof(struct LxmlElement), /*tp_basicsize*/
540 0, /*tp_itemsize*/
541 __pyx_tp_dealloc_8ia_etree__Element, /*tp_dealloc*/
542 0, /*tp_print*/
543 0, /*tp_getattr*/
544 0, /*tp_setattr*/
545 0, /*tp_compare*/
546 0, /*tp_repr*/
547 &__pyx_tp_as_number__Element, /*tp_as_number*/
548 &__pyx_tp_as_sequence__Element, /*tp_as_sequence*/
549 &__pyx_tp_as_mapping__Element, /*tp_as_mapping*/
550 0, /*tp_hash*/
551 0, /*tp_call*/
552 0, /*tp_str*/
553 0, /*tp_getattro*/
554 0, /*tp_setattro*/
555 &__pyx_tp_as_buffer__Element, /*tp_as_buffer*/
556 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
557 0, /*tp_doc*/
558 __pyx_tp_traverse_8ia_etree__Element, /*tp_traverse*/
559 __pyx_tp_clear_8ia_etree__Element, /*tp_clear*/
560 0, /*tp_richcompare*/
561 0, /*tp_weaklistoffset*/
562 0, /*tp_iter*/
563 0, /*tp_iternext*/
564 __pyx_methods_8ia_etree__Element, /*tp_methods*/
565 0, /*tp_members*/
566 0, /*tp_getset*/
567 0, /*tp_base*/
568 0, /*tp_dict*/
569 0, /*tp_descr_get*/
570 0, /*tp_descr_set*/
571 0, /*tp_dictoffset*/
572 0, /*tp_init*/
573 0, /*tp_alloc*/
574 __pyx_tp_new_8ia_etree__Element, /*tp_new*/
575 0, /*tp_free*/
576 0, /*tp_is_gc*/
577 0, /*tp_bases*/
578 0, /*tp_mro*/
579 0, /*tp_cache*/
580 0, /*tp_subclasses*/
581 0, /*tp_weaklist*/
582 };
584 static PyObject *__pyx_tp_new_8ia_etree_Vorpal(PyTypeObject *t, PyObject *a, PyObject *k) {
585 PyObject *o = (*t->tp_alloc)(t, 0);
586 if (!o) return 0;
587 return o;
588 }
590 static void __pyx_tp_dealloc_8ia_etree_Vorpal(PyObject *o) {
591 (*o->ob_type->tp_free)(o);
592 }
594 static struct PyMethodDef __pyx_methods_8ia_etree_Vorpal[] = {
595 {0, 0, 0, 0}
596 };
598 static PyNumberMethods __pyx_tp_as_number_Vorpal = {
599 0, /*nb_add*/
600 0, /*nb_subtract*/
601 0, /*nb_multiply*/
602 0, /*nb_divide*/
603 0, /*nb_remainder*/
604 0, /*nb_divmod*/
605 0, /*nb_power*/
606 0, /*nb_negative*/
607 0, /*nb_positive*/
608 0, /*nb_absolute*/
609 0, /*nb_nonzero*/
610 0, /*nb_invert*/
611 0, /*nb_lshift*/
612 0, /*nb_rshift*/
613 0, /*nb_and*/
614 0, /*nb_xor*/
615 0, /*nb_or*/
616 0, /*nb_coerce*/
617 0, /*nb_int*/
618 0, /*nb_long*/
619 0, /*nb_float*/
620 0, /*nb_oct*/
621 0, /*nb_hex*/
622 0, /*nb_inplace_add*/
623 0, /*nb_inplace_subtract*/
624 0, /*nb_inplace_multiply*/
625 0, /*nb_inplace_divide*/
626 0, /*nb_inplace_remainder*/
627 0, /*nb_inplace_power*/
628 0, /*nb_inplace_lshift*/
629 0, /*nb_inplace_rshift*/
630 0, /*nb_inplace_and*/
631 0, /*nb_inplace_xor*/
632 0, /*nb_inplace_or*/
633 0, /*nb_floor_divide*/
634 0, /*nb_true_divide*/
635 0, /*nb_inplace_floor_divide*/
636 0, /*nb_inplace_true_divide*/
637 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
638 0, /*nb_index*/
639 #endif
640 };
642 static PySequenceMethods __pyx_tp_as_sequence_Vorpal = {
643 0, /*sq_length*/
644 0, /*sq_concat*/
645 0, /*sq_repeat*/
646 0, /*sq_item*/
647 0, /*sq_slice*/
648 0, /*sq_ass_item*/
649 0, /*sq_ass_slice*/
650 0, /*sq_contains*/
651 0, /*sq_inplace_concat*/
652 0, /*sq_inplace_repeat*/
653 };
655 static PyMappingMethods __pyx_tp_as_mapping_Vorpal = {
656 0, /*mp_length*/
657 0, /*mp_subscript*/
658 0, /*mp_ass_subscript*/
659 };
661 static PyBufferProcs __pyx_tp_as_buffer_Vorpal = {
662 0, /*bf_getreadbuffer*/
663 0, /*bf_getwritebuffer*/
664 0, /*bf_getsegcount*/
665 0, /*bf_getcharbuffer*/
666 };
668 PyTypeObject __pyx_type_8ia_etree_Vorpal = {
669 PyObject_HEAD_INIT(0)
670 0, /*ob_size*/
671 "ia_etree.Vorpal", /*tp_name*/
672 sizeof(struct __pyx_obj_8ia_etree_Vorpal), /*tp_basicsize*/
673 0, /*tp_itemsize*/
674 __pyx_tp_dealloc_8ia_etree_Vorpal, /*tp_dealloc*/
675 0, /*tp_print*/
676 0, /*tp_getattr*/
677 0, /*tp_setattr*/
678 0, /*tp_compare*/
679 0, /*tp_repr*/
680 &__pyx_tp_as_number_Vorpal, /*tp_as_number*/
681 &__pyx_tp_as_sequence_Vorpal, /*tp_as_sequence*/
682 &__pyx_tp_as_mapping_Vorpal, /*tp_as_mapping*/
683 0, /*tp_hash*/
684 0, /*tp_call*/
685 0, /*tp_str*/
686 0, /*tp_getattro*/
687 0, /*tp_setattro*/
688 &__pyx_tp_as_buffer_Vorpal, /*tp_as_buffer*/
689 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
690 0, /*tp_doc*/
691 0, /*tp_traverse*/
692 0, /*tp_clear*/
693 0, /*tp_richcompare*/
694 0, /*tp_weaklistoffset*/
695 0, /*tp_iter*/
696 0, /*tp_iternext*/
697 __pyx_methods_8ia_etree_Vorpal, /*tp_methods*/
698 0, /*tp_members*/
699 0, /*tp_getset*/
700 0, /*tp_base*/
701 0, /*tp_dict*/
702 0, /*tp_descr_get*/
703 0, /*tp_descr_set*/
704 0, /*tp_dictoffset*/
705 0, /*tp_init*/
706 0, /*tp_alloc*/
707 __pyx_tp_new_8ia_etree_Vorpal, /*tp_new*/
708 0, /*tp_free*/
709 0, /*tp_is_gc*/
710 0, /*tp_bases*/
711 0, /*tp_mro*/
712 0, /*tp_cache*/
713 0, /*tp_subclasses*/
714 0, /*tp_weaklist*/
715 };
717 static struct PyMethodDef __pyx_methods[] = {
718 {0, 0, 0, 0}
719 };
721 static void __pyx_init_filenames(void); /*proto*/
723 PyMODINIT_FUNC initia_etree(void); /*proto*/
724 PyMODINIT_FUNC initia_etree(void) {
725 PyObject *__pyx_1 = 0;
726 __pyx_init_filenames();
727 __pyx_m = Py_InitModule4("ia_etree", __pyx_methods, 0, 0, PYTHON_API_VERSION);
728 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
729 Py_INCREF(__pyx_m);
730 __pyx_b = PyImport_AddModule("__builtin__");
731 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
732 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
733 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
734 if (__Pyx_ExportFunction("getAttributeValue", (void*)__pyx_f_8ia_etree_getAttributeValue, "PyObject *(struct LxmlElement *,PyObject *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
735 __pyx_type_8ia_etree__BaseParser.tp_free = _PyObject_GC_Del;
736 if (PyType_Ready(&__pyx_type_8ia_etree__BaseParser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
737 if (PyObject_SetAttrString(__pyx_m, "_BaseParser", (PyObject *)&__pyx_type_8ia_etree__BaseParser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
738 __pyx_ptype_8ia_etree__BaseParser = &__pyx_type_8ia_etree__BaseParser;
739 LxmlDocumentType.tp_free = _PyObject_GC_Del;
740 if (PyType_Ready(&LxmlDocumentType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
741 if (PyObject_SetAttrString(__pyx_m, "_Document", (PyObject *)&LxmlDocumentType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
742 __pyx_ptype_8ia_etree__Document = &LxmlDocumentType;
743 LxmlElementType.tp_free = _PyObject_GC_Del;
744 if (PyType_Ready(&LxmlElementType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
745 if (PyObject_SetAttrString(__pyx_m, "_Element", (PyObject *)&LxmlElementType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
746 __pyx_ptype_8ia_etree__Element = &LxmlElementType;
747 if (PyType_Ready(&__pyx_type_8ia_etree_Vorpal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
748 if (PyObject_SetAttrString(__pyx_m, "Vorpal", (PyObject *)&__pyx_type_8ia_etree_Vorpal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
749 __pyx_ptype_8ia_etree_Vorpal = &__pyx_type_8ia_etree_Vorpal;
751 /* "/Local/Projects/D/Pyrex/Source/Tests/Bugs/behnel/behnel5/ia_etree.pyx":17 */
752 return;
753 __pyx_L1:;
754 Py_XDECREF(__pyx_1);
755 __Pyx_AddTraceback("ia_etree");
756 }
758 static char *__pyx_filenames[] = {
759 "ia_etree.pyx",
760 };
762 /* Runtime support code */
764 static void __pyx_init_filenames(void) {
765 __pyx_f = __pyx_filenames;
766 }
768 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
769 while (t->p) {
770 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
771 if (!*t->p)
772 return -1;
773 if (t->i)
774 PyString_InternInPlace(t->p);
775 ++t;
776 }
777 return 0;
778 }
780 static int __Pyx_ExportFunction(char *n, void *f, char *s) {
781 PyObject *d = 0;
782 PyObject *p = 0;
783 d = PyObject_GetAttrString(__pyx_m, "__pyx_capi__");
784 if (!d) {
785 PyErr_Clear();
786 d = PyDict_New();
787 if (!d)
788 goto bad;
789 Py_INCREF(d);
790 if (PyModule_AddObject(__pyx_m, "__pyx_capi__", d) < 0)
791 goto bad;
792 }
793 p = PyCObject_FromVoidPtrAndDesc(f, s, 0);
794 if (!p)
795 goto bad;
796 if (PyDict_SetItemString(d, n, p) < 0)
797 goto bad;
798 Py_DECREF(d);
799 return 0;
800 bad:
801 Py_XDECREF(p);
802 Py_XDECREF(d);
803 return -1;
804 }
806 #include "compile.h"
807 #include "frameobject.h"
808 #include "traceback.h"
810 static void __Pyx_AddTraceback(char *funcname) {
811 PyObject *py_srcfile = 0;
812 PyObject *py_funcname = 0;
813 PyObject *py_globals = 0;
814 PyObject *empty_tuple = 0;
815 PyObject *empty_string = 0;
816 PyCodeObject *py_code = 0;
817 PyFrameObject *py_frame = 0;
819 py_srcfile = PyString_FromString(__pyx_filename);
820 if (!py_srcfile) goto bad;
821 py_funcname = PyString_FromString(funcname);
822 if (!py_funcname) goto bad;
823 py_globals = PyModule_GetDict(__pyx_m);
824 if (!py_globals) goto bad;
825 empty_tuple = PyTuple_New(0);
826 if (!empty_tuple) goto bad;
827 empty_string = PyString_FromString("");
828 if (!empty_string) goto bad;
829 py_code = PyCode_New(
830 0, /*int argcount,*/
831 0, /*int nlocals,*/
832 0, /*int stacksize,*/
833 0, /*int flags,*/
834 empty_string, /*PyObject *code,*/
835 empty_tuple, /*PyObject *consts,*/
836 empty_tuple, /*PyObject *names,*/
837 empty_tuple, /*PyObject *varnames,*/
838 empty_tuple, /*PyObject *freevars,*/
839 empty_tuple, /*PyObject *cellvars,*/
840 py_srcfile, /*PyObject *filename,*/
841 py_funcname, /*PyObject *name,*/
842 __pyx_lineno, /*int firstlineno,*/
843 empty_string /*PyObject *lnotab*/
844 );
845 if (!py_code) goto bad;
846 py_frame = PyFrame_New(
847 PyThreadState_Get(), /*PyThreadState *tstate,*/
848 py_code, /*PyCodeObject *code,*/
849 py_globals, /*PyObject *globals,*/
850 0 /*PyObject *locals*/
851 );
852 if (!py_frame) goto bad;
853 py_frame->f_lineno = __pyx_lineno;
854 PyTraceBack_Here(py_frame);
855 bad:
856 Py_XDECREF(py_srcfile);
857 Py_XDECREF(py_funcname);
858 Py_XDECREF(empty_tuple);
859 Py_XDECREF(empty_string);
860 Py_XDECREF(py_code);
861 Py_XDECREF(py_frame);
862 }
