-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1358 2009/01/17 23:54:20 tom Exp $
+-- $Id: NEWS,v 1.1360 2009/01/24 23:06:51 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20090124
+ + modify init_pair() to allow caller to create extra color pairs beyond
+ the color_pairs limit, which use default colors (request by Emanuele
+ Giaquinta).
+ + add misc/terminfo.tmp and misc/*.pc to "sources" rule.
+ + fix typo "==" where "=" is needed in ncurses-config.in and
+ gen-pkgconfig.in files (Debian #512161).
+
20090117
+ add -shared option to MK_SHARED_LIB when -Bsharable is used, for
*BSD's, without which "main" might be one of the shared library's
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.683 2009/01/17 16:29:15 tom Exp $
+# $Id: dist.mk,v 1.684 2009/01/24 20:49:01 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 7
-NCURSES_PATCH = 20090117
+NCURSES_PATCH = 20090124
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
.\"***************************************************************************
-.\" Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
+.\" Copyright (c) 1998-2005,2009 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 *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_color.3x,v 1.28 2005/12/18 00:00:37 tom Exp $
+.\" $Id: curs_color.3x,v 1.29 2009/01/24 23:10:02 tom Exp $
.TH curs_color 3X ""
.na
.hy 0
.TP 5
-
The value of the first argument
-must be between \fB1\fR and \fBCOLOR_PAIRS-1\fR.
+must be between \fB1\fR and \fBCOLOR_PAIRS-1\fR,
+except that if default colors are used (see \fBuse_default_colors\fP)
+the upper limit is adjusted to allow for extra pairs which use
+a default color in foreground and/or background.
.TP 5
-
The value of the second and
-# $Id: Makefile.in,v 1.48 2009/01/03 23:52:41 tom Exp $
+# $Id: Makefile.in,v 1.50 2009/01/24 21:42:15 tom Exp $
##############################################################################
# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. #
# #
depend :
-sources :
+sources :: terminfo.tmp
install : install.data install.libs
@MAKE_PC_FILES@install.libs :: pc-files
@MAKE_PC_FILES@ $(SHELL) -c 'for name in *.pc; do $(INSTALL_DATA) $$name $(PKG_CONFIG_LIBDIR)/$$name; done'
+@MAKE_PC_FILES@sources :: pc-files
@MAKE_PC_FILES@pc-files :
@MAKE_PC_FILES@ $(SHELL) ./gen-pkgconfig
@MAKE_PC_FILES@ touch $@
#!@SHELL@
-# $Id: gen-pkgconfig.in,v 1.4 2009/01/04 21:52:33 tom Exp $
+# $Id: gen-pkgconfig.in,v 1.5 2009/01/24 21:06:36 tom Exp $
##############################################################################
# Copyright (c) 2009 Free Software Foundation, Inc. #
# #
do
name=`basename $lib`
root=`basename $name "$DFT_DEP_SUFFIX"`
- if test "$name" == "$root" ; then
+ if test "$name" = "$root" ; then
root=`basename $name "$CXX_LIB_SUFFIX"`
- if test "$name" == "$root" ; then
+ if test "$name" = "$root" ; then
continue
fi
fi
#!@SHELL@
-# $Id: ncurses-config.in,v 1.21 2009/01/06 01:06:21 tom Exp $
+# $Id: ncurses-config.in,v 1.22 2009/01/24 21:06:45 tom Exp $
##############################################################################
# Copyright (c) 2006-2007,2009 Free Software Foundation, Inc. #
# #
if test "${includedir}" != /usr/include ; then
INCS="-I${includedir}"
fi
- if test "x@WITH_OVERWRITE@" == xno ; then
+ if test "x@WITH_OVERWRITE@" = xno ; then
INCS="$INCS -I${includedir}/${THIS}"
fi
sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
/****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2007,2009 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 *
#include <term.h>
#include <tic.h>
-MODULE_ID("$Id: lib_color.c,v 1.85 2007/04/07 17:07:28 tom Exp $")
+MODULE_ID("$Id: lib_color.c,v 1.87 2009/01/25 00:25:31 tom Exp $")
/*
* These should be screen structure members. They need to be globals for
};
/* *INDENT-ON* */
+/*
+ * Ensure that we use color pairs only when colors have been started, and also
+ * that the index is within the limits of the table which we allocated.
+ */
+#define ValidPair(pair) \
+ ((SP != 0) && (pair >= 0) && (pair < SP->_pair_limit) && SP->_coloron)
+
#if NCURSES_EXT_FUNCS
/*
* These are called from _nc_do_color(), which in turn is called from
}
if (max_pairs > 0 && max_colors > 0) {
+ SP->_pair_limit = max_pairs;
+
+#if NCURSES_EXT_FUNCS
+ /*
+ * If using default colors, allocate extra space in table to
+ * allow for default-color as a component of a color-pair.
+ */
+ SP->_pair_limit += (1 + (2 * max_colors));
+#endif
SP->_pair_count = max_pairs;
SP->_color_count = max_colors;
#if !USE_REENTRANT
#endif
if ((SP->_color_pairs = TYPE_CALLOC(colorpair_t,
- max_pairs)) != 0) {
+ SP->_pair_limit)) != 0) {
if ((SP->_color_table = TYPE_CALLOC(color_t,
max_colors)) != 0) {
SP->_color_pairs[0] = PAIR_OF(default_fg(), default_bg());
init_pair(short pair, short f, short b)
{
colorpair_t result;
+ colorpair_t previous;
T((T_CALLED("init_pair(%d,%d,%d)"), pair, f, b));
- if ((pair < 0) || (pair >= COLOR_PAIRS) || SP == 0 || !SP->_coloron)
+ if (!ValidPair(pair))
returnCode(ERR);
+
+ previous = SP->_color_pairs[pair];
#if NCURSES_EXT_FUNCS
if (SP->_default_color) {
- if (f < 0)
+ bool isDefault = FALSE;
+ bool wasDefault = FALSE;
+ int default_pairs = SP->_default_pairs;
+
+ /*
+ * Map caller's color number, e.g., -1, 0, 1, .., 7, etc., into
+ * internal unsigned values which we will store in the _color_pairs[]
+ * table.
+ */
+ if (isDefaultColor(f)) {
f = COLOR_DEFAULT;
- if (b < 0)
+ isDefault = TRUE;
+ } else if (!OkColorHi(f)) {
+ returnCode(ERR);
+ }
+
+ if (isDefaultColor(b)) {
b = COLOR_DEFAULT;
- if (!OkColorHi(f) && !isDefaultColor(f))
+ isDefault = TRUE;
+ } else if (!OkColorHi(b)) {
returnCode(ERR);
- if (!OkColorHi(b) && !isDefaultColor(b))
+ }
+
+ /*
+ * Check if the table entry that we are going to init/update used
+ * default colors.
+ */
+ if ((FORE_OF(previous) == COLOR_DEFAULT)
+ || (BACK_OF(previous) == COLOR_DEFAULT))
+ wasDefault = TRUE;
+
+ /*
+ * Keep track of the number of entries in the color pair table which
+ * used a default color.
+ */
+ if (isDefault && !wasDefault) {
+ ++default_pairs;
+ } else if (wasDefault && !isDefault) {
+ --default_pairs;
+ }
+
+ /*
+ * As an extension, ncurses allows the pair number to exceed the
+ * terminal's color_pairs value for pairs using a default color.
+ *
+ * Note that updating a pair which used a default color with one
+ * that does not will decrement the count - and possibly interfere
+ * with sequentially adding new pairs.
+ */
+ if (pair > (SP->_pair_count + default_pairs)) {
returnCode(ERR);
+ }
+ SP->_default_pairs = default_pairs;
} else
#endif
{
* pair colors with the new ones).
*/
result = PAIR_OF(f, b);
- if (SP->_color_pairs[pair] != 0
- && SP->_color_pairs[pair] != result) {
+ if (previous != 0
+ && previous != result) {
int y, x;
for (y = 0; y <= curscr->_maxy; y++) {
T((T_CALLED("pair_content(%d,%p,%p)"), pair, f, b));
- if ((pair < 0) || (pair >= COLOR_PAIRS) || SP == 0 || !SP->_coloron) {
+ if (!ValidPair(pair)) {
result = ERR;
} else {
- NCURSES_COLOR_T fg = ((SP->_color_pairs[pair] >> C_SHIFT) & C_MASK);
- NCURSES_COLOR_T bg = (SP->_color_pairs[pair] & C_MASK);
+ NCURSES_COLOR_T fg = FORE_OF(SP->_color_pairs[pair]);
+ NCURSES_COLOR_T bg = BACK_OF(SP->_color_pairs[pair]);
#if NCURSES_EXT_FUNCS
if (fg == COLOR_DEFAULT)
NCURSES_COLOR_T bg = COLOR_DEFAULT;
NCURSES_COLOR_T old_fg, old_bg;
- if (pair < 0 || pair >= COLOR_PAIRS) {
+ if (!ValidPair(pair)) {
return;
} else if (pair != 0) {
if (set_color_pair) {
/****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,2009 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 *
/****************************************************************************
* Author: Juergen Pfeifer, 1998 *
- * and: Thomas E. Dickey, 2005 *
+ * and: Thomas E. Dickey, 2005-on *
****************************************************************************/
/*
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_colorset.c,v 1.11 2005/01/29 21:40:51 tom Exp $")
+MODULE_ID("$Id: lib_colorset.c,v 1.12 2009/01/25 00:44:40 tom Exp $")
NCURSES_EXPORT(int)
wcolor_set(WINDOW *win, short color_pair_number, void *opts)
{
+ int code = ERR;
+
T((T_CALLED("wcolor_set(%p,%d)"), win, color_pair_number));
if (win
&& !opts
+ && (SP != 0)
&& (color_pair_number >= 0)
- && (color_pair_number < COLOR_PAIRS)) {
+ && (color_pair_number < SP->_pair_limit)) {
TR(TRACE_ATTRS, ("... current %ld", (long) GET_WINDOW_PAIR(win)));
SET_WINDOW_PAIR(win, color_pair_number);
if_EXT_COLORS(win->_color = color_pair_number);
- returnCode(OK);
- } else
- returnCode(ERR);
+ code = OK;
+ }
+ returnCode(code);
}
/****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,2009 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 *
/****************************************************************************
* Author: Juergen Pfeifer, 1998 *
- * and: Thomas E. Dickey 2005 *
+ * and: Thomas E. Dickey 2005-on *
****************************************************************************/
/*
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkatr_set.c,v 1.10 2005/01/28 21:11:53 tom Exp $")
+MODULE_ID("$Id: lib_slkatr_set.c,v 1.11 2009/01/25 00:47:15 tom Exp $")
NCURSES_EXPORT(int)
slk_attr_set(const attr_t attr, short color_pair_number, void *opts)
{
+ int code = ERR;
+
T((T_CALLED("slk_attr_set(%s,%d)"), _traceattr(attr), color_pair_number));
- if (SP != 0 && SP->_slk != 0 && !opts &&
- color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
+ if (SP != 0
+ && SP->_slk != 0
+ && !opts
+ && color_pair_number >= 0
+ && color_pair_number < SP->_pair_limit) {
TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP->_slk->attr))));
SetAttr(SP->_slk->attr, attr);
if (color_pair_number > 0) {
SetPair(SP->_slk->attr, color_pair_number);
}
TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
- returnCode(OK);
- } else
- returnCode(ERR);
+ code = OK;
+ }
+ returnCode(code);
}
/****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,2009 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 *
/****************************************************************************
* Author: Juergen Pfeifer, 1998 *
- * and: Thomas E. Dickey 2005 *
+ * and: Thomas E. Dickey 2005-on *
****************************************************************************/
/*
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkcolor.c,v 1.12 2005/01/28 21:11:53 tom Exp $")
+MODULE_ID("$Id: lib_slkcolor.c,v 1.13 2009/01/25 00:48:07 tom Exp $")
NCURSES_EXPORT(int)
slk_color(short color_pair_number)
{
+ int code = ERR;
+
T((T_CALLED("slk_color(%d)"), color_pair_number));
- if (SP != 0 && SP->_slk != 0 &&
- color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
+ if (SP != 0
+ && SP->_slk != 0
+ && color_pair_number >= 0
+ && color_pair_number < SP->_pair_limit) {
TR(TRACE_ATTRS, ("... current is %s", _tracech_t(CHREF(SP->_slk->attr))));
SetPair(SP->_slk->attr, color_pair_number);
TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
- returnCode(OK);
- } else
- returnCode(ERR);
+ code = OK;
+ }
+ returnCode(code);
}
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2008,2009 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 *
/*
- * $Id: curses.priv.h,v 1.395 2008/11/23 00:09:04 tom Exp $
+ * $Id: curses.priv.h,v 1.396 2009/01/24 23:04:59 tom Exp $
*
* curses.priv.h
*
#define C_SHIFT 9 /* we need more bits than there are colors */
#define C_MASK ((1 << C_SHIFT) - 1)
#define PAIR_OF(fg, bg) ((((fg) & C_MASK) << C_SHIFT) | ((bg) & C_MASK))
+#define FORE_OF(c) (((c) >> C_SHIFT) & C_MASK)
+#define BACK_OF(c) ((c) & C_MASK)
#define isDefaultColor(c) ((c) >= COLOR_DEFAULT || (c) < 0)
#define COLOR_DEFAULT C_MASK
int _color_count; /* count of colors in palette */
colorpair_t *_color_pairs; /* screen's color pair list */
int _pair_count; /* count of color pairs */
+ int _pair_limit; /* actual limit of color-pairs */
#if NCURSES_EXT_FUNCS
bool _default_color; /* use default colors */
bool _has_sgr_39_49; /* has ECMA default color support */
int _default_fg; /* assumed default foreground */
int _default_bg; /* assumed default background */
+ int _default_pairs; /* count pairs using default color */
#endif
chtype _ok_attributes; /* valid attributes for terminal */
chtype _xmc_suppress; /* attributes to suppress if xmc */
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2008,2009 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 *
#include <ctype.h>
#include <term.h>
-MODULE_ID("$Id: tty_update.c,v 1.246 2008/08/30 20:08:19 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.247 2009/01/25 00:48:36 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
newPair = GetPair(newLine[n]);
if (oldPair != newPair
&& unColor(oldLine[n]) == unColor(newLine[n])) {
- if (oldPair < COLOR_PAIRS
- && newPair < COLOR_PAIRS
+ if (oldPair < SP->_pair_limit
+ && newPair < SP->_pair_limit
&& SP->_color_pairs[oldPair] == SP->_color_pairs[newPair]) {
SetPair(oldLine[n], GetPair(newLine[n]));
}
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.334 2008/12/20 17:13:27 tom Exp $
+$Id: ncurses.c,v 1.336 2009/01/25 00:39:14 tom Exp $
***************************************************************************/
width = 4;
} else if (color >= 8) {
sprintf(temp, "[%02d]", color);
+ } else if (color < 0) {
+ strcpy(temp, "default");
} else {
strcpy(temp, the_color_names[color]);
}
" b/B toggle bold off/on");
mvwprintw(helpwin, row++, col,
" n/N toggle text/number on/off");
+ mvwprintw(helpwin, row++, col,
+ " r/R toggle reverse on/off");
mvwprintw(helpwin, row++, col,
" w/W toggle width between 8/16 colors");
#if USE_WIDEC_SUPPORT
bool done = FALSE;
bool opt_acsc = FALSE;
bool opt_bold = FALSE;
- bool opt_wide = FALSE;
+ bool opt_revs = FALSE;
bool opt_nums = FALSE;
+ bool opt_wide = FALSE;
WINDOW *helpwin;
- if (pairs_max > COLOR_PAIRS)
- pairs_max = COLOR_PAIRS;
+ if (COLORS * COLORS == COLOR_PAIRS) {
+ int limit = (COLORS - min_colors) * (COLORS - min_colors);
+ if (pairs_max > limit)
+ pairs_max = limit;
+ } else {
+ if (pairs_max > COLOR_PAIRS)
+ pairs_max = COLOR_PAIRS;
+ }
while (!done) {
int shown = 0;
hello = "Hello";
per_row = 8;
}
+ per_row -= min_colors;
row_limit = (pairs_max + per_row - 1) / per_row;
move(0, 0);
- (void) printw("There are %d color pairs and %d colors\n",
- pairs_max, COLORS);
+ (void) printw("There are %d color pairs and %d colors%s\n",
+ pairs_max, COLORS,
+ min_colors ? " besides 'default'" : "");
clrtobot();
(void) mvprintw(top + 1, 0,
/* show color names/numbers across the top */
for (i = 0; i < per_row; i++)
- show_color_name(top + 2, (i + 1) * width, i, opt_wide);
+ show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide);
/* show a grid of colors, with color names/ numbers on the left */
for (i = (short) (base_row * per_row); i < pairs_max; i++) {
int col = (i % per_row + 1) * width;
short pair = i;
+#define InxToFG(i) (short) ((i % (COLORS - min_colors)) + min_colors)
+#define InxToBG(i) (short) ((i / (COLORS - min_colors)) + min_colors)
if (row >= 0 && move(row, col) != ERR) {
- short fg = (short) (i % COLORS);
- short bg = (short) (i / COLORS);
+ short fg = InxToFG(i);
+ short bg = InxToBG(i);
init_pair(pair, fg, bg);
attron((attr_t) COLOR_PAIR(pair));
attron((attr_t) A_ALTCHARSET);
if (opt_bold)
attron((attr_t) A_BOLD);
+ if (opt_revs)
+ attron((attr_t) A_REVERSE);
if (opt_nums) {
sprintf(numbered, "{%02X}", i);
printw("%-*.*s", width, width, hello);
attrset(A_NORMAL);
- if ((i % per_row) == 0 && (i % COLORS) == 0) {
- show_color_name(row, 0, i / COLORS, opt_wide);
+ if ((i % per_row) == 0 && InxToFG(i) == min_colors) {
+ show_color_name(row, 0, InxToBG(i), opt_wide);
}
++shown;
} else if (shown) {
case 'N':
opt_nums = TRUE;
break;
+ case 'r':
+ opt_revs = FALSE;
+ break;
+ case 'R':
+ opt_revs = TRUE;
+ break;
case case_QUIT:
done = TRUE;
continue;
int base_row = 0;
int grid_top = top + 3;
int page_size = (LINES - grid_top);
- int pairs_max = COLOR_PAIRS;
+ int pairs_max = (unsigned short) (-1);
int row_limit;
int per_row;
char numbered[80];
bool done = FALSE;
bool opt_acsc = FALSE;
bool opt_bold = FALSE;
+ bool opt_revs = FALSE;
bool opt_wide = FALSE;
bool opt_nums = FALSE;
bool opt_xchr = FALSE;
wchar_t buffer[10];
WINDOW *helpwin;
+ if (COLORS * COLORS == COLOR_PAIRS) {
+ int limit = (COLORS - min_colors) * (COLORS - min_colors);
+ if (pairs_max > limit)
+ pairs_max = limit;
+ } else {
+ if (pairs_max > COLOR_PAIRS)
+ pairs_max = COLOR_PAIRS;
+ }
+
while (!done) {
int shown = 0;
hello = "Hello";
per_row = 8;
}
+ per_row -= min_colors;
+
if (opt_xchr) {
make_fullwidth_text(buffer, hello);
width *= 2;
row_limit = (pairs_max + per_row - 1) / per_row;
move(0, 0);
- (void) printw("There are %d color pairs and %d colors\n",
- pairs_max, COLORS);
+ (void) printw("There are %d color pairs and %d colors%s\n",
+ pairs_max, COLORS,
+ min_colors ? " besides 'default'" : "");
clrtobot();
(void) mvprintw(top + 1, 0,
/* show color names/numbers across the top */
for (i = 0; i < per_row; i++)
- show_color_name(top + 2, (i + 1) * width, i, opt_wide);
+ show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide);
/* show a grid of colors, with color names/ numbers on the left */
for (i = (base_row * per_row); i < pairs_max; i++) {
short pair = (short) i;
if (row >= 0 && move(row, col) != ERR) {
- init_pair(pair, (short) (i % COLORS), (short) (i / COLORS));
+ init_pair(pair, InxToFG(i), InxToBG(i));
color_set(pair, NULL);
if (opt_acsc)
attr_on((attr_t) A_ALTCHARSET, NULL);
if (opt_bold)
attr_on((attr_t) A_BOLD, NULL);
+ if (opt_revs)
+ attr_on((attr_t) A_REVERSE, NULL);
if (opt_nums) {
sprintf(numbered, "{%02X}", i);
addnwstr(buffer, width);
attr_set(A_NORMAL, 0, NULL);
- if ((i % per_row) == 0 && (i % COLORS) == 0) {
- show_color_name(row, 0, i / COLORS, opt_wide);
+ if ((i % per_row) == 0 && InxToFG(i) == min_colors) {
+ show_color_name(row, 0, InxToBG(i), opt_wide);
}
++shown;
} else if (shown) {
case 'N':
opt_nums = TRUE;
break;
+ case 'r':
+ opt_revs = FALSE;
+ break;
+ case 'R':
+ opt_revs = TRUE;
+ break;
case case_QUIT:
done = TRUE;
continue;