* eval.c, numbers.h, unif.h, smob.h, srcprop.c: Added #include
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Sun, 22 Sep 1996 22:41:10 +0000 (22:41 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Sun, 22 Sep 1996 22:41:10 +0000 (22:41 +0000)
"print.h"

* arbiters.c (prinarb),
async.c (print_async),
debug.c (prindebugobj, prinmemoized),
eval.c (prinprom, prinmacro),
filesys.c (scm_fd_print, scm_dir_print),
kw.c (print_kw),
mallocs.c (prinmalloc),
numbers.c, numbers.h (scm_floprint, scm_bigprint),
smob.h (scm_smobfuns),
srcprop.c (prinsrcprops),
throw.c (prinjb),
unif.c, unif.h (scm_raprin1, rapr1),
variable.c (prin_var): Changed argument `int writing' to
`scm_print_state *pstate'.

libguile/eval.c
libguile/numbers.c
libguile/numbers.h
libguile/smob.h
libguile/srcprop.c
libguile/unif.h

index 5acfced..898642c 100644 (file)
@@ -68,6 +68,7 @@
 #include "procprop.h"
 #include "hashtab.h"
 #include "hash.h"
+#include "print.h"
 
 #ifdef DEBUG_EXTENSIONS
 #include "debug.h"
@@ -2772,17 +2773,20 @@ scm_makprom (code)
 
 #ifdef __STDC__
 static int 
-prinprom (SCM exp, SCM port, int writing)
+prinprom (SCM exp, SCM port, scm_print_state *pstate)
 #else
 static int 
-prinprom (exp, port, writing)
+prinprom (exp, port, pstate)
      SCM exp;
      SCM port;
-     int writing;
+     scm_print_state *pstate;
 #endif
 {
+  int writingp = SCM_WRITINGP (pstate);
   scm_gen_puts (scm_regular_string, "#<promise ", port);
-  scm_iprin1 (SCM_CDR (exp), port, writing);
+  SCM_SET_WRITINGP (pstate, 1);
+  scm_iprin1 (SCM_CDR (exp), port, pstate);
+  SCM_SET_WRITINGP (pstate, writingp);
   scm_gen_putc ('>', port);
   return !0;
 }
@@ -2844,15 +2848,16 @@ scm_makmmacro (code)
 
 #ifdef __STDC__
 static int 
-prinmacro (SCM exp, SCM port, int writing)
+prinmacro (SCM exp, SCM port, scm_print_state *pstate)
 #else
 static int 
-prinmacro (exp, port, writing)
+prinmacro (exp, port, pstate)
      SCM exp;
      SCM port;
-     int writing;
+     scm_print_state *pstate;
 #endif
 {
+  int writingp = SCM_WRITINGP (pstate);
   if (SCM_CAR (exp) & (3L << 16))
     scm_gen_puts (scm_regular_string, "#<macro", port);
   else
@@ -2860,7 +2865,9 @@ prinmacro (exp, port, writing)
   if (SCM_CAR (exp) & (2L << 16))
     scm_gen_putc ('!', port);
   scm_gen_putc (' ', port);
-  scm_iprin1 (SCM_CDR (exp), port, writing);
+  SCM_SET_WRITINGP (pstate, 1);
+  scm_iprin1 (SCM_CDR (exp), port, pstate);
+  SCM_SET_WRITINGP (pstate, writingp);
   scm_gen_putc ('>', port);
   return !0;
 }
index bf3d638..2202935 100644 (file)
@@ -1581,13 +1581,13 @@ scm_number_to_string(x, radix)
    SCM_FLOATS or SCM_BIGDIGs conditionals */
 #ifdef __STDC__
 int
-scm_floprint(SCM sexp, SCM port, int writing)
+scm_floprint(SCM sexp, SCM port, scm_print_state *pstate)
 #else
 int
-scm_floprint(sexp, port, writing)
+scm_floprint(sexp, port, pstate)
      SCM sexp;
      SCM port;
-     int writing;
+     scm_print_state *pstate;
 #endif
 {
 #ifdef SCM_FLOATS
@@ -1602,13 +1602,13 @@ scm_floprint(sexp, port, writing)
 
 #ifdef __STDC__
 int
-scm_bigprint(SCM exp, SCM port, int writing)
+scm_bigprint(SCM exp, SCM port, scm_print_state *pstate)
 #else
 int
-scm_bigprint(exp, port, writing)
+scm_bigprint(exp, port, pstate)
      SCM exp;
      SCM port;
-     int writing;
+     scm_print_state *pstate;
 #endif
 {
 #ifdef SCM_BIGDIG
index 96bd5e2..6f6647b 100644 (file)
@@ -45,6 +45,7 @@
 \f
 
 #include "libguile/__scm.h"
+#include "print.h"
 
 \f
 
@@ -265,8 +266,8 @@ extern SCM scm_divbigint(SCM x, long z, int sgn, int mode);
 extern SCM scm_divbigbig(SCM_BIGDIG *x, scm_sizet nx, SCM_BIGDIG *y, scm_sizet ny, int sgn, int modes);
 extern scm_sizet scm_iint2str(long num, int rad, char *p);
 extern SCM scm_number_to_string(SCM x, SCM radix);
-extern int scm_floprint(SCM sexp, SCM port, int writing);
-extern int scm_bigprint(SCM exp, SCM port, int writing);
+extern int scm_floprint(SCM sexp, SCM port, scm_print_state *pstate);
+extern int scm_bigprint(SCM exp, SCM port, scm_print_state *pstate);
 extern SCM scm_istr2int(char *str, long len, long radix);
 extern SCM scm_istr2flo(char *str, long len, long radix);
 extern SCM scm_istring2number(char *str, long len, long radix);
index ddd3cc4..f7ab334 100644 (file)
  */
 \f
 #include "libguile/__scm.h"
+#include "print.h"
 
 \f
 typedef struct scm_smobfuns
 {
   SCM (*mark) SCM_P ((SCM));
   scm_sizet (*free) SCM_P ((SCM));
-  int (*print) SCM_P ((SCM exp, SCM port, int writing));
+  int (*print) SCM_P ((SCM exp, SCM port, scm_print_state *pstate));
   SCM (*equalp) SCM_P ((SCM, SCM));
 } scm_smobfuns;
 
index d577738..e2c7af9 100644 (file)
@@ -51,6 +51,7 @@
 #include "hashtab.h"
 #include "hash.h"
 #include "weaks.h"
+#include "print.h"
 
 #include "srcprop.h"
 \f
@@ -108,17 +109,20 @@ freesrcprops (obj)
 
 #ifdef __STDC__
 static int
-prinsrcprops (SCM obj, SCM port, int writing)
+prinsrcprops (SCM obj, SCM port, scm_print_state *pstate)
 #else
 static int
-prinsrcprops (obj, port, writing)
+prinsrcprops (obj, port, pstate)
      SCM obj;
      SCM port;
-     int writing;
+     scm_print_state *pstate;
 #endif
 {
+  int writingp = SCM_WRITINGP (pstate);
   scm_gen_puts (scm_regular_string, "#<srcprops ", port);
-  scm_iprin1 (scm_srcprops_to_plist (obj), port, 1);
+  SCM_SET_WRITINGP (pstate, 1);
+  scm_iprin1 (scm_srcprops_to_plist (obj), port, pstate);
+  SCM_SET_WRITINGP (pstate, writingp);
   scm_gen_putc ('>', port);
   return 1;
 }
index 6d2dc4d..a4071ee 100644 (file)
@@ -45,6 +45,7 @@
 \f
 
 #include "libguile/__scm.h"
+#include "print.h"
 
 \f
 typedef struct scm_array
@@ -107,7 +108,7 @@ extern SCM scm_string_downcase_x (SCM v);
 extern SCM scm_istr2bve (char *str, long len);
 extern SCM scm_array_to_list (SCM v);
 extern SCM scm_list_to_uniform_array (SCM ndim, SCM prot, SCM lst);
-extern int scm_raprin1 (SCM exp, SCM port, int writing);
+extern int scm_raprin1 (SCM exp, SCM port, scm_print_state *pstate);
 extern SCM scm_array_prototype (SCM ra);
 extern void scm_init_unif (void);