xref: /sqlite-3.40.0/ext/rtree/sqlite3rtree.h (revision 3b5a7a37)
1 
2 #include <sqlite3.h>
3 
4 typedef struct RtreeGeometry RtreeGeometry;
5 
6 struct RtreeGeometry {
7   void *pContext;                 /* Copy of pContext passed to s_r_g_c() */
8   int nParam;                     /* Size of array aParam[] */
9   double *aParam;                 /* Parameters passed to SQL geom function */
10   void *pUser;                    /* Callback implementation user data */
11   void (*xDelUser)(void *);       /* Called by SQLite to clean up pUser */
12 };
13 
14 /*
15 ** Register a geometry callback named zGeom that can be used as part of an
16 ** R-Tree geometry query as follows:
17 **
18 **   SELECT ... FROM <rtree> WHERE <rtree> MATCH $zGeom(... params ...)
19 */
20 int sqlite3_rtree_geometry_callback(
21   sqlite3 *db,
22   const char *zGeom,
23   int (*xGeom)(RtreeGeometry *, int nCoord, double *aCoord, int *piResOut),
24   void *pContext
25 );
26 
27