22//
33// internal.h: Rcpp R/C++ interface class library --
44//
5- // Copyright (C) 2012 - 2013 Dirk Eddelbuettel and Romain Francois
5+ // Copyright (C) 2012 - 2015 Dirk Eddelbuettel and Romain Francois
66//
77// This file is part of Rcpp.
88//
3737
3838#define MAX_ARGS 65
3939#define UNPACK_EXTERNAL_ARGS (__CARGS__,__P__ ) \
40- SEXP __CARGS__[MAX_ARGS] ; \
41- int nargs = 0 ; \
42- for (; nargs<MAX_ARGS; nargs++){ \
43- if ( Rf_isNull (__P__) ) break ; \
44- __CARGS__[nargs] = CAR (__P__) ; \
45- __P__ = CDR (__P__) ; \
40+ SEXP __CARGS__[MAX_ARGS]; \
41+ int nargs = 0 ; \
42+ for (; nargs<MAX_ARGS; nargs++) { \
43+ if ( Rf_isNull (__P__)) break ; \
44+ __CARGS__[nargs] = CAR (__P__); \
45+ __P__ = CDR (__P__); \
4646}
4747
48- #define RCPP_FUN_1 (__OUT__,__NAME__, ___0 ) \
49- __OUT__ RCPP_DECORATE (__NAME__)(___0) ; \
50- SEXP __NAME__ (SEXP x0){ \
51- SEXP res = R_NilValue ; \
52- BEGIN_RCPP \
53- res = ::Rcpp::wrap ( RCPP_DECORATE (__NAME__)(::Rcpp::internal::converter ( x0 )) ) ; \
54- return res ; \
55- END_RCPP \
56- } \
48+ #define RCPP_FUN_1 (__OUT__,__NAME__, ___0 ) \
49+ __OUT__ RCPP_DECORATE (__NAME__)(___0); \
50+ SEXP __NAME__ (SEXP x0) { \
51+ SEXP res = R_NilValue; \
52+ BEGIN_RCPP \
53+ res = ::Rcpp::wrap (RCPP_DECORATE (__NAME__)(::Rcpp::internal::converter (x0))) ; \
54+ return res; \
55+ END_RCPP \
56+ } \
5757__OUT__ RCPP_DECORATE (__NAME__)(___0)
5858
5959
60- #define RCPP_FUN_2 (__OUT__,__NAME__, ___0, ___1 ) \
61- __OUT__ RCPP_DECORATE (__NAME__)(___0, ___1) ; \
62- SEXP __NAME__ (SEXP x0, SEXP x1){ \
63- SEXP res = R_NilValue ; \
64- BEGIN_RCPP \
65- res = ::Rcpp::wrap ( RCPP_DECORATE (__NAME__)(::Rcpp::internal::converter ( x0 ), ::Rcpp::internal::converter ( x1 )) ) ; \
66- return res ; \
67- END_RCPP \
68- } \
60+ #define RCPP_FUN_2 (__OUT__,__NAME__, ___0, ___1 ) \
61+ __OUT__ RCPP_DECORATE (__NAME__)(___0, ___1); \
62+ SEXP __NAME__ (SEXP x0, SEXP x1) { \
63+ SEXP res = R_NilValue; \
64+ BEGIN_RCPP \
65+ res = ::Rcpp::wrap (RCPP_DECORATE (__NAME__)(::Rcpp::internal::converter (x0), \
66+ ::Rcpp::internal::converter (x1))); \
67+ return res; \
68+ END_RCPP \
69+ } \
6970__OUT__ RCPP_DECORATE (__NAME__)(___0, ___1)
7071
71- #define RCPP_FUN_3 (__OUT__,__NAME__, ___0, ___1, ___2 ) \
72- __OUT__ RCPP_DECORATE (__NAME__)(___0, ___1, ___2) ; \
73- SEXP __NAME__ (SEXP x0, SEXP x1, SEXP x2){ \
74- SEXP res = R_NilValue ; \
75- BEGIN_RCPP \
76- res = ::Rcpp::wrap ( RCPP_DECORATE (__NAME__)(::Rcpp::internal::converter ( x0 ), ::Rcpp::internal::converter ( x1 ), ::Rcpp::internal::converter ( x2 )) ) ; \
77- return res ; \
78- END_RCPP \
79- } \
72+ #define RCPP_FUN_3 (__OUT__,__NAME__, ___0, ___1, ___2 ) \
73+ __OUT__ RCPP_DECORATE (__NAME__)(___0, ___1, ___2); \
74+ SEXP __NAME__ (SEXP x0, SEXP x1, SEXP x2) { \
75+ SEXP res = R_NilValue; \
76+ BEGIN_RCPP \
77+ res = ::Rcpp::wrap (RCPP_DECORATE (__NAME__)(::Rcpp::internal::converter (x0), \
78+ ::Rcpp::internal::converter (x1), \
79+ ::Rcpp::internal::converter(x2))); \
80+ return res; \
81+ END_RCPP \
82+ } \
8083__OUT__ RCPP_DECORATE (__NAME__)(___0, ___1, ___2)
8184
82- #define RCPP_FUN_4 (__OUT__,__NAME__, ___0, ___1, ___2, ___3 ) \
83- __OUT__ RCPP_DECORATE (__NAME__)(___0, ___1, ___2, ___3) ; \
84- SEXP __NAME__ (SEXP x0, SEXP x1, SEXP x2, SEXP x3){ \
85- SEXP res = R_NilValue ; \
86- BEGIN_RCPP \
87- res = ::Rcpp::wrap ( RCPP_DECORATE (__NAME__)(::Rcpp::internal::converter ( x0 ), ::Rcpp::internal::converter ( x1 ), ::Rcpp::internal::converter ( x2 ), ::Rcpp::internal::converter ( x3 )) ) ; \
88- return res ; \
89- END_RCPP \
90- } \
85+ #define RCPP_FUN_4 (__OUT__,__NAME__, ___0, ___1, ___2, ___3 ) \
86+ __OUT__ RCPP_DECORATE (__NAME__)(___0, ___1, ___2, ___3); \
87+ SEXP __NAME__ (SEXP x0, SEXP x1, SEXP x2, SEXP x3) { \
88+ SEXP res = R_NilValue; \
89+ BEGIN_RCPP \
90+ res = ::Rcpp::wrap ( RCPP_DECORATE (__NAME__)(::Rcpp::internal::converter (x0), \
91+ ::Rcpp::internal::converter (x1), \
92+ ::Rcpp::internal::converter(x2), \
93+ ::Rcpp::internal::converter(x3))); \
94+ return res; \
95+ END_RCPP \
96+ } \
9197__OUT__ RCPP_DECORATE (__NAME__)(___0, ___1, ___2, ___3)
9298
93- SEXP get_Rcpp_protection_stack() ;
99+ SEXP get_Rcpp_protection_stack();
94100
95- CALLFUN_1 (as_character_externalptr) ;
101+ CALLFUN_1 (as_character_externalptr);
96102
97103CALLFUN_1 (Class__name);
98- CALLFUN_1 (Class__has_default_constructor) ;
104+ CALLFUN_1 (Class__has_default_constructor);
99105
100106CALLFUN_1 (CppClass__complete);
101107CALLFUN_1 (CppClass__methods);
102108
103- CALLFUN_1 (Module__classes_info) ;
104- CALLFUN_1 (Module__complete) ;
109+ CALLFUN_1 (Module__classes_info);
110+ CALLFUN_1 (Module__complete);
105111CALLFUN_1 (Module__functions_arity);
106112CALLFUN_1 (Module__functions_names);
107113CALLFUN_2 (Module__get_class);
@@ -118,20 +124,20 @@ CALLFUN_1(rcpp_error_recorder);
118124CALLFUN_3 (CppField__get);
119125CALLFUN_4 (CppField__set);
120126
121- CALLFUN_0 (rcpp_capabilities) ;
122- CALLFUN_0 (rcpp_can_use_cxx0x) ;
123- CALLFUN_0 (rcpp_can_use_cxx11) ;
127+ CALLFUN_0 (rcpp_capabilities);
128+ CALLFUN_0 (rcpp_can_use_cxx0x);
129+ CALLFUN_0 (rcpp_can_use_cxx11);
124130
125131/* .External functions */
126- EXTFUN (CppMethod__invoke) ;
127- EXTFUN (CppMethod__invoke_void) ;
128- EXTFUN (CppMethod__invoke_notvoid) ;
129- EXTFUN (InternalFunction_invoke) ;
130- EXTFUN (Module__invoke) ;
131- EXTFUN (class__newInstance) ;
132- EXTFUN (class__dummyInstance) ;
133-
134- void init_Rcpp_routines (DllInfo*) ;
132+ EXTFUN (CppMethod__invoke);
133+ EXTFUN (CppMethod__invoke_void);
134+ EXTFUN (CppMethod__invoke_notvoid);
135+ EXTFUN (InternalFunction_invoke);
136+ EXTFUN (Module__invoke);
137+ EXTFUN (class__newInstance);
138+ EXTFUN (class__dummyInstance);
139+
140+ void init_Rcpp_routines (DllInfo*);
135141
136142#undef CALLFUN_0
137143#undef CALLFUN_1
0 commit comments