diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-22 18:02:21 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-22 18:02:21 +0000 |
commit | 7fe795010750d2e2889d7085abeaa1ee0926c69b (patch) | |
tree | b52138c43e052b09287afed0fb6351cd31249bda /lib/libcurses/trace/trace_tries.c | |
parent | 85db479b2362c15a2266e01737d835e86cda1b1e (diff) |
Update to ncurses-5.2-20010114
Diffstat (limited to 'lib/libcurses/trace/trace_tries.c')
-rw-r--r-- | lib/libcurses/trace/trace_tries.c | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/lib/libcurses/trace/trace_tries.c b/lib/libcurses/trace/trace_tries.c index effb7378d6c..d0dd538d9be 100644 --- a/lib/libcurses/trace/trace_tries.c +++ b/lib/libcurses/trace/trace_tries.c @@ -1,7 +1,7 @@ -/* $OpenBSD: trace_tries.c,v 1.3 1999/03/11 21:03:58 millert Exp $ */ +/* $OpenBSD: trace_tries.c,v 1.4 2001/01/22 18:01:59 millert Exp $ */ /**************************************************************************** - * Copyright (c) 1999 Free Software Foundation, Inc. * + * Copyright (c) 1999,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,40 +37,45 @@ #include <curses.priv.h> -MODULE_ID("$From: trace_tries.c,v 1.6 1999/03/06 22:51:07 tom Exp $") +MODULE_ID("$From: trace_tries.c,v 1.8 2000/12/10 03:03:51 tom Exp $") #ifdef TRACE static unsigned char *buffer; static unsigned len; -static void recur_tries(struct tries *tree, unsigned level) +static void +recur_tries(struct tries *tree, unsigned level) { - if (level > len) - buffer = (unsigned char *)realloc(buffer, len = (level + 1) * 4); + if (level > len) + buffer = (unsigned char *) realloc(buffer, len = (level + 1) * 4); - while (tree != 0) { - if ((buffer[level] = tree->ch) == 0) - buffer[level] = 128; - buffer[level+1] = 0; - if (tree->value != 0) { - _tracef("%5d: %s (%s)", tree->value, _nc_visbuf((char *)buffer), keyname(tree->value)); - } - if (tree->child) - recur_tries(tree->child, level+1); - tree = tree->sibling; + while (tree != 0) { + if ((buffer[level] = tree->ch) == 0) + buffer[level] = 128; + buffer[level + 1] = 0; + if (tree->value != 0) { + _tracef("%5d: %s (%s)", tree->value, + _nc_visbuf((char *) buffer), keyname(tree->value)); } + if (tree->child) + recur_tries(tree->child, level + 1); + tree = tree->sibling; + } } -void _nc_trace_tries(struct tries *tree) +NCURSES_EXPORT(void) +_nc_trace_tries(struct tries *tree) { - buffer = typeMalloc(unsigned char, len = 80); - _tracef("BEGIN tries %p", tree); - recur_tries(tree, 0); - _tracef(". . . tries %p", tree); - free(buffer); + buffer = typeMalloc(unsigned char, len = 80); + _tracef("BEGIN tries %p", tree); + recur_tries(tree, 0); + _tracef(". . . tries %p", tree); + free(buffer); } + #else -void _nc_trace_tries(struct tries *tree GCC_UNUSED) +NCURSES_EXPORT(void) +_nc_trace_tries(struct tries *tree GCC_UNUSED) { } #endif |