@@ -38,29 +38,31 @@ namespace Rcpp{
3838 struct tm * gmtime_ (const time_t * const );
3939}
4040
41- SEXP rcpp_get_stack_trace ();
42- SEXP rcpp_set_stack_trace (SEXP);
43- std::string demangle ( const std::string& name);
44- const char * short_file_name (const char * );
45- int * get_cache ( int n );
46- SEXP stack_trace ( const char *file, int line);
47- SEXP get_string_elt (SEXP s, int i);
48- const char * char_get_string_elt (SEXP s, int i);
49- void set_string_elt (SEXP s, int i, SEXP v);
50- void char_set_string_elt (SEXP s, int i, const char * v);
51- SEXP* get_string_ptr (SEXP s);
52- SEXP get_vector_elt (SEXP v, int i);
53- void set_vector_elt (SEXP v, int i, SEXP x);
54- SEXP* get_vector_ptr (SEXP v);
55- const char * char_nocheck ( SEXP x);
56- void * dataptr (SEXP x);
41+ SEXP rcpp_get_stack_trace ();
42+ SEXP rcpp_set_stack_trace (SEXP);
43+ std::string demangle (const std::string& name);
44+ const char * short_file_name (const char * );
45+ int * get_cache (int n);
46+ SEXP stack_trace ( const char *file, int line);
47+ SEXP get_string_elt (SEXP s, int i);
48+ const char * char_get_string_elt (SEXP s, int i);
49+ void set_string_elt (SEXP s, int i, SEXP v);
50+ void char_set_string_elt (SEXP s, int i, const char * v);
51+ SEXP* get_string_ptr (SEXP s);
52+ SEXP get_vector_elt (SEXP v, int i);
53+ void set_vector_elt (SEXP v, int i, SEXP x);
54+ SEXP* get_vector_ptr (SEXP v);
55+ const char * char_nocheck (SEXP x);
56+ void * dataptr (SEXP x);
5757Rcpp::Module* getCurrentScope ();
58- void setCurrentScope ( Rcpp::Module* mod );
59- SEXP reset_current_error ();
60- int error_occured ();
61- SEXP rcpp_get_current_error ();
58+ void setCurrentScope ( Rcpp::Module* mod );
59+ SEXP reset_current_error ();
60+ int error_occured ();
61+ SEXP rcpp_get_current_error ();
62+ void print (SEXP s);
6263
6364#else
65+
6466namespace Rcpp {
6567
6668 #define GET_CALLABLE (__FUN__ ) (Fun) R_GetCCallable( " Rcpp" , __FUN__ )
@@ -140,6 +142,7 @@ inline attribute_hidden const char* short_file_name(const char* file) {
140142 static Fun fun = GET_CALLABLE (" short_file_name" );
141143 return fun (file);
142144}
145+
143146inline attribute_hidden SEXP stack_trace ( const char *file, int line){
144147 typedef SEXP (*Fun)(const char *, int );
145148 static Fun fun = GET_CALLABLE (" stack_trace" );
@@ -235,11 +238,19 @@ inline attribute_hidden int error_occured(){
235238 static Fun fun = GET_CALLABLE (" error_occured" );
236239 return fun ();
237240}
241+
238242inline attribute_hidden SEXP rcpp_get_current_error (){
239243 typedef SEXP (*Fun)(void );
240244 static Fun fun = GET_CALLABLE (" rcpp_get_current_error" );
241245 return fun ();
242246}
247+
248+ inline attribute_hidden void print (SEXP s) {
249+ typedef void (*Fun)(SEXP);
250+ static Fun fun = GET_CALLABLE (" print" );
251+ fun (s);
252+ }
253+
243254#endif
244255
245256
0 commit comments