/[thuban]/branches/WIP-pyshapelib-bramz/libraries/pyshapelib/pyshapelib_api.h
ViewVC logotype

Annotation of /branches/WIP-pyshapelib-bramz/libraries/pyshapelib/pyshapelib_api.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1611 - (hide annotations)
Tue Aug 19 21:24:20 2003 UTC (21 years, 6 months ago) by jan
Original Path: trunk/thuban/libraries/pyshapelib/pyshapelib_api.h
File MIME type: text/plain
File size: 1318 byte(s)
These files have been moved here from thuban/extensions/pyshapelib/
See there in the Attic for the older history.

1 jan 1611 /* Header file for the PyShapelib API for other Python modules */
2     /* $Revision$ */
3    
4     #ifndef PYSHAPELIB_API_H
5     #define PYSHAPELIB_API_H
6    
7     typedef struct {
8     /* Shapefile functions */
9     SHPObject * (*SHPReadObject)(SHPHandle hSHP, int iShape);
10     void (*SHPDestroyObject)(SHPObject * psObject);
11    
12     /* SHPTree functions */
13     SHPTree * (*SHPCreateTree)(SHPHandle hSHP, int nDimension, int nMaxDepth,
14     double *padfBoundsMin, double *padfBoundsMax);
15     void (*SHPDestroyTree)(SHPTree * hTree);
16     int * (*SHPTreeFindLikelyShapes)(SHPTree * hTree, double * padfBoundsMin,
17     double * padfBoundsMax, int *);
18     } PyShapeLibAPI;
19    
20    
21     /* Macro to import the shapelib module, extract the API pointer and
22     * assign it to the variable given as argument */
23     #define PYSHAPELIB_IMPORT_API(apivariable) \
24     { \
25     PyObject * shapelib = PyImport_ImportModule("shapelibc"); \
26     if (shapelib) \
27     { \
28     PyObject * c_api_func = PyObject_GetAttrString(shapelib, "c_api"); \
29     if (c_api_func) \
30     { \
31     PyObject * cobj = PyObject_CallObject(c_api_func, NULL); \
32     if (cobj) \
33     { \
34     (apivariable) = (PyShapeLibAPI*)PyCObject_AsVoidPtr(cobj); \
35     } \
36     } \
37     } \
38     }
39    
40    
41     #endif /* PYSHAPELIB_API_H */

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26