#ifndef PRINTH
#define PRINTH
-/* Copyright (C) 1995,1996 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998 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
/* State information passed around during printing.
*/
-#define SCM_PRINT_STATE_P(obj) (SCM_NIMP(obj) && SCM_STRUCTP(obj) && \
- SCM_STRUCT_VTABLE(obj) == \
- scm_print_state_vtable)
+#define SCM_PRINT_STATE_P(obj) (SCM_STRUCTP(obj) \
+ && (SCM_STRUCT_VTABLE(obj) \
+ == scm_print_state_vtable))
#define SCM_PRINT_STATE(obj) ((scm_print_state *) SCM_STRUCT_DATA (obj))
#define RESET_PRINT_STATE(pstate) \
#define SCM_WRITINGP(pstate) ((pstate)->writingp)
#define SCM_SET_WRITINGP(pstate, x) { (pstate)->writingp = (x); }
-#define SCM_COERCE_OPORT(p) ((SCM_NIMP(p) && SCM_PRINT_STATE_P(SCM_CDR (p)))? \
- SCM_CAR(p) : p)
+#define SCM_COERCE_OUTPORT(p) ((SCM_NIMP (p) \
+ && SCM_CONSP (p) \
+ && SCM_PRINT_STATE_P (SCM_CDR (p))) \
+ ? SCM_CAR (p) \
+ : p)
#define SCM_PRINT_STATE_LAYOUT "sruwuwuwuwuwpwuwuwuruopr"
typedef struct scm_print_state {
extern int scm_valid_oport_value_p SCM_P ((SCM val));
extern void scm_init_print SCM_P ((void));
+#ifdef GUILE_DEBUG
+extern SCM scm_current_pstate SCM_P ((void));
+#endif
#endif /* PRINTH */