Utterly needless cleanups to hopelessly messy code.
[bpt/guile.git] / libguile / ports.h
index 1a4b231..a7ea3e1 100644 (file)
@@ -2,7 +2,7 @@
 
 #ifndef PORTSH
 #define PORTSH
-/*     Copyright (C) 1995,1996 Free Software Foundation, Inc.
+/*     Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 #include "libguile/__scm.h"
 
-\f
-
-enum scm_port_representation_type
-{
-  scm_regular_port,
-  scm_mb_port,
-  scm_wchar_port
-};
-
-enum scm_string_representation_type
-{
-  scm_regular_string = scm_regular_port,
-  scm_mb_string = scm_mb_port,
-  scm_wchar_string = scm_wchar_port
-};
+#include "libguile/print.h"
+#include "libguile/struct.h"
 
+\f
 
 struct scm_port_table 
 {
@@ -76,8 +64,6 @@ struct scm_port_table
 
   int line_number;             /* debugging support.  */
   int column_number;           /* debugging support.  */
-
-  enum scm_port_representation_type representation;
 };
 
 extern struct scm_port_table **scm_port_table;
@@ -86,6 +72,8 @@ extern int scm_port_table_size; /* Number of ports in scm_port_table.  */
 
 \f
 
+#define SCM_EOF_OBJECT_P(x) ((x) == SCM_EOF_VAL)
+
 /* PORT FLAGS
  * A set of flags characterizes a port.
  */
@@ -120,8 +108,6 @@ extern int scm_port_table_size; /* Number of ports in scm_port_table.  */
 #define SCM_COL(x) SCM_PTAB_ENTRY(x)->column_number
 #define SCM_REVEALED(x) SCM_PTAB_ENTRY(x)->revealed
 #define SCM_SETREVEALED(x,s) (SCM_PTAB_ENTRY(x)->revealed = s)
-#define SCM_PORT_REPRESENTATION(x) SCM_PTAB_ENTRY(x)->representation
-#define SCM_SET_PORT_REPRESENTATION(x,s) (SCM_PTAB_ENTRY(x)->representation = s)
 #define SCM_CRDYP(port) (SCM_CAR (port) & SCM_CRDY)
 #define SCM_CLRDY(port) {SCM_SETAND_CAR (port, SCM_CUC);}
 #define SCM_SETRDY(port) {SCM_SETOR_CAR (port, SCM_CRDY);}
@@ -147,6 +133,7 @@ typedef struct scm_ptobfuns
   scm_sizet (*fwrite) SCM_P ((char *ptr, scm_sizet size, scm_sizet nitems, SCM stream));
   int (*fflush) SCM_P ((SCM stream));
   int (*fgetc) SCM_P ((SCM stream));
+  char * (*fgets) SCM_P ((SCM stream, int *len));
   int (*fclose) SCM_P ((SCM stream));
 } scm_ptobfuns;
 
@@ -155,18 +142,18 @@ typedef struct scm_ptobfuns
 \f
 
 extern scm_ptobfuns *scm_ptobs;
-extern scm_sizet scm_numptob;
+extern int scm_numptob;
 extern int scm_port_table_room;
 
 \f
 
 extern SCM scm_markstream SCM_P ((SCM ptr));
 extern long scm_newptob SCM_P ((scm_ptobfuns *ptob));
-extern void scm_fflush SCM_P ((SCM port));
 extern SCM scm_char_ready_p SCM_P ((SCM port));
 extern SCM scm_current_input_port SCM_P ((void));
 extern SCM scm_current_output_port SCM_P ((void));
 extern SCM scm_current_error_port SCM_P ((void));
+extern SCM scm_current_load_port SCM_P ((void));
 extern SCM scm_set_current_input_port SCM_P ((SCM port));
 extern SCM scm_set_current_output_port SCM_P ((SCM port));
 extern SCM scm_set_current_error_port SCM_P ((SCM port));
@@ -177,17 +164,23 @@ extern SCM scm_pt_member SCM_P ((SCM member));
 extern int scm_revealed_count SCM_P ((SCM port));
 extern SCM scm_port_revealed SCM_P ((SCM port));
 extern SCM scm_set_port_revealed_x SCM_P ((SCM port, SCM rcount));
+extern long scm_mode_bits SCM_P ((char *modes));
+extern SCM scm_port_mode SCM_P ((SCM port));
 extern SCM scm_close_port SCM_P ((SCM port));
 extern SCM scm_close_all_ports_except SCM_P ((SCM ports));
 extern SCM scm_input_port_p SCM_P ((SCM x));
 extern SCM scm_output_port_p SCM_P ((SCM x));
 extern SCM scm_eof_object_p SCM_P ((SCM x));
 extern SCM scm_force_output SCM_P ((SCM port));
+extern SCM scm_flush_all_ports SCM_P ((void));
 extern SCM scm_read_char SCM_P ((SCM port));
 extern SCM scm_peek_char SCM_P ((SCM port));
 extern SCM scm_unread_char SCM_P ((SCM cobj, SCM port));
+extern char *scm_generic_fgets SCM_P ((SCM port, int *len));
 extern SCM scm_port_line SCM_P ((SCM port));
+extern SCM scm_set_port_line_x SCM_P ((SCM port, SCM line));
 extern SCM scm_port_column SCM_P ((SCM port));
+extern SCM scm_set_port_column_x SCM_P ((SCM port, SCM line));
 extern SCM scm_port_filename SCM_P ((SCM port));
 extern SCM scm_set_port_filename_x SCM_P ((SCM port, SCM filename));
 extern void scm_prinport SCM_P ((SCM exp, SCM port, char *type));