view R/scratch/stdio.R @ 63:9b6cdffd30dd

- further fixes of inccorect overflow errors for int (and long on LLP64 systems) * prev commit had bugs * added overflow tests for also int, long, long long (for both, lp64 and llp64) - while at it, fixing a reference leak when not using python with utf8 caching
author Tassilo Philipp
date Sun, 19 May 2024 15:33:18 +0200
parents 0cfcc391201f
children
line wrap: on
line source

# Dynport: stdio
# Description: Standard I/O C library
# Dynport-Maintainer: dadler@uni-goettingen.de
# -----------------------------------------------------------------------------

.sysname <- Sys.info()[["sysname"]]
if (.sysname == "Windows") {
  .libNameC <- "msvcrt"
} else {
  .libNameC <- "c"
}

dynbind(.libNameC,"
fopen(ZZ)p;
fread(piip)i;
fwrite(piip)i;
fseek(pli)i;
fclose(p)i;
memcpy(ppi)p;
memset(pii)p;
")

SEEK_SET = 0
SEEK_CUR = 1
SEEK_END = 2