2154 |
@) |
@) |
2155 |
|
|
2156 |
@(static defun fread (vector start count stream) |
@(static defun fread (vector start count stream) |
2157 |
unsigned char *p; |
char *p; |
2158 |
int n,beg; |
int n,beg; |
2159 |
@ |
@ |
2160 |
stream=coerce_stream(stream,0); |
stream=coerce_stream(stream,0); |
2161 |
if (stream==Cnil) @(return Cnil); |
if (stream==Cnil) @(return Cnil); |
2162 |
p = vector->ust.ust_self; |
p = vector->st.st_self; |
2163 |
beg = ((type_of(start)==t_fixnum) ? fix(start) : 0); |
beg = ((type_of(start)==t_fixnum) ? fix(start) : 0); |
2164 |
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)); |
2165 |
if ((n=SAFE_FREAD(p+beg,1,n,stream->sm.sm_fp))) |
if ((n=SAFE_FREAD(p+beg,1,n,stream->sm.sm_fp))) |
2222 |
#define AMT_TO_WRITE 500 |
#define AMT_TO_WRITE 500 |
2223 |
while(i< bufp->ust.ust_fillp) { |
while(i< bufp->ust.ust_fillp) { |
2224 |
wrote =TcpOutputProc ( fd, |
wrote =TcpOutputProc ( fd, |
2225 |
&(bufp->ust.ust_self[i]), |
&(bufp->st.st_self[i]), |
2226 |
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, |
2227 |
&err |
&err |
2228 |
#ifdef __MINGW32__ |
#ifdef __MINGW32__ |
2287 |
static object |
static object |
2288 |
maccept(object x) { |
maccept(object x) { |
2289 |
|
|
2290 |
int fd,n; |
int fd; |
2291 |
|
unsigned n; |
2292 |
struct sockaddr_in addr; |
struct sockaddr_in addr; |
2293 |
object server,host,port; |
object server,host,port; |
2294 |
|
|
2347 |
char buf1[500]; |
char buf1[500]; |
2348 |
char buf2[500]; |
char buf2[500]; |
2349 |
char *myaddrPtr=buf1,*hostPtr=buf2; |
char *myaddrPtr=buf1,*hostPtr=buf2; |
2350 |
object x; |
object x=Cnil; |
2351 |
@ |
@ |
2352 |
if (type_of(host) == t_string) { |
if (type_of(host) == t_string) { |
2353 |
hostPtr=lisp_copy_to_null_terminated(host,hostPtr,sizeof(buf1)); |
hostPtr=lisp_copy_to_null_terminated(host,hostPtr,sizeof(buf1)); |