/[gcl]/gcl/o/file.d
ViewVC logotype

Diff of /gcl/o/file.d

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by camm, Fri Jul 12 22:00:49 2002 UTC revision 1.10 by camm, Sat Jul 20 07:10:55 2002 UTC
# Line 29  Foundation, 675 Mass Ave, Cambridge, MA Line 29  Foundation, 675 Mass Ave, Cambridge, MA
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    
# Line 109  FILE *fp; Line 111  FILE *fp;
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  {  {
# Line 168  BEGIN: Line 170  BEGIN:
170    
171          default:          default:
172                  error("illegal stream mode");                  error("illegal stream mode");
173                    return(FALSE);
174          }          }
175  }  }
176    
# Line 223  BEGIN: Line 226  BEGIN:
226    
227          default:          default:
228                  error("illegal stream mode");                  error("illegal stream mode");
229                    return(FALSE);
230          }          }
231  }  }
232    
# Line 276  BEGIN: Line 280  BEGIN:
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);
# Line 290  setup_stream_buffer(x) Line 296  setup_stream_buffer(x)
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  {  {
# Line 297  object strm; Line 304  object strm;
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;
# Line 308  object strm; Line 315  object strm;
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.
# Line 320  enum smmode smm; Line 333  enum smmode 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;
# Line 351  object if_exists, if_does_not_exist; Line 364  object if_exists, if_does_not_exist;
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);
# Line 458  object if_exists, if_does_not_exist; Line 471  object if_exists, if_does_not_exist;
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!  */
# Line 634  object strm; Line 650  object strm;
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;
# Line 660  BEGIN: Line 681  BEGIN:
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                                    
# Line 727  BEGIN: Line 748  BEGIN:
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;
# Line 746  BEGIN: Line 766  BEGIN:
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;
# Line 829  UNREAD_ERROR: Line 854  UNREAD_ERROR:
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;
# Line 946  BEGIN: Line 979  BEGIN:
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;
# Line 954  object strm; Line 988  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;
# Line 1024  bool Line 1059  bool
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    
# Line 1109  BEGIN: Line 1143  BEGIN:
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
# Line 1124  bool Line 1161  bool
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    
# Line 1182  BEGIN: Line 1217  BEGIN:
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! */
# Line 1204  BEGIN: Line 1238  BEGIN:
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    
# Line 1246  BEGIN: Line 1281  BEGIN:
1281    
1282          default:          default:
1283                  error("illegal stream mode");                  error("illegal stream mode");
1284                    return(-1);
1285          }          }
1286  }  }
1287    
# Line 1294  BEGIN: Line 1330  BEGIN:
1330    
1331          default:          default:
1332                  error("illegal stream mode");                  error("illegal stream mode");
1333                    return(-1);
1334          }          }
1335  }  }
1336    
# Line 1331  BEGIN: Line 1368  BEGIN:
1368    
1369          default:          default:
1370                  error("illegal stream mode");                  error("illegal stream mode");
1371                    return(-1);
1372          }          }
1373  }  }
1374    
# Line 1386  BEGIN: Line 1424  BEGIN:
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  {  {
# Line 1407  char *s; Line 1447  char *s;
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    
# Line 1428  char *s; Line 1470  char *s;
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;
# Line 1450  Lmake_broadcast_stream() Line 1493  Lmake_broadcast_stream()
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;
# Line 1472  Lmake_concatenated_stream() Line 1516  Lmake_concatenated_stream()
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);
# Line 1483  Lmake_two_way_stream() Line 1528  Lmake_two_way_stream()
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);
# Line 1497  Lmake_echo_stream() Line 1543  Lmake_echo_stream()
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)
# Line 1526  for the string ~S.", Line 1572  for the string ~S.",
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);
# Line 1548  Lget_output_stream_string() Line 1596  Lget_output_stream_string()
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);
# Line 1557  siLoutput_stream_string() Line 1606  siLoutput_stream_string()
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);
# Line 1567  Lstreamp() Line 1617  Lstreamp()
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);
# Line 1578  Linput_stream_p() Line 1629  Linput_stream_p()
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);
# Line 1589  Loutput_stream_p() Line 1641  Loutput_stream_p()
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);
# Line 1610  Lstream_element_type() Line 1663  Lstream_element_type()
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);
# Line 1652  Lstream_element_type() Line 1705  Lstream_element_type()
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) {
# Line 1676  for the file-stream ~S.", Line 1729  for the file-stream ~S.",
1729          }                }      
1730  @)  @)
1731    
1732    void
1733  Lfile_length()  Lfile_length()
1734  {  {
1735          int i;          int i;
# Line 1711  object sSAload_pathnameA; Line 1765  object sSAload_pathnameA;
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    
# Line 1722  object sSAload_pathnameA; Line 1776  object sSAload_pathnameA;
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    
# Line 1847  object sSAload_pathnameA; Line 1901  object sSAload_pathnameA;
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);
# Line 1856  siLget_string_input_stream_index() Line 1911  siLget_string_input_stream_index()
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;
# Line 1874  siLmake_string_output_stream_from_string Line 1930  siLmake_string_output_stream_from_string
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;
# Line 1887  siLcopy_stream() Line 1944  siLcopy_stream()
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  {  {
# Line 1926  object strm; Line 1987  object strm;
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);
# Line 1937  siLuser_stream_state() Line 1999  siLuser_stream_state()
1999  }  }
2000  #endif  #endif
2001    
2002    void
2003  closed_stream(strm)  closed_stream(strm)
2004  object strm;  object strm;
2005  {  {
# Line 1998  int out; Line 2061  int out;
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);
# Line 2031  siLfp_input_stream() Line 2096  siLfp_input_stream()
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  @)  @)
# Line 2056  siLfp_input_stream() Line 2121  siLfp_input_stream()
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;
# Line 2066  putCharGclSocket(strm,ch) Line 2132  putCharGclSocket(strm,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    
# Line 2091  gclFlushSocket(strm) Line 2157  gclFlushSocket(strm)
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);
# Line 2115  object port; Line 2180  object port;
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);
# Line 2164  object async; Line 2228  object async;
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;
# Line 2223  DEFVAR("*DEBUG-IO*",sLAdebug_ioA,LISP,st Line 2286  DEFVAR("*DEBUG-IO*",sLAdebug_ioA,LISP,st
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;
# Line 2295  DEF_ORDINARY("VERBOSE",sKverbose,KEYWORD Line 2359  DEF_ORDINARY("VERBOSE",sKverbose,KEYWORD
2359    
2360    
2361    
2362    void
2363  init_file_function()  init_file_function()
2364  {  {
2365    
# Line 2371  char *str; Line 2436  char *str;
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;
# Line 2385  char *str; Line 2447  char *str;
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    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26