~ubuntu-branches/ubuntu/wily/python-imaging/wily

« back to all changes in this revision

Viewing changes to outline.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-31 20:49:20 UTC
  • mfrom: (1.1.4)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130131204920-7tnuhqhlsqdza4c2
Rewrite build dependencies to allow cross builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "Python.h"
21
21
 
22
 
#if PY_VERSION_HEX < 0x01060000
23
 
#define PyObject_New PyObject_NEW
24
 
#define PyObject_Del PyMem_DEL
25
 
#endif
26
 
 
27
22
#include "Imaging.h"
28
23
 
29
24
 
35
30
    ImagingOutline outline;
36
31
} OutlineObject;
37
32
 
38
 
staticforward PyTypeObject OutlineType;
 
33
static PyTypeObject OutlineType;
39
34
 
40
 
#define PyOutline_Check(op) ((op)->ob_type == &OutlineType)
 
35
#define PyOutline_Check(op) (Py_TYPE(op) == &OutlineType)
41
36
 
42
37
static OutlineObject*
43
38
_outline_new(void)
44
39
{
45
40
    OutlineObject *self;
46
41
 
 
42
    if (PyType_Ready(&OutlineType) < 0)
 
43
        return NULL;
 
44
 
47
45
    self = PyObject_New(OutlineObject, &OutlineType);
48
46
    if (self == NULL)
49
47
        return NULL;
159
157
    {NULL, NULL} /* sentinel */
160
158
};
161
159
 
162
 
static PyObject*  
163
 
_outline_getattr(OutlineObject* self, char* name)
164
 
{
165
 
    return Py_FindMethod(_outline_methods, (PyObject*) self, name);
166
 
}
167
 
 
168
 
statichere PyTypeObject OutlineType = {
169
 
        PyObject_HEAD_INIT(NULL)
170
 
        0,                              /*ob_size*/
 
160
static PyTypeObject OutlineType = {
 
161
        PyVarObject_HEAD_INIT(NULL, 0)
171
162
        "Outline",                      /*tp_name*/
172
163
        sizeof(OutlineObject),          /*tp_size*/
173
164
        0,                              /*tp_itemsize*/
174
165
        /* methods */
175
166
        (destructor)_outline_dealloc,   /*tp_dealloc*/
176
167
        0,                              /*tp_print*/
177
 
        (getattrfunc)_outline_getattr,  /*tp_getattr*/
178
 
        0                               /*tp_setattr*/
 
168
    0,                          /*tp_getattr*/
 
169
    0,                          /*tp_setattr*/
 
170
    0,                          /*tp_compare*/
 
171
    0,                          /*tp_repr*/
 
172
    0,                          /*tp_as_number */
 
173
    0,                          /*tp_as_sequence */
 
174
    0,                          /*tp_as_mapping */
 
175
    0,                          /*tp_hash*/
 
176
    0,                          /*tp_call*/
 
177
    0,                          /*tp_str*/
 
178
    0,                          /*tp_getattro*/
 
179
    0,                          /*tp_setattro*/
 
180
    0,                          /*tp_as_buffer*/
 
181
    Py_TPFLAGS_DEFAULT,         /*tp_flags*/
 
182
    0,                          /*tp_doc*/
 
183
    0,                          /*tp_traverse*/
 
184
    0,                          /*tp_clear*/
 
185
    0,                          /*tp_richcompare*/
 
186
    0,                          /*tp_weaklistoffset*/
 
187
    0,                          /*tp_iter*/
 
188
    0,                          /*tp_iternext*/
 
189
    _outline_methods,           /*tp_methods*/
 
190
    0,                          /*tp_members*/
 
191
    0,                          /*tp_getset*/
179
192
};