[Rcpp-commits] r2167 - in pkg/Rcpp: R inst/unitTests src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Sep 25 02:15:42 CEST 2010


Author: jmc
Date: 2010-09-25 02:15:42 +0200 (Sat, 25 Sep 2010)
New Revision: 2167

Added:
   pkg/Rcpp/src/Rcpp_init.c
Modified:
   pkg/Rcpp/R/Module.R
   pkg/Rcpp/inst/unitTests/runit.modref.R
Log:
Rcpp_init.c file with registration for CpppField__{get,set} routines

Modified: pkg/Rcpp/R/Module.R
===================================================================
--- pkg/Rcpp/R/Module.R	2010-09-24 23:30:23 UTC (rev 2166)
+++ pkg/Rcpp/R/Module.R	2010-09-25 00:15:42 UTC (rev 2167)
@@ -225,10 +225,9 @@
     f <- function( x ) NULL
     body(f) <- substitute({
         if( missing( x ) )
-            .Call("CppField__get", class_pointer, pointer, .pointer, PACKAGE = "Rcpp")
+            .Call("CppField__get", class_pointer, pointer, .pointer)
         else
-            .Call("CppField__set", class_pointer, pointer, .pointer, x, 
-        PACKAGE = "Rcpp")
+            .Call("CppField__set", class_pointer, pointer, .pointer, x)
     }, list(class_pointer = FIELD$class_pointer,
             pointer = FIELD$pointer))
     environment(f) <- where

Modified: pkg/Rcpp/inst/unitTests/runit.modref.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.modref.R	2010-09-24 23:30:23 UTC (rev 2166)
+++ pkg/Rcpp/inst/unitTests/runit.modref.R	2010-09-25 00:15:42 UTC (rev 2167)
@@ -1,6 +1,6 @@
 #!/usr/bin/r -t
 #
-# Copyright (C) 2010	Dirk Eddelbuettel and Romain Francois
+# Copyright (C) 2010	John Chambers, Dirk Eddelbuettel and Romain Francois
 #
 # This file is part of Rcpp.
 #

Added: pkg/Rcpp/src/Rcpp_init.c
===================================================================
--- pkg/Rcpp/src/Rcpp_init.c	                        (rev 0)
+++ pkg/Rcpp/src/Rcpp_init.c	2010-09-25 00:15:42 UTC (rev 2167)
@@ -0,0 +1,48 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// Rcpp_init.c : Rcpp R/C++ interface class library -- Initialize and register
+//
+// Copyright (C) 2010	      John Chambers, Dirk Eddelbuettel and Romain Francois
+//
+//
+// This file is part of Rcpp.
+//
+// Rcpp is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// Rcpp 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 for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Rcpp.  If not, see <http://www.gnu.org/licenses/>.
+#include <R.h>
+#include <Rinternals.h>
+#include <R_ext/Rdynload.h>
+
+SEXP CppField__get(SEXP, SEXP, SEXP);
+SEXP CppField__set(SEXP, SEXP, SEXP, SEXP);
+
+
+static R_CallMethodDef callEntries[]  = {
+    {"CppField__get", (DL_FUNC) &CppField__get, 3},
+       {"CppField__set", (DL_FUNC) &CppField__set, 4},
+       {NULL, NULL, 0}
+     }; 
+ 
+void
+R_init_SoDA(DllInfo *info)
+{
+  /* Register routines, allocate resources. */
+  R_registerRoutines(info, NULL /* .C*/, callEntries /*.Call*/,
+		     NULL /* .Fortran */, NULL /*.Extern*/);
+}
+          
+void
+R_unload_SoDA(DllInfo *info)
+{
+  /* Release resources. */
+}



More information about the Rcpp-commits mailing list