search for: cad4r

Displaying 5 results from an estimated 5 matches for "cad4r".

Did you mean: ca4r
2010 Jun 19
1
more powerful iconv
...CADDDR(args)) != 1) error(_("invalid '%s' argument"), "sub"); - if(STRING_ELT(CADDDR(args), 0) == NA_STRING) sub = NULL; + if(STRING_ELT(CADDDR(args), 0) == NA_STRING || isRawx) sub = NULL; else sub = translateChar(STRING_ELT(CADDDR(args), 0)); mark = asLogical(CAD4R(args)); if(mark == NA_LOGICAL) @@ -584,7 +585,7 @@ PROTECT(ans = duplicate(x)); R_AllocStringBuffer(0, &cbuff); /* 0 -> default */ for(i = 0; i < LENGTH(x); i++) { - si = STRING_ELT(x, i); + si = isRawx ? x : STRING_ELT(x, i); top_of_loop: inbuf = CHAR(si); inb =...
2019 Nov 04
2
Questions on the R C API
Hi All, I have some questions regarding the R C API. Let's assume I have a function which is defined as follows: R file: myfunc <- function(a, b, ...) .External(Cfun, a, b, ...) C file: SEXP Cfun(SEXP args) { args = CDR(args); SEXP a = CAR(args); args = CDR(args); SEXP b = CAR(args); args = CDR(args); /* continue to do something with remaining arguments in "..."
2019 Nov 04
0
Questions on the R C API
...e) ((e)->u.listsxp.carval) #define CDR(e) ((e)->u.listsxp.cdrval) #define CAAR(e) CAR(CAR(e)) #define CDAR(e) CDR(CAR(e)) #define CADR(e) CAR(CDR(e)) #define CDDR(e) CDR(CDR(e)) #define CDDDR(e) CDR(CDR(CDR(e))) #define CADDR(e) CAR(CDR(CDR(e))) #define CADDDR(e) CAR(CDR(CDR(CDR(e)))) #define CAD4R(e) CAR(CDR(CDR(CDR(CDR(e))))) ``` You can use them to get first a few arguments from a pairlist. Another solution would be converting the pairlist into a list so that you can use the methods defined for a list to access any element. I do not know which C function can achieve that but `as.list` at...
2019 Nov 05
1
Questions on the R C API
...R(e) ((e)->u.listsxp.cdrval) > #define CAAR(e) CAR(CAR(e)) > #define CDAR(e) CDR(CAR(e)) > #define CADR(e) CAR(CDR(e)) > #define CDDR(e) CDR(CDR(e)) > #define CDDDR(e) CDR(CDR(CDR(e))) > #define CADDR(e) CAR(CDR(CDR(e))) > #define CADDDR(e) CAR(CDR(CDR(CDR(e)))) > #define CAD4R(e) CAR(CDR(CDR(CDR(CDR(e))))) > ``` > > You can use them to get first a few arguments from a pairlist. Another > solution would be converting the pairlist into a list so that you can use > the methods defined for a list to access any element. I do not know which C > function can a...
2018 Dec 04
3
patch to support custom HTTP headers in download.file() and url()
...int ncon, block, raw = 0, defmeth, @@ -5333,6 +5334,15 @@ SEXP attribute_hidden do_url(SEXP call, SEXP op, SEXP args, SEXP env) error(_("invalid '%s' argument"), "raw"); } + // --------- headers, for url() only + if(PRIMVAL(op) == 0) { + SEXP lheaders = CAD4R(CDR(args)); + if (!isNull(lheaders)) { + headers = VECTOR_ELT(lheaders, 0); + headers_flat = VECTOR_ELT(lheaders, 1); + } + } + if(!meth) { if (strncmp(url, "ftps://", 7) == 0) { #ifdef HAVE_LIBCURL @@ -5369,12 +5379,12 @@ SEXP attribute_hidden do_url(SEXP call, SEXP op,...