[Rcpp-commits] r4128 - in pkg/Rcpp: . inst/include inst/include/Rcpp inst/include/Rcpp/macros src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 10 13:47:38 CET 2012


Author: romain
Date: 2012-12-10 13:47:38 +0100 (Mon, 10 Dec 2012)
New Revision: 4128

Removed:
   pkg/Rcpp/inst/include/Rcpp/routines.h
Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/include/Rcpp/exceptions.h
   pkg/Rcpp/inst/include/Rcpp/macros/debug.h
   pkg/Rcpp/inst/include/RcppCommon.h
   pkg/Rcpp/src/Rcpp_init.c
   pkg/Rcpp/src/api.cpp
   pkg/Rcpp/src/barrier.cpp
   pkg/Rcpp/src/exceptions.cpp
   pkg/Rcpp/src/internal.h
Log:
more moving things out of Rcpp.h

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2012-12-10 12:23:49 UTC (rev 4127)
+++ pkg/Rcpp/ChangeLog	2012-12-10 12:47:38 UTC (rev 4128)
@@ -4,7 +4,7 @@
         and debugging.cpp content
         * include/platform/compiler.h: put here compiler specific deduction things
         * src/internal.h: new header to host function declarations for 
-        routines that are not exported into Rcpp.h (capabilities, ...)
+        routines that are not exported into Rcpp.h
         * src/Rcpp_init.c: export capabilities (renamed rcpp_capabilities)
         
 2012-12-09 Romain Francois <romain at r-enthusiasts.com>

Modified: pkg/Rcpp/inst/include/Rcpp/exceptions.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/exceptions.h	2012-12-10 12:23:49 UTC (rev 4127)
+++ pkg/Rcpp/inst/include/Rcpp/exceptions.h	2012-12-10 12:47:38 UTC (rev 4128)
@@ -25,7 +25,6 @@
 #define R_NO_REMAP
 #include <Rinternals.h>
 #include <sstream>
-#include <Rcpp/routines.h>
 
 SEXP stack_trace( const char *file, int line) ;
 #define GET_STACKTRACE() stack_trace( __FILE__, __LINE__ )

Modified: pkg/Rcpp/inst/include/Rcpp/macros/debug.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/macros/debug.h	2012-12-10 12:23:49 UTC (rev 4127)
+++ pkg/Rcpp/inst/include/Rcpp/macros/debug.h	2012-12-10 12:47:38 UTC (rev 4128)
@@ -27,14 +27,6 @@
 #define RCPP_DEBUG_LEVEL 0
 #endif
 
-#ifndef logTxt
-    #if RCPP_DEBUG_LEVEL > 0
-        #define logTxt(x) ::logTxtFunction(__FILE__, __LINE__, x);
-    #else
-        #define logTxt(x)
-    #endif
-#endif
-
 const char* short_file_name(const char* file) ;
 
 #if RCPP_DEBUG_LEVEL > 0

