1 |
|
/* -*-C-*- */ |
2 |
/* |
/* |
3 |
Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa |
Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa |
4 |
|
|
2534 |
@) |
@) |
2535 |
|
|
2536 |
@(static defun fread (vector start count stream) |
@(static defun fread (vector start count stream) |
2537 |
unsigned char *p; |
char *p; |
2538 |
int n,beg; |
int n,beg; |
2539 |
@ |
@ |
2540 |
stream=coerce_stream(stream,0); |
stream=coerce_stream(stream,0); |
2541 |
if (stream==Cnil) @(return Cnil); |
if (stream==Cnil) @(return Cnil); |
2542 |
p = vector->ust.ust_self; |
p = vector->st.st_self; |
2543 |
beg = ((type_of(start)==t_fixnum) ? fix(start) : 0); |
beg = ((type_of(start)==t_fixnum) ? fix(start) : 0); |
2544 |
n = ((type_of(count)==t_fixnum) ? fix(count) : (vector->st.st_fillp - beg)); |
n = ((type_of(count)==t_fixnum) ? fix(count) : (vector->st.st_fillp - beg)); |
2545 |
if ((n=SAFE_FREAD(p+beg,1,n,stream->sm.sm_fp))) |
if ((n=SAFE_FREAD(p+beg,1,n,stream->sm.sm_fp))) |
2602 |
#define AMT_TO_WRITE 500 |
#define AMT_TO_WRITE 500 |
2603 |
while(i< bufp->ust.ust_fillp) { |
while(i< bufp->ust.ust_fillp) { |
2604 |
wrote =TcpOutputProc ( fd, |
wrote =TcpOutputProc ( fd, |
2605 |
&(bufp->ust.ust_self[i]), |
&(bufp->st.st_self[i]), |
2606 |
bufp->ust.ust_fillp-i > AMT_TO_WRITE ? AMT_TO_WRITE : bufp->ust.ust_fillp-i, |
bufp->ust.ust_fillp-i > AMT_TO_WRITE ? AMT_TO_WRITE : bufp->ust.ust_fillp-i, |
2607 |
&err |
&err |
2608 |
#ifdef __MINGW32__ |
#ifdef __MINGW32__ |
2667 |
static object |
static object |
2668 |
maccept(object x) { |
maccept(object x) { |
2669 |
|
|
2670 |
int fd,n; |
int fd; |
2671 |
|
unsigned n; |
2672 |
struct sockaddr_in addr; |
struct sockaddr_in addr; |
2673 |
object server,host,port; |
object server,host,port; |
2674 |
|
|