@@ -38,29 +38,31 @@ namespace Rcpp{
38
38
struct tm * gmtime_ (const time_t * const );
39
39
}
40
40
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);
57
57
Rcpp::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);
62
63
63
64
#else
65
+
64
66
namespace Rcpp {
65
67
66
68
#define GET_CALLABLE (__FUN__ ) (Fun) R_GetCCallable( " Rcpp" , __FUN__ )
@@ -140,6 +142,7 @@ inline attribute_hidden const char* short_file_name(const char* file) {
140
142
static Fun fun = GET_CALLABLE (" short_file_name" );
141
143
return fun (file);
142
144
}
145
+
143
146
inline attribute_hidden SEXP stack_trace ( const char *file, int line){
144
147
typedef SEXP (*Fun)(const char *, int );
145
148
static Fun fun = GET_CALLABLE (" stack_trace" );
@@ -235,11 +238,19 @@ inline attribute_hidden int error_occured(){
235
238
static Fun fun = GET_CALLABLE (" error_occured" );
236
239
return fun ();
237
240
}
241
+
238
242
inline attribute_hidden SEXP rcpp_get_current_error (){
239
243
typedef SEXP (*Fun)(void );
240
244
static Fun fun = GET_CALLABLE (" rcpp_get_current_error" );
241
245
return fun ();
242
246
}
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
+
243
254
#endif
244
255
245
256
0 commit comments