added set-port-position! for binary output files.

This commit is contained in:
Abdulaziz Ghuloum
2008-12-09 03:00:44 -05:00
parent 4861daf6fc
commit aba76624b2
7 changed files with 88 additions and 18 deletions
+1
View File
@@ -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 */
+12
View File
@@ -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);