Deleted: pkg/Rcpp/inst/include/Rcpp/routines.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/routines.h	2012-12-10 12:23:49 UTC (rev 4127)
+++ pkg/Rcpp/inst/include/Rcpp/routines.h	2012-12-10 12:47:38 UTC (rev 4128)
@@ -1,87 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// routines.h: Rcpp R/C++ interface class library -- .Call exported routines
-//
-// Copyright (C) 2010 - 2011 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/>.
-
-#ifndef Rcpp__routines_h
-#define Rcpp__routines_h
-
-#define CALLFUN_0(name) SEXP name()
-#define CALLFUN_1(name) SEXP name(SEXP)
-#define CALLFUN_2(name) SEXP name(SEXP,SEXP)
-#define CALLFUN_3(name) SEXP name(SEXP,SEXP,SEXP)
-#define CALLFUN_4(name) SEXP name(SEXP,SEXP,SEXP,SEXP)
-#define CALLFUN_5(name) SEXP name(SEXP,SEXP,SEXP,SEXP,SEXP)
-#define EXTFUN(name) SEXP name(SEXP)
-
-// we have to do the ifdef __cplusplus dance because this file
-// is included both in C and C++ files
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-CALLFUN_1(Class__name);
-CALLFUN_1(Class__has_default_constructor) ;
-CALLFUN_1(CppClass__complete);
-CALLFUN_1(CppClass__methods);
-
-CALLFUN_1(Module__classes_info) ;
-CALLFUN_1(Module__complete) ;
-CALLFUN_1(Module__functions_arity);
-CALLFUN_1(Module__functions_names);
-CALLFUN_2(Module__get_class);
-CALLFUN_2(Module__has_class);
-CALLFUN_2(Module__has_function);
-CALLFUN_2(Module__get_function);
-CALLFUN_1(Module__name);
-CALLFUN_2(CppObject__finalize);
-
-CALLFUN_0(get_rcpp_cache);
-CALLFUN_0(init_Rcpp_cache);
-CALLFUN_0(reset_current_error);
-CALLFUN_1(rcpp_error_recorder);
-CALLFUN_1(rcpp_set_current_error);
-CALLFUN_0(rcpp_get_current_error);
-CALLFUN_1(rcpp_set_error_occured);
-CALLFUN_0(rcpp_get_error_occured);
-CALLFUN_1(rcpp_set_stack_trace);
-CALLFUN_0(rcpp_get_stack_trace);
-
-
-/* .External functions */
-EXTFUN(CppMethod__invoke) ;
-EXTFUN(CppMethod__invoke_void) ;
-EXTFUN(CppMethod__invoke_notvoid) ;
-EXTFUN(InternalFunction_invoke) ;
-EXTFUN(Module__invoke) ;
-EXTFUN(class__newInstance) ;
-EXTFUN(class__dummyInstance) ;
-
-#ifdef __cplusplus
-}
-#endif
-
-#undef CALLFUN_0
-#undef CALLFUN_1
-#undef CALLFUN_2
-#undef CALLFUN_3
-#undef CALLFUN_4
-#undef CALLFUN_5
-
-#endif

Modified: pkg/Rcpp/inst/include/RcppCommon.h
===================================================================
--- pkg/Rcpp/inst/include/RcppCommon.h	2012-12-10 12:23:49 UTC (rev 4127)
+++ pkg/Rcpp/inst/include/RcppCommon.h	2012-12-10 12:47:38 UTC (rev 4128)
@@ -28,8 +28,6 @@
 #include <Rcpp/config.h>
 #include <Rcpp/macros/macros.h>
 
-void logTxtFunction(const char* file, const int line, const char* expression ) ;
-
 /**
  * \brief Rcpp API
  */
@@ -186,7 +184,6 @@
 
 #include <Rcpp/sugar/sugar_forward.h>
 
-#include <Rcpp/routines.h>
 #include <Rcpp/cache.h>
 
 // "Rcout" iostream class contributed by Jelmer Ypma

Modified: pkg/Rcpp/src/Rcpp_init.c
===================================================================
--- pkg/Rcpp/src/Rcpp_init.c	2012-12-10 12:23:49 UTC (rev 4127)
+++ pkg/Rcpp/src/Rcpp_init.c	2012-12-10 12:47:38 UTC (rev 4128)
@@ -20,9 +20,6 @@
 // along with Rcpp.  If not, see <http://www.gnu.org/licenses/>.
 #include <R.h>
 #include <Rinternals.h>
-#include <R_ext/Rdynload.h>
-
-#include <Rcpp/routines.h>
 #include "internal.h"
 
 // borrowed from Matrix

Modified: pkg/Rcpp/src/api.cpp
===================================================================
--- pkg/Rcpp/src/api.cpp	2012-12-10 12:23:49 UTC (rev 4127)
+++ pkg/Rcpp/src/api.cpp	2012-12-10 12:47:38 UTC (rev 4128)
@@ -1097,10 +1097,6 @@
 // }}}
 
 // {{{ utilities (from RcppCommon.cpp)
