aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/ncurses/trace/lib_tracedmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ncurses/ncurses/trace/lib_tracedmp.c')
-rw-r--r--contrib/ncurses/ncurses/trace/lib_tracedmp.c75
1 files changed, 38 insertions, 37 deletions
diff --git a/contrib/ncurses/ncurses/trace/lib_tracedmp.c b/contrib/ncurses/ncurses/trace/lib_tracedmp.c
index a67a37ef7edd..22304ce73187 100644
--- a/contrib/ncurses/ncurses/trace/lib_tracedmp.c
+++ b/contrib/ncurses/ncurses/trace/lib_tracedmp.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * 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 *
@@ -37,92 +37,93 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_tracedmp.c,v 1.13 1998/03/21 18:39:44 tom Exp $")
+MODULE_ID("$Id: lib_tracedmp.c,v 1.16 2000/12/10 03:02:45 tom Exp $")
#ifdef TRACE
-void _tracedump(const char *name, WINDOW *win)
+NCURSES_EXPORT(void)
+_tracedump(const char *name, WINDOW *win)
{
- int i, j, n, width;
+ int i, j, n, width;
/* compute narrowest possible display width */
- for (width = i = 0; i <= win->_maxy; i++)
- {
+ for (width = i = 0; i <= win->_maxy; i++) {
n = 0;
for (j = 0; j <= win->_maxx; j++)
- if (win->_line[i].text[j] != ' ')
- n = j;
+ if (win->_line[i].text[j] != ' ')
+ n = j;
if (n > width)
- width = n;
+ width = n;
}
if (width < win->_maxx)
- ++width;
+ ++width;
- for (n = 0; n <= win->_maxy; n++)
- {
- char buf[BUFSIZ], *ep;
+ for (n = 0; n <= win->_maxy; n++) {
+ char buf[BUFSIZ], *ep;
bool haveattrs, havecolors;
/* dump A_CHARTEXT part */
(void) sprintf(buf, "%s[%2d] %3d%3d ='",
- name, n,
- win->_line[n].firstchar,
- win->_line[n].lastchar);
+ name, n,
+ win->_line[n].firstchar,
+ win->_line[n].lastchar);
ep = buf + strlen(buf);
for (j = 0; j <= width; j++) {
ep[j] = TextOf(win->_line[n].text[j]);
if (ep[j] == 0)
- ep[j] = '.';
+ ep[j] = '.';
}
ep[j] = '\'';
- ep[j+1] = '\0';
+ ep[j + 1] = '\0';
_tracef("%s", buf);
/* dump A_COLOR part, will screw up if there are more than 96 */
havecolors = FALSE;
for (j = 0; j <= width; j++)
- if (win->_line[n].text[j] & A_COLOR)
- {
+ if (win->_line[n].text[j] & A_COLOR) {
havecolors = TRUE;
break;
}
- if (havecolors)
- {
- (void) sprintf(buf, "%*s[%2d]%*s='", (int)strlen(name), "colors", n, 8, " ");
+ if (havecolors) {
+ (void) sprintf(buf, "%*s[%2d]%*s='", (int) strlen(name),
+ "colors", n, 8, " ");
ep = buf + strlen(buf);
for (j = 0; j <= width; j++)
- ep[j] = ((win->_line[n].text[j] >> 8) & 0xff) + ' ';
+ ep[j] = CharOf(win->_line[n].text[j] >> 8) + ' ';
ep[j] = '\'';
- ep[j+1] = '\0';
+ ep[j + 1] = '\0';
_tracef("%s", buf);
}
- for (i = 0; i < 4; i++)
- {
- const char *hex = " 123456789ABCDEF";
- chtype mask = (0xf << ((i + 4) * 4));
+ for (i = 0; i < 4; i++) {
+ const char *hex = " 123456789ABCDEF";
+ chtype mask = (0xf << ((i + 4) * 4));
haveattrs = FALSE;
for (j = 0; j <= width; j++)
- if (win->_line[n].text[j] & mask)
- {
+ if (win->_line[n].text[j] & mask) {
haveattrs = TRUE;
break;
}
- if (haveattrs)
- {
- (void) sprintf(buf, "%*s%d[%2d]%*s='", (int)strlen(name)-1, "attrs", i, n, 8, " ");
+ if (haveattrs) {
+ (void) sprintf(buf, "%*s%d[%2d]%*s='", (int) strlen(name) -
+ 1, "attrs", i, n, 8, " ");
ep = buf + strlen(buf);
for (j = 0; j <= width; j++)
ep[j] = hex[(win->_line[n].text[j] & mask) >> ((i + 4) * 4)];
ep[j] = '\'';
- ep[j+1] = '\0';
+ ep[j + 1] = '\0';
_tracef("%s", buf);
}
}
}
}
#else
-extern void _nc_lib_tracedmp(void);
- void _nc_lib_tracedmp(void) { }
+extern
+NCURSES_EXPORT(void)
+_nc_lib_tracedmp(void);
+NCURSES_EXPORT(void)
+_nc_lib_tracedmp(void)
+{
+}
#endif /* TRACE */