gjb@cs.washington.edu, http://www.cs.washington.edu/homes/gjb */
+#include <stdio.h>
#include <ctype.h>
#include "libguile/_scm.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
#include "libguile/stacks.h"
#include "libguile/srcprop.h"
scm_iprin1 (scm_unmemoize (source), port, pstate);
}
}
- else if (SCM_NIMP (source))
+ else if (SCM_MEMOIZEDP (source))
{
scm_puts ("In expression ", port);
pstate->writingp = 1;
data.mode = "error";
data.port = port;
scm_internal_catch (SCM_BOOL_T,
- (scm_catch_body_t) display_error_body, &a,
- (scm_catch_handler_t) display_error_handler, &data);
+ (scm_t_catch_body) display_error_body, &a,
+ (scm_t_catch_handler) display_error_handler, &data);
}
print_params_t *new_params;
SCM_VALIDATE_NONEMPTYLIST_COPYLEN (2, params, n);
- for (ls = params; SCM_NNULLP (ls); ls = SCM_CDR (ls))
+ for (ls = params; !SCM_NULLP (ls); ls = SCM_CDR (ls))
SCM_ASSERT (scm_ilength (SCM_CAR (params)) == 2
&& SCM_INUMP (SCM_CAAR (ls))
&& SCM_INUM (SCM_CAAR (ls)) >= 0
{
SCM string;
int i = 0, n;
- scm_ptob_descriptor_t *ptob = scm_ptobs + SCM_PTOBNUM (sport);
+ scm_t_ptob_descriptor *ptob = scm_ptobs + SCM_PTOBNUM (sport);
do
{
pstate->length = print_params[i].length;
display_application (SCM frame,int indentation,SCM sport,SCM port,scm_print_state *pstate)
{
SCM proc = SCM_FRAME_PROC (frame);
- SCM name = (SCM_NFALSEP (scm_procedure_p (proc))
+ SCM name = (!SCM_FALSEP (scm_procedure_p (proc))
? scm_procedure_name (proc)
: SCM_BOOL_F);
display_frame_expr ("[",
- scm_cons (SCM_NFALSEP (name) ? name : proc,
+ scm_cons (!SCM_FALSEP (name) ? name : proc,
SCM_FRAME_ARGS (frame)),
SCM_FRAME_EVAL_ARGS_P (frame) ? " ..." : "]",
indentation,
}
/* display file name and line number */
- if (SCM_NFALSEP (SCM_SHOW_FILE_NAME))
+ if (!SCM_FALSEP (SCM_SHOW_FILE_NAME))
display_backtrace_file_and_line (frame, port, pstate);
/* Check size of frame number. */
};
static SCM
-display_backtrace_body(struct display_backtrace_args *a)
+display_backtrace_body (struct display_backtrace_args *a)
#define FUNC_NAME "display_backtrace_body"
{
int n_frames, beg, end, n, i, j;
a->port = SCM_COERCE_OUTPORT (a->port);
/* Argument checking and extraction. */
- SCM_ASSERT (SCM_STACKP (a->stack),
- a->stack,
- SCM_ARG1,
- s_display_backtrace);
- SCM_ASSERT (SCM_OPOUTPORTP (a->port),
- a->port,
- SCM_ARG2,
- s_display_backtrace);
+ SCM_VALIDATE_STACK (1, a->stack);
+ SCM_VALIDATE_OPOUTPORT (2, a->port);
n_frames = SCM_INUM (scm_stack_length (a->stack));
n = SCM_INUMP (a->depth) ? SCM_INUM (a->depth) : SCM_BACKTRACE_DEPTH;
if (SCM_BACKWARDS_P)
indent_p = 0;
else
{
+ unsigned int j;
+
indent_p = 1;
frame = scm_stack_ref (a->stack, SCM_MAKINUM (beg));
for (i = 0, j = 0; i < n; ++i)
data.mode = "backtrace";
data.port = port;
scm_internal_catch (SCM_BOOL_T,
- (scm_catch_body_t) display_backtrace_body, &a,
- (scm_catch_handler_t) display_error_handler, &data);
+ (scm_t_catch_body) display_backtrace_body, &a,
+ (scm_t_catch_handler) display_error_handler, &data);
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
{
SCM the_last_stack =
scm_fluid_ref (SCM_VARIABLE_REF (scm_the_last_stack_fluid_var));
- if (SCM_NFALSEP (the_last_stack))
+ if (!SCM_FALSEP (the_last_stack))
{
scm_newline (scm_cur_outp);
scm_puts ("Backtrace:\n", scm_cur_outp);