diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1996-09-22 22:47:10 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1996-09-22 22:47:10 +0000 |
commit | 8ab4a274e8cace258a81d897fd347405891504b9 (patch) | |
tree | d0865f282aed51f6b4934e997261ffe661f013c6 /libguile/print.h | |
parent | c62fbfe1a8bd88a8f8ebee428234a8b33a4fc7e9 (diff) | |
download | guile-8ab4a274e8cace258a81d897fd347405891504b9.tar.gz |
* print.h: Modified prototypes for scm_iprlist, scm_prin1 and
scm_iprin1. Removed prototype for scm_prlist.
* print.c, print.h: Closures now print like #<procedure foo (x)>.
People who whish to see the source can do `(print-enable 'source)'.
Removed #ifdef DEBUG_EXTENSIONS.
Diffstat (limited to 'libguile/print.h')
-rw-r--r-- | libguile/print.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/libguile/print.h b/libguile/print.h index 41e7472b4..017c8f766 100644 --- a/libguile/print.h +++ b/libguile/print.h @@ -54,14 +54,40 @@ extern scm_option scm_print_opts[]; #define SCM_PRINT_SOURCE_P ((int) scm_print_opts[1].val) #define SCM_N_PRINT_OPTIONS 2 +/* State information passed around during printing. + */ +#define RESET_PRINT_STATE(pstate) \ +{ \ + pstate->list_offset = 0; \ + pstate->top = 0; \ +} + +#define SCM_WRITINGP(pstate) ((pstate)->writingp) +#define SCM_SET_WRITINGP(pstate, x) { (pstate)->writingp = (x); } + +#define SCM_PRINT_STATE_LAYOUT "sruwuwuwuwpwuwuwuwpW" +typedef struct scm_print_state { + SCM handle; /* Struct handle */ + unsigned long writingp; /* Writing? */ + unsigned long fancyp; /* Fancy printing? */ + unsigned long level; /* Max level */ + unsigned long length; /* Max number of objects per level */ + SCM hot_ref; /* Hot reference */ + unsigned long list_offset; + unsigned long top; /* Top of reference stack */ + unsigned long ceiling; /* Max size of reference stack */ + unsigned long n_refs; /* Size of struct tail array */ + SCM ref_stack[1]; /* Stack of references used during + circular reference detection */ +} scm_print_state; + #ifdef __STDC__ extern SCM scm_print_options (SCM setting); extern void scm_intprint (long n, int radix, SCM port); extern void scm_ipruk (char *hdr, SCM ptr, SCM port); -extern void scm_prlist (char *hdr, SCM exp, char tlr, SCM port, int writing); -extern void scm_iprlist (char *hdr, SCM exp, char tlr, SCM port, int writing); -extern void scm_prin1 (SCM exp, SCM port, int writing); -extern void scm_iprin1 (SCM exp, SCM port, int writing); +extern void scm_iprlist (char *hdr, SCM exp, char tlr, SCM port, scm_print_state *pstate); +extern void scm_prin1 (SCM exp, SCM port, int writingp); +extern void scm_iprin1 (SCM exp, SCM port, scm_print_state *pstate); extern SCM scm_write (SCM obj, SCM port); extern SCM scm_display (SCM obj, SCM port); extern SCM scm_newline(SCM port); @@ -72,7 +98,6 @@ extern void scm_init_print (void); extern SCM scm_print_options (); extern void scm_intprint (); extern void scm_ipruk (); -extern void scm_prlist (); extern void scm_iprlist (); extern void scm_prin1 (); extern void scm_iprin1 (); |