| 1 |
#include <R.h> |
| 2 |
#include <Rinternals.h> |
| 3 |
#include "sp.h" |
| 4 |
|
| 5 |
#include <R_ext/Rdynload.h> |
| 6 |
|
| 7 |
static const R_CMethodDef CEntries[] = { |
| 8 |
|
| 9 |
|
| 10 |
{"setup_poly_minmax", (DL_FUNC) &setup_poly_minmax, 1}, |
| 11 |
{"InPoly", (DL_FUNC) &InPoly, 2}, |
| 12 |
{"sarea", (DL_FUNC) &sarea, 7}, |
| 13 |
{"spRFindCG", (DL_FUNC) &spRFindCG, 6}, |
| 14 |
{"sp_gcdist", (DL_FUNC) &sp_gcdist, 5}, |
| 15 |
{"sp_dists", (DL_FUNC) &sp_dists, 7}, |
| 16 |
{"sp_dists_NN", (DL_FUNC) &sp_dists_NN, 7}, |
| 17 |
{"sp_lengths", (DL_FUNC) &sp_lengths, 5}, |
| 18 |
|
| 19 |
{"spRFindCG_c", (DL_FUNC) &spRFindCG_c, 5}, |
| 20 |
{"comm2comment", (DL_FUNC) &comm2comment, 4}, |
| 21 |
{NULL, NULL, 0} |
| 22 |
}; |
| 23 |
|
| 24 |
static R_CallMethodDef CallEntries[] = { |
| 25 |
|
| 26 |
{"R_point_in_polygon_sp", (DL_FUNC) &R_point_in_polygon_sp, 4}, |
| 27 |
{"sp_zerodist", (DL_FUNC) &sp_zerodist, 5}, |
| 28 |
{"sp_duplicates", (DL_FUNC) &sp_duplicates, 5}, |
| 29 |
{"pointsInBox", (DL_FUNC) &pointsInBox, 3}, |
| 30 |
{"tList", (DL_FUNC) &tList, 2}, |
| 31 |
|
| 32 |
{"Polygon_c", (DL_FUNC) &Polygon_c, 3}, |
| 33 |
{"Polygons_c", (DL_FUNC) &Polygons_c, 2}, |
| 34 |
{"SpatialPolygons_c", (DL_FUNC) &SpatialPolygons_c, 3}, |
| 35 |
{"bboxCalcR_c", (DL_FUNC) &bboxCalcR_c, 1}, |
| 36 |
{"Polygon_validate_c", (DL_FUNC) &Polygon_validate_c, 1}, |
| 37 |
{"Polygons_validate_c", (DL_FUNC) &Polygons_validate_c, 1}, |
| 38 |
{"SpatialPolygons_validate_c", (DL_FUNC) &SpatialPolygons_validate_c, 1}, |
| 39 |
{"SpatialPolygons_getIDs_c", (DL_FUNC) &SpatialPolygons_getIDs_c, 1}, |
| 40 |
{"SpatialPolygons_plotOrder_c", (DL_FUNC) &SpatialPolygons_plotOrder_c, 1}, |
| 41 |
{"comment2comm", (DL_FUNC) &comment2comm, 1}, |
| 42 |
|
| 43 |
{NULL, NULL, 0} |
| 44 |
}; |
| 45 |
|
| 46 |
|
| 47 |
void |
| 48 |
#ifdef HAVE_VISIBILITY_ATTRIBUTE |
| 49 |
__attribute__ ((visibility ("default"))) |
| 50 |
#endif |
| 51 |
R_init_sp(DllInfo *dll) |
| 52 |
{ |
| 53 |
R_registerRoutines(dll, CEntries, CallEntries, NULL, NULL); |
| 54 |
R_useDynamicSymbols(dll, FALSE); |
| 55 |
|
| 56 |
} |
| 57 |
|