Skip to content

Commit 992cd01

Browse files
committed
Replace extern "C" by cpp11::sexp
1 parent 48ab979 commit 992cd01

File tree

9 files changed

+116
-116
lines changed

9 files changed

+116
-116
lines changed

src/connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ SEXP write_bin(SEXP data, SEXP con) {
3232
// raw vector.
3333
//
3434
[[cpp11::register]]
35-
extern "C" SEXP read_connection_(SEXP con_sxp, SEXP read_size_sxp) {
35+
cpp11::sexp read_connection_(SEXP con_sxp, SEXP read_size_sxp) {
3636

3737
BEGIN_CPP
3838
std::vector<char> buffer;

src/cpp11.cpp

Lines changed: 58 additions & 58 deletions
Large diffs are not rendered by default.

src/xml2_doc.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <cstring>
1212

1313
[[cpp11::register]]
14-
extern "C" SEXP xml_parse_options_() {
14+
cpp11::sexp xml_parse_options_() {
1515

1616
#if defined(LIBXML_VERSION) && (LIBXML_VERSION >= 20700)
1717
#define HAS_OLD10
@@ -184,7 +184,7 @@ extern "C" SEXP xml_parse_options_() {
184184
}
185185

186186
[[cpp11::register]]
187-
extern "C" SEXP doc_parse_file(
187+
cpp11::sexp doc_parse_file(
188188
SEXP path_sxp,
189189
SEXP encoding_sxp,
190190
SEXP as_html_sxp,
@@ -217,7 +217,7 @@ extern "C" SEXP doc_parse_file(
217217
}
218218

219219
[[cpp11::register]]
220-
extern "C" SEXP doc_parse_raw(
220+
cpp11::sexp doc_parse_raw(
221221
SEXP x,
222222
SEXP encoding_sxp,
223223
SEXP base_url_sxp,
@@ -259,7 +259,7 @@ extern "C" SEXP doc_parse_raw(
259259
}
260260

261261
[[cpp11::register]]
262-
extern "C" SEXP doc_root(SEXP x) {
262+
cpp11::sexp doc_root(SEXP x) {
263263
BEGIN_CPP
264264
XPtrDoc doc(x);
265265
XPtrNode node(xmlDocGetRootElement(doc.checked_get()));
@@ -268,15 +268,15 @@ extern "C" SEXP doc_root(SEXP x) {
268268
}
269269

270270
[[cpp11::register]]
271-
extern "C" SEXP doc_has_root(SEXP x_sxp) {
271+
cpp11::sexp doc_has_root(SEXP x_sxp) {
272272
BEGIN_CPP
273273
XPtrDoc x(x_sxp);
274274
return Rf_ScalarLogical(xmlDocGetRootElement(x.get()) != NULL);
275275
END_CPP
276276
}
277277

278278
[[cpp11::register]]
279-
extern "C" SEXP doc_url(SEXP doc_sxp) {
279+
cpp11::sexp doc_url(SEXP doc_sxp) {
280280
BEGIN_CPP
281281

282282
XPtrDoc doc(doc_sxp);
@@ -293,7 +293,7 @@ extern "C" SEXP doc_url(SEXP doc_sxp) {
293293
}
294294

295295
[[cpp11::register]]
296-
extern "C" SEXP doc_new(SEXP version_sxp, SEXP encoding_sxp) {
296+
cpp11::sexp doc_new(SEXP version_sxp, SEXP encoding_sxp) {
297297

298298
const char* encoding = CHAR(STRING_ELT(encoding_sxp, 0));
299299

@@ -306,7 +306,7 @@ extern "C" SEXP doc_new(SEXP version_sxp, SEXP encoding_sxp) {
306306
}
307307

308308
[[cpp11::register]]
309-
extern "C" SEXP doc_set_root(SEXP doc_sxp, SEXP root_sxp) {
309+
cpp11::sexp doc_set_root(SEXP doc_sxp, SEXP root_sxp) {
310310
BEGIN_CPP
311311
XPtrDoc doc(doc_sxp);
312312
XPtrNode root(root_sxp);
@@ -316,7 +316,7 @@ extern "C" SEXP doc_set_root(SEXP doc_sxp, SEXP root_sxp) {
316316
}
317317

318318
[[cpp11::register]]
319-
extern "C" SEXP doc_is_html(SEXP doc_sxp) {
319+
cpp11::sexp doc_is_html(SEXP doc_sxp) {
320320
BEGIN_CPP
321321
XPtrDoc doc(doc_sxp);
322322
return Rf_ScalarLogical(doc->properties & XML_DOC_HTML);

src/xml2_init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void handleGenericError(void *ctx, const char *fmt, ...)
4040
}
4141

4242
[[cpp11::register]]
43-
extern "C" SEXP init_libxml2() {
43+
cpp11::sexp init_libxml2() {
4444
// Check that header and libs are compatible
4545
LIBXML_TEST_VERSION
4646

@@ -59,6 +59,6 @@ extern "C" {
5959
}
6060

6161
[[cpp11::register]]
62-
extern "C" SEXP libxml2_version_(){
62+
cpp11::sexp libxml2_version_(){
6363
return Rf_mkString(LIBXML_DOTTED_VERSION);
6464
}

src/xml2_namespace.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "xml2_utils.h"
1111

1212
[[cpp11::register]]
13-
extern "C" SEXP unique_ns(SEXP ns) {
13+
cpp11::sexp unique_ns(SEXP ns) {
1414
BEGIN_CPP
1515
return NsMap(ns).out();
1616
END_CPP
@@ -29,7 +29,7 @@ void cache_namespace(xmlNode* node, NsMap* nsMap) {
2929
}
3030

3131
[[cpp11::register]]
32-
extern "C" SEXP doc_namespaces(SEXP doc_sxp) {
32+
cpp11::sexp doc_namespaces(SEXP doc_sxp) {
3333
BEGIN_CPP
3434
XPtrDoc doc(doc_sxp);
3535

@@ -43,7 +43,7 @@ extern "C" SEXP doc_namespaces(SEXP doc_sxp) {
4343
}
4444

4545
[[cpp11::register]]
46-
extern "C" SEXP ns_lookup_uri(SEXP doc_sxp, SEXP node_sxp, SEXP uri_sxp) {
46+
cpp11::sexp ns_lookup_uri(SEXP doc_sxp, SEXP node_sxp, SEXP uri_sxp) {
4747
BEGIN_CPP
4848
XPtrDoc doc(doc_sxp);
4949
XPtrNode node(node_sxp);
@@ -58,7 +58,7 @@ extern "C" SEXP ns_lookup_uri(SEXP doc_sxp, SEXP node_sxp, SEXP uri_sxp) {
5858
}
5959

6060
[[cpp11::register]]
61-
extern "C" SEXP ns_lookup(SEXP doc_sxp, SEXP node_sxp, SEXP prefix_sxp) {
61+
cpp11::sexp ns_lookup(SEXP doc_sxp, SEXP node_sxp, SEXP prefix_sxp) {
6262
BEGIN_CPP
6363
XPtrDoc doc(doc_sxp);
6464
XPtrNode node(node_sxp);

0 commit comments

Comments
 (0)