REALSXP, /* double *expected */ INTSXP, /* int *observed */ REALSXP, /* double *fact */ INTSXP, /* int *jwork */ REALSXP /* double *results */ }; static const R_CMethodDef cMethods[] = { {"gtestsim", (DL_FUNC) >estsim, 11, gtestsim_t}, {NULL, NULL, 0} }; static const R_CallMethodDef callMethods[] = { /* utils.c */ CALLMETHOD_DEF(debug_utils, 0), /* RoSeqs_utils.c */ CALLMETHOD_DEF(debug_RoSeqs_utils, 0), /* XString_class.c */ CALLMETHOD_DEF(debug_XString_class, 0), CALLMETHOD_DEF(init_DNAlkups, 2), CALLMETHOD_DEF(init_RNAlkups, 2), CALLMETHOD_DEF(new_XString_from_CHARACTER, 5), CALLMETHOD_DEF(new_CHARACTER_from_XString, 2), /* XStringSet_class.c */ CALLMETHOD_DEF(debug_XStringSet_class, 0), CALLMETHOD_DEF(new_XStringSet_from_CHARACTER, 6), CALLMETHOD_DEF(new_CHARACTER_from_XStringSet, 2),
#include "TKF91.h" #include "TKF92.h" #include "TKF92HG.h" #include "matrix.h" #define CALLMETHOD_DEF(fun, numArgs) {#fun, (DL_FUNC) &fun, numArgs} static const R_CallMethodDef callMethods[] = { /* TKF91.c */ CALLMETHOD_DEF(TKF91LikelihoodFunctionWrapper, 7), CALLMETHOD_DEF(TKF91LikelihoodFunction1DMain, 6), CALLMETHOD_DEF(TKF91LikelihoodFunction2DMainNM, 5), // CALLMETHOD_DEF(TKF91LikelihoodFunction2DMain_nlopt, 6), /* TKF92.c */ CALLMETHOD_DEF(TKF92LikelihoodFunctionWrapper, 8), CALLMETHOD_DEF(TKF92LikelihoodFunction1DMain, 7), CALLMETHOD_DEF(TKF92LikelihoodFunction3DMainNM, 5), // CALLMETHOD_DEF(TKF92LikelihoodFunction3DMain_nlopt, 6), /* TKF92HG.c */ CALLMETHOD_DEF(TKF92HGLikelihoodFunctionWrapper, 10), CALLMETHOD_DEF(TKF92HGLikelihoodFunction1DMain, 9), CALLMETHOD_DEF(TKF92HGLikelihoodFunction5DMainNM, 5), // CALLMETHOD_DEF(TKF92HGLikelihoodFunction5DMain_nlopt, 6), /* matrix.c */ CALLMETHOD_DEF(PAMnR, 2), {NULL, NULL, 0} };
#include "IRanges_defines.h" #include <R_ext/Rdynload.h> //define some macros to make registering functions easier #define CALLMETHOD_DEF(fun, numArgs) {#fun, (DL_FUNC) &fun, numArgs} #define REGISTER_CCALLABLE(fun) \ R_RegisterCCallable("IRanges", #fun, (DL_FUNC) &fun) //registration information: //Each routine in the registration information is specified by giving a name along with the address of the routine and any information about the number and type of the parameters. static const R_CallMethodDef callMethods[] = { /* RleViews_utils.c */ CALLMETHOD_DEF(RleViews_viewMuls, 3) /* XIntegerViews_utils.c */ /*CALLMETHOD_DEF(XIntegerViews_summaryN, 3),*/ }; //Init function for this package, // get (retrieve) callable functions from the IRanges package // using R_GetCCallable (http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Registering-native-routines) // get pointers to functions with name p_functionName //these are originally defined in IRanges_interface.h void R_init_IRangeKernels(DllInfo *info) {
#include <R_ext/Rdynload.h> #include <R_ext/Visibility.h> #include "init.h" static const R_CallMethodDef callMethods[] = { CALLMETHOD_DEF(rarg_parse, 5), CALLMETHOD_DEF(rarg_isInit, 0), CALLMETHOD_DEF(rarg_get, 1), CALLMETHOD_DEF(rarg_getPos, 2), CALLMETHOD_DEF(rarg_present, 1), {NULL, NULL, 0} }; void attribute_visible R_init_ribiosArg(DllInfo *info) { R_registerRoutines(info, NULL, callMethods, NULL, NULL); R_useDynamicSymbols(info, FALSE); R_forceSymbols(info, TRUE); }
#include "IRanges.h" #define CALLMETHOD_DEF(fun, numArgs) {#fun, (DL_FUNC) &fun, numArgs} #define REGISTER_CCALLABLE(fun) \ R_RegisterCCallable("IRanges", #fun, (DL_FUNC) &fun) static const R_CallMethodDef callMethods[] = { /* Ranges_class.c */ CALLMETHOD_DEF(valid_Ranges, 3), /* Ranges_comparison.c */ CALLMETHOD_DEF(Ranges_compare, 4), /* IRanges_class.c */ CALLMETHOD_DEF(debug_IRanges_class, 0), CALLMETHOD_DEF(IRanges_isNormal, 1), CALLMETHOD_DEF(IRanges_from_integer, 1), CALLMETHOD_DEF(NormalIRanges_from_logical, 1), /* IRanges_constructor.c */ CALLMETHOD_DEF(solve_user_SEW0, 3), CALLMETHOD_DEF(solve_user_SEW, 6), /* Grouping_class.c */ CALLMETHOD_DEF(debug_Grouping_class, 0), CALLMETHOD_DEF(H2LGrouping_members, 2), CALLMETHOD_DEF(H2LGrouping_vmembers, 2),