/usr/lib/R/site-library/XVector/include/_XVector_stubs.c is in r-bioc-xvector 0.18.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | #include "XVector_interface.h"
#define DEFINE_CCALLABLE_STUB(retT, stubname, Targs, args) \
typedef retT(*__ ## stubname ## _funtype__)Targs; \
retT stubname Targs \
{ \
static __ ## stubname ## _funtype__ fun = NULL; \
if (fun == NULL) \
fun = (__ ## stubname ## _funtype__) R_GetCCallable("XVector", "_" #stubname); \
return fun args; \
}
/*
* Using the above macro when retT (the returned type) is void will make Sun
* Studio 12 C compiler unhappy. So we need to use the following macro to
* handle that case.
*/
#define DEFINE_NOVALUE_CCALLABLE_STUB(stubname, Targs, args) \
typedef void(*__ ## stubname ## _funtype__)Targs; \
void stubname Targs \
{ \
static __ ## stubname ## _funtype__ fun = NULL; \
if (fun == NULL) \
fun = (__ ## stubname ## _funtype__) R_GetCCallable("XVector", "_" #stubname); \
fun args; \
return; \
}
/*
* Stubs for callables defined in io_utils.c
*/
DEFINE_CCALLABLE_STUB(int, filexp_read,
(SEXP filexp, char *buf, int buf_size),
( filexp, buf, buf_size)
)
DEFINE_CCALLABLE_STUB(int, filexp_gets,
(SEXP filexp, char *buf, int buf_size, int *EOL_in_buf),
( filexp, buf, buf_size, EOL_in_buf)
)
DEFINE_NOVALUE_CCALLABLE_STUB(filexp_seek,
(SEXP filexp, long long int offset, int whence),
( filexp, offset, whence)
)
DEFINE_NOVALUE_CCALLABLE_STUB(filexp_rewind,
(SEXP filexp),
( filexp)
)
DEFINE_CCALLABLE_STUB(int, filexp_puts,
(SEXP filexp, const char *s),
( filexp, s)
)
DEFINE_NOVALUE_CCALLABLE_STUB(filexp_putc,
(SEXP filexp, int c),
( filexp, c)
)
DEFINE_CCALLABLE_STUB(int, delete_trailing_LF_or_CRLF,
(const char *buf, int buf_len),
( buf, buf_len)
)
/*
* Stubs for callables defined in Ocopy_byteblocks.c
*/
DEFINE_NOVALUE_CCALLABLE_STUB(Ocopy_byteblocks_from_i1i2,
(int i1, int i2, char *dest, size_t dest_nblocks, const char *src, size_t src_nblocks, size_t blocksize),
( i1, i2, dest, dest_nblocks, src, src_nblocks, blocksize)
)
DEFINE_NOVALUE_CCALLABLE_STUB(Ocopy_byteblocks_from_subscript,
(const int *subset, int n, char *dest, size_t dest_nblocks, const char *src, size_t src_nblocks, size_t blocksize),
( subset, n, dest, dest_nblocks, src, src_nblocks, blocksize)
)
DEFINE_NOVALUE_CCALLABLE_STUB(Ocopy_byteblocks_to_i1i2,
(int i1, int i2, char *dest, size_t dest_nblocks, const char *src, size_t src_nblocks, size_t blocksize),
( i1, i2, dest, dest_nblocks, src, src_nblocks, blocksize)
)
DEFINE_NOVALUE_CCALLABLE_STUB(Ocopy_byteblocks_to_subscript,
(const int *subset, int n, char *dest, size_t dest_nblocks, const char *src, size_t src_nblocks, size_t blocksize),
( subset, n, dest, dest_nblocks, src, src_nblocks, blocksize)
)
DEFINE_NOVALUE_CCALLABLE_STUB(Ocopy_bytes_from_i1i2_with_lkup,
(int i1, int i2, char *dest, int dest_nbytes, const char *src, int src_nbytes, const int *lkup, int lkup_length),
( i1, i2, dest, dest_nbytes, src, src_nbytes, lkup, lkup_length)
)
DEFINE_NOVALUE_CCALLABLE_STUB(Ocopy_bytes_from_subscript_with_lkup,
(const int *subset, int n, char *dest, int dest_nbytes, const char *src, int src_nbytes, const int *lkup, int lkup_length),
( subset, n, dest, dest_nbytes, src, src_nbytes, lkup, lkup_length)
)
DEFINE_NOVALUE_CCALLABLE_STUB(Ocopy_bytes_to_i1i2_with_lkup,
(int i1, int i2, char *dest, int dest_nbytes, const char *src, int src_nbytes, const int *lkup, int lkup_length),
( i1, i2, dest, dest_nbytes, src, src_nbytes, lkup, lkup_length)
)
DEFINE_NOVALUE_CCALLABLE_STUB(Ocopy_bytes_to_subscript_with_lkup,
(const int *subset, int n, char *dest, int dest_nbytes, const char *src, int src_nbytes, const int *lkup, int lkup_length),
( subset, n, dest, dest_nbytes, src, src_nbytes, lkup, lkup_length)
)
DEFINE_NOVALUE_CCALLABLE_STUB(Orevcopy_byteblocks_from_i1i2,
(int i1, int i2, char *dest, size_t dest_nblocks, const char *src, size_t src_nblocks, size_t blocksize),
( i1, i2, dest, dest_nblocks, src, src_nblocks, blocksize)
)
DEFINE_NOVALUE_CCALLABLE_STUB(Orevcopy_bytes_from_i1i2_with_lkup,
(int i1, int i2, char *dest, int dest_nbytes, const char *src, int src_nbytes, const int *lkup, int lkup_length),
( i1, i2, dest, dest_nbytes, src, src_nbytes, lkup, lkup_length)
)
DEFINE_NOVALUE_CCALLABLE_STUB(Ocopy_bytes_from_i1i2_to_complex,
(int i1, int i2, Rcomplex *dest, int dest_nbytes, const char *src, int src_nbytes, const Rcomplex *lkup, int lkup_length),
( i1, i2, dest, dest_nbytes, src, src_nbytes, lkup, lkup_length)
)
/*
* Stubs for callables defined in SharedVector_class.c
*/
DEFINE_CCALLABLE_STUB(SEXP, new_SharedVector,
(const char *classname, SEXP tag),
( classname, tag)
)
DEFINE_CCALLABLE_STUB(SEXP, get_SharedVector_tag,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(int, get_SharedVector_length,
(SEXP x),
( x)
)
/*
* Stubs for callables defined in XVector_class.c
*/
DEFINE_CCALLABLE_STUB(SEXP, get_XVector_shared,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(int, get_XVector_offset,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(int, get_XVector_length,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(SEXP, get_XVector_tag,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(Chars_holder, hold_XRaw,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(Ints_holder, hold_XInteger,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(Doubles_holder, hold_XDouble,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XVector,
(const char *classname, SEXP shared, int offset, int length),
( classname, shared, offset, length)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XRaw_from_tag,
(const char *classname, SEXP tag),
( classname, tag)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XInteger_from_tag,
(const char *classname, SEXP tag),
( classname, tag)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XDouble_from_tag,
(const char *classname, SEXP tag),
( classname, tag)
)
DEFINE_CCALLABLE_STUB(SEXP, alloc_XRaw,
(const char *classname, int length),
( classname, length)
)
DEFINE_CCALLABLE_STUB(SEXP, alloc_XInteger,
(const char *classname, int length),
( classname, length)
)
DEFINE_CCALLABLE_STUB(SEXP, alloc_XDouble,
(const char *classname, int length),
( classname, length)
)
/*
* Stubs for callables defined in XVectorList_class.c
*/
DEFINE_CCALLABLE_STUB(int, get_XVectorList_length,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(SEXP, get_XVectorList_width,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(SEXP, get_XVectorList_names,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(XVectorList_holder, hold_XVectorList,
(SEXP x),
( x)
)
DEFINE_CCALLABLE_STUB(int, get_length_from_XVectorList_holder,
(const XVectorList_holder *x_holder),
( x_holder)
)
DEFINE_CCALLABLE_STUB(Chars_holder, get_elt_from_XRawList_holder,
(const XVectorList_holder *x_holder, int i),
( x_holder, i)
)
DEFINE_CCALLABLE_STUB(Ints_holder, get_elt_from_XIntegerList_holder,
(const XVectorList_holder *x_holder, int i),
( x_holder, i)
)
DEFINE_CCALLABLE_STUB(Doubles_holder, get_elt_from_XDoubleList_holder,
(const XVectorList_holder *x_holder, int i),
( x_holder, i)
)
DEFINE_CCALLABLE_STUB(XVectorList_holder, get_linear_subset_from_XVectorList_holder,
(const XVectorList_holder *x_holder, int offset, int length),
( x_holder, offset, length)
)
DEFINE_NOVALUE_CCALLABLE_STUB(set_XVectorList_names,
(SEXP x, SEXP names),
( x, names)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XRawList_from_tags,
(const char *classname, const char *element_type, SEXP tags, SEXP ranges, SEXP ranges_group),
( classname, element_type, tags, ranges, ranges_group)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XIntegerList_from_tags,
(const char *classname, const char *element_type, SEXP tags, SEXP ranges, SEXP ranges_group),
( classname, element_type, tags, ranges, ranges_group)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XDoubleList_from_tags,
(const char *classname, const char *element_type, SEXP tags, SEXP ranges, SEXP ranges_group),
( classname, element_type, tags, ranges, ranges_group)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XRawList_from_tag,
(const char *classname, const char *element_type, SEXP tag, SEXP ranges),
( classname, element_type, tag, ranges)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XIntegerList_from_tag,
(const char *classname, const char *element_type, SEXP tag, SEXP ranges),
( classname, element_type, tag, ranges)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XDoubleList_from_tag,
(const char *classname, const char *element_type, SEXP tag, SEXP ranges),
( classname, element_type, tag, ranges)
)
DEFINE_CCALLABLE_STUB(SEXP, alloc_XRawList,
(const char *classname, const char *element_type, SEXP width),
( classname, element_type, width)
)
DEFINE_CCALLABLE_STUB(SEXP, alloc_XIntegerList,
(const char *classname, const char *element_type, SEXP width),
( classname, element_type, width)
)
DEFINE_CCALLABLE_STUB(SEXP, alloc_XDoubleList,
(const char *classname, const char *element_type, SEXP width),
( classname, element_type, width)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XRawList_from_CharAEAE,
(const char *classname, const char *element_type, const CharAEAE *char_aeae, SEXP lkup),
( classname, element_type, char_aeae, lkup)
)
DEFINE_CCALLABLE_STUB(SEXP, new_XIntegerList_from_IntAEAE,
(const char *classname, const char *element_type, const IntAEAE *int_aeae),
( classname, element_type, int_aeae)
)
|