[Rcpp-commits] r1153 - scripts

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 4 08:07:02 CEST 2010


Author: romain
Date: 2010-05-04 08:07:01 +0200 (Tue, 04 May 2010)
New Revision: 1153

Modified:
   scripts/preprocessor.R
Log:
small addition to RCPP_FUNCTION

Modified: scripts/preprocessor.R
===================================================================
--- scripts/preprocessor.R	2010-05-04 02:53:42 UTC (rev 1152)
+++ scripts/preprocessor.R	2010-05-04 06:07:01 UTC (rev 1153)
@@ -7,6 +7,14 @@
 rcpp_function <- sapply( 0:65, function(i){
 	txt <- sprintf( '
 #define RCPP_FUNCTION_%d(__OUT__,__NAME__%s)        \\
+extern "C" SEXP __NAME__##__rcpp_info__( ){         \\
+    return Rcpp::List(                              \\
+        _["n"]   = %d ,                             \\
+        _["out"] = #__OUT__ ,                       \\
+        _["in"]  = CharacterVector::create(         \\
+        	%s                                       \\
+        	) ) ;                                    \\
+}                                                   \\
 __OUT__ RCPP_DECORATE(__NAME__)(%s) ;               \\
 extern "C" SEXP __NAME__(%s){                       \\
 SEXP res = R_NilValue ;                             \\
@@ -18,6 +26,8 @@
 __OUT__ RCPP_DECORATE(__NAME__)(%s)', 
 	i,
 	if( i == 0 ) "" else paste( ",", paste( sprintf( "___%d", 0:(i-1)), collapse=", ") ),
+	i, 
+	if( i == 0 ) "" else paste( sprintf( "#___%d", 0:(i-1)), collapse=", "),
 	if( i == 0 ) "" else paste( sprintf( "___%d", 0:(i-1)), collapse=", "),
 	if( i == 0 ) "" else paste( sprintf( "SEXP x%d", 0:(i-1) ), collapse = ", " ), 
 	if( i == 0 ) "" else paste( sprintf( "::Rcpp::internal::converter( x%d )", 0:(i-1) ), collapse = ", " ), 



More information about the Rcpp-commits mailing list