* uuid now uses a bytevector for ffi.
This commit is contained in:
parent
027d50e84a
commit
1c4d3c4b40
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -467,8 +467,8 @@ ikp ik_uuid(ikp str){
|
|||
}
|
||||
uuid_strlen = strlen(uuid_chars);
|
||||
}
|
||||
int n = unfix(ref(str, off_string_length));
|
||||
unsigned char* data = str+off_string_data;
|
||||
int n = unfix(ref(str, off_bytevector_length));
|
||||
unsigned char* data = str+off_bytevector_data;
|
||||
read(fd, data, n);
|
||||
unsigned char* p = data;
|
||||
unsigned char* q = data + n;
|
||||
|
@ -480,20 +480,6 @@ ikp ik_uuid(ikp str){
|
|||
}
|
||||
|
||||
|
||||
#if 0
|
||||
ikp ik_read(ikp fdptr, ikp bufptr, ikp lenptr){
|
||||
int fd = unfix(fdptr);
|
||||
int len = unfix(lenptr);
|
||||
char* buf = (char*)(bufptr+disp_string_data-string_tag);
|
||||
int bytes = read(fd, buf, len);
|
||||
if(bytes == -1){
|
||||
perror("S_read");
|
||||
exit(-10);
|
||||
}
|
||||
return fix(bytes);
|
||||
}
|
||||
#endif
|
||||
|
||||
ikp ik_write(ikp fdptr, ikp idx, ikp str){
|
||||
fprintf(stderr, "IK_WRITE\n");
|
||||
int fd = unfix(fdptr);
|
||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -6,6 +6,7 @@
|
|||
(ikarus system $strings)
|
||||
(ikarus system $fx)
|
||||
(ikarus system $chars)
|
||||
(ikarus system $bytevectors)
|
||||
(ikarus system $pairs)
|
||||
(except (ikarus) string-length string-ref string-set! make-string
|
||||
string->list string=? string-append substring string
|
||||
|
@ -230,7 +231,8 @@
|
|||
|
||||
(define uuid
|
||||
(lambda ()
|
||||
(let ([s (make-string 16)])
|
||||
(or (foreign-call "ik_uuid" s)
|
||||
(error 'uuid "failed!")))))
|
||||
(let ([s ($make-bytevector 16)])
|
||||
(utf8-bytevector->string
|
||||
(or (foreign-call "ik_uuid" s)
|
||||
(error 'uuid "failed!"))))))
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue