-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathcpp11.cpp
More file actions
143 lines (138 loc) · 9.74 KB
/
Copy pathcpp11.cpp
File metadata and controls
143 lines (138 loc) · 9.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// Generated by cpp11: do not edit by hand
// clang-format off
#include "haven_types.h"
#include "cpp11/declarations.hpp"
#include <R_ext/Visibility.h>
// DfReader.cpp
cpp11::list df_parse_sas_file(cpp11::list spec_b7dat, cpp11::list spec_b7cat, std::string encoding, std::string catalog_encoding, cpp11::integers cols_skip, long n_max, long rows_skip);
extern "C" SEXP _haven_df_parse_sas_file(SEXP spec_b7dat, SEXP spec_b7cat, SEXP encoding, SEXP catalog_encoding, SEXP cols_skip, SEXP n_max, SEXP rows_skip) {
BEGIN_CPP11
return cpp11::as_sexp(df_parse_sas_file(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec_b7dat), cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec_b7cat), cpp11::as_cpp<cpp11::decay_t<std::string>>(encoding), cpp11::as_cpp<cpp11::decay_t<std::string>>(catalog_encoding), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(cols_skip), cpp11::as_cpp<cpp11::decay_t<long>>(n_max), cpp11::as_cpp<cpp11::decay_t<long>>(rows_skip)));
END_CPP11
}
// DfReader.cpp
cpp11::list df_parse_sas_raw(cpp11::list spec_b7dat, cpp11::list spec_b7cat, std::string encoding, std::string catalog_encoding, cpp11::integers cols_skip, long n_max, long rows_skip);
extern "C" SEXP _haven_df_parse_sas_raw(SEXP spec_b7dat, SEXP spec_b7cat, SEXP encoding, SEXP catalog_encoding, SEXP cols_skip, SEXP n_max, SEXP rows_skip) {
BEGIN_CPP11
return cpp11::as_sexp(df_parse_sas_raw(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec_b7dat), cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec_b7cat), cpp11::as_cpp<cpp11::decay_t<std::string>>(encoding), cpp11::as_cpp<cpp11::decay_t<std::string>>(catalog_encoding), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(cols_skip), cpp11::as_cpp<cpp11::decay_t<long>>(n_max), cpp11::as_cpp<cpp11::decay_t<long>>(rows_skip)));
END_CPP11
}
// DfReader.cpp
cpp11::list df_parse_xpt_file(cpp11::list spec, cpp11::integers cols_skip, long n_max, long rows_skip);
extern "C" SEXP _haven_df_parse_xpt_file(SEXP spec, SEXP cols_skip, SEXP n_max, SEXP rows_skip) {
BEGIN_CPP11
return cpp11::as_sexp(df_parse_xpt_file(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(cols_skip), cpp11::as_cpp<cpp11::decay_t<long>>(n_max), cpp11::as_cpp<cpp11::decay_t<long>>(rows_skip)));
END_CPP11
}
// DfReader.cpp
cpp11::list df_parse_xpt_raw(cpp11::list spec, cpp11::integers cols_skip, long n_max, long rows_skip);
extern "C" SEXP _haven_df_parse_xpt_raw(SEXP spec, SEXP cols_skip, SEXP n_max, SEXP rows_skip) {
BEGIN_CPP11
return cpp11::as_sexp(df_parse_xpt_raw(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(cols_skip), cpp11::as_cpp<cpp11::decay_t<long>>(n_max), cpp11::as_cpp<cpp11::decay_t<long>>(rows_skip)));
END_CPP11
}
// DfReader.cpp
cpp11::list df_parse_dta_file(cpp11::list spec, std::string encoding, cpp11::integers cols_skip, long n_max, long rows_skip);
extern "C" SEXP _haven_df_parse_dta_file(SEXP spec, SEXP encoding, SEXP cols_skip, SEXP n_max, SEXP rows_skip) {
BEGIN_CPP11
return cpp11::as_sexp(df_parse_dta_file(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec), cpp11::as_cpp<cpp11::decay_t<std::string>>(encoding), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(cols_skip), cpp11::as_cpp<cpp11::decay_t<long>>(n_max), cpp11::as_cpp<cpp11::decay_t<long>>(rows_skip)));
END_CPP11
}
// DfReader.cpp
cpp11::list df_parse_dta_raw(cpp11::list spec, std::string encoding, cpp11::integers cols_skip, long n_max, long rows_skip);
extern "C" SEXP _haven_df_parse_dta_raw(SEXP spec, SEXP encoding, SEXP cols_skip, SEXP n_max, SEXP rows_skip) {
BEGIN_CPP11
return cpp11::as_sexp(df_parse_dta_raw(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec), cpp11::as_cpp<cpp11::decay_t<std::string>>(encoding), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(cols_skip), cpp11::as_cpp<cpp11::decay_t<long>>(n_max), cpp11::as_cpp<cpp11::decay_t<long>>(rows_skip)));
END_CPP11
}
// DfReader.cpp
cpp11::list df_parse_sav_file(cpp11::list spec, std::string encoding, bool user_na, cpp11::integers cols_skip, long n_max, long rows_skip);
extern "C" SEXP _haven_df_parse_sav_file(SEXP spec, SEXP encoding, SEXP user_na, SEXP cols_skip, SEXP n_max, SEXP rows_skip) {
BEGIN_CPP11
return cpp11::as_sexp(df_parse_sav_file(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec), cpp11::as_cpp<cpp11::decay_t<std::string>>(encoding), cpp11::as_cpp<cpp11::decay_t<bool>>(user_na), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(cols_skip), cpp11::as_cpp<cpp11::decay_t<long>>(n_max), cpp11::as_cpp<cpp11::decay_t<long>>(rows_skip)));
END_CPP11
}
// DfReader.cpp
cpp11::list df_parse_sav_raw(cpp11::list spec, std::string encoding, bool user_na, cpp11::integers cols_skip, long n_max, long rows_skip);
extern "C" SEXP _haven_df_parse_sav_raw(SEXP spec, SEXP encoding, SEXP user_na, SEXP cols_skip, SEXP n_max, SEXP rows_skip) {
BEGIN_CPP11
return cpp11::as_sexp(df_parse_sav_raw(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec), cpp11::as_cpp<cpp11::decay_t<std::string>>(encoding), cpp11::as_cpp<cpp11::decay_t<bool>>(user_na), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(cols_skip), cpp11::as_cpp<cpp11::decay_t<long>>(n_max), cpp11::as_cpp<cpp11::decay_t<long>>(rows_skip)));
END_CPP11
}
// DfReader.cpp
cpp11::list df_parse_por_file(cpp11::list spec, std::string encoding, bool user_na, cpp11::integers cols_skip, long n_max, long rows_skip);
extern "C" SEXP _haven_df_parse_por_file(SEXP spec, SEXP encoding, SEXP user_na, SEXP cols_skip, SEXP n_max, SEXP rows_skip) {
BEGIN_CPP11
return cpp11::as_sexp(df_parse_por_file(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec), cpp11::as_cpp<cpp11::decay_t<std::string>>(encoding), cpp11::as_cpp<cpp11::decay_t<bool>>(user_na), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(cols_skip), cpp11::as_cpp<cpp11::decay_t<long>>(n_max), cpp11::as_cpp<cpp11::decay_t<long>>(rows_skip)));
END_CPP11
}
// DfReader.cpp
cpp11::list df_parse_por_raw(cpp11::list spec, std::string encoding, bool user_na, cpp11::integers cols_skip, long n_max, long rows_skip);
extern "C" SEXP _haven_df_parse_por_raw(SEXP spec, SEXP encoding, SEXP user_na, SEXP cols_skip, SEXP n_max, SEXP rows_skip) {
BEGIN_CPP11
return cpp11::as_sexp(df_parse_por_raw(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(spec), cpp11::as_cpp<cpp11::decay_t<std::string>>(encoding), cpp11::as_cpp<cpp11::decay_t<bool>>(user_na), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(cols_skip), cpp11::as_cpp<cpp11::decay_t<long>>(n_max), cpp11::as_cpp<cpp11::decay_t<long>>(rows_skip)));
END_CPP11
}
// DfWriter.cpp
void write_sav_(cpp11::list data, cpp11::strings path, std::string compress);
extern "C" SEXP _haven_write_sav_(SEXP data, SEXP path, SEXP compress) {
BEGIN_CPP11
write_sav_(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::strings>>(path), cpp11::as_cpp<cpp11::decay_t<std::string>>(compress));
return R_NilValue;
END_CPP11
}
// DfWriter.cpp
void write_dta_(cpp11::list data, cpp11::strings path, int version, cpp11::sexp label, int strl_threshold);
extern "C" SEXP _haven_write_dta_(SEXP data, SEXP path, SEXP version, SEXP label, SEXP strl_threshold) {
BEGIN_CPP11
write_dta_(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::strings>>(path), cpp11::as_cpp<cpp11::decay_t<int>>(version), cpp11::as_cpp<cpp11::decay_t<cpp11::sexp>>(label), cpp11::as_cpp<cpp11::decay_t<int>>(strl_threshold));
return R_NilValue;
END_CPP11
}
// DfWriter.cpp
void write_sas_(cpp11::list data, cpp11::strings path);
extern "C" SEXP _haven_write_sas_(SEXP data, SEXP path) {
BEGIN_CPP11
write_sas_(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::strings>>(path));
return R_NilValue;
END_CPP11
}
// DfWriter.cpp
void write_xpt_(cpp11::list data, cpp11::strings path, int version, std::string name, cpp11::sexp label);
extern "C" SEXP _haven_write_xpt_(SEXP data, SEXP path, SEXP version, SEXP name, SEXP label) {
BEGIN_CPP11
write_xpt_(cpp11::as_cpp<cpp11::decay_t<cpp11::list>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::strings>>(path), cpp11::as_cpp<cpp11::decay_t<int>>(version), cpp11::as_cpp<cpp11::decay_t<std::string>>(name), cpp11::as_cpp<cpp11::decay_t<cpp11::sexp>>(label));
return R_NilValue;
END_CPP11
}
extern "C" {
/* .Call calls */
extern SEXP is_tagged_na_(SEXP, SEXP);
extern SEXP na_tag_(SEXP);
extern SEXP tagged_na_(SEXP);
static const R_CallMethodDef CallEntries[] = {
{"_haven_df_parse_dta_file", (DL_FUNC) &_haven_df_parse_dta_file, 5},
{"_haven_df_parse_dta_raw", (DL_FUNC) &_haven_df_parse_dta_raw, 5},
{"_haven_df_parse_por_file", (DL_FUNC) &_haven_df_parse_por_file, 6},
{"_haven_df_parse_por_raw", (DL_FUNC) &_haven_df_parse_por_raw, 6},
{"_haven_df_parse_sas_file", (DL_FUNC) &_haven_df_parse_sas_file, 7},
{"_haven_df_parse_sas_raw", (DL_FUNC) &_haven_df_parse_sas_raw, 7},
{"_haven_df_parse_sav_file", (DL_FUNC) &_haven_df_parse_sav_file, 6},
{"_haven_df_parse_sav_raw", (DL_FUNC) &_haven_df_parse_sav_raw, 6},
{"_haven_df_parse_xpt_file", (DL_FUNC) &_haven_df_parse_xpt_file, 4},
{"_haven_df_parse_xpt_raw", (DL_FUNC) &_haven_df_parse_xpt_raw, 4},
{"_haven_write_dta_", (DL_FUNC) &_haven_write_dta_, 5},
{"_haven_write_sas_", (DL_FUNC) &_haven_write_sas_, 2},
{"_haven_write_sav_", (DL_FUNC) &_haven_write_sav_, 3},
{"_haven_write_xpt_", (DL_FUNC) &_haven_write_xpt_, 5},
{"is_tagged_na_", (DL_FUNC) &is_tagged_na_, 2},
{"na_tag_", (DL_FUNC) &na_tag_, 1},
{"tagged_na_", (DL_FUNC) &tagged_na_, 1},
{NULL, NULL, 0}
};
}
extern "C" attribute_visible void R_init_haven(DllInfo* dll){
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
R_forceSymbols(dll, TRUE);
}