-void logTxtFunction(const char* file, const int line, const char* expression) {
-    Rprintf("%s:%d %s\n", file, line, expression);
-}
-
 SEXP rcpp_can_use_cxx0x(){ 
 #ifdef HAS_VARIADIC_TEMPLATES
     return Rf_ScalarLogical( TRUE );

Modified: pkg/Rcpp/src/barrier.cpp
===================================================================
--- pkg/Rcpp/src/barrier.cpp	2012-12-10 12:23:49 UTC (rev 4127)
+++ pkg/Rcpp/src/barrier.cpp	2012-12-10 12:47:38 UTC (rev 4128)
@@ -22,7 +22,7 @@
 #define USE_RINTERNALS
 #include <Rinternals.h>
 #include <Rcpp/barrier.h>
-#include <Rcpp/routines.h>
+#include "internal.h"
 #include <Rcpp/cache.h>
 #include <algorithm>
 

Modified: pkg/Rcpp/src/exceptions.cpp
===================================================================
--- pkg/Rcpp/src/exceptions.cpp	2012-12-10 12:23:49 UTC (rev 4127)
+++ pkg/Rcpp/src/exceptions.cpp	2012-12-10 12:47:38 UTC (rev 4128)
@@ -24,6 +24,7 @@
 #include <Rinternals.h>
 #include <Rcpp/exceptions.h>
 #include <cstdlib>
+#include "internal.h"
 
 namespace Rcpp{
     

Modified: pkg/Rcpp/src/internal.h
===================================================================
--- pkg/Rcpp/src/internal.h	2012-12-10 12:23:49 UTC (rev 4127)
+++ pkg/Rcpp/src/internal.h	2012-12-10 12:47:38 UTC (rev 4128)
@@ -22,12 +22,15 @@
 #ifndef Rcpp_internal_h
 #define Rcpp_internal_h
 
+#include <R_ext/Rdynload.h>
+
 #define CALLFUN_0(name) SEXP name()
 #define CALLFUN_1(name) SEXP name(SEXP)
 #define CALLFUN_2(name) SEXP name(SEXP,SEXP)
 #define CALLFUN_3(name) SEXP name(SEXP,SEXP,SEXP)
 #define CALLFUN_4(name) SEXP name(SEXP,SEXP,SEXP,SEXP)
 #define CALLFUN_5(name) SEXP name(SEXP,SEXP,SEXP,SEXP,SEXP)
+#define EXTFUN(name) SEXP name(SEXP)
 
 // this file contains declarations of functions that are not 
 // exported via Rcpp.h but are needed to make Rcpp work internally
@@ -38,6 +41,34 @@
 
     CALLFUN_1(as_character_externalptr) ;
 
+    CALLFUN_1(Class__name);
+    CALLFUN_1(Class__has_default_constructor) ;
+
+    CALLFUN_1(CppClass__complete);
+    CALLFUN_1(CppClass__methods);
+    
+    CALLFUN_1(Module__classes_info) ;
+    CALLFUN_1(Module__complete) ;
+    CALLFUN_1(Module__functions_arity);
+    CALLFUN_1(Module__functions_names);
+    CALLFUN_2(Module__get_class);
+    CALLFUN_2(Module__has_class);
+    CALLFUN_2(Module__has_function);
+    CALLFUN_2(Module__get_function);
+    CALLFUN_1(Module__name);
+    CALLFUN_2(CppObject__finalize);
+    
+    CALLFUN_0(get_rcpp_cache);
+    CALLFUN_0(init_Rcpp_cache);
+    CALLFUN_0(reset_current_error);
+    CALLFUN_1(rcpp_error_recorder);
+    CALLFUN_1(rcpp_set_current_error);
+    CALLFUN_0(rcpp_get_current_error);
+    CALLFUN_1(rcpp_set_error_occured);
+    CALLFUN_0(rcpp_get_error_occured);
+    CALLFUN_1(rcpp_set_stack_trace);
+    CALLFUN_0(rcpp_get_stack_trace);
+    
     CALLFUN_3(CppField__get);
     CALLFUN_4(CppField__set);
 
@@ -45,6 +76,15 @@
     CALLFUN_0(rcpp_can_use_cxx0x) ;
     CALLFUN_1(rcpp_call_test) ;
 
+    /* .External functions */
+    EXTFUN(CppMethod__invoke) ;
+    EXTFUN(CppMethod__invoke_void) ;
+    EXTFUN(CppMethod__invoke_notvoid) ;
+    EXTFUN(InternalFunction_invoke) ;
+    EXTFUN(Module__invoke) ;
+    EXTFUN(class__newInstance) ;
+    EXTFUN(class__dummyInstance) ;
+    
     void init_Rcpp_routines(DllInfo*) ;
     const char * sexp_to_name(int sexp_type); 
 



More information about the Rcpp-commits mailing list