diff --git a/inst/include/h3libapi.h b/inst/include/h3libapi.h index c4fae62..838b9b4 100644 --- a/inst/include/h3libapi.h +++ b/inst/include/h3libapi.h @@ -587,42 +587,42 @@ Direction(*fun)(H3Index, H3Index) = return fun(origin, destination); } -inline void _geoToFaceIjk(const LatLng *g, int res, FaceIJK *h) { - void(*fun)(const LatLng*, int, FaceIJK*) = - (void(*)(const LatLng*, int, FaceIJK*)) R_GetCCallable("h3lib", "_geoToFaceIjk"); - fun(g, res, h); -} - - -inline void _faceIjkToGeo(const FaceIJK *h, int res, LatLng *g) { - void(*fun)(const FaceIJK*, int, LatLng*) = - (void(*)(const FaceIJK*, int, LatLng*)) R_GetCCallable("h3lib", "_faceIjkToGeo"); - fun(h, res, g); -} - -inline void _geoToHex2d(const LatLng *g, int res, int *face, Vec2d *v) { - void(*fun)(const LatLng*, int, int*, Vec2d*) = - (void(*)(const LatLng*, int, int*, Vec2d*)) R_GetCCallable("h3lib", "_geoToHex2d"); - fun(g, res, face, v); -} - -inline void _hex2dToCoordIJK(const Vec2d *v, CoordIJK *h) { - void(*fun)(const Vec2d*, CoordIJK*) = - (void(*)(const Vec2d*, CoordIJK*)) R_GetCCallable("h3lib", "_hex2dToCoordIJK"); - fun(v, h); -} - -inline H3Error _h3ToFaceIjk(H3Index h, FaceIJK *fijk) { - H3Error(*fun)(H3Index, FaceIJK*) = - (H3Error(*)(H3Index, FaceIJK*)) R_GetCCallable("h3lib", "_h3ToFaceIjk"); - return fun(h, fijk); -} - -inline H3Index _faceIjkToH3(const FaceIJK *fijk, int res) { - H3Index(*fun)(const FaceIJK*, int) = - (H3Index(*)(const FaceIJK*, int)) R_GetCCallable("h3lib", "_faceIjkToH3"); - return fun(fijk, res); -} +// inline void _geoToFaceIjk(const LatLng *g, int res, FaceIJK *h) { +// void(*fun)(const LatLng*, int, FaceIJK*) = +// (void(*)(const LatLng*, int, FaceIJK*)) R_GetCCallable("h3lib", "_geoToFaceIjk"); +// fun(g, res, h); +// } +// +// +// inline void _faceIjkToGeo(const FaceIJK *h, int res, LatLng *g) { +// void(*fun)(const FaceIJK*, int, LatLng*) = +// (void(*)(const FaceIJK*, int, LatLng*)) R_GetCCallable("h3lib", "_faceIjkToGeo"); +// fun(h, res, g); +// } +// +// inline void _geoToHex2d(const LatLng *g, int res, int *face, Vec2d *v) { +// void(*fun)(const LatLng*, int, int*, Vec2d*) = +// (void(*)(const LatLng*, int, int*, Vec2d*)) R_GetCCallable("h3lib", "_geoToHex2d"); +// fun(g, res, face, v); +// } +// +// inline void _hex2dToCoordIJK(const Vec2d *v, CoordIJK *h) { +// void(*fun)(const Vec2d*, CoordIJK*) = +// (void(*)(const Vec2d*, CoordIJK*)) R_GetCCallable("h3lib", "_hex2dToCoordIJK"); +// fun(v, h); +// } +// +// inline H3Error _h3ToFaceIjk(H3Index h, FaceIJK *fijk) { +// H3Error(*fun)(H3Index, FaceIJK*) = +// (H3Error(*)(H3Index, FaceIJK*)) R_GetCCallable("h3lib", "_h3ToFaceIjk"); +// return fun(h, fijk); +// } +// +// inline H3Index _faceIjkToH3(const FaceIJK *fijk, int res) { +// H3Index(*fun)(const FaceIJK*, int) = +// (H3Index(*)(const FaceIJK*, int)) R_GetCCallable("h3lib", "_faceIjkToH3"); +// return fun(fijk, res); +// } inline H3Error cellToLocalIjk(H3Index origin, H3Index h3, CoordIJK *out) { H3Index(*fun)(H3Index, H3Index, CoordIJK*) = @@ -636,11 +636,11 @@ inline void _geoToClosestFace(const LatLng *g, int *face, double *sqd) { fun(g, face, sqd); } -inline void _ijkToHex2d(const CoordIJK *h, Vec2d *v) { - void(*fun)(const CoordIJK*, Vec2d*) = - (void(*)(const CoordIJK*, Vec2d*)) R_GetCCallable("h3lib", "_ijkToHex2d"); - fun(h, v); -} +// inline void _ijkToHex2d(const CoordIJK *h, Vec2d *v) { +// void(*fun)(const CoordIJK*, Vec2d*) = +// (void(*)(const CoordIJK*, Vec2d*)) R_GetCCallable("h3lib", "_ijkToHex2d"); +// fun(h, v); +// } #ifdef __cplusplus } diff --git a/src/init.c b/src/init.c index c138611..fc67852 100644 --- a/src/init.c +++ b/src/init.c @@ -97,15 +97,15 @@ void attribute_visible R_init_h3lib(DllInfo *info) // Non-API R_RegisterCCallable("h3lib", "directionForNeighbor", (DL_FUNC) &directionForNeighbor); - R_RegisterCCallable("h3lib", "_geoToFaceIjk", (DL_FUNC) &_geoToFaceIjk); - R_RegisterCCallable("h3lib", "_hex2dToCoordIJK", (DL_FUNC) &_hex2dToCoordIJK); - R_RegisterCCallable("h3lib", "_faceIjkToGeo", (DL_FUNC) &_faceIjkToGeo); - R_RegisterCCallable("h3lib", "_geoToHex2d", (DL_FUNC) &_geoToHex2d); - R_RegisterCCallable("h3lib", "_h3ToFaceIjk", (DL_FUNC) &_h3ToFaceIjk); - R_RegisterCCallable("h3lib", "_faceIjkToH3", (DL_FUNC) &_faceIjkToH3); - R_RegisterCCallable("h3lib", "cellToLocalIjk", (DL_FUNC) &cellToLocalIjk); + // R_RegisterCCallable("h3lib", "_geoToFaceIjk", (DL_FUNC) &_geoToFaceIjk); + // R_RegisterCCallable("h3lib", "_hex2dToCoordIJK", (DL_FUNC) &_hex2dToCoordIJK); + // R_RegisterCCallable("h3lib", "_faceIjkToGeo", (DL_FUNC) &_faceIjkToGeo); + // R_RegisterCCallable("h3lib", "_geoToHex2d", (DL_FUNC) &_geoToHex2d); + // R_RegisterCCallable("h3lib", "_h3ToFaceIjk", (DL_FUNC) &_h3ToFaceIjk); + // R_RegisterCCallable("h3lib", "_faceIjkToH3", (DL_FUNC) &_faceIjkToH3); + // R_RegisterCCallable("h3lib", "cellToLocalIjk", (DL_FUNC) &cellToLocalIjk); R_RegisterCCallable("h3lib", "_geoToClosestFace", (DL_FUNC) &_geoToClosestFace); - R_RegisterCCallable("h3lib", "_ijkToHex2d", (DL_FUNC) &_ijkToHex2d); + // R_RegisterCCallable("h3lib", "_ijkToHex2d", (DL_FUNC) &_ijkToHex2d); R_forceSymbols(info, TRUE); // controls visibility