29 |
It also contains read_fasl_data. |
It also contains read_fasl_data. |
30 |
*/ |
*/ |
31 |
|
|
32 |
|
#include <stdlib.h> |
33 |
|
|
34 |
#define IN_FILE |
#define IN_FILE |
35 |
#include "include.h" |
#include "include.h" |
36 |
|
|
111 |
#undef feof |
#undef feof |
112 |
#define feof feof1 |
#define feof feof1 |
113 |
|
|
114 |
|
void |
115 |
end_of_stream(strm) |
end_of_stream(strm) |
116 |
object strm; |
object strm; |
117 |
{ |
{ |
170 |
|
|
171 |
default: |
default: |
172 |
error("illegal stream mode"); |
error("illegal stream mode"); |
173 |
|
return(FALSE); |
174 |
} |
} |
175 |
} |
} |
176 |
|
|
226 |
|
|
227 |
default: |
default: |
228 |
error("illegal stream mode"); |
error("illegal stream mode"); |
229 |
|
return(FALSE); |
230 |
} |
} |
231 |
} |
} |
232 |
|
|
280 |
|
|
281 |
default: |
default: |
282 |
error("illegal stream mode"); |
error("illegal stream mode"); |
283 |
|
return(FALSE); |
284 |
} |
} |
285 |
} |
} |
286 |
|
|
287 |
#ifndef NO_SETBUF |
#ifndef NO_SETBUF |
288 |
|
void |
289 |
setup_stream_buffer(x) |
setup_stream_buffer(x) |
290 |
object x; |
object x; |
291 |
{char *buf=alloc_contblock(BUFSIZ); |
{char *buf=alloc_contblock(BUFSIZ); |
296 |
setbuf(x->sm.sm_fp, buf); |
setbuf(x->sm.sm_fp, buf); |
297 |
} |
} |
298 |
|
|
299 |
|
void |
300 |
deallocate_stream_buffer(strm) |
deallocate_stream_buffer(strm) |
301 |
object strm; |
object strm; |
302 |
{ |
{ |
304 |
{insert_contblock(strm->sm.sm_buffer, BUFSIZ); |
{insert_contblock(strm->sm.sm_buffer, BUFSIZ); |
305 |
strm->sm.sm_buffer = 0;} |
strm->sm.sm_buffer = 0;} |
306 |
else |
else |
307 |
printf("no buffer? %x \n",strm->sm.sm_fp); |
printf("no buffer? %p \n",strm->sm.sm_fp); |
308 |
|
|
309 |
#ifndef FCLOSE_SETBUF_OK |
#ifndef FCLOSE_SETBUF_OK |
310 |
strm->sm.sm_fp->_base = NULL; |
strm->sm.sm_fp->_base = NULL; |
315 |
|
|
316 |
DEFVAR("*ALLOW-GZIPPED-FILE*",sSAallow_gzipped_fileA,SI,sLnil,""); |
DEFVAR("*ALLOW-GZIPPED-FILE*",sSAallow_gzipped_fileA,SI,sLnil,""); |
317 |
|
|
318 |
|
void |
319 |
|
too_long_file_name(object); |
320 |
|
void |
321 |
|
cannot_open(object); |
322 |
|
void |
323 |
|
cannot_create(object); |
324 |
/* |
/* |
325 |
Open_stream(fn, smm, if_exists, if_does_not_exist) |
Open_stream(fn, smm, if_exists, if_does_not_exist) |
326 |
opens file fn with mode smm. |
opens file fn with mode smm. |
333 |
object if_exists, if_does_not_exist; |
object if_exists, if_does_not_exist; |
334 |
{ |
{ |
335 |
object x; |
object x; |
336 |
FILE *fp; |
FILE *fp=NULL; |
337 |
char fname[BUFSIZ]; |
char fname[BUFSIZ]; |
338 |
int i; |
int i; |
339 |
object unzipped = 0; |
object unzipped = 0; |
364 |
if (fp) |
if (fp) |
365 |
{ char *tmp; |
{ char *tmp; |
366 |
char command [500]; |
char command [500]; |
367 |
close(fp); |
fclose(fp); |
368 |
tmp = tmpnam(0); |
tmp = tmpnam(0); |
369 |
unzipped = make_simple_string(tmp); |
unzipped = make_simple_string(tmp); |
370 |
sprintf(command,"gzip -dc %s > %s",buf,tmp); |
sprintf(command,"gzip -dc %s > %s",buf,tmp); |
471 |
return(x); |
return(x); |
472 |
} |
} |
473 |
|
|
474 |
|
void |
475 |
|
gclFlushSocket(object); |
476 |
/* |
/* |
477 |
Close_stream(strm) closes stream strm. |
Close_stream(strm) closes stream strm. |
478 |
The abort_flag is not used now. |
The abort_flag is not used now. |
479 |
*/ |
*/ |
480 |
|
void |
481 |
close_stream(strm) |
close_stream(strm) |
482 |
object strm; |
object strm; |
483 |
/*bool abort_flag; */ /* Not used now! */ |
/*bool abort_flag; */ /* Not used now! */ |
650 |
return(strng); |
return(strng); |
651 |
} |
} |
652 |
|
|
653 |
|
void |
654 |
|
cannot_read(object); |
655 |
|
|
656 |
|
void |
657 |
|
closed_stream(object); |
658 |
int |
int |
659 |
readc_stream(strm) |
readc_stream(strm) |
660 |
object strm; |
object strm; |
681 |
if (c == EOF) { |
if (c == EOF) { |
682 |
if (xkclfeof(c,strm->sm.sm_fp)) |
if (xkclfeof(c,strm->sm.sm_fp)) |
683 |
end_of_stream(strm); |
end_of_stream(strm); |
684 |
else c = getOneChar(strm); |
else c = getOneChar(strm->sm.sm_fp); |
685 |
if (c == EOF) end_of_stream(strm); |
if (c == EOF) end_of_stream(strm); |
686 |
} |
} |
687 |
|
|
748 |
#define STM_TYPE 6 |
#define STM_TYPE 6 |
749 |
#define STM_NAME 8 |
#define STM_NAME 8 |
750 |
{object val; |
{object val; |
|
object endp_temp; |
|
751 |
object *old_vs_base = vs_base; |
object *old_vs_base = vs_base; |
752 |
object *old_vs_top = vs_top; |
object *old_vs_top = vs_top; |
753 |
vs_base = vs_top; |
vs_base = vs_top; |
766 |
|
|
767 |
default: |
default: |
768 |
error("illegal stream mode"); |
error("illegal stream mode"); |
769 |
|
return(0); |
770 |
} |
} |
771 |
} |
} |
772 |
|
|
773 |
|
int |
774 |
|
rl_ungetc_em(int, FILE *); |
775 |
|
|
776 |
|
void |
777 |
unreadc_stream(c, strm) |
unreadc_stream(c, strm) |
778 |
int c; |
int c; |
779 |
object strm; |
object strm; |
854 |
FEerror("Cannot unread the stream ~S.", 1, strm); |
FEerror("Cannot unread the stream ~S.", 1, strm); |
855 |
} |
} |
856 |
|
|
857 |
|
void |
858 |
|
putCharGclSocket(object,int); |
859 |
|
int |
860 |
|
rl_putc_em(int, FILE *); |
861 |
|
void |
862 |
|
cannot_write(object); |
863 |
|
|
864 |
|
int |
865 |
writec_stream(c, strm) |
writec_stream(c, strm) |
866 |
int c; |
int c; |
867 |
object strm; |
object strm; |
979 |
return(c); |
return(c); |
980 |
} |
} |
981 |
|
|
982 |
|
void |
983 |
writestr_stream(s, strm) |
writestr_stream(s, strm) |
984 |
char *s; |
char *s; |
985 |
object strm; |
object strm; |
988 |
writec_stream(*s++, strm); |
writec_stream(*s++, strm); |
989 |
} |
} |
990 |
|
|
991 |
|
void |
992 |
flush_stream(strm) |
flush_stream(strm) |
993 |
object strm; |
object strm; |
994 |
{ object endp_temp; |
{ object endp_temp; |
1059 |
stream_at_end(strm) |
stream_at_end(strm) |
1060 |
object strm; |
object strm; |
1061 |
{ object endp_temp; |
{ object endp_temp; |
|
object x; |
|
1062 |
#define NON_CHAR -1000 |
#define NON_CHAR -1000 |
1063 |
VOL int c = NON_CHAR; |
VOL int c = NON_CHAR; |
1064 |
|
|
1143 |
#endif |
#endif |
1144 |
default: |
default: |
1145 |
error("illegal stream mode"); |
error("illegal stream mode"); |
1146 |
|
return(FALSE); |
1147 |
} |
} |
1148 |
} |
} |
1149 |
|
|
1150 |
|
|
1151 |
#ifdef HAVE_SYS_IOCTL_H |
#ifdef HAVE_SYS_IOCTL_H |
1152 |
#include <sys/ioctl.h> |
#include <sys/ioctl.h> |
1153 |
#endif |
#endif |
1154 |
|
|
1155 |
|
|
1156 |
#ifdef LISTEN_USE_FCNTL |
#ifdef LISTEN_USE_FCNTL |
1157 |
#include <fcntl.h> |
#include <fcntl.h> |
1158 |
#endif |
#endif |
1161 |
listen_stream(strm) |
listen_stream(strm) |
1162 |
object strm; |
object strm; |
1163 |
{ object endp_temp; |
{ object endp_temp; |
|
object x; |
|
|
int c; |
|
1164 |
|
|
1165 |
BEGIN: |
BEGIN: |
1166 |
|
|
1217 |
goto BEGIN; |
goto BEGIN; |
1218 |
|
|
1219 |
case smm_concatenated: |
case smm_concatenated: |
|
CONCATENATED: |
|
1220 |
if (endp(strm->sm.sm_object0)) |
if (endp(strm->sm.sm_object0)) |
1221 |
return(FALSE); |
return(FALSE); |
1222 |
strm = strm->sm.sm_object0->c.c_car; /* Incomplete! */ |
strm = strm->sm.sm_object0->c.c_car; /* Incomplete! */ |
1238 |
case smm_broadcast: |
case smm_broadcast: |
1239 |
case smm_string_output: |
case smm_string_output: |
1240 |
FEerror("Can't listen to ~S.", 1, strm); |
FEerror("Can't listen to ~S.", 1, strm); |
1241 |
|
return(FALSE); |
1242 |
default: |
default: |
1243 |
error("illegal stream mode"); |
error("illegal stream mode"); |
1244 |
|
return(FALSE); |
1245 |
} |
} |
1246 |
} |
} |
1247 |
|
|
1281 |
|
|
1282 |
default: |
default: |
1283 |
error("illegal stream mode"); |
error("illegal stream mode"); |
1284 |
|
return(-1); |
1285 |
} |
} |
1286 |
} |
} |
1287 |
|
|
1330 |
|
|
1331 |
default: |
default: |
1332 |
error("illegal stream mode"); |
error("illegal stream mode"); |
1333 |
|
return(-1); |
1334 |
} |
} |
1335 |
} |
} |
1336 |
|
|
1368 |
|
|
1369 |
default: |
default: |
1370 |
error("illegal stream mode"); |
error("illegal stream mode"); |
1371 |
|
return(-1); |
1372 |
} |
} |
1373 |
} |
} |
1374 |
|
|
1424 |
#endif |
#endif |
1425 |
default: |
default: |
1426 |
error("illegal stream mode"); |
error("illegal stream mode"); |
1427 |
|
return(-1); |
1428 |
} |
} |
1429 |
} |
} |
1430 |
|
|
1431 |
|
void |
1432 |
load(s) |
load(s) |
1433 |
char *s; |
char *s; |
1434 |
{ |
{ |
1447 |
break; |
break; |
1448 |
vs_push(x); |
vs_push(x); |
1449 |
ieval(x); |
ieval(x); |
1450 |
vs_pop; |
vs_popp; |
1451 |
} |
} |
1452 |
close_stream(strm); |
close_stream(strm); |
1453 |
vs_reset; |
vs_reset; |
1454 |
} |
} |
1455 |
|
|
1456 |
Lmake_synonym_stream() |
|
1457 |
|
void |
1458 |
|
Lmake_synonym_stream() |
1459 |
{ |
{ |
1460 |
object x; |
object x; |
1461 |
|
|
1470 |
vs_base[0] = x; |
vs_base[0] = x; |
1471 |
} |
} |
1472 |
|
|
1473 |
|
void |
1474 |
Lmake_broadcast_stream() |
Lmake_broadcast_stream() |
1475 |
{ |
{ |
1476 |
object x; |
object x; |
1493 |
vs_base[0] = x; |
vs_base[0] = x; |
1494 |
} |
} |
1495 |
|
|
1496 |
|
void |
1497 |
Lmake_concatenated_stream() |
Lmake_concatenated_stream() |
1498 |
{ |
{ |
1499 |
object x; |
object x; |
1516 |
vs_base[0] = x; |
vs_base[0] = x; |
1517 |
} |
} |
1518 |
|
|
1519 |
|
void |
1520 |
Lmake_two_way_stream() |
Lmake_two_way_stream() |
1521 |
{ |
{ |
1522 |
check_arg(2); |
check_arg(2); |
1528 |
!output_stream_p(vs_base[1])) |
!output_stream_p(vs_base[1])) |
1529 |
cannot_write(vs_base[1]); |
cannot_write(vs_base[1]); |
1530 |
vs_base[0] = make_two_way_stream(vs_base[0], vs_base[1]); |
vs_base[0] = make_two_way_stream(vs_base[0], vs_base[1]); |
1531 |
vs_pop; |
vs_popp; |
1532 |
} |
} |
1533 |
|
|
1534 |
|
void |
1535 |
Lmake_echo_stream() |
Lmake_echo_stream() |
1536 |
{ |
{ |
1537 |
check_arg(2); |
check_arg(2); |
1543 |
!output_stream_p(vs_base[1])) |
!output_stream_p(vs_base[1])) |
1544 |
cannot_write(vs_base[1]); |
cannot_write(vs_base[1]); |
1545 |
vs_base[0] = make_echo_stream(vs_base[0], vs_base[1]); |
vs_base[0] = make_echo_stream(vs_base[0], vs_base[1]); |
1546 |
vs_pop; |
vs_popp; |
1547 |
} |
} |
1548 |
|
|
1549 |
@(defun make_string_input_stream (strng &o istart iend) |
@(defun make_string_input_stream (strng &o istart iend) |
1572 |
3, istart, iend, strng); |
3, istart, iend, strng); |
1573 |
@) |
@) |
1574 |
|
|
1575 |
|
void |
1576 |
Lmake_string_output_stream() |
Lmake_string_output_stream() |
1577 |
{ |
{ |
1578 |
check_arg(0); |
check_arg(0); |
1579 |
vs_push(make_string_output_stream(64)); |
vs_push(make_string_output_stream(64)); |
1580 |
} |
} |
1581 |
|
|
1582 |
|
void |
1583 |
Lget_output_stream_string() |
Lget_output_stream_string() |
1584 |
{ |
{ |
1585 |
check_arg(1); |
check_arg(1); |
1596 |
extracts the string associated with the given |
extracts the string associated with the given |
1597 |
string-output-stream. |
string-output-stream. |
1598 |
*/ |
*/ |
1599 |
|
void |
1600 |
siLoutput_stream_string() |
siLoutput_stream_string() |
1601 |
{ |
{ |
1602 |
check_arg(1); |
check_arg(1); |
1606 |
vs_base[0] = vs_base[0]->sm.sm_object0; |
vs_base[0] = vs_base[0]->sm.sm_object0; |
1607 |
} |
} |
1608 |
|
|
1609 |
|
void |
1610 |
Lstreamp() |
Lstreamp() |
1611 |
{ |
{ |
1612 |
check_arg(1); |
check_arg(1); |
1617 |
vs_base[0] = Cnil; |
vs_base[0] = Cnil; |
1618 |
} |
} |
1619 |
|
|
1620 |
|
void |
1621 |
Linput_stream_p() |
Linput_stream_p() |
1622 |
{ |
{ |
1623 |
check_arg(1); |
check_arg(1); |
1629 |
vs_base[0] = Cnil; |
vs_base[0] = Cnil; |
1630 |
} |
} |
1631 |
|
|
1632 |
|
void |
1633 |
Loutput_stream_p() |
Loutput_stream_p() |
1634 |
{ |
{ |
1635 |
check_arg(1); |
check_arg(1); |
1641 |
vs_base[0] = Cnil; |
vs_base[0] = Cnil; |
1642 |
} |
} |
1643 |
|
|
1644 |
|
void |
1645 |
Lstream_element_type() |
Lstream_element_type() |
1646 |
{ |
{ |
1647 |
check_arg(1); |
check_arg(1); |
1663 |
(if_exists Cnil iesp) |
(if_exists Cnil iesp) |
1664 |
(if_does_not_exist Cnil idnesp) |
(if_does_not_exist Cnil idnesp) |
1665 |
&aux strm) |
&aux strm) |
1666 |
enum smmode smm; |
enum smmode smm=0; |
1667 |
@ |
@ |
1668 |
check_type_or_pathname_string_symbol_stream(&filename); |
check_type_or_pathname_string_symbol_stream(&filename); |
1669 |
filename = coerce_to_namestring(filename); |
filename = coerce_to_namestring(filename); |
1705 |
@) |
@) |
1706 |
|
|
1707 |
@(defun file_position (file_stream &o position) |
@(defun file_position (file_stream &o position) |
1708 |
int i; |
int i=0; |
1709 |
@ |
@ |
1710 |
check_type_stream(&file_stream); |
check_type_stream(&file_stream); |
1711 |
if (position == Cnil) { |
if (position == Cnil) { |
1729 |
} |
} |
1730 |
@) |
@) |
1731 |
|
|
1732 |
|
void |
1733 |
Lfile_length() |
Lfile_length() |
1734 |
{ |
{ |
1735 |
int i; |
int i; |
1765 |
filename = coerce_to_namestring(pathname); |
filename = coerce_to_namestring(pathname); |
1766 |
old_bds_top=bds_top; |
old_bds_top=bds_top; |
1767 |
if (pntype == Cnil || pntype == sKwild || |
if (pntype == Cnil || pntype == sKwild || |
1768 |
type_of(pntype) == t_string && |
(type_of(pntype) == t_string && |
1769 |
#ifdef UNIX |
#ifdef UNIX |
1770 |
string_eq(pntype, FASL_string)) { |
string_eq(pntype, FASL_string))) { |
1771 |
#endif |
#endif |
1772 |
#ifdef AOSVS |
#ifdef AOSVS |
1773 |
|
|
1776 |
fasl_filename = coerce_to_namestring(pathname); |
fasl_filename = coerce_to_namestring(pathname); |
1777 |
} |
} |
1778 |
if (pntype == Cnil || pntype == sKwild || |
if (pntype == Cnil || pntype == sKwild || |
1779 |
type_of(pntype) == t_string && |
(type_of(pntype) == t_string && |
1780 |
#ifdef UNIX |
#ifdef UNIX |
1781 |
string_eq(pntype, LSP_string)) { |
string_eq(pntype, LSP_string))) { |
1782 |
#endif |
#endif |
1783 |
#ifdef AOSVS |
#ifdef AOSVS |
1784 |
|
|
1901 |
@(return Ct) |
@(return Ct) |
1902 |
@) |
@) |
1903 |
|
|
1904 |
|
void |
1905 |
siLget_string_input_stream_index() |
siLget_string_input_stream_index() |
1906 |
{ |
{ |
1907 |
check_arg(1); |
check_arg(1); |
1911 |
vs_base[0] = make_fixnum(STRING_INPUT_STREAM_NEXT(vs_base[0])); |
vs_base[0] = make_fixnum(STRING_INPUT_STREAM_NEXT(vs_base[0])); |
1912 |
} |
} |
1913 |
|
|
1914 |
|
void |
1915 |
siLmake_string_output_stream_from_string() |
siLmake_string_output_stream_from_string() |
1916 |
{ |
{ |
1917 |
object strng, strm; |
object strng, strm; |
1930 |
vs_base[0] = strm; |
vs_base[0] = strm; |
1931 |
} |
} |
1932 |
|
|
1933 |
|
void |
1934 |
siLcopy_stream() |
siLcopy_stream() |
1935 |
{ |
{ |
1936 |
object in, out; |
object in, out; |
1944 |
writec_stream(readc_stream(in), out); |
writec_stream(readc_stream(in), out); |
1945 |
flush_stream(out); |
flush_stream(out); |
1946 |
vs_base[0] = Ct; |
vs_base[0] = Ct; |
1947 |
vs_pop; |
vs_popp; |
1948 |
#ifdef AOSVS |
#ifdef AOSVS |
1949 |
|
|
1950 |
#endif |
#endif |
1951 |
} |
} |
1952 |
|
|
1953 |
|
void |
1954 |
too_long_file_name(fn) |
too_long_file_name(fn) |
1955 |
object fn; |
object fn; |
1956 |
{ |
{ |
1957 |
FEerror("~S is a too long file name.", 1, fn); |
FEerror("~S is a too long file name.", 1, fn); |
1958 |
} |
} |
1959 |
|
|
1960 |
|
void |
1961 |
cannot_open(fn) |
cannot_open(fn) |
1962 |
object fn; |
object fn; |
1963 |
{ |
{ |
1964 |
FEerror("Cannot open the file ~A.", 1, fn); |
FEerror("Cannot open the file ~A.", 1, fn); |
1965 |
} |
} |
1966 |
|
|
1967 |
|
void |
1968 |
cannot_create(fn) |
cannot_create(fn) |
1969 |
object fn; |
object fn; |
1970 |
{ |
{ |
1971 |
FEerror("Cannot create the file ~A.", 1, fn); |
FEerror("Cannot create the file ~A.", 1, fn); |
1972 |
} |
} |
1973 |
|
|
1974 |
|
void |
1975 |
cannot_read(strm) |
cannot_read(strm) |
1976 |
object strm; |
object strm; |
1977 |
{ |
{ |
1978 |
FEerror("Cannot read the stream ~S.", 1, strm); |
FEerror("Cannot read the stream ~S.", 1, strm); |
1979 |
} |
} |
1980 |
|
|
1981 |
|
void |
1982 |
cannot_write(strm) |
cannot_write(strm) |
1983 |
object strm; |
object strm; |
1984 |
{ |
{ |
1987 |
|
|
1988 |
#ifdef USER_DEFINED_STREAMS |
#ifdef USER_DEFINED_STREAMS |
1989 |
/* more support for user defined streams */ |
/* more support for user defined streams */ |
1990 |
|
void |
1991 |
siLuser_stream_state() |
siLuser_stream_state() |
1992 |
{ |
{ |
1993 |
check_arg(1); |
check_arg(1); |
1999 |
} |
} |
2000 |
#endif |
#endif |
2001 |
|
|
2002 |
|
void |
2003 |
closed_stream(strm) |
closed_stream(strm) |
2004 |
object strm; |
object strm; |
2005 |
{ |
{ |
2061 |
return(strm); |
return(strm); |
2062 |
} |
} |
2063 |
|
|
2064 |
|
void |
2065 |
siLfp_output_stream() |
siLfp_output_stream() |
2066 |
{check_arg(1); |
{check_arg(1); |
2067 |
vs_base[0]=coerce_stream(vs_base[0],1); |
vs_base[0]=coerce_stream(vs_base[0],1); |
2068 |
} |
} |
2069 |
|
|
2070 |
|
void |
2071 |
siLfp_input_stream() |
siLfp_input_stream() |
2072 |
{check_arg(1); |
{check_arg(1); |
2073 |
vs_base[0]=coerce_stream(vs_base[0],0); |
vs_base[0]=coerce_stream(vs_base[0],0); |
2096 |
p = vector->ust.ust_self; |
p = vector->ust.ust_self; |
2097 |
beg = ((type_of(start)==t_fixnum) ? fix(start) : 0); |
beg = ((type_of(start)==t_fixnum) ? fix(start) : 0); |
2098 |
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)); |
2099 |
if (n=fread(p+beg,1,n,stream->sm.sm_fp)) |
if ((n=fread(p+beg,1,n,stream->sm.sm_fp))) |
2100 |
@(return `make_fixnum(n)`); |
@(return `make_fixnum(n)`); |
2101 |
@(return Cnil); |
@(return Cnil); |
2102 |
@) |
@) |
2121 |
Side Effects: The buffer may be filled, and the fill pointer |
Side Effects: The buffer may be filled, and the fill pointer |
2122 |
of the buffer may be changed. |
of the buffer may be changed. |
2123 |
*/ |
*/ |
2124 |
|
void |
2125 |
putCharGclSocket(strm,ch) |
putCharGclSocket(strm,ch) |
2126 |
object strm; |
object strm; |
2127 |
int ch; |
int ch; |
2132 |
if (bufp->ust.ust_fillp < bufp->ust.ust_dim) { |
if (bufp->ust.ust_fillp < bufp->ust.ust_dim) { |
2133 |
dprintf("getchar returns (%c)\n",bufp->ust.ust_self[-1+(bufp->ust.ust_fillp)]); |
dprintf("getchar returns (%c)\n",bufp->ust.ust_self[-1+(bufp->ust.ust_fillp)]); |
2134 |
bufp->ust.ust_self[(bufp->ust.ust_fillp)++]=ch; |
bufp->ust.ust_self[(bufp->ust.ust_fillp)++]=ch; |
2135 |
return ch; |
return; |
2136 |
} |
} |
2137 |
else { |
else { |
2138 |
gclFlushSocket(strm,Ct); |
gclFlushSocket(strm); |
2139 |
goto AGAIN; |
goto AGAIN; |
2140 |
} |
} |
2141 |
} |
} |
2142 |
|
|
2143 |
|
void |
2144 |
gclFlushSocket(strm) |
gclFlushSocket(strm) |
2145 |
object strm; |
object strm; |
2146 |
|
|
2157 |
while(i< bufp->ust.ust_fillp) { |
while(i< bufp->ust.ust_fillp) { |
2158 |
wrote =TcpOutputProc(fd,&(bufp->ust.ust_self[i]), |
wrote =TcpOutputProc(fd,&(bufp->ust.ust_self[i]), |
2159 |
bufp->ust.ust_fillp-i > AMT_TO_WRITE ? AMT_TO_WRITE : |
bufp->ust.ust_fillp-i > AMT_TO_WRITE ? AMT_TO_WRITE : |
2160 |
bufp->ust.ust_fillp-i,&err, |
bufp->ust.ust_fillp-i,&err); |
|
AMT_TO_WRITE); |
|
2161 |
if (wrote < 0) { |
if (wrote < 0) { |
2162 |
SET_STREAM_FLAG(strm,gcl_sm_had_error,1); |
SET_STREAM_FLAG(strm,gcl_sm_had_error,1); |
2163 |
close_stream(strm); |
close_stream(strm); |
2180 |
object async; |
object async; |
2181 |
{ |
{ |
2182 |
object x; |
object x; |
|
FILE *fp = NULL; |
|
2183 |
if (fd < 0 ) |
if (fd < 0 ) |
2184 |
{ |
{ |
2185 |
FEerror("Could not connect",0); |
FEerror("Could not connect",0); |
2228 |
int fd; |
int fd; |
2229 |
int isServer = 0; |
int isServer = 0; |
2230 |
int inPort; |
int inPort; |
|
FILE *fp; |
|
2231 |
char buf1[500]; |
char buf1[500]; |
2232 |
char buf2[500]; |
char buf2[500]; |
2233 |
char *myaddrPtr=buf1,*hostPtr=buf2; |
char *myaddrPtr=buf1,*hostPtr=buf2; |
2286 |
DEFVAR("*TRACE-OUTPUT*",sLAtrace_outputA,LISP,standard_io,""); |
DEFVAR("*TRACE-OUTPUT*",sLAtrace_outputA,LISP,standard_io,""); |
2287 |
|
|
2288 |
|
|
2289 |
init_file() |
void |
2290 |
|
init_file(void) |
2291 |
{ |
{ |
2292 |
object standard_input; |
object standard_input; |
2293 |
object standard_output; |
object standard_output; |
2359 |
|
|
2360 |
|
|
2361 |
|
|
2362 |
|
void |
2363 |
init_file_function() |
init_file_function() |
2364 |
{ |
{ |
2365 |
|
|
2436 |
{ |
{ |
2437 |
object faslfile, data; |
object faslfile, data; |
2438 |
#ifdef UNIX |
#ifdef UNIX |
|
FILE *fp; |
|
|
|
|
|
|
|
2439 |
#ifdef BSD |
#ifdef BSD |
2440 |
#ifdef HAVE_AOUT |
#ifdef HAVE_AOUT |
2441 |
struct exec header; |
struct exec header; |
2447 |
#ifdef E15 |
#ifdef E15 |
2448 |
struct exec header; |
struct exec header; |
2449 |
#endif |
#endif |
|
int i; |
|
2450 |
#endif |
#endif |
2451 |
vs_mark; |
vs_mark; |
2452 |
|
|