annotate Objects/cobject.c @ 32527:0da660e05e69 legacy-trunk

"#if WITH_THREAD" is incorrect; must be #ifdef instead; WITH_THREAD isn't always set to an integer value when it's defined.
author Tim Peters <tim.peters@gmail.com>
date Wed, 07 Jul 2004 20:42:07 +0000
parents 07a0a0726649
children 74a598964c96
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3315
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
1
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 /* Wrap void* pointers to be passed between C modules */
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
3
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
4 #include "Python.h"
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
5
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
6
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 /* Declarations for objects of type PyCObject */
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
8
13447
a89f7f268de4 Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents: 13256
diff changeset
9 typedef void (*destructor1)(void *);
a89f7f268de4 Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents: 13256
diff changeset
10 typedef void (*destructor2)(void *, void*);
6509
f022bbd12338 New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
Guido van Rossum <guido@python.org>
parents: 5115
diff changeset
11
3315
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 typedef struct {
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
13 PyObject_HEAD
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
14 void *cobject;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
15 void *desc;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
16 void (*destructor)(void *);
3315
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 } PyCObject;
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
18
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 PyObject *
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
20 PyCObject_FromVoidPtr(void *cobj, void (*destr)(void *))
3315
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 {
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
22 PyCObject *self;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
23
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
24 self = PyObject_NEW(PyCObject, &PyCObject_Type);
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
25 if (self == NULL)
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
26 return NULL;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
27 self->cobject=cobj;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
28 self->destructor=destr;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
29 self->desc=NULL;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
30
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
31 return (PyObject *)self;
6509
f022bbd12338 New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
Guido van Rossum <guido@python.org>
parents: 5115
diff changeset
32 }
f022bbd12338 New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
Guido van Rossum <guido@python.org>
parents: 5115
diff changeset
33
f022bbd12338 New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
Guido van Rossum <guido@python.org>
parents: 5115
diff changeset
34 PyObject *
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
35 PyCObject_FromVoidPtrAndDesc(void *cobj, void *desc,
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
36 void (*destr)(void *, void *))
6509
f022bbd12338 New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
Guido van Rossum <guido@python.org>
parents: 5115
diff changeset
37 {
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
38 PyCObject *self;
6509
f022bbd12338 New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
Guido van Rossum <guido@python.org>
parents: 5115
diff changeset
39
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
40 if (!desc) {
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
41 PyErr_SetString(PyExc_TypeError,
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
42 "PyCObject_FromVoidPtrAndDesc called with null"
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
43 " description");
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
44 return NULL;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
45 }
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
46 self = PyObject_NEW(PyCObject, &PyCObject_Type);
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
47 if (self == NULL)
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
48 return NULL;
29814
cb3ce7cec261 Add whitespace.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23832
diff changeset
49 self->cobject = cobj;
cb3ce7cec261 Add whitespace.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23832
diff changeset
50 self->destructor = (destructor1)destr;
cb3ce7cec261 Add whitespace.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23832
diff changeset
51 self->desc = desc;
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
52
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
53 return (PyObject *)self;
3315
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
54 }
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
55
5033
5b7b703dabfa Added PyCObject_Import.
Guido van Rossum <guido@python.org>
parents: 4584
diff changeset
56 void *
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
57 PyCObject_AsVoidPtr(PyObject *self)
5033
5b7b703dabfa Added PyCObject_Import.
Guido van Rossum <guido@python.org>
parents: 4584
diff changeset
58 {
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
59 if (self) {
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
60 if (self->ob_type == &PyCObject_Type)
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
61 return ((PyCObject *)self)->cobject;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
62 PyErr_SetString(PyExc_TypeError,
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
63 "PyCObject_AsVoidPtr with non-C-object");
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
64 }
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
65 if (!PyErr_Occurred())
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
66 PyErr_SetString(PyExc_TypeError,
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
67 "PyCObject_AsVoidPtr called with null pointer");
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
68 return NULL;
5033
5b7b703dabfa Added PyCObject_Import.
Guido van Rossum <guido@python.org>
parents: 4584
diff changeset
69 }
5b7b703dabfa Added PyCObject_Import.
Guido van Rossum <guido@python.org>
parents: 4584
diff changeset
70
5b7b703dabfa Added PyCObject_Import.
Guido van Rossum <guido@python.org>
parents: 4584
diff changeset
71 void *
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
72 PyCObject_GetDesc(PyObject *self)
6509
f022bbd12338 New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
Guido van Rossum <guido@python.org>
parents: 5115
diff changeset
73 {
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
74 if (self) {
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
75 if (self->ob_type == &PyCObject_Type)
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
76 return ((PyCObject *)self)->desc;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
77 PyErr_SetString(PyExc_TypeError,
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
78 "PyCObject_GetDesc with non-C-object");
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
79 }
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
80 if (!PyErr_Occurred())
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
81 PyErr_SetString(PyExc_TypeError,
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
82 "PyCObject_GetDesc called with null pointer");
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
83 return NULL;
6509
f022bbd12338 New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
Guido van Rossum <guido@python.org>
parents: 5115
diff changeset
84 }
f022bbd12338 New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
Guido van Rossum <guido@python.org>
parents: 5115
diff changeset
85
f022bbd12338 New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
Guido van Rossum <guido@python.org>
parents: 5115
diff changeset
86 void *
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
87 PyCObject_Import(char *module_name, char *name)
5033
5b7b703dabfa Added PyCObject_Import.
Guido van Rossum <guido@python.org>
parents: 4584
diff changeset
88 {
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
89 PyObject *m, *c;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
90 void *r = NULL;
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
91
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
92 if ((m = PyImport_ImportModule(module_name))) {
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
93 if ((c = PyObject_GetAttrString(m,name))) {
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
94 r = PyCObject_AsVoidPtr(c);
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
95 Py_DECREF(c);
5033
5b7b703dabfa Added PyCObject_Import.
Guido van Rossum <guido@python.org>
parents: 4584
diff changeset
96 }
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
97 Py_DECREF(m);
5033
5b7b703dabfa Added PyCObject_Import.
Guido van Rossum <guido@python.org>
parents: 4584
diff changeset
98 }
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
99 return r;
5033
5b7b703dabfa Added PyCObject_Import.
Guido van Rossum <guido@python.org>
parents: 4584
diff changeset
100 }
5b7b703dabfa Added PyCObject_Import.
Guido van Rossum <guido@python.org>
parents: 4584
diff changeset
101
30716
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
102 int
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
103 PyCObject_SetVoidPtr(PyObject *_self, void *cobj)
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
104 {
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
105 PyCObject* self = (PyCObject*)_self;
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
106 if (self == NULL || !PyCObject_Check(self) ||
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
107 self->destructor != NULL) {
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
108 PyErr_SetString(PyExc_TypeError,
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
109 "Invalid call to PyCObject_SetVoidPtr");
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
110 return 0;
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
111 }
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
112 self->cobject = cobj;
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
113 return 1;
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
114 }
07a0a0726649 Make CObjects mutable. Fixes #477441.
Martin v. Löwis <martin@v.loewis.de>
parents: 29814
diff changeset
115
3315
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
116 static void
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
117 PyCObject_dealloc(PyCObject *self)
3315
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
118 {
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
119 if (self->destructor) {
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
120 if(self->desc)
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
121 ((destructor2)(self->destructor))(self->cobject, self->desc);
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
122 else
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
123 (self->destructor)(self->cobject);
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
124 }
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
125 PyObject_DEL(self);
3315
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
126 }
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
127
5033
5b7b703dabfa Added PyCObject_Import.
Guido van Rossum <guido@python.org>
parents: 4584
diff changeset
128
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 14375
diff changeset
129 PyDoc_STRVAR(PyCObject_Type__doc__,
3910
9cf11af3628c Allow compilation by K&R C compiler.
Guido van Rossum <guido@python.org>
parents: 3315
diff changeset
130 "C objects to be exported from one extension module to another\n\
9cf11af3628c Allow compilation by K&R C compiler.
Guido van Rossum <guido@python.org>
parents: 3315
diff changeset
131 \n\
9cf11af3628c Allow compilation by K&R C compiler.
Guido van Rossum <guido@python.org>
parents: 3315
diff changeset
132 C objects are used for communication between extension modules. They\n\
9cf11af3628c Allow compilation by K&R C compiler.
Guido van Rossum <guido@python.org>
parents: 3315
diff changeset
133 provide a way for an extension module to export a C interface to other\n\
9cf11af3628c Allow compilation by K&R C compiler.
Guido van Rossum <guido@python.org>
parents: 3315
diff changeset
134 extension modules, so that extension modules can use the Python import\n\
23832
ed1ba37a46b7 Patch #568124: Add doc string macros.
Martin v. Löwis <martin@v.loewis.de>
parents: 14375
diff changeset
135 mechanism to link to one another.");
3315
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
136
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
137 PyTypeObject PyCObject_Type = {
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
138 PyObject_HEAD_INIT(&PyType_Type)
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
139 0, /*ob_size*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
140 "PyCObject", /*tp_name*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
141 sizeof(PyCObject), /*tp_basicsize*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
142 0, /*tp_itemsize*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
143 /* methods */
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
144 (destructor)PyCObject_dealloc, /*tp_dealloc*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
145 (printfunc)0, /*tp_print*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
146 (getattrfunc)0, /*tp_getattr*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
147 (setattrfunc)0, /*tp_setattr*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
148 (cmpfunc)0, /*tp_compare*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
149 (reprfunc)0, /*tp_repr*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
150 0, /*tp_as_number*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
151 0, /*tp_as_sequence*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
152 0, /*tp_as_mapping*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
153 (hashfunc)0, /*tp_hash*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
154 (ternaryfunc)0, /*tp_call*/
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
155 (reprfunc)0, /*tp_str*/
3315
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
156
13450
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
157 /* Space for future expansion */
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
158 0L,0L,0L,0L,
4ad26968662b ANSI-fication of the source.
Fred Drake <fdrake@acm.org>
parents: 13447
diff changeset
159 PyCObject_Type__doc__ /* Documentation string */
3315
44f48aaca8bf opaque C object a la Jim Fulton
Guido van Rossum <guido@python.org>
parents:
diff changeset
160 };