added set-port-position! for binary output files.
This commit is contained in:
@@ -213,6 +213,7 @@ ikptr normalize_bignum(long int limbs, int sign, ikptr r);
|
||||
ikptr s_to_number(signed long x, ikpcb* pcb);
|
||||
ikptr d_to_number(double x, ikpcb* pcb);
|
||||
ikptr make_pointer(long x, ikpcb* pcb);
|
||||
long long extract_num_longlong(ikptr x);
|
||||
|
||||
#define IK_HEAP_EXT_SIZE (32 * 4096)
|
||||
#define IK_HEAPSIZE (1024 * ((wordsize==4)?1:2) * 4096) /* 4/8 MB */
|
||||
|
||||
@@ -41,6 +41,18 @@ ikrt_close_fd(ikptr fd /*, ikpcb* pcb */){
|
||||
}
|
||||
}
|
||||
|
||||
ikptr
|
||||
ikrt_set_position(ikptr fd, ikptr pos /*, ikpcb* pcb */){
|
||||
off_t offset = extract_num_longlong(pos);
|
||||
off_t err = lseek(unfix(fd), offset, SEEK_SET);
|
||||
if(err == -1){
|
||||
return ik_errno_to_code();
|
||||
} else {
|
||||
return false_object;;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ikptr
|
||||
ikrt_open_input_fd(ikptr fn /*, ikpcb* pcb */){
|
||||
int fh = open((char*)(long)(fn+off_bytevector_data), O_RDONLY, 0);
|
||||
|
||||
Reference in New Issue
Block a user