Skip to content

Commit

Permalink
added source file for native registration
Browse files Browse the repository at this point in the history
  • Loading branch information
markvanderloo committed Apr 7, 2017
1 parent 7ddb243 commit be4a3e9
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions pkg/src/R_register_native.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include <R.h>
#include <Rinternals.h>
#include <stdlib.h> // for NULL
#include <R_ext/Rdynload.h>

/* FIXME:
Check these declarations against the C/Fortran source code.
*/

/* .Call calls */
extern SEXP R_all_int(SEXP);
extern SEXP R_amatch(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP R_get_qgrams(SEXP, SEXP);
extern SEXP R_lengths(SEXP);
extern SEXP R_lower_tri(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
extern SEXP R_soundex(SEXP, SEXP);
extern SEXP R_stringdist(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);

static const R_CallMethodDef CallEntries[] = {
{"R_all_int", (DL_FUNC) &R_all_int, 1},
{"R_amatch", (DL_FUNC) &R_amatch, 11},
{"R_get_qgrams", (DL_FUNC) &R_get_qgrams, 2},
{"R_lengths", (DL_FUNC) &R_lengths, 1},
{"R_lower_tri", (DL_FUNC) &R_lower_tri, 7},
{"R_soundex", (DL_FUNC) &R_soundex, 2},
{"R_stringdist", (DL_FUNC) &R_stringdist, 8},
{NULL, NULL, 0}
};

void R_init_stringdist(DllInfo *dll)
{
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
}

0 comments on commit be4a3e9

Please sign in to comment.