1 #include <R.h>
2 #include <Rinternals.h>
3 #include <stdlib.h> // for NULL
4 #include <stdbool.h>
5 #include <R_ext/Rdynload.h>
6 #include "altrep-rle.h"
7 #include "vctrs.h"
8 
9 // Compile with `-fvisibility=hidden -DHAVE_VISIBILITY_ATTRIBUTE` if you link to this library
10 #include <R_ext/Visibility.h>
11 #define export attribute_visible extern
12 
13 
14 extern SEXP vctrs_list_get(SEXP, SEXP);
15 extern SEXP vctrs_list_set(SEXP, SEXP, SEXP);
16 extern SEXP vctrs_field_get(SEXP, SEXP);
17 extern SEXP vctrs_field_set(SEXP, SEXP, SEXP);
18 extern SEXP vctrs_fields(SEXP);
19 extern SEXP vctrs_n_fields(SEXP);
20 extern SEXP vctrs_hash(SEXP);
21 extern SEXP vctrs_hash_object(SEXP);
22 extern SEXP vctrs_equal_object(SEXP, SEXP);
23 extern SEXP vctrs_duplicated(SEXP);
24 extern SEXP vctrs_unique_loc(SEXP);
25 extern SEXP vctrs_count(SEXP);
26 extern SEXP vctrs_id(SEXP);
27 extern SEXP vctrs_n_distinct(SEXP);
28 extern SEXP vec_split(SEXP, SEXP);
29 extern SEXP vctrs_group_id(SEXP);
30 extern SEXP vctrs_group_rle(SEXP);
31 extern SEXP vec_group_loc(SEXP);
32 extern SEXP vctrs_equal(SEXP, SEXP, SEXP);
33 extern SEXP vctrs_equal_na(SEXP);
34 extern SEXP vctrs_compare(SEXP, SEXP, SEXP);
35 extern SEXP vctrs_match(SEXP, SEXP, SEXP, SEXP, SEXP);
36 extern SEXP vctrs_in(SEXP, SEXP, SEXP, SEXP, SEXP);
37 extern SEXP vctrs_duplicated_any(SEXP);
38 extern SEXP vctrs_size(SEXP);
39 extern SEXP vctrs_list_sizes(SEXP);
40 extern SEXP vctrs_dim(SEXP);
41 extern SEXP vctrs_dim_n(SEXP);
42 extern SEXP vctrs_is_unspecified(SEXP);
43 extern SEXP vctrs_typeof(SEXP, SEXP);
44 extern SEXP vctrs_is_vector(SEXP);
45 extern SEXP vctrs_ptype2(SEXP, SEXP, SEXP, SEXP);
46 extern SEXP vctrs_typeof2(SEXP, SEXP);
47 extern SEXP vctrs_typeof2_s3(SEXP, SEXP);
48 extern SEXP vctrs_cast(SEXP, SEXP, SEXP, SEXP);
49 extern SEXP vctrs_as_location(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP);
50 extern SEXP vec_slice(SEXP, SEXP);
51 extern SEXP vctrs_init(SEXP, SEXP);
52 extern SEXP vctrs_chop(SEXP, SEXP);
53 extern SEXP vctrs_unchop(SEXP, SEXP, SEXP, SEXP, SEXP);
54 extern SEXP vctrs_chop_seq(SEXP, SEXP, SEXP, SEXP);
55 extern SEXP vec_slice_seq(SEXP, SEXP, SEXP, SEXP);
56 extern SEXP vec_slice_rep(SEXP, SEXP, SEXP);
57 extern SEXP vctrs_restore(SEXP, SEXP, SEXP);
58 extern SEXP vctrs_restore_default(SEXP, SEXP);
59 extern SEXP vec_proxy(SEXP);
60 extern SEXP vec_proxy_equal(SEXP);
61 extern SEXP vec_proxy_compare(SEXP);
62 extern SEXP vec_proxy_order(SEXP);
63 extern SEXP vec_proxy_complete(SEXP);
64 extern SEXP vctrs_df_proxy(SEXP, SEXP);
65 extern SEXP vctrs_unspecified(SEXP);
66 extern SEXP vctrs_ptype(SEXP, SEXP);
67 extern SEXP vec_ptype_finalise(SEXP);
68 extern SEXP vctrs_minimal_names(SEXP);
69 extern SEXP vctrs_unique_names(SEXP, SEXP);
70 extern SEXP vctrs_as_minimal_names(SEXP);
71 extern SEXP vec_names(SEXP);
72 extern SEXP vctrs_is_unique_names(SEXP);
73 extern SEXP vctrs_as_unique_names(SEXP, SEXP);
74 extern SEXP vec_set_names(SEXP, SEXP);
75 extern SEXP vctrs_df_cast_opts(SEXP, SEXP, SEXP, SEXP, SEXP);
76 extern SEXP vctrs_df_ptype2_opts(SEXP, SEXP, SEXP, SEXP, SEXP);
77 extern SEXP vctrs_type_info(SEXP);
78 extern SEXP vctrs_proxy_info(SEXP);
79 extern SEXP vctrs_class_type(SEXP);
80 extern SEXP vctrs_bare_df_restore(SEXP, SEXP, SEXP);
81 extern SEXP vctrs_recycle(SEXP, SEXP, SEXP);
82 extern SEXP vctrs_assign(SEXP, SEXP, SEXP, SEXP, SEXP);
83 extern SEXP vctrs_assign_seq(SEXP, SEXP, SEXP, SEXP, SEXP);
84 extern SEXP vctrs_set_attributes(SEXP, SEXP);
85 extern SEXP vctrs_as_df_row(SEXP, SEXP);
86 extern SEXP vctrs_outer_names(SEXP, SEXP, SEXP);
87 extern SEXP vctrs_df_size(SEXP);
88 extern SEXP vctrs_as_df_col(SEXP, SEXP);
89 extern SEXP vctrs_apply_name_spec(SEXP, SEXP, SEXP, SEXP);
90 extern SEXP vctrs_unset_s4(SEXP);
91 extern SEXP vctrs_validate_name_repair_arg(SEXP);
92 extern SEXP vctrs_validate_minimal_names(SEXP, SEXP);
93 extern SEXP vctrs_as_names(SEXP, SEXP, SEXP, SEXP);
94 extern SEXP vctrs_is_partial(SEXP);
95 extern SEXP vctrs_is_list(SEXP);
96 extern SEXP vctrs_try_catch_callback(SEXP, SEXP);
97 extern SEXP vctrs_is_coercible(SEXP, SEXP, SEXP, SEXP, SEXP);
98 extern SEXP vctrs_as_subscript(SEXP, SEXP, SEXP, SEXP, SEXP);
99 extern SEXP vctrs_as_subscript_result(SEXP, SEXP, SEXP, SEXP, SEXP);
100 extern SEXP vctrs_df_flatten_info(SEXP);
101 extern SEXP df_flatten(SEXP);
102 extern SEXP vctrs_linked_version();
103 extern SEXP vctrs_tib_ptype2(SEXP x, SEXP y, SEXP x_arg_, SEXP y_arg_);
104 extern SEXP vctrs_tib_cast(SEXP x, SEXP y, SEXP x_arg_, SEXP y_arg_);
105 extern SEXP vctrs_assign_params(SEXP, SEXP, SEXP, SEXP);
106 extern SEXP vctrs_has_dim(SEXP);
107 extern SEXP vctrs_rep(SEXP, SEXP);
108 extern SEXP vctrs_rep_each(SEXP, SEXP);
109 extern SEXP vctrs_maybe_shared_col(SEXP, SEXP);
110 extern SEXP vctrs_new_df_unshared_col();
111 extern SEXP vctrs_shaped_ptype(SEXP, SEXP, SEXP, SEXP, SEXP);
112 extern SEXP vctrs_shape2(SEXP, SEXP, SEXP, SEXP);
113 extern SEXP vctrs_new_date(SEXP);
114 extern SEXP vctrs_date_validate(SEXP);
115 extern SEXP vctrs_new_datetime(SEXP, SEXP);
116 extern SEXP vctrs_datetime_validate(SEXP);
117 extern SEXP vctrs_ptype2_opts(SEXP, SEXP, SEXP, SEXP, SEXP);
118 extern SEXP vctrs_s3_find_method(SEXP, SEXP, SEXP);
119 extern SEXP vctrs_implements_ptype2(SEXP);
120 extern SEXP vctrs_ptype2_dispatch_native(SEXP, SEXP, SEXP, SEXP, SEXP);
121 extern SEXP vctrs_cast_dispatch_native(SEXP, SEXP, SEXP, SEXP, SEXP);
122 extern SEXP vctrs_fast_c(SEXP, SEXP);
123 extern SEXP vctrs_data_frame(SEXP, SEXP, SEXP);
124 extern SEXP vctrs_df_list(SEXP, SEXP, SEXP);
125 extern SEXP vctrs_identify_runs(SEXP);
126 extern SEXP vctrs_locate_runs(SEXP, SEXP);
127 extern SEXP vctrs_detect_runs(SEXP, SEXP);
128 extern SEXP vctrs_slice_complete(SEXP);
129 extern SEXP vctrs_locate_complete(SEXP);
130 extern SEXP vctrs_detect_complete(SEXP);
131 extern SEXP vctrs_normalize_encoding(SEXP);
132 extern SEXP vctrs_order(SEXP, SEXP, SEXP, SEXP);
133 extern SEXP vctrs_order_locs(SEXP, SEXP, SEXP, SEXP);
134 extern SEXP vctrs_unrep(SEXP);
135 extern SEXP vctrs_fill_missing(SEXP, SEXP, SEXP);
136 extern SEXP vctrs_chr_paste_prefix(SEXP, SEXP, SEXP);
137 
138 
139 // Maturing
140 // In the public header
141 extern bool vec_is_vector(SEXP);
142 extern R_len_t short_vec_size(SEXP);
143 extern SEXP short_vec_recycle(SEXP, R_len_t);
144 
145 // Experimental
146 // Exported but not available in the public header
147 extern SEXP exp_vec_cast(SEXP, SEXP);
148 extern SEXP exp_vec_chop(SEXP, SEXP);
149 extern SEXP exp_vec_slice_impl(SEXP, SEXP);
150 extern SEXP exp_vec_names(SEXP);
151 extern SEXP exp_vec_set_names(SEXP, SEXP);
152 extern SEXP exp_short_compact_seq(R_len_t, R_len_t, bool);
153 extern SEXP exp_short_init_compact_seq(int*, R_len_t, R_len_t, bool);
154 
155 // Defined below
156 SEXP vctrs_init_library(SEXP);
157 
158 // Defined in altrep-rle.h
159 extern SEXP altrep_rle_Make(SEXP);
160 void vctrs_init_altrep_rle(DllInfo* dll);
161 
162 static const R_CallMethodDef CallEntries[] = {
163   {"vctrs_list_get",                   (DL_FUNC) &vctrs_list_get, 2},
164   {"vctrs_list_set",                   (DL_FUNC) &vctrs_list_set, 3},
165   {"vctrs_field_get",                  (DL_FUNC) &vctrs_field_get, 2},
166   {"vctrs_field_set",                  (DL_FUNC) &vctrs_field_set, 3},
167   {"vctrs_fields",                     (DL_FUNC) &vctrs_fields, 1},
168   {"vctrs_n_fields",                   (DL_FUNC) &vctrs_n_fields, 1},
169   {"vctrs_hash",                       (DL_FUNC) &vctrs_hash, 1},
170   {"vctrs_hash_object",                (DL_FUNC) &vctrs_hash_object, 1},
171   {"vctrs_equal_object",               (DL_FUNC) &vctrs_equal_object, 2},
172   {"vctrs_unique_loc",                 (DL_FUNC) &vctrs_unique_loc, 1},
173   {"vctrs_duplicated",                 (DL_FUNC) &vctrs_duplicated, 1},
174   {"vctrs_duplicated_any",             (DL_FUNC) &vctrs_duplicated_any, 1},
175   {"vctrs_count",                      (DL_FUNC) &vctrs_count, 1},
176   {"vctrs_id",                         (DL_FUNC) &vctrs_id, 1},
177   {"vctrs_n_distinct",                 (DL_FUNC) &vctrs_n_distinct, 1},
178   {"vctrs_split",                      (DL_FUNC) &vec_split, 2},
179   {"vctrs_group_id",                   (DL_FUNC) &vctrs_group_id, 1},
180   {"vctrs_group_rle",                  (DL_FUNC) &vctrs_group_rle, 1},
181   {"vctrs_group_loc",                  (DL_FUNC) &vec_group_loc, 1},
182   {"vctrs_size",                       (DL_FUNC) &vctrs_size, 1},
183   {"vctrs_list_sizes",                 (DL_FUNC) &vctrs_list_sizes, 1},
184   {"vctrs_dim",                        (DL_FUNC) &vctrs_dim, 1},
185   {"vctrs_dim_n",                      (DL_FUNC) &vctrs_dim_n, 1},
186   {"vctrs_is_unspecified",             (DL_FUNC) &vctrs_is_unspecified, 1},
187   {"vctrs_equal",                      (DL_FUNC) &vctrs_equal, 3},
188   {"vctrs_equal_na",                   (DL_FUNC) &vctrs_equal_na, 1},
189   {"vctrs_compare",                    (DL_FUNC) &vctrs_compare, 3},
190   {"vctrs_match",                      (DL_FUNC) &vctrs_match, 5},
191   {"vctrs_in",                         (DL_FUNC) &vctrs_in, 5},
192   {"vctrs_typeof",                     (DL_FUNC) &vctrs_typeof, 2},
193   {"vctrs_init_library",               (DL_FUNC) &vctrs_init_library, 1},
194   {"vctrs_is_vector",                  (DL_FUNC) &vctrs_is_vector, 1},
195   {"vctrs_ptype2",                     (DL_FUNC) &vctrs_ptype2, 4},
196   {"vctrs_typeof2",                    (DL_FUNC) &vctrs_typeof2, 2},
197   {"vctrs_typeof2_s3",                 (DL_FUNC) &vctrs_typeof2_s3, 2},
198   {"vctrs_cast",                       (DL_FUNC) &vctrs_cast, 4},
199   {"vctrs_as_location",                (DL_FUNC) &vctrs_as_location, 8},
200   {"vctrs_slice",                      (DL_FUNC) &vec_slice, 2},
201   {"vctrs_init",                       (DL_FUNC) &vctrs_init, 2},
202   {"vctrs_chop",                       (DL_FUNC) &vctrs_chop, 2},
203   {"vctrs_unchop",                     (DL_FUNC) &vctrs_unchop, 5},
204   {"vctrs_chop_seq",                   (DL_FUNC) &vctrs_chop_seq, 4},
205   {"vctrs_slice_seq",                  (DL_FUNC) &vec_slice_seq, 4},
206   {"vctrs_slice_rep",                  (DL_FUNC) &vec_slice_rep, 3},
207   {"vctrs_restore",                    (DL_FUNC) &vctrs_restore, 3},
208   {"vctrs_restore_default",            (DL_FUNC) &vctrs_restore_default, 2},
209   {"vctrs_proxy",                      (DL_FUNC) &vec_proxy, 1},
210   {"vctrs_proxy_equal",                (DL_FUNC) &vec_proxy_equal, 1},
211   {"vctrs_proxy_compare",              (DL_FUNC) &vec_proxy_compare, 1},
212   {"vctrs_proxy_order",                (DL_FUNC) &vec_proxy_order, 1},
213   {"vctrs_proxy_complete",             (DL_FUNC) &vec_proxy_complete, 1},
214   {"vctrs_df_proxy",                   (DL_FUNC) &vctrs_df_proxy, 2},
215   {"vctrs_unspecified",                (DL_FUNC) &vctrs_unspecified, 1},
216   {"vctrs_ptype",                      (DL_FUNC) &vctrs_ptype, 2},
217   {"vctrs_ptype_finalise",             (DL_FUNC) &vec_ptype_finalise, 1},
218   {"vctrs_minimal_names",              (DL_FUNC) &vctrs_minimal_names, 1},
219   {"vctrs_unique_names",               (DL_FUNC) &vctrs_unique_names, 2},
220   {"vctrs_as_minimal_names",           (DL_FUNC) &vctrs_as_minimal_names, 1},
221   {"vctrs_names",                      (DL_FUNC) &vec_names, 1},
222   {"vctrs_is_unique_names",            (DL_FUNC) &vctrs_is_unique_names, 1},
223   {"vctrs_as_unique_names",            (DL_FUNC) &vctrs_as_unique_names, 2},
224   {"vctrs_set_names",                  (DL_FUNC) &vec_set_names, 2},
225   {"vctrs_df_cast_opts",               (DL_FUNC) &vctrs_df_cast_opts, 5},
226   {"vctrs_df_ptype2_opts",             (DL_FUNC) &vctrs_df_ptype2_opts, 5},
227   {"vctrs_type_info",                  (DL_FUNC) &vctrs_type_info, 1},
228   {"vctrs_proxy_info",                 (DL_FUNC) &vctrs_proxy_info, 1},
229   {"vctrs_class_type",                 (DL_FUNC) &vctrs_class_type, 1},
230   {"vctrs_bare_df_restore",            (DL_FUNC) &vctrs_bare_df_restore, 3},
231   {"vctrs_recycle",                    (DL_FUNC) &vctrs_recycle, 3},
232   {"vctrs_assign",                     (DL_FUNC) &vctrs_assign, 5},
233   {"vctrs_assign_seq",                 (DL_FUNC) &vctrs_assign_seq, 5},
234   {"vctrs_set_attributes",             (DL_FUNC) &vctrs_set_attributes, 2},
235   {"vctrs_as_df_row",                  (DL_FUNC) &vctrs_as_df_row, 2},
236   {"vctrs_outer_names",                (DL_FUNC) &vctrs_outer_names, 3},
237   {"vctrs_df_size",                    (DL_FUNC) &vctrs_df_size, 1},
238   {"vctrs_as_df_col",                  (DL_FUNC) &vctrs_as_df_col, 2},
239   {"vctrs_apply_name_spec",            (DL_FUNC) &vctrs_apply_name_spec, 4},
240   {"vctrs_unset_s4",                   (DL_FUNC) &vctrs_unset_s4, 1},
241   {"vctrs_altrep_rle_Make",            (DL_FUNC) &altrep_rle_Make, 1},
242   {"vctrs_validate_name_repair_arg",   (DL_FUNC) &vctrs_validate_name_repair_arg, 1},
243   {"vctrs_validate_minimal_names",     (DL_FUNC) &vctrs_validate_minimal_names, 2},
244   {"vctrs_as_names",                   (DL_FUNC) &vctrs_as_names, 4},
245   {"vctrs_is_partial",                 (DL_FUNC) &vctrs_is_partial, 1},
246   {"vctrs_is_list",                    (DL_FUNC) &vctrs_is_list, 1},
247   {"vctrs_try_catch_callback",         (DL_FUNC) &vctrs_try_catch_callback, 2},
248   {"vctrs_is_coercible",               (DL_FUNC) &vctrs_is_coercible, 5},
249   {"vctrs_as_subscript",               (DL_FUNC) &vctrs_as_subscript, 5},
250   {"vctrs_as_subscript_result",        (DL_FUNC) &vctrs_as_subscript_result, 5},
251   {"vctrs_df_flatten_info",            (DL_FUNC) &vctrs_df_flatten_info, 1},
252   {"vctrs_df_flatten",                 (DL_FUNC) &df_flatten, 1},
253   {"vctrs_linked_version",             (DL_FUNC) &vctrs_linked_version, 0},
254   {"vctrs_tib_ptype2",                 (DL_FUNC) &vctrs_tib_ptype2, 4},
255   {"vctrs_tib_cast",                   (DL_FUNC) &vctrs_tib_cast, 4},
256   {"vctrs_assign_params",              (DL_FUNC) &vctrs_assign_params, 4},
257   {"vctrs_has_dim",                    (DL_FUNC) &vctrs_has_dim, 1},
258   {"vctrs_rep",                        (DL_FUNC) &vctrs_rep, 2},
259   {"vctrs_rep_each",                   (DL_FUNC) &vctrs_rep_each, 2},
260   {"vctrs_maybe_shared_col",           (DL_FUNC) &vctrs_maybe_shared_col, 2},
261   {"vctrs_new_df_unshared_col",        (DL_FUNC) &vctrs_new_df_unshared_col, 0},
262   {"vctrs_shaped_ptype",               (DL_FUNC) &vctrs_shaped_ptype, 5},
263   {"vctrs_shape2",                     (DL_FUNC) &vctrs_shape2, 4},
264   {"vctrs_new_date",                   (DL_FUNC) &vctrs_new_date, 1},
265   {"vctrs_date_validate",              (DL_FUNC) &vctrs_date_validate, 1},
266   {"vctrs_new_datetime",               (DL_FUNC) &vctrs_new_datetime, 2},
267   {"vctrs_datetime_validate",          (DL_FUNC) &vctrs_datetime_validate, 1},
268   {"vctrs_ptype2_opts",                (DL_FUNC) &vctrs_ptype2_opts, 5},
269   {"vctrs_s3_find_method",             (DL_FUNC) &vctrs_s3_find_method, 3},
270   {"vctrs_implements_ptype2",          (DL_FUNC) &vctrs_implements_ptype2, 1},
271   {"vctrs_ptype2_dispatch_native",     (DL_FUNC) &vctrs_ptype2_dispatch_native, 5},
272   {"vctrs_cast_dispatch_native",       (DL_FUNC) &vctrs_cast_dispatch_native, 5},
273   {"vctrs_fast_c",                     (DL_FUNC) &vctrs_fast_c, 2},
274   {"vctrs_data_frame",                 (DL_FUNC) &vctrs_data_frame, 3},
275   {"vctrs_df_list",                    (DL_FUNC) &vctrs_df_list, 3},
276   {"vctrs_identify_runs",              (DL_FUNC) &vctrs_identify_runs, 1},
277   {"vctrs_locate_runs",                (DL_FUNC) &vctrs_locate_runs, 2},
278   {"vctrs_detect_runs",                (DL_FUNC) &vctrs_detect_runs, 2},
279   {"vctrs_slice_complete",             (DL_FUNC) &vctrs_slice_complete, 1},
280   {"vctrs_locate_complete",            (DL_FUNC) &vctrs_locate_complete, 1},
281   {"vctrs_detect_complete",            (DL_FUNC) &vctrs_detect_complete, 1},
282   {"vctrs_normalize_encoding",         (DL_FUNC) &vctrs_normalize_encoding, 1},
283   {"vctrs_order",                      (DL_FUNC) &vctrs_order, 4},
284   {"vctrs_order_locs",                 (DL_FUNC) &vctrs_order_locs, 4},
285   {"vctrs_unrep",                      (DL_FUNC) &vctrs_unrep, 1},
286   {"vctrs_fill_missing",               (DL_FUNC) &vctrs_fill_missing, 3},
287   {"vctrs_chr_paste_prefix",           (DL_FUNC) &vctrs_chr_paste_prefix, 3},
288   {NULL, NULL, 0}
289 };
290 
291 extern SEXP vctrs_type_common(SEXP, SEXP, SEXP, SEXP);
292 extern SEXP vctrs_ptype_common_opts(SEXP, SEXP, SEXP, SEXP);
293 extern SEXP vctrs_size_common(SEXP, SEXP, SEXP, SEXP);
294 extern SEXP vctrs_recycle_common(SEXP, SEXP, SEXP, SEXP);
295 extern SEXP vctrs_cast_common(SEXP, SEXP, SEXP, SEXP);
296 extern SEXP vctrs_cast_common_opts(SEXP, SEXP, SEXP, SEXP);
297 extern SEXP vctrs_rbind(SEXP, SEXP, SEXP, SEXP);
298 extern SEXP vctrs_cbind(SEXP, SEXP, SEXP, SEXP);
299 extern SEXP vctrs_c(SEXP, SEXP, SEXP, SEXP);
300 extern SEXP vctrs_new_data_frame(SEXP);
301 
302 static const R_ExternalMethodDef ExtEntries[] = {
303   {"vctrs_type_common",                (DL_FUNC) &vctrs_type_common, 1},
304   {"vctrs_ptype_common_opts",          (DL_FUNC) &vctrs_ptype_common_opts, 2},
305   {"vctrs_size_common",                (DL_FUNC) &vctrs_size_common, 2},
306   {"vctrs_recycle_common",             (DL_FUNC) &vctrs_recycle_common, 1},
307   {"vctrs_cast_common",                (DL_FUNC) &vctrs_cast_common, 1},
308   {"vctrs_cast_common_opts",           (DL_FUNC) &vctrs_cast_common_opts, 2},
309   {"vctrs_rbind",                      (DL_FUNC) &vctrs_rbind, 4},
310   {"vctrs_cbind",                      (DL_FUNC) &vctrs_cbind, 3},
311   {"vctrs_c",                          (DL_FUNC) &vctrs_c, 3},
312   {"vctrs_new_data_frame",             (DL_FUNC) &vctrs_new_data_frame, -1},
313   {NULL, NULL, 0}
314 };
315 
R_init_vctrs(DllInfo * dll)316 export void R_init_vctrs(DllInfo *dll)
317 {
318     R_registerRoutines(dll, NULL, CallEntries, NULL, ExtEntries);
319     R_useDynamicSymbols(dll, FALSE);
320 
321     // Maturing
322     // In the public header
323     R_RegisterCCallable("vctrs", "vec_is_vector",      (DL_FUNC) &vec_is_vector);
324     R_RegisterCCallable("vctrs", "short_vec_size",     (DL_FUNC) &short_vec_size);
325     R_RegisterCCallable("vctrs", "short_vec_recycle",  (DL_FUNC) &short_vec_recycle);
326 
327     // Experimental
328     // Exported but not available in the public header
329     R_RegisterCCallable("vctrs", "exp_vec_cast",                (DL_FUNC) &exp_vec_cast);
330     R_RegisterCCallable("vctrs", "exp_vec_chop",                (DL_FUNC) &exp_vec_chop);
331     R_RegisterCCallable("vctrs", "exp_vec_slice_impl",          (DL_FUNC) &exp_vec_slice_impl);
332     R_RegisterCCallable("vctrs", "exp_vec_names",               (DL_FUNC) &exp_vec_names);
333     R_RegisterCCallable("vctrs", "exp_vec_set_names",           (DL_FUNC) &exp_vec_set_names);
334     R_RegisterCCallable("vctrs", "exp_short_compact_seq",       (DL_FUNC) &exp_short_compact_seq);
335     R_RegisterCCallable("vctrs", "exp_short_init_compact_seq",  (DL_FUNC) &exp_short_init_compact_seq);
336 
337     // Altrep classes
338     vctrs_init_altrep_rle(dll);
339 }
340 
341 
342 void vctrs_init_bind(SEXP ns);
343 void vctrs_init_cast(SEXP ns);
344 void vctrs_init_data(SEXP ns);
345 void vctrs_init_dictionary(SEXP ns);
346 void vctrs_init_names(SEXP ns);
347 void vctrs_init_proxy_restore(SEXP ns);
348 void vctrs_init_slice(SEXP ns);
349 void vctrs_init_slice_assign(SEXP ns);
350 void vctrs_init_subscript(SEXP ns);
351 void vctrs_init_subscript_loc(SEXP ns);
352 void vctrs_init_ptype2(SEXP ns);
353 void vctrs_init_ptype2_dispatch(SEXP ns);
354 void vctrs_init_rep(SEXP ns);
355 void vctrs_init_type(SEXP ns);
356 void vctrs_init_type_data_frame(SEXP ns);
357 void vctrs_init_type_date_time(SEXP ns);
358 void vctrs_init_type_info(SEXP ns);
359 void vctrs_init_unspecified(SEXP ns);
360 void vctrs_init_utils(SEXP ns);
361 
vctrs_init_library(SEXP ns)362 SEXP vctrs_init_library(SEXP ns) {
363   vctrs_init_bind(ns);
364   vctrs_init_cast(ns);
365   vctrs_init_data(ns);
366   vctrs_init_dictionary(ns);
367   vctrs_init_names(ns);
368   vctrs_init_proxy_restore(ns);
369   vctrs_init_slice(ns);
370   vctrs_init_slice_assign(ns);
371   vctrs_init_subscript(ns);
372   vctrs_init_subscript_loc(ns);
373   vctrs_init_ptype2(ns);
374   vctrs_init_ptype2_dispatch(ns);
375   vctrs_init_rep(ns);
376   vctrs_init_type(ns);
377   vctrs_init_type_data_frame(ns);
378   vctrs_init_type_date_time(ns);
379   vctrs_init_type_info(ns);
380   vctrs_init_unspecified(ns);
381   vctrs_init_utils(ns);
382   return R_NilValue;
383 }
384