// [[Rcpp::internal]] SEXP rcpp_error_recorder(SEXP e){ SEXP cache = get_rcpp_cache() ; // error occured set_error_occured( cache, Rf_ScalarLogical(TRUE) ) ; // current error set_current_error(cache, e ) ; return R_NilValue ; }
// [[Rcpp::register]] int* get_cache( int m){ SEXP cache = get_rcpp_cache() ; SEXP hash_cache = VECTOR_ELT( cache, RCPP_HASH_CACHE_INDEX) ; int n = Rf_length(hash_cache) ; if( m > n ){ Rcpp::Shield<SEXP> new_hash_cache( Rf_allocVector( INTSXP, m) ) ; hash_cache = new_hash_cache ; SET_VECTOR_ELT(cache,RCPP_HASH_CACHE_INDEX, hash_cache); } int *res = INTEGER(hash_cache) ; std::fill(res, res+m, 0 ) ; return res ; }
// [[Rcpp::register]] SEXP reset_current_error(){ SEXP cache = get_rcpp_cache() ; // error occured set_error_occured( cache, Rf_ScalarLogical(FALSE) ) ; // current error set_current_error( cache, R_NilValue ) ; // stack trace SET_VECTOR_ELT( cache, 3, R_NilValue ) ; return R_NilValue ; }
// [[Rcpp::register]] SEXP rcpp_get_current_error(){ return VECTOR_ELT( get_rcpp_cache(), 2 ) ; }
// [[Rcpp::register]] int error_occured(){ SEXP err = VECTOR_ELT( get_rcpp_cache(), 1 ) ; return LOGICAL(err)[0] ; }
// [[Rcpp::register]] SEXP rcpp_set_stack_trace(SEXP e){ SET_VECTOR_ELT( get_rcpp_cache(), 3, e ) ; return R_NilValue ; }
// [[Rcpp::register]] SEXP rcpp_get_stack_trace(){ return VECTOR_ELT( get_rcpp_cache(), 3 ) ; }
// [[Rcpp::register]] SEXP get_Rcpp_namespace(){ return VECTOR_ELT( get_rcpp_cache() , 0 ) ; }
SEXP get_Rcpp_protection_stack(){ if( ! Rcpp_cache_know ){ get_rcpp_cache() ; } return Rcpp_protection_stack ; }