diff --git a/com.oracle.truffle.r.native/fficall/jni/src/alloc.c b/com.oracle.truffle.r.native/fficall/jni/src/alloc.c index 0a8eed302df13b40e0c7824304ba0170eef2d7f3..6bb69ea2d2f6f046202b8af762386f6a4536364c 100644 --- a/com.oracle.truffle.r.native/fficall/jni/src/alloc.c +++ b/com.oracle.truffle.r.native/fficall/jni/src/alloc.c @@ -43,6 +43,12 @@ char *R_alloc(size_t n, int size) { return (char*) p; } +char* S_alloc(long n, int size) { + char *p = R_alloc(n, size); + memset(p, 0, n); + return p; +} + void allocExit() { int i; for (i = 0; i < tMemTableIndex; i++) { diff --git a/com.oracle.truffle.r.native/fficall/jni/src/applic.c b/com.oracle.truffle.r.native/fficall/jni/src/applic.c new file mode 100644 index 0000000000000000000000000000000000000000..f7229804c16182b81c5fd7ce38ff2f65fba2ee77 --- /dev/null +++ b/com.oracle.truffle.r.native/fficall/jni/src/applic.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +#include "rffiutils.h" +#include <R_ext/Applic.h> + +void init_applic(JNIEnv *env) { + +} + +void Rdqags(integr_fn f, void *ex, double *a, double *b, + double *epsabs, double *epsrel, + double *result, double *abserr, int *neval, int *ier, + int *limit, int *lenw, int *last, int *iwork, double *work) { + unimplemented("Rdqags"); +} + + +void Rdqagi(integr_fn f, void *ex, double *bound, int *inf, + double *epsabs, double *epsrel, + double *result, double *abserr, int *neval, int *ier, + int *limit, int *lenw, int *last, + int *iwork, double *work) { + unimplemented("Rdqagi"); +} diff --git a/com.oracle.truffle.r.native/fficall/jni/src/misc.c b/com.oracle.truffle.r.native/fficall/jni/src/misc.c index afbc0e520c3078fad8735763777443f0ce69bb7f..9cc7e40c13f8fa877f3e81b0ee6a80577a705fb6 100644 --- a/com.oracle.truffle.r.native/fficall/jni/src/misc.c +++ b/com.oracle.truffle.r.native/fficall/jni/src/misc.c @@ -63,6 +63,10 @@ void R_rsort(double *x, int n) { unimplemented("R_rsort"); } +void R_qsort_I (double *v, int *II, int i, int j) { + unimplemented("R_qsort_I"); +} + void R_qsort_int_I(int *iv, int *II, int i, int j) { unimplemented("R_qsort_int_I"); } @@ -79,6 +83,14 @@ void R_CheckUserInterrupt() { // TODO (we don't even do this in the Java code) } +void R_CheckStack(void) { + unimplemented("R_CheckStack"); +} + +void R_CheckStack2(size_t x) { + unimplemented("R_CheckStack2"); +} + int R_finite(double x) { JNIEnv *env = getEnv(); return (*env)->CallStaticBooleanMethod(env, RRuntimeClass, isFiniteMethodID, x); @@ -89,6 +101,24 @@ int R_IsNaN(double x) { return (*env)->CallStaticBooleanMethod(env, RRuntimeClass, isNAorNaNMethodID, x); } +void Rprintf(const char *msg, ...) { + va_list argptr; + va_start(argptr, msg); + vprintf(msg, argptr); +} + +void REprintf(const char *x, ...) { + unimplemented("REprintf"); +} + +R_len_t R_BadLongVector(SEXP x, const char *y, int z) { + unimplemented("R_BadLongVector"); +} + +int R_IsNA(double x) { + unimplemented("R_IsNA"); +} + int IS_S4_OBJECT(SEXP x) { JNIEnv *env = getEnv(); return (*env)->CallStaticIntMethod(env, CallRFFIHelperClass, iS4ObjectMethodID, x); @@ -100,3 +130,8 @@ void SET_S4_OBJECT(SEXP x) { void UNSET_S4_OBJECT(SEXP x) { unimplemented("UNSET_S4_OBJECT"); } + +const char *R_ExpandFileName(const char *x) { + unimplemented("R_ExpandFileName"); +} + diff --git a/com.oracle.truffle.r.native/fficall/jni/src/rf_functions.c b/com.oracle.truffle.r.native/fficall/jni/src/rf_functions.c index 2c1c41fbb6d518a7daa28e864081413841729f8e..d12b27843470d3f842508c4c6f9129b04b19361e 100644 --- a/com.oracle.truffle.r.native/fficall/jni/src/rf_functions.c +++ b/com.oracle.truffle.r.native/fficall/jni/src/rf_functions.c @@ -122,6 +122,10 @@ SEXP Rf_allocMatrix(SEXPTYPE mode, int nrow, int ncol) { return checkRef(thisenv, result); } +SEXP Rf_allocList(int x) { + unimplemented("Rf_allocList)"); +} + SEXP Rf_cons(SEXP car, SEXP cdr) { JNIEnv *thisenv = getEnv(); SEXP result = (*thisenv)->CallStaticObjectMethod(thisenv, CallRFFIHelperClass, Rf_consMethodID, car, cdr); @@ -176,6 +180,10 @@ R_xlen_t Rf_any_duplicated(SEXP x, Rboolean from_last) { unimplemented("Rf_any_duplicated)"); } +SEXP Rf_duplicated(SEXP x, Rboolean y) { + unimplemented("Rf_duplicated)"); +} + Rboolean Rf_inherits(SEXP x, const char * klass) { unimplemented("Rf_inherits)"); } @@ -349,6 +357,10 @@ SEXP Rf_mkChar(const char *x) { return checkRef(thisenv, result); } +SEXP Rf_mkCharCE(const char *x, cetype_t y) { + unimplemented("Rf_mkCharCE"); +} + SEXP Rf_mkCharLenCE(const char *x, int len, cetype_t enc) { JNIEnv *thisenv = getEnv(); char buf[len + 1]; @@ -450,12 +462,6 @@ void Rf_warning(const char *format, ...) { (*thisenv)->CallStaticObjectMethod(thisenv, CallRFFIHelperClass, Rf_warningMethodID, string); } -void Rprintf(const char *msg, ...) { - va_list argptr; - va_start(argptr, msg); - vprintf(msg, argptr); -} - // Tools package support, not in public API SEXP R_NewHashedEnv(SEXP parent, SEXP size) { @@ -485,14 +491,6 @@ SEXP Rf_classgets(SEXP x, SEXP y) { unimplemented("Rf_classgets"); } -double Rf_fmax2(double x, double y) { - unimplemented("Rf_fmax2"); -} - -double Rf_fmin2(double x, double y) { - unimplemented("Rf_fmin2"); -} - const char *Rf_translateChar(SEXP x) { unimplemented("Rf_translateChar"); } diff --git a/com.oracle.truffle.r.native/fficall/jni/src/rmathc.c b/com.oracle.truffle.r.native/fficall/jni/src/rmathc.c index 47599d9a21a6432aaca08ff8b82ae4240604503e..231d4be28664d43220389723c85d6f8b45a889e7 100644 --- a/com.oracle.truffle.r.native/fficall/jni/src/rmathc.c +++ b/com.oracle.truffle.r.native/fficall/jni/src/rmathc.c @@ -26,6 +26,98 @@ void init_rmath(JNIEnv *env) { } +double Rf_choose(double x, double y) { + unimplemented("Rf_choose"); +} + +double Rf_lchoose(double x, double y) { + unimplemented("Rf_lchoose"); +} + +double Rf_dbeta(double x, double y, double z, int w) { + unimplemented("Rf_dbeta"); +} + +double Rf_pbeta(double x, double y, double z, int w , int v) { + unimplemented("Rf_pbeta"); +} + +double Rf_qbeta(double x, double y, double z, int w , int v) { + unimplemented("Rf_qbeta"); +} + +double Rf_rbeta(double x, double y) { + unimplemented("Rf_rbeta"); +} + double Rf_dnorm4(double a, double b, double c , int d) { unimplemented("Rf_dnorm4"); } + +double Rf_pnorm5(double x, double y, double z, int w, int v) { + unimplemented("Rf_pnorm5"); +} + +int Rf_imax2(int x, int y) { + unimplemented("Rf_imax2"); +} + +int Rf_imin2(int x, int y) { + unimplemented("Rf_imin2"); +} + +double Rf_fmax2(double x, double y) { + unimplemented("Rf_fmax2"); +} + +double Rf_fmin2(double x, double y) { + unimplemented("Rf_fmin2"); +} + +double Rf_sign(double x) { + unimplemented("Rf_sign"); +} + +double Rf_runif(double x, double y) { + unimplemented("Rf_runif"); +} + +double Rf_gammafn(double x) { + unimplemented("Rf_gammafn"); +} + +double Rf_lgammafn(double x) { + unimplemented("Rf_lgammafn"); +} + +double Rf_lgammafn_sign(double x, int*y) { + unimplemented("Rf_lgammafn_sign"); +} + +double R_pow(double x, double y) { + unimplemented("R_pow"); +} + +double R_pow_di(double x , int y) { + unimplemented("R_pow_di"); +} + +double Rf_dchisq(double x, double y, int z) { + unimplemented("Rf_dchisq"); +} + +double Rf_pchisq(double x, double y, int z, int w) { + unimplemented("Rf_pchisq"); +} + +double Rf_qchisq(double x, double y, int z, int w) { + unimplemented("Rf_qchisq"); +} + +double Rf_rchisq(double x) { + unimplemented("Rf_rchisq"); +} + +double Rf_dexp(double x, double y, int z) { + unimplemented("Rf_dexp"); +}