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. */
* 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"
#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
}
\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);
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)
\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
}
\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;
#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.
*/
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.
*
}
+\f
+/* Closing ports. */
+
/* scm_close_port
* Call the close operation on a port object.
* see also scm_close.
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
\f
\f
-/* {Void Ports}
- */
+/* Void ports. */
int scm_tc16_void_port = 0;