o change unctrl() to render C1 characters (128-159) as ~@, ~A, etc.
o trace() function is provided only if TRACE is defined, e.g., in the debug
library. Modify related calls to _tracechar() to use unctrl() instead.
-# $OpenBSD: MKunctrl.awk,v 1.1 1999/01/18 19:09:32 millert Exp $
-# $From: MKunctrl.awk,v 1.6 1998/06/06 18:18:07 tom Exp $
+# $OpenBSD: MKunctrl.awk,v 1.2 2000/04/04 16:49:59 millert Exp $
+# $From: MKunctrl.awk,v 1.7 2000/04/01 19:49:26 tom Exp $
##############################################################################
# Copyright (c) 1998 Free Software Foundation, Inc. #
# #
printf "\"^\\%03o\"", ch + 64
} else if (ch == 127) {
printf "\"^?\""
+ } else if (ch >= 128 && ch < 160) {
+ printf "\"~\\%03o\"", ch - 64
} else {
printf "\"\\%03o\"", ch
gap = gap " "
-/* $OpenBSD: curses.h,v 1.49 2000/03/26 16:45:02 millert Exp $ */
+/* $OpenBSD: curses.h,v 1.50 2000/04/04 16:49:58 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
/* These are defined only in curses.h, and are used for conditional compiles */
#define NCURSES_VERSION_MAJOR 5
#define NCURSES_VERSION_MINOR 0
-#define NCURSES_VERSION_PATCH 20000325
+#define NCURSES_VERSION_PATCH 20000401
/* This is defined in more than one ncurses header, for identification */
#undef NCURSES_VERSION
-/* $OpenBSD: captoinfo.c,v 1.7 2000/03/26 16:45:03 millert Exp $ */
+/* $OpenBSD: captoinfo.c,v 1.8 2000/04/04 16:49:59 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$From: captoinfo.c,v 1.36 2000/03/19 23:04:26 tom Exp $")
+MODULE_ID("$From: captoinfo.c,v 1.37 2000/04/01 20:07:34 tom Exp $")
#define MAX_PUSHED 16 /* max # args we can push onto the stack */
invalid:
dp = save_char(dp, '%');
s--;
- _nc_warning("unknown %% code %s in %s",
- _tracechar(*s), cap);
+ _nc_warning("unknown %% code %s (%#x) in %s",
+ unctrl(*s), (*s) & 0xff, cap);
break;
}
break;
#include <term_entry.h>
#include <tic.h>
-MODULE_ID("$From: comp_scan.c,v 1.41 2000/03/25 17:25:33 tom Exp $")
+MODULE_ID("$From: comp_scan.c,v 1.42 2000/04/01 19:08:36 tom Exp $")
/*
* Maximum length of string capability we'll accept before raising an error.
#endif
&& !strchr(terminfo_punct, (char) ch)) {
_nc_warning("Illegal character (expected alphanumeric or %s) - %s",
- terminfo_punct, _tracechar((chtype) ch));
+ terminfo_punct, unctrl(ch));
_nc_panic_mode(separator);
goto start_token;
}
case '@':
if ((ch = next_char()) != separator)
_nc_warning("Missing separator after `%s', have %s",
- buffer, _tracechar((chtype) ch));
+ buffer, unctrl(ch));
_nc_curr_token.tk_name = buffer;
type = CANCEL;
break;
default:
/* just to get rid of the compiler warning */
type = UNDEF;
- _nc_warning("Illegal character - %s",
- _tracechar((chtype) ch));
+ _nc_warning("Illegal character - %s", unctrl(ch));
}
} /* end else (first_column == FALSE) */
} /* end else (ch != EOF) */
_nc_err_abort("Premature EOF");
if (!(is7bits(ch) && isprint(ch))) {
- _nc_warning("Illegal ^ character - %s",
- _tracechar((unsigned char) ch));
+ _nc_warning("Illegal ^ character - %s", unctrl(ch));
}
if (ch == '?') {
*(ptr++) = '\177';
default:
_nc_warning("Illegal character %s in \\ sequence",
- _tracechar((unsigned char) ch));
+ unctrl(ch));
*(ptr++) = (char) ch;
} /* endswitch (ch) */
} /* endelse (ch < '0' || ch > '7') */
-/* $OpenBSD: lib_trace.c,v 1.4 2000/03/10 01:35:05 millert Exp $ */
+/* $OpenBSD: lib_trace.c,v 1.5 2000/04/04 16:49:59 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
#include <ctype.h>
-MODULE_ID("$From: lib_trace.c,v 1.33 2000/02/13 01:01:55 tom Exp $")
+MODULE_ID("$From: lib_trace.c,v 1.34 2000/04/01 20:25:47 tom Exp $")
unsigned _nc_tracing = 0; /* always define this */
long _nc_outchars = 0;
static FILE *tracefp; /* default to writing to stderr */
-#endif
void
trace(const unsigned int tracelevel GCC_UNUSED)
{
-#ifdef TRACE
static bool been_here = FALSE;
static char my_name[] = "trace";
_tracef("TRACING NCURSES version %s (%d)",
NCURSES_VERSION, NCURSES_VERSION_PATCH);
}
-#endif
}
+#endif
const char *
_nc_visbuf2(int bufnum, const char *buf)
if (buf == CANCELLED_STRING)
return ("(cancelled)");
+#ifdef TRACE
tp = vbuf = _nc_trace_buf(bufnum, (strlen(buf) * 4) + 5);
+#else
+ {
+ static char *mybuf[2];
+ mybuf[bufnum] = _nc_doalloc(mybuf[bufnum], (strlen(buf) * 4) + 5);
+ tp = vbuf = mybuf[bufnum];
+ }
+#endif
*tp++ = '"';
while ((c = *buf++) != '\0') {
if (c == '"') {
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
****************************************************************************/
-
-
/*
* lib_tracechr.c - Tracing/Debugging routines
*/
-
-#ifndef TRACE
-#define TRACE /* turn on internal defs for this module */
-#endif
-
#include <curses.priv.h>
-#include <ctype.h>
+MODULE_ID("$From: lib_tracechr.c,v 1.2 2000/04/01 20:17:26 tom Exp $")
#ifdef TRACE
char *_tracechar(const unsigned char ch)
{
static char crep[20];
- /*
- * We can show the actual character if it's either an ordinary printable
- * or one of the high-half characters.
- */
- if (isprint(ch) || (ch & 0x80))
- {
- crep[0] = '\'';
- crep[1] = ch; /* necessary; printf tries too hard on metachars */
- (void) sprintf(crep + 2, "' = 0x%02x", (unsigned)ch);
- }
- else
- (void) sprintf(crep, "0x%02x", (unsigned)ch);
+ (void) sprintf(crep, "'%s' = 0x%02x", unctrl(ch), (unsigned)ch);
return(crep);
}
#else