Utterly needless cleanups to hopelessly messy code.
authorJim Blandy <jimb@red-bean.com>
Mon, 5 Oct 1998 21:04:15 +0000 (21:04 +0000)
committerJim Blandy <jimb@red-bean.com>
Mon, 5 Oct 1998 21:04:15 +0000 (21:04 +0000)
* ports.c: Doc fixes.
(scm_fflush): Moved to ...
* genio.c (scm_fflush): ... here, amongst all the other port
method invocation functions.
* genio.h, ports.h: The prototype moves too.

libguile/genio.c
libguile/genio.h
libguile/ports.c
libguile/ports.h

index 74bc0d3..1b04a0c 100644 (file)
@@ -90,6 +90,14 @@ scm_lfwrite (ptr, size, port)
 }
 
 
+void 
+scm_fflush (port)
+     SCM port;
+{
+  scm_sizet i = SCM_PTOBNUM (port);
+  (scm_ptobs[i].fflush) (SCM_STREAM (port));
+}
+
 \f
 
 int 
index 288e60f..8362d9c 100644 (file)
@@ -51,6 +51,7 @@
 extern void scm_putc SCM_P ((int c, SCM port));
 extern void scm_puts SCM_P ((char *str_data, SCM port));
 extern void scm_lfwrite SCM_P ((char *ptr, scm_sizet size, SCM port));
+extern void scm_fflush SCM_P ((SCM port));
 extern int scm_getc SCM_P ((SCM port));
 extern void scm_ungetc SCM_P ((int c, SCM port));
 /* FIXME: this is a terrible name.  */
index 809be19..71824e4 100644 (file)
@@ -39,6 +39,8 @@
  * whether to permit this exception to apply to your modifications.
  * If you do not wish that, delete this exception notice.  */
 \f
+/* Headers.  */
+
 #include <stdio.h>
 #include "_scm.h"
 #include "genio.h"
@@ -64,7 +66,9 @@
 #ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 #endif
+
 \f
+/* The port kind table --- a dynamically resized array of port types.  */
 
 
 /* scm_ptobs scm_numptob
@@ -122,17 +126,6 @@ scm_newptob (ptob)
 }
 
 \f
-/* internal SCM call */
-
-void 
-scm_fflush (port)
-     SCM port;
-{
-  scm_sizet i = SCM_PTOBNUM (port);
-  (scm_ptobs[i].fflush) (SCM_STREAM (port));
-}
-
-\f
 
 SCM_PROC(s_char_ready_p, "char-ready?", 0, 1, 0, scm_char_ready_p);
 
@@ -143,7 +136,9 @@ scm_char_ready_p (port)
   if (SCM_UNBNDP (port))
     port = scm_cur_inp;
   else
-    SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port), port, SCM_ARG1, s_char_ready_p);
+    SCM_ASSERT (SCM_NIMP (port) && SCM_OPINPORTP (port), port, SCM_ARG1,
+               s_char_ready_p);
+
   if (SCM_CRDYP (port) || !SCM_FPORTP (port))
     return SCM_BOOL_T;
   return (scm_input_waiting_p ((FILE *) SCM_STREAM (port), s_char_ready_p)
@@ -153,10 +148,8 @@ scm_char_ready_p (port)
 
 
 \f
+/* Standard ports --- current input, output, error, and more(!).  */
 
-
-/* {Standard Ports}
- */
 SCM_PROC(s_current_input_port, "current-input-port", 0, 0, 0, scm_current_input_port);
 
 SCM 
@@ -230,10 +223,7 @@ scm_set_current_error_port (port)
 }
 
 \f
-
-/* {Ports - in general}
- * 
- */
+/* The port table --- a table of all the open ports.  */
 
 /* Array of open ports, required for reliable MOVE->FDES etc.  */
 struct scm_port_table **scm_port_table;
@@ -317,6 +307,9 @@ scm_pt_member (member)
 #endif
 
 
+\f
+/* Revealed counts --- an oddity inherited from SCSH.  */
+
 /* Find a port in the table and return its revealed count.
    Also used by the garbage collector.
  */
@@ -360,6 +353,10 @@ scm_set_port_revealed_x (port, rcount)
   return SCM_UNSPECIFIED;
 }
 
+
+\f
+/* Retrieving a port's mode.  */
+
 /* Return the flags that characterize a port based on the mode
  * string used to open a file for that port.
  *
@@ -408,6 +405,9 @@ scm_port_mode (port)
 }
 
 
+\f
+/* Closing ports.  */
+
 /* scm_close_port
  * Call the close operation on a port object. 
  * see also scm_close.
@@ -478,6 +478,10 @@ scm_close_all_ports_except (ports)
   return SCM_UNSPECIFIED;
 }
 
+
+\f
+/* Utter miscellany.  Gosh, we should clean this up some time.  */
+
 SCM_PROC(s_input_port_p, "input-port?", 1, 0, 0, scm_input_port_p);
 
 SCM 
@@ -823,8 +827,7 @@ scm_ports_prehistory ()
 \f
 
 \f
-/* {Void Ports}
- */
+/* Void ports.   */
 
 int scm_tc16_void_port = 0;
 
index 9226f72..a7ea3e1 100644 (file)
@@ -149,7 +149,6 @@ extern int scm_port_table_room;
 
 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));