0
|
1 /** ===========================================================================
|
|
2 ** R-Package: rdyncall
|
|
3 ** File: src/rpackage.c
|
|
4 ** Description: R package registry
|
|
5 **/
|
|
6
|
|
7 #include <Rinternals.h>
|
|
8 #include <R_ext/Rdynload.h>
|
|
9
|
|
10 /** ---------------------------------------------------------------------------
|
|
11 ** Package contents:
|
|
12 */
|
|
13
|
|
14 /* rdyncall.c */
|
|
15 SEXP r_new_callvm(SEXP callmode, SEXP size);
|
|
16 SEXP r_free_callvm(SEXP callvm);
|
|
17 SEXP r_dyncall(SEXP args); /* .External() with args = callvm, address, signature, args */
|
|
18
|
|
19 /* rdynload.c */
|
|
20 SEXP r_dynload(SEXP libpath);
|
|
21 SEXP r_dynsym(SEXP libobj, SEXP symname, SEXP protectlib);
|
|
22 SEXP r_dynunload(SEXP libobj);
|
|
23
|
|
24 /* rpack.c */
|
|
25 SEXP r_pack(SEXP ptr, SEXP offset, SEXP sig, SEXP value);
|
|
26 SEXP r_unpack(SEXP ptr, SEXP offset, SEXP sig);
|
|
27
|
|
28 /* rcallback.c */
|
|
29 SEXP r_new_callback(SEXP sig, SEXP fun, SEXP rho, SEXP mode);
|
|
30
|
|
31 /* rutils.c */
|
|
32 SEXP r_asextptr(SEXP v);
|
|
33 SEXP r_isnullptr(SEXP x);
|
|
34 SEXP r_offsetPtr(SEXP x, SEXP offset);
|
|
35
|
|
36 /* rutils_str.c */
|
|
37 SEXP r_ptr2str(SEXP ptr);
|
|
38 SEXP r_strarrayptr(SEXP ptr);
|
|
39 SEXP r_strptr(SEXP x);
|
|
40
|
|
41 /* rutils_float.c */
|
|
42 SEXP r_as_floatraw(SEXP real);
|
|
43 SEXP r_floatraw2numeric(SEXP floatraw);
|
|
44
|
|
45 /** ---------------------------------------------------------------------------
|
|
46 ** R Interface .External registry
|
|
47 */
|
|
48
|
|
49 R_ExternalMethodDef externalMethods[] =
|
|
50 {
|
|
51 /* --- rdyncall.c -------------------------------------------------------- */
|
|
52 {"dyncall", (DL_FUNC) &r_dyncall, -1},
|
|
53 /* --- end (sentinel) ---------------------------------------------------- */
|
|
54 {NULL,NULL,0}
|
|
55 };
|
|
56
|
|
57 /** ---------------------------------------------------------------------------
|
|
58 ** R Interface .Call registry
|
|
59 */
|
|
60
|
|
61 R_CallMethodDef callMethods[] =
|
|
62 {
|
|
63 /* --- rdyncall.c -------------------------------------------------------- */
|
|
64 {"new_callvm" , (DL_FUNC) &r_new_callvm , 2},
|
|
65 {"free_callvm" , (DL_FUNC) &r_free_callvm , 1},
|
|
66 /* --- rdynload.c -------------------------------------------------------- */
|
|
67 {"dynload" , (DL_FUNC) &r_dynload , 1},
|
|
68 {"dynsym" , (DL_FUNC) &r_dynsym , 3},
|
|
69 {"dynunload" , (DL_FUNC) &r_dynunload , 1},
|
|
70 /* --- rcallback.c ------------------------------------------------------- */
|
|
71 {"new_callback" , (DL_FUNC) &r_new_callback , 3},
|
|
72 /* --- rpack.c ----------------------------------------------------------- */
|
|
73 {"pack" , (DL_FUNC) &r_pack , 4},
|
|
74 {"unpack" , (DL_FUNC) &r_unpack , 3},
|
|
75 /* --- rutils.c ---------------------------------------------------------- */
|
|
76 {"asextptr" , (DL_FUNC) &r_asextptr , 1},
|
|
77 {"isnullptr" , (DL_FUNC) &r_isnullptr , 1},
|
|
78 {"offsetPtr" , (DL_FUNC) &r_offsetPtr , 2},
|
|
79 /* --- rutils_str.c ------------------------------------------------------ */
|
|
80 {"r_ptr2str" , (DL_FUNC) &r_ptr2str , 1},
|
|
81 {"r_strarrayptr" , (DL_FUNC) &r_strarrayptr , 1},
|
|
82 {"r_strptr" , (DL_FUNC) &r_strptr , 1},
|
|
83 /* --- rutils_float.c ---------------------------------------------------- */
|
|
84 {"r_as_floatraw" , (DL_FUNC) &r_as_floatraw , 1},
|
|
85 {"r_floatraw2numeric" , (DL_FUNC) &r_floatraw2numeric , 1},
|
|
86 /* --- end (sentinel) ---------------------------------------------------- */
|
|
87 {NULL,NULL, 0}
|
|
88 };
|
|
89
|
|
90 /** ---------------------------------------------------------------------------
|
|
91 ** R Library entry:
|
|
92 */
|
|
93
|
|
94 void R_init_rdyncall(DllInfo *info)
|
|
95 {
|
|
96 R_registerRoutines(info, NULL, callMethods, NULL, externalMethods);
|
|
97 }
|
|
98
|
|
99 void R_unload_rdyncall(DllInfo *info)
|
|
100 {
|
|
101 }
|