* open-input-file now uses a bytevector representing the filename
during ffi.
This commit is contained in:
parent
498084a6e8
commit
1586986dbe
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -805,7 +805,14 @@ ikp ikrt_read(ikp fd, ikp buff, ikpcb* pcb){
|
||||||
|
|
||||||
ikp
|
ikp
|
||||||
ikrt_open_input_file(ikp fname, ikpcb* pcb){
|
ikrt_open_input_file(ikp fname, ikpcb* pcb){
|
||||||
int fd = open(string_data(fname), O_RDONLY);
|
char* name;
|
||||||
|
if(tagof(fname) == bytevector_tag){
|
||||||
|
name = (char*) fname + off_bytevector_data;
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "bug in ikrt_open_input_file\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
int fd = open(name, O_RDONLY);
|
||||||
if(fd == -1){
|
if(fd == -1){
|
||||||
return false_object;
|
return false_object;
|
||||||
} else {
|
} else {
|
||||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -141,7 +141,8 @@
|
||||||
(define $open-input-file
|
(define $open-input-file
|
||||||
(lambda (filename)
|
(lambda (filename)
|
||||||
(close-ports)
|
(close-ports)
|
||||||
(let ([fd/error (foreign-call "ikrt_open_input_file" filename)])
|
(let ([fd/error (foreign-call "ikrt_open_input_file"
|
||||||
|
(string->utf8-bytevector filename))])
|
||||||
(if (fixnum? fd/error)
|
(if (fixnum? fd/error)
|
||||||
(let ([port (make-input-port
|
(let ([port (make-input-port
|
||||||
(make-input-file-handler fd/error filename)
|
(make-input-file-handler fd/error filename)
|
||||||
|
|
Loading…
Reference in New Issue