-/* $OpenBSD: lib_color.c,v 1.6 2000/03/10 01:35:02 millert Exp $ */
+/* $OpenBSD: lib_color.c,v 1.7 2000/03/26 16:45:03 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
#include <term.h>
#include <tic.h>
-MODULE_ID("$From: lib_color.c,v 1.45 2000/02/27 00:20:31 tom Exp $")
+MODULE_ID("$From: lib_color.c,v 1.49 2000/03/26 03:12:12 tom Exp $")
/*
* These should be screen structure members. They need to be globals for
/* *INDENT-ON* */
#ifdef NCURSES_EXT_FUNCS
+/*
+ * These are called from _nc_do_color(), which in turn is called from
+ * vidattr - so we have to assume that SP may be null.
+ */
static int
default_fg(void)
{
- return (SP->_default_fg != C_MASK) ? SP->_default_fg : COLOR_WHITE;
+ return (SP != 0) ? SP->_default_fg : COLOR_WHITE;
}
static int
default_bg(void)
{
- return (SP->_default_bg != C_MASK) ? SP->_default_bg : COLOR_BLACK;
+ return SP != 0 ? SP->_default_bg : COLOR_BLACK;
}
#else
#define default_fg() COLOR_WHITE
T((T_CALLED("init_pair(%d,%d,%d)"), pair, f, b));
- if ((pair < 1) || (pair >= COLOR_PAIRS))
+ if ((pair < 0) || (pair >= COLOR_PAIRS))
returnCode(ERR);
#ifdef NCURSES_EXT_FUNCS
if (SP->_default_color) {
returnCode(ERR);
} else
#endif
+ {
if ((f < 0) || (f >= COLORS)
- || (b < 0) || (b >= COLORS))
- returnCode(ERR);
+ || (b < 0) || (b >= COLORS)
+ || (pair < 1))
+ returnCode(ERR);
+ }
/*
* When a pair's content is changed, replace its colors (if pair was
}
}
SP->_color_pairs[pair] = result;
+ if ((int)(SP->_current_attr & A_COLOR) == COLOR_PAIR(pair))
+ SP->_current_attr |= A_COLOR; /* force attribute update */
if (initialize_pair) {
const color_t *tp = hue_lightness_saturation ? hls_palette : cga_palette;
}
void
-_nc_do_color(int pair, bool reverse, int (*outc) (int))
+_nc_do_color(int old_pair, int pair, bool reverse, int (*outc) (int))
{
- short fg, bg;
+ short fg = C_MASK, bg = C_MASK;
+ short old_fg, old_bg;
- if (pair == 0) {
- if (
-#ifdef NCURSES_EXT_FUNCS
- !SP->_default_color ||
-#endif
- !set_original_colors()) {
- fg = default_fg();
- bg = default_bg();
- } else {
- fg = C_MASK;
- bg = C_MASK;
- }
- } else {
+ if (pair != 0) {
if (set_color_pair) {
TPUTS_TRACE("set_color_pair");
tputs(tparm(set_color_pair, pair), 1, outc);
return;
- } else {
+ } else if (SP != 0) {
pair_content(pair, &fg, &bg);
-#ifdef NCURSES_EXT_FUNCS
- if (SP->_default_color) {
- if (fg == C_MASK)
- fg = SP->_default_fg;
- if (bg == C_MASK)
- bg = SP->_default_bg;
- }
-#endif
}
}
- if (fg == C_MASK || bg == C_MASK) {
- if (set_original_colors() != TRUE) {
- if (fg == C_MASK)
- fg = default_fg();
- if (bg == C_MASK)
- bg = default_bg();
+ if (old_pair >= 0 && SP != 0) {
+ pair_content(old_pair, &old_fg, &old_bg);
+ if ((fg == C_MASK && old_fg != C_MASK)
+ || (bg == C_MASK && old_bg != C_MASK)) {
+#ifdef NCURSES_EXT_FUNCS
+ /*
+ * A minor optimization - but extension. If "AX" is specified in
+ * the terminal description, treat it as screen's indicator of ECMA
+ * SGR 39 and SGR 49, and assume the two sequences are independent.
+ */
+ if (SP->_has_sgr_39_49 && old_bg == C_MASK && old_fg != C_MASK) {
+ tputs("\033[39m", 1, outc);
+ } else if (SP->_has_sgr_39_49 && old_fg == C_MASK && old_bg != C_MASK) {
+ tputs("\033[49m", 1, outc);
+ } else
+#endif
+ set_original_colors();
}
+ } else {
+ set_original_colors();
+ if (old_pair < 0)
+ return;
}
+#ifdef NCURSES_EXT_FUNCS
+ if (fg == C_MASK)
+ fg = default_fg();
+ if (bg == C_MASK)
+ bg = default_bg();
+#endif
+
if (reverse) {
short xx = fg;
fg = bg;
-/* $OpenBSD: lib_dft_fgbg.c,v 1.3 2000/03/10 01:35:02 millert Exp $ */
+/* $OpenBSD: lib_dft_fgbg.c,v 1.4 2000/03/26 16:45:03 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
#include <curses.priv.h>
#include <term.h>
-MODULE_ID("$From: lib_dft_fgbg.c,v 1.8 2000/02/19 23:57:40 tom Exp $")
+MODULE_ID("$From: lib_dft_fgbg.c,v 1.10 2000/03/26 03:08:53 Alexander.V.Lukyanov Exp $")
/*
* Modify the behavior of color-pair 0 so that the library doesn't assume that
returnCode(ERR);
SP->_default_color = (fg != COLOR_WHITE) || (bg != COLOR_BLACK);
+ SP->_has_sgr_39_49 = tigetflag("AX");
SP->_default_fg = (fg >= 0) ? (fg & C_MASK) : C_MASK;
SP->_default_bg = (bg >= 0) ? (bg & C_MASK) : C_MASK;
if (SP->_color_pairs != 0)
- SP->_color_pairs[0] = PAIR_OF(fg, bg);
+ init_pair(0, fg, bg);
returnCode(OK);
}
-/* $OpenBSD: lib_mouse.c,v 1.8 2000/03/10 01:35:02 millert Exp $ */
+/* $OpenBSD: lib_mouse.c,v 1.9 2000/03/26 16:45:03 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
#endif
#endif
-MODULE_ID("$From: lib_mouse.c,v 1.50 2000/02/13 00:59:39 tom Exp $")
+MODULE_ID("$From: lib_mouse.c,v 1.51 2000/03/18 22:11:42 tom Exp $")
#define MY_TRACE TRACE_ICALLS|TRACE_IEVENT
static void
initialize_mousetype(void)
{
- static char *xterm_kmous = "\033[M";
+ static const char *xterm_kmous = "\033[M";
/* Try gpm first, because gpm may be configured to run in xterm */
#if USE_GPM_SUPPORT
-/* $OpenBSD: lib_set_term.c,v 1.7 2000/03/10 01:35:02 millert Exp $ */
+/* $OpenBSD: lib_set_term.c,v 1.8 2000/03/26 16:45:03 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
#include <term.h> /* cur_term */
#include <tic.h>
-MODULE_ID("$From: lib_set_term.c,v 1.50 2000/02/13 00:59:39 tom Exp $")
+MODULE_ID("$From: lib_set_term.c,v 1.51 2000/03/26 01:03:36 tom Exp $")
SCREEN *
set_term(SCREEN * screenp)
SP->_no_padding = getenv("NCURSES_NO_PADDING") != 0;
#endif
#ifdef NCURSES_EXT_FUNCS
+ SP->_default_color = FALSE;
+ SP->_has_sgr_39_49 = FALSE;
SP->_default_fg = COLOR_WHITE;
SP->_default_bg = COLOR_BLACK;
#endif
-/* $OpenBSD: curses.h,v 1.48 2000/03/13 23:53:38 millert Exp $ */
+/* $OpenBSD: curses.h,v 1.49 2000/03/26 16:45:02 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 20000311
+#define NCURSES_VERSION_PATCH 20000325
/* This is defined in more than one ncurses header, for identification */
#undef NCURSES_VERSION
-/* $OpenBSD: curses.priv.h,v 1.25 2000/03/10 01:35:01 millert Exp $ */
+/* $OpenBSD: curses.priv.h,v 1.26 2000/03/26 16:45:03 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
/*
- * $From: curses.priv.h,v 1.153 2000/02/19 23:31:39 tom Exp $
+ * $From: curses.priv.h,v 1.157 2000/03/26 01:01:14 tom Exp $
*
* curses.priv.h
*
unsigned short *_color_pairs; /* screen's color pair list */
int _pair_count; /* count of color pairs */
#ifdef NCURSES_EXT_FUNCS
- int _default_color; /* use default colors */
+ 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 */
#endif
vidattr(AttrOf(c))
#endif
-#ifdef NCURSES_EXPANDED
+#if defined(NCURSES_EXPANDED) && defined(NCURSES_EXT_FUNCS)
#undef toggle_attr_on
#define toggle_attr_on(S,at) _nc_toggle_attr_on(&(S), at)
extern char * _nc_printf_string(const char *fmt, va_list ap);
/* tries.c */
-extern void _nc_add_to_try(struct tries **tree, char *str, unsigned short code);
+extern void _nc_add_to_try(struct tries **tree, const char *str, unsigned short code);
extern char *_nc_expand_try(struct tries *tree, unsigned short code, int *count, size_t len);
extern int _nc_remove_key(struct tries **tree, unsigned short code);
extern int _nc_remove_string(struct tries **tree, char *string);
extern int _nc_setupscreen(short, short const, FILE *);
extern int _nc_timed_wait(int, int, int *);
extern int _nc_waddch_nosync(WINDOW *, const chtype);
-extern void _nc_do_color(int, bool, int (*)(int));
+extern void _nc_do_color(int, int, bool, int (*)(int));
extern void _nc_freeall(void);
extern void _nc_freewin(WINDOW *win);
extern void _nc_hash_map(void);
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
<!--
- $From: hackguide.html,v 1.24 2000/03/05 01:19:41 tom Exp $
+ $From: hackguide.html,v 1.25 2000/03/25 18:45:21 tom Exp $
-->
<HTML>
<HEAD>
<OL>
<LI>Develop a recipe to reproduce the bug.
-
+<p>
Bugs we can reproduce are likely to be fixed very quickly, often
within days. The most effective single thing you can do to get a
quick fix is develop a way we can duplicate the bad behavior --
major=7
-minor=0
+minor=1
-/* $OpenBSD: term_entry.h,v 1.9 2000/03/13 23:53:39 millert Exp $ */
+/* $OpenBSD: term_entry.h,v 1.10 2000/03/26 16:45:03 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
****************************************************************************/
-/* $From: term_entry.h,v 1.28 2000/03/12 00:44:04 tom Exp $ */
+/* $From: term_entry.h,v 1.29 2000/03/19 02:04:15 tom Exp $ */
/*
* term_entry.h -- interface to entry-manipulation code
/* parse_entry.c: entry-parsing code */
#if NCURSES_XNAMES
extern bool _nc_user_definable;
+extern bool _nc_disable_period;
#endif
extern int _nc_parse_entry(ENTRY *, int, bool);
extern int _nc_capcmp(const char *, const char *);
-/* $OpenBSD: tic.h,v 1.8 2000/01/16 01:35:17 millert Exp $ */
+/* $OpenBSD: tic.h,v 1.9 2000/03/26 16:45:03 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998-2000 Free Software Foundation, Inc. *
extern char *_nc_tic_expand(const char *, bool, int);
/* comp_scan.c: decode string from readable form */
-extern char _nc_trans_string(char *);
+extern char _nc_trans_string(char *, char *);
/* captoinfo.c: capability conversion */
extern char *_nc_captoinfo(const char *, const char *, int const);
-/* $OpenBSD: add_tries.c,v 1.1 1999/01/18 19:10:12 millert Exp $ */
+/* $OpenBSD: add_tries.c,v 1.2 2000/03/26 16:45:03 millert Exp $ */
/****************************************************************************
- * 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 *
#include <curses.priv.h>
-MODULE_ID("$From: add_tries.c,v 1.1 1998/11/08 00:04:18 tom Exp $")
+MODULE_ID("$From: add_tries.c,v 1.2 2000/03/18 22:23:56 tom Exp $")
#define SET_TRY(dst,src) if ((dst->ch = *src++) == 128) dst->ch = '\0'
#define CMP_TRY(a,b) ((a)? (a == b) : (b == 128))
-void _nc_add_to_try(struct tries **tree, char *str, unsigned short code)
+void
+_nc_add_to_try(struct tries **tree, const char *str, unsigned short code)
{
- static bool out_of_memory = FALSE;
- struct tries *ptr, *savedptr;
- unsigned char *txt = (unsigned char *)str;
-
- if (txt == 0 || *txt == '\0' || out_of_memory || code == 0)
- return;
-
- if ((*tree) != 0) {
- ptr = savedptr = (*tree);
-
- for (;;) {
- unsigned char cmp = *txt;
-
- while (!CMP_TRY(ptr->ch, cmp)
- && ptr->sibling != 0)
- ptr = ptr->sibling;
-
- if (CMP_TRY(ptr->ch, cmp)) {
- if (*(++txt) == '\0') {
- ptr->value = code;
- return;
- }
- if (ptr->child != 0)
- ptr = ptr->child;
- else
- break;
- } else {
- if ((ptr->sibling = typeCalloc(struct tries,1)) == 0) {
- out_of_memory = TRUE;
- return;
- }
-
- savedptr = ptr = ptr->sibling;
- SET_TRY(ptr,txt);
- ptr->value = 0;
-
- break;
- }
- } /* end for (;;) */
- } else { /* (*tree) == 0 :: First sequence to be added */
- savedptr = ptr = (*tree) = typeCalloc(struct tries,1);
-
- if (ptr == 0) {
- out_of_memory = TRUE;
- return;
+ static bool out_of_memory = FALSE;
+ struct tries *ptr, *savedptr;
+ unsigned const char *txt = (unsigned const char *) str;
+
+ if (txt == 0 || *txt == '\0' || out_of_memory || code == 0)
+ return;
+
+ if ((*tree) != 0) {
+ ptr = savedptr = (*tree);
+
+ for (;;) {
+ unsigned char cmp = *txt;
+
+ while (!CMP_TRY(ptr->ch, cmp)
+ && ptr->sibling != 0)
+ ptr = ptr->sibling;
+
+ if (CMP_TRY(ptr->ch, cmp)) {
+ if (*(++txt) == '\0') {
+ ptr->value = code;
+ return;
+ }
+ if (ptr->child != 0)
+ ptr = ptr->child;
+ else
+ break;
+ } else {
+ if ((ptr->sibling = typeCalloc(struct tries, 1)) == 0) {
+ out_of_memory = TRUE;
+ return;
}
- SET_TRY(ptr,txt);
+ savedptr = ptr = ptr->sibling;
+ SET_TRY(ptr, txt);
ptr->value = 0;
+
+ break;
+ }
+ } /* end for (;;) */
+ } else { /* (*tree) == 0 :: First sequence to be added */
+ savedptr = ptr = (*tree) = typeCalloc(struct tries, 1);
+
+ if (ptr == 0) {
+ out_of_memory = TRUE;
+ return;
}
- /* at this point, we are adding to the try. ptr->child == 0 */
+ SET_TRY(ptr, txt);
+ ptr->value = 0;
+ }
- while (*txt) {
- ptr->child = typeCalloc(struct tries,1);
+ /* at this point, we are adding to the try. ptr->child == 0 */
- ptr = ptr->child;
+ while (*txt) {
+ ptr->child = typeCalloc(struct tries, 1);
- if (ptr == 0) {
- out_of_memory = TRUE;
+ ptr = ptr->child;
- while ((ptr = savedptr) != 0) {
- savedptr = ptr->child;
- free(ptr);
- }
+ if (ptr == 0) {
+ out_of_memory = TRUE;
- return;
- }
+ while ((ptr = savedptr) != 0) {
+ savedptr = ptr->child;
+ free(ptr);
+ }
- SET_TRY(ptr,txt);
- ptr->value = 0;
+ return;
}
- ptr->value = code;
- return;
+ SET_TRY(ptr, txt);
+ ptr->value = 0;
+ }
+
+ ptr->value = code;
+ return;
}
-/* $OpenBSD: alloc_ttype.c,v 1.2 1999/05/08 20:29:00 millert Exp $ */
+/* $OpenBSD: alloc_ttype.c,v 1.3 2000/03/26 16:45:03 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 *
* Author: Thomas E. Dickey <dickey@clark.net> 1999 *
****************************************************************************/
-
/*
* align_ttype.c -- functions for TERMTYPE
*
#include <tic.h>
#include <term_entry.h>
-MODULE_ID("$From: alloc_ttype.c,v 1.6 1999/03/01 22:10:44 tom Exp $")
+MODULE_ID("$From: alloc_ttype.c,v 1.8 2000/03/25 17:03:11 tom Exp $")
#if NCURSES_XNAMES
/*
* Merge the a/b lists into dst. Both a/b are sorted (see _nc_extend_names()),
* so we do not have to worry about order dependencies.
*/
-static int merge_names(char **dst, char **a, int na, char **b, int nb)
+static int
+merge_names(char **dst, char **a, int na, char **b, int nb)
{
int n = 0;
while (na && nb) {
return n;
}
-static bool find_name(char **table, int length, char *name)
+static bool
+find_name(char **table, int length, char *name)
{
while (length-- > 0) {
if (!strcmp(*table++, name)) {
return FALSE;
}
-static void realign_data(TERMTYPE *to, char **ext_Names, int ext_Booleans, int ext_Numbers, int ext_Strings)
+static void
+realign_data(TERMTYPE * to, char **ext_Names, int ext_Booleans, int
+ ext_Numbers, int ext_Strings)
{
int n, m, base;
int limit = (to->ext_Booleans + to->ext_Numbers + to->ext_Strings);
if (to->ext_Booleans != ext_Booleans) {
to->num_Booleans += (ext_Booleans - to->ext_Booleans);
to->Booleans = typeRealloc(char, to->num_Booleans, to->Booleans);
- for (n = to->ext_Booleans-1,
- m = ext_Booleans-1,
- base = to->num_Booleans - (m+1); m >= 0; m--) {
+ for (n = to->ext_Booleans - 1,
+ m = ext_Booleans - 1,
+ base = to->num_Booleans - (m + 1); m >= 0; m--) {
if (find_name(to->ext_Names, limit, ext_Names[m])) {
to->Booleans[base + m] = to->Booleans[base + n--];
} else {
if (to->ext_Numbers != ext_Numbers) {
to->num_Numbers += (ext_Numbers - to->ext_Numbers);
to->Numbers = typeRealloc(short, to->num_Numbers, to->Numbers);
- for (n = to->ext_Numbers-1,
- m = ext_Numbers-1,
- base = to->num_Numbers - (m+1); m >= 0; m--) {
- if (find_name(to->ext_Names, limit, ext_Names[m+ext_Booleans])) {
+ for (n = to->ext_Numbers - 1,
+ m = ext_Numbers - 1,
+ base = to->num_Numbers - (m + 1); m >= 0; m--) {
+ if (find_name(to->ext_Names, limit, ext_Names[m + ext_Booleans])) {
to->Numbers[base + m] = to->Numbers[base + n--];
} else {
to->Numbers[base + m] = ABSENT_NUMERIC;
}
}
- to->ext_Numbers = ext_Numbers;
+ to->ext_Numbers = ext_Numbers;
}
if (to->ext_Strings != ext_Strings) {
to->num_Strings += (ext_Strings - to->ext_Strings);
- to->Strings = typeRealloc(char*, to->num_Strings, to->Strings);
- for (n = to->ext_Strings-1,
- m = ext_Strings-1,
- base = to->num_Strings - (m+1); m >= 0; m--) {
- if (find_name(to->ext_Names, limit, ext_Names[m+ext_Booleans+ext_Numbers])) {
+ to->Strings = typeRealloc(char *, to->num_Strings, to->Strings);
+ for (n = to->ext_Strings - 1,
+ m = ext_Strings - 1,
+ base = to->num_Strings - (m + 1); m >= 0; m--) {
+ if (find_name(to->ext_Names, limit, ext_Names[m + ext_Booleans + ext_Numbers])) {
to->Strings[base + m] = to->Strings[base + n--];
} else {
to->Strings[base + m] = ABSENT_STRING;
/*
* Returns the first index in ext_Names[] for the given token-type
*/
-static int _nc_first_ext_name(TERMTYPE *tp, int token_type)
+static int
+_nc_first_ext_name(TERMTYPE * tp, int token_type)
{
int first;
/*
* Returns the last index in ext_Names[] for the given token-type
*/
-static int _nc_last_ext_name(TERMTYPE *tp, int token_type)
+static int
+_nc_last_ext_name(TERMTYPE * tp, int token_type)
{
int last;
switch (token_type) {
case BOOLEAN:
- last = tp->ext_Booleans;
+ last = tp->ext_Booleans;
break;
case NUMBER:
- last = tp->ext_Booleans + tp->ext_Numbers;
+ last = tp->ext_Booleans + tp->ext_Numbers;
break;
default:
case STRING:
- last = NUM_EXT_NAMES(tp);
+ last = NUM_EXT_NAMES(tp);
break;
}
return last;
/*
* Lookup an entry from extended-names, returning -1 if not found
*/
-static int _nc_find_ext_name(TERMTYPE *tp, char *name, int token_type)
+static int
+_nc_find_ext_name(TERMTYPE * tp, char *name, int token_type)
{
unsigned j;
unsigned first = _nc_first_ext_name(tp, token_type);
- unsigned last = _nc_last_ext_name(tp, token_type);
+ unsigned last = _nc_last_ext_name(tp, token_type);
for (j = first; j < last; j++) {
if (!strcmp(name, tp->ext_Names[j])) {
* Translate an index into ext_Names[] into the corresponding index into data
* (e.g., Booleans[]).
*/
-static int _nc_ext_data_index(TERMTYPE *tp, int n, int token_type)
+static int
+_nc_ext_data_index(TERMTYPE * tp, int n, int token_type)
{
switch (token_type) {
case BOOLEAN:
break;
case NUMBER:
n += (tp->num_Numbers - tp->ext_Numbers)
- - (tp->ext_Booleans);
+ - (tp->ext_Booleans);
break;
default:
case STRING:
n += (tp->num_Strings - tp->ext_Strings)
- - (tp->ext_Booleans + tp->ext_Numbers);
+ - (tp->ext_Booleans + tp->ext_Numbers);
}
return n;
}
* Adjust tables to remove (not free) an extended name and its corresponding
* data.
*/
-static void _nc_del_ext_name(TERMTYPE *tp, char *name, int token_type)
+static void
+_nc_del_ext_name(TERMTYPE * tp, char *name, int token_type)
{
int j;
int first, last;
if ((first = _nc_find_ext_name(tp, name, token_type)) >= 0) {
last = NUM_EXT_NAMES(tp) - 1;
for (j = first; j < last; j++) {
- tp->ext_Names[j] = tp->ext_Names[j+1];
+ tp->ext_Names[j] = tp->ext_Names[j + 1];
}
first = _nc_ext_data_index(tp, first, token_type);
switch (token_type) {
case BOOLEAN:
last = tp->num_Booleans - 1;
for (j = first; j < last; j++)
- tp->Booleans[j] = tp->Booleans[j+1];
+ tp->Booleans[j] = tp->Booleans[j + 1];
tp->ext_Booleans -= 1;
tp->num_Booleans -= 1;
break;
case NUMBER:
last = tp->num_Numbers - 1;
for (j = first; j < last; j++)
- tp->Numbers[j] = tp->Numbers[j+1];
+ tp->Numbers[j] = tp->Numbers[j + 1];
tp->ext_Numbers -= 1;
tp->num_Numbers -= 1;
break;
case STRING:
last = tp->num_Strings - 1;
for (j = first; j < last; j++)
- tp->Strings[j] = tp->Strings[j+1];
+ tp->Strings[j] = tp->Strings[j + 1];
tp->ext_Strings -= 1;
tp->num_Strings -= 1;
break;
* Adjust tables to insert an extended name, making room for new data. The
* index into the corresponding data array is returned.
*/
-static int _nc_ins_ext_name(TERMTYPE *tp, char *name, int token_type)
+static int
+_nc_ins_ext_name(TERMTYPE * tp, char *name, int token_type)
{
unsigned first = _nc_first_ext_name(tp, token_type);
- unsigned last = _nc_last_ext_name(tp, token_type);
+ unsigned last = _nc_last_ext_name(tp, token_type);
unsigned total = NUM_EXT_NAMES(tp) + 1;
unsigned j, k;
}
tp->ext_Names = typeRealloc(char *, total, tp->ext_Names);
- for (k = total-1; k > j; k--)
- tp->ext_Names[k] = tp->ext_Names[k-1];
+ for (k = total - 1; k > j; k--)
+ tp->ext_Names[k] = tp->ext_Names[k - 1];
tp->ext_Names[j] = name;
j = _nc_ext_data_index(tp, j, token_type);
tp->ext_Booleans += 1;
tp->num_Booleans += 1;
tp->Booleans = typeRealloc(char, tp->num_Booleans, tp->Booleans);
- for (k = tp->num_Booleans-1; k > j; k--)
- tp->Booleans[k] = tp->Booleans[k-1];
+ for (k = tp->num_Booleans - 1; k > j; k--)
+ tp->Booleans[k] = tp->Booleans[k - 1];
break;
case NUMBER:
tp->ext_Numbers += 1;
tp->num_Numbers += 1;
tp->Numbers = typeRealloc(short, tp->num_Numbers, tp->Numbers);
- for (k = tp->num_Numbers-1; k > j; k--)
- tp->Numbers[k] = tp->Numbers[k-1];
+ for (k = tp->num_Numbers - 1; k > j; k--)
+ tp->Numbers[k] = tp->Numbers[k - 1];
break;
case STRING:
tp->ext_Strings += 1;
tp->num_Strings += 1;
tp->Strings = typeRealloc(char *, tp->num_Strings, tp->Strings);
- for (k = tp->num_Strings-1; k > j; k--)
- tp->Strings[k] = tp->Strings[k-1];
+ for (k = tp->num_Strings - 1; k > j; k--)
+ tp->Strings[k] = tp->Strings[k - 1];
break;
}
return j;
* as a boolean or number. We'll get this as a special case when we get a
* cancellation of a name that is inherited from another entry.
*/
-static void adjust_cancels(TERMTYPE *to, TERMTYPE *from)
+static void
+adjust_cancels(TERMTYPE * to, TERMTYPE * from)
{
int first = to->ext_Booleans + to->ext_Numbers;
- int last = first + to->ext_Strings;
+ int last = first + to->ext_Strings;
int j, k;
- for (j = first; j < last; ) {
+ for (j = first; j < last;) {
char *name = to->ext_Names[j];
unsigned j_str = to->num_Strings - first - to->ext_Strings;
_nc_del_ext_name(to, name, STRING);
k = _nc_ins_ext_name(to, name, BOOLEAN);
to->Booleans[k] = FALSE;
- } else if ((k = _nc_find_ext_name(from, to->ext_Names[j], NUMBER)) >= 0) {
+ } else if ((k = _nc_find_ext_name(from, to->ext_Names[j],
+ NUMBER)) >= 0) {
_nc_del_ext_name(to, name, STRING);
k = _nc_ins_ext_name(to, name, NUMBER);
to->Numbers[k] = CANCELLED_NUMERIC;
}
}
-void _nc_align_termtype(TERMTYPE *to, TERMTYPE *from)
+void
+_nc_align_termtype(TERMTYPE * to, TERMTYPE * from)
{
int na = NUM_EXT_NAMES(to);
int nb = NUM_EXT_NAMES(from);
char **ext_Names;
int ext_Booleans, ext_Numbers, ext_Strings;
- DEBUG(2, ("align_termtype to(%d:%s), from(%d:%s)", na, to->term_names, nb, from->term_names));
+ DEBUG(2, ("align_termtype to(%d:%s), from(%d:%s)", na, to->term_names,
+ nb, from->term_names));
if (na != 0 || nb != 0) {
if ((na == nb) /* check if the arrays are equivalent */
- && (to->ext_Booleans == from->ext_Booleans)
- && (to->ext_Numbers == from->ext_Numbers)
- && (to->ext_Strings == from->ext_Strings)) {
+ &&(to->ext_Booleans == from->ext_Booleans)
+ && (to->ext_Numbers == from->ext_Numbers)
+ && (to->ext_Strings == from->ext_Strings)) {
for (n = 0, same = TRUE; n < na; n++) {
if (strcmp(to->ext_Names[n], from->ext_Names[n])) {
same = FALSE;
* into it, updating to's counts for booleans, etc. Fortunately we do
* this only for the terminfo compiler (tic) and comparer (infocmp).
*/
- ext_Names = typeMalloc(char *, na+nb);
+ ext_Names = typeMalloc(char *, na + nb);
if (to->ext_Strings && (from->ext_Booleans + from->ext_Numbers))
adjust_cancels(to, from);
adjust_cancels(from, to);
ext_Booleans = merge_names(ext_Names,
- to->ext_Names,
- to->ext_Booleans,
- from->ext_Names,
- from->ext_Booleans);
- ext_Numbers = merge_names(ext_Names + ext_Booleans,
- to->ext_Names
- + to->ext_Booleans,
- to->ext_Numbers,
- from->ext_Names
- + from->ext_Booleans,
- from->ext_Numbers);
- ext_Strings = merge_names(ext_Names + ext_Numbers + ext_Booleans,
- to->ext_Names
- + to->ext_Booleans
- + to->ext_Numbers,
- to->ext_Strings,
- from->ext_Names
- + from->ext_Booleans
- + from->ext_Numbers,
- from->ext_Strings);
+ to->ext_Names,
+ to->ext_Booleans,
+ from->ext_Names,
+ from->ext_Booleans);
+ ext_Numbers = merge_names(ext_Names + ext_Booleans,
+ to->ext_Names
+ + to->ext_Booleans,
+ to->ext_Numbers,
+ from->ext_Names
+ + from->ext_Booleans,
+ from->ext_Numbers);
+ ext_Strings = merge_names(ext_Names + ext_Numbers + ext_Booleans,
+ to->ext_Names
+ + to->ext_Booleans
+ + to->ext_Numbers,
+ to->ext_Strings,
+ from->ext_Names
+ + from->ext_Booleans
+ + from->ext_Numbers,
+ from->ext_Strings);
/*
* Now we must reallocate the Booleans, etc., to allow the data to be
* overlaid.
*/
if (na != (ext_Booleans + ext_Numbers + ext_Strings)) {
realign_data(to, ext_Names, ext_Booleans, ext_Numbers, ext_Strings);
- free(to->ext_Names);
+ FreeIfNeeded(to->ext_Names);
to->ext_Names = ext_Names;
- DEBUG(2, ("realigned %d extended names for '%s' (to)", NUM_EXT_NAMES(to), to->term_names));
+ DEBUG(2, ("realigned %d extended names for '%s' (to)",
+ NUM_EXT_NAMES(to), to->term_names));
}
if (nb != (ext_Booleans + ext_Numbers + ext_Strings)) {
nb = (ext_Booleans + ext_Numbers + ext_Strings);
realign_data(from, ext_Names, ext_Booleans, ext_Numbers, ext_Strings);
from->ext_Names = typeRealloc(char *, nb, from->ext_Names);
memcpy(from->ext_Names, ext_Names, sizeof(char *) * nb);
- DEBUG(2, ("realigned %d extended names for '%s' (from)", NUM_EXT_NAMES(from), from->term_names));
+ DEBUG(2, ("realigned %d extended names for '%s' (from)",
+ NUM_EXT_NAMES(from), from->term_names));
}
}
}
#endif
-void _nc_copy_termtype(TERMTYPE *dst, TERMTYPE *src)
+void
+_nc_copy_termtype(TERMTYPE * dst, TERMTYPE * src)
{
int i;
- *dst = *src; /* ...to copy the sizes and string-tables */
- dst->Booleans = typeMalloc(char, NUM_BOOLEANS(dst));
- dst->Numbers = typeMalloc(short, NUM_NUMBERS(dst));
- dst->Strings = typeMalloc(char *, NUM_STRINGS(dst));
+ *dst = *src; /* ...to copy the sizes and string-tables */
+ dst->Booleans = typeMalloc(char, NUM_BOOLEANS(dst));
+ dst->Numbers = typeMalloc(short, NUM_NUMBERS(dst));
+ dst->Strings = typeMalloc(char *, NUM_STRINGS(dst));
/* FIXME: use memcpy for these and similar loops */
- for_each_boolean(i,dst)
+ for_each_boolean(i, dst)
dst->Booleans[i] = src->Booleans[i];
- for_each_number(i,dst)
+ for_each_number(i, dst)
dst->Numbers[i] = src->Numbers[i];
- for_each_string(i,dst)
+ for_each_string(i, dst)
dst->Strings[i] = src->Strings[i];
/* FIXME: we probably should also copy str_table and ext_str_table,
if ((i = NUM_EXT_NAMES(src)) != 0) {
dst->ext_Names = typeMalloc(char *, i);
memcpy(dst->ext_Names, src->ext_Names, i * sizeof(char *));
+ } else {
+ dst->ext_Names = 0;
}
#endif
-/* $OpenBSD: captoinfo.c,v 1.6 2000/03/13 23:53:40 millert Exp $ */
+/* $OpenBSD: captoinfo.c,v 1.7 2000/03/26 16:45:03 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$From: captoinfo.c,v 1.35 2000/03/11 12:27:55 tom Exp $")
+MODULE_ID("$From: captoinfo.c,v 1.36 2000/03/19 23:04:26 tom Exp $")
#define MAX_PUSHED 16 /* max # args we can push onto the stack */
bufptr = save_char(bufptr, '%');
while (isdigit(*str))
bufptr = save_char(bufptr, *str++);
- if (strchr("doxX", *str)) {
+ if (strchr("doxX.", *str)) {
if (*str != 'd') /* termcap doesn't have octal, hex */
return 0;
- str++;
}
break;
-/* $OpenBSD: comp_parse.c,v 1.5 2000/03/13 23:53:40 millert Exp $ */
+/* $OpenBSD: comp_parse.c,v 1.6 2000/03/26 16:45:03 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
#include <tic.h>
#include <term_entry.h>
-MODULE_ID("$From: comp_parse.c,v 1.38 2000/03/12 00:14:46 tom Exp $")
+MODULE_ID("$From: comp_parse.c,v 1.39 2000/03/25 17:07:30 tom Exp $")
static void sanity_check(TERMTYPE *);
void (*_nc_check_termtype) (TERMTYPE *) = sanity_check;
if (silent)
_nc_suppress_warnings = TRUE; /* shut the lexer up, too */
- memset(&thisentry, 0, sizeof(thisentry));
- for (_nc_reset_input(fp, buf); _nc_parse_entry(&thisentry, literal,
- silent) != ERR;) {
+ _nc_reset_input(fp, buf);
+ for (;;) {
+ memset(&thisentry, 0, sizeof(thisentry));
+ if (_nc_parse_entry(&thisentry, literal, silent) == ERR)
+ break;
if (!isalnum(thisentry.tterm.term_names[0]))
_nc_err_abort("terminal names must start with letter or digit");
#include <curses.priv.h>
#include <ctype.h>
+#include <term_entry.h>
#include <tic.h>
-MODULE_ID("$From: comp_scan.c,v 1.38 2000/02/13 01:01:26 tom Exp $")
+MODULE_ID("$From: comp_scan.c,v 1.41 2000/03/25 17:25:33 tom Exp $")
/*
* Maximum length of string capability we'll accept before raising an error.
if (separator == ':' && ch == ':')
ch = next_char();
- if (ch == '.') {
+ if (ch == '.'
+#ifdef NCURSES_EXT_FUNCS
+ && !_nc_disable_period
+#endif
+ ) {
dot_flag = TRUE;
DEBUG(8, ("dot-flag set"));
}
/* have to make some punctuation chars legal for terminfo */
- if (!isalnum(ch) && !strchr(terminfo_punct, (char) ch)) {
+ if (!isalnum(ch)
+#ifdef NCURSES_EXT_FUNCS
+ && !(ch == '.' && _nc_disable_period)
+#endif
+ && !strchr(terminfo_punct, (char) ch)) {
_nc_warning("Illegal character (expected alphanumeric or %s) - %s",
terminfo_punct, _tracechar((chtype) ch));
_nc_panic_mode(separator);
break;
case '=':
- ch = _nc_trans_string(ptr);
+ ch = _nc_trans_string(ptr, buffer + sizeof(buffer));
if (ch != separator)
_nc_warning("Missing separator");
_nc_curr_token.tk_name = buffer;
*/
char
-_nc_trans_string(char *ptr)
+_nc_trans_string(char *ptr, char *last)
{
int count = 0;
int number;
int i, c;
chtype ch, last_ch = '\0';
bool ignored = FALSE;
+ bool long_warning = FALSE;
while ((ch = c = next_char()) != (chtype) separator && c != EOF) {
+ if (ptr == (last - 1))
+ break;
if ((_nc_syntax == SYN_TERMCAP) && c == '\n')
break;
if (ch == '^' && last_ch != '%') {
}
ignored = FALSE;
- if (count > MAXCAPLEN)
+ if (count > MAXCAPLEN && !long_warning) {
_nc_warning("Very long string found. Missing separator?");
+ long_warning = TRUE;
+ }
} /* end while */
*ptr = '\0';
-/* $OpenBSD: free_ttype.c,v 1.2 1999/05/08 20:29:01 millert Exp $ */
+/* $OpenBSD: free_ttype.c,v 1.3 2000/03/26 16:45:04 millert Exp $ */
/****************************************************************************
* Copyright (c) 1999 Free Software Foundation, Inc. *
#include <tic.h>
#include <term_entry.h>
-MODULE_ID("$From: free_ttype.c,v 1.2 1999/03/01 00:30:35 tom Exp $")
+MODULE_ID("$From: free_ttype.c,v 1.3 2000/03/19 02:03:07 tom Exp $")
void _nc_free_termtype(TERMTYPE *ptr)
{
#if NCURSES_XNAMES
bool _nc_user_definable = TRUE;
+bool _nc_disable_period = FALSE; /* used by tic -a option */
int use_extended_names(bool flag)
{
-/* $OpenBSD: read_termcap.c,v 1.6 2000/03/13 23:53:40 millert Exp $ */
+/* $OpenBSD: read_termcap.c,v 1.7 2000/03/26 16:45:04 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
#include <tic.h>
#include <term_entry.h>
-MODULE_ID("$From: read_termcap.c,v 1.45 2000/02/13 01:01:26 tom Exp $")
+MODULE_ID("$From: read_termcap.c,v 1.46 2000/03/18 21:53:26 tom Exp $")
#ifndef PURE_TERMINFO
-/* $OpenBSD: lib_vidattr.c,v 1.3 1999/11/28 17:49:55 millert Exp $ */
+/* $OpenBSD: lib_vidattr.c,v 1.4 2000/03/26 16:45:04 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,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 *
#include <curses.priv.h>
#include <term.h>
-MODULE_ID("$From: lib_vidattr.c,v 1.24 1999/11/14 02:53:43 tom Exp $")
+MODULE_ID("$From: lib_vidattr.c,v 1.26 2000/03/26 02:56:20 tom Exp $");
#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
/* if there is no current screen, assume we *can* do color */
#define SetColorsIf(why,old_attr) \
- if (can_color && (1)) { \
+ if (can_color && (why)) { \
int old_pair = PAIR_NUMBER(old_attr); \
T(("old pair = %d -- new pair = %d", old_pair, pair)); \
if ((pair != old_pair) \
|| (fix_pair0 && (pair == 0)) \
|| (reverse ^ ((old_attr & A_REVERSE) != 0))) { \
- _nc_do_color(pair, reverse, outc); \
+ _nc_do_color(old_pair, pair, reverse, outc); \
} \
}
-int vidputs(attr_t newmode, int (*outc)(int))
+int
+vidputs(attr_t newmode, int (*outc) (int))
{
-static attr_t previous_attr = A_NORMAL;
-attr_t turn_on, turn_off;
-int pair;
-bool reverse = FALSE;
-bool used_ncv = FALSE;
-bool can_color = (SP == 0 || SP->_coloron);
+ static attr_t previous_attr = A_NORMAL;
+ attr_t turn_on, turn_off;
+ int pair;
+ bool reverse = FALSE;
+ bool used_ncv = FALSE;
+ bool can_color = (SP == 0 || SP->_coloron);
#ifdef NCURSES_EXT_FUNCS
-bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color);
+ bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color);
#else
#define fix_pair0 FALSE
#endif
- T((T_CALLED("vidputs(%s)"), _traceattr(newmode)));
+ T((T_CALLED("vidputs(%s)"), _traceattr(newmode)));
- /* this allows us to go on whether or not newterm() has been called */
- if (SP)
- previous_attr = SP->_current_attr;
+ /* this allows us to go on whether or not newterm() has been called */
+ if (SP)
+ previous_attr = SP->_current_attr;
- T(("previous attribute was %s", _traceattr(previous_attr)));
+ T(("previous attribute was %s", _traceattr(previous_attr)));
#if !USE_XMC_SUPPORT
- if ((SP != 0)
- && (magic_cookie_glitch > 0))
- newmode &= ~(SP->_xmc_suppress);
+ if ((SP != 0)
+ && (magic_cookie_glitch > 0))
+ newmode &= ~(SP->_xmc_suppress);
#endif
- /*
- * If we have a terminal that cannot combine color with video
- * attributes, use the colors in preference.
- */
- if ((newmode & A_COLOR)
- && (no_color_video > 0)) {
- static const struct {
- attr_t video;
- unsigned bit;
- } table[] = {
- { A_STANDOUT, 1 },
- { A_UNDERLINE, 2 },
- { A_REVERSE, 4 },
- { A_BLINK, 8 },
- { A_DIM, 16 },
- { A_BOLD, 32 },
- { A_INVIS, 64 },
- { A_PROTECT, 128 },
- { A_ALTCHARSET, 256 },
- };
- size_t n;
- for (n = 0; n < SIZEOF(table); n++) {
- if ((table[n].bit & no_color_video)
- && (table[n].video & newmode)) {
- used_ncv = TRUE;
- if (table[n].video == A_REVERSE)
- reverse = TRUE;
- else
- newmode &= ~table[n].video;
- }
- }
+ /*
+ * If we have a terminal that cannot combine color with video
+ * attributes, use the colors in preference.
+ */
+ if ((newmode & A_COLOR)
+ && (no_color_video > 0)) {
+ /* *INDENT-OFF* */
+ static const struct {
+ attr_t video;
+ unsigned bit;
+ } table[] = {
+ { A_STANDOUT, 1 },
+ { A_UNDERLINE, 2 },
+ { A_REVERSE, 4 },
+ { A_BLINK, 8 },
+ { A_DIM, 16 },
+ { A_BOLD, 32 },
+ { A_INVIS, 64 },
+ { A_PROTECT, 128 },
+ { A_ALTCHARSET, 256 },
+ };
+ /* *INDENT-ON* */
+
+ size_t n;
+ for (n = 0; n < SIZEOF(table); n++) {
+ if ((table[n].bit & no_color_video)
+ && (table[n].video & newmode)) {
+ used_ncv = TRUE;
+ if (table[n].video == A_REVERSE)
+ reverse = TRUE;
+ else
+ newmode &= ~table[n].video;
+ }
}
+ }
- if (newmode == previous_attr)
- returnCode(OK);
+ if (newmode == previous_attr)
+ returnCode(OK);
+
+ pair = PAIR_NUMBER(newmode);
+
+ if (reverse) {
+ newmode &= ~A_REVERSE;
+ }
- pair = PAIR_NUMBER(newmode);
+ turn_off = (~newmode & previous_attr) & ALL_BUT_COLOR;
+ turn_on = (newmode & ~previous_attr) & ALL_BUT_COLOR;
- if (reverse) {
- newmode &= ~A_REVERSE;
+ SetColorsIf(((pair == 0) && !fix_pair0), previous_attr);
+
+ if (newmode == A_NORMAL) {
+ if ((previous_attr & A_ALTCHARSET) && exit_alt_charset_mode) {
+ doPut(exit_alt_charset_mode);
+ previous_attr &= ~A_ALTCHARSET;
+ }
+ if (previous_attr) {
+ doPut(exit_attribute_mode);
+ previous_attr &= ~A_COLOR;
}
- turn_off = (~newmode & previous_attr) & ALL_BUT_COLOR;
- turn_on = (newmode & ~previous_attr) & ALL_BUT_COLOR;
-
- SetColorsIf(pair == 0, previous_attr);
-
- if (newmode == A_NORMAL) {
- if((previous_attr & A_ALTCHARSET) && exit_alt_charset_mode) {
- doPut(exit_alt_charset_mode);
- previous_attr &= ~A_ALTCHARSET;
- }
- if (previous_attr) {
- doPut(exit_attribute_mode);
- if (fix_pair0) _nc_do_color(0, FALSE, _nc_outch);
- previous_attr &= ~A_COLOR;
- }
-
- SetColorsIf(pair != 0, previous_attr);
- } else if (set_attributes && !used_ncv) {
- if (turn_on || turn_off) {
- TPUTS_TRACE("set_attributes");
- tputs(tparm(set_attributes,
- (newmode & A_STANDOUT) != 0,
- (newmode & A_UNDERLINE) != 0,
- (newmode & A_REVERSE) != 0,
- (newmode & A_BLINK) != 0,
- (newmode & A_DIM) != 0,
- (newmode & A_BOLD) != 0,
- (newmode & A_INVIS) != 0,
- (newmode & A_PROTECT) != 0,
- (newmode & A_ALTCHARSET) != 0), 1, outc);
- previous_attr &= ~A_COLOR;
- }
- SetColorsIf(pair != 0, previous_attr);
- } else {
-
- T(("turning %s off", _traceattr(turn_off)));
-
- TurnOff(A_ALTCHARSET, exit_alt_charset_mode);
-
- if (!SP || SP->_use_rmul) {
- TurnOff(A_UNDERLINE, exit_underline_mode);
- }
-
- if (!SP || SP->_use_rmso) {
- TurnOff(A_STANDOUT, exit_standout_mode);
- }
-
- if (turn_off && exit_attribute_mode) {
- doPut(exit_attribute_mode);
- if (fix_pair0) _nc_do_color(0, FALSE, _nc_outch);
- turn_on |= (newmode & (chtype)(~A_COLOR));
- previous_attr &= ~A_COLOR;
- }
- SetColorsIf(pair != 0, previous_attr);
-
- T(("turning %s on", _traceattr(turn_on)));
-
- TurnOn (A_ALTCHARSET, enter_alt_charset_mode);
- TurnOn (A_BLINK, enter_blink_mode);
- TurnOn (A_BOLD, enter_bold_mode);
- TurnOn (A_DIM, enter_dim_mode);
- TurnOn (A_REVERSE, enter_reverse_mode);
- TurnOn (A_STANDOUT, enter_standout_mode);
- TurnOn (A_PROTECT, enter_protected_mode);
- TurnOn (A_INVIS, enter_secure_mode);
- TurnOn (A_UNDERLINE, enter_underline_mode);
- TurnOn (A_HORIZONTAL, enter_horizontal_hl_mode);
- TurnOn (A_LEFT, enter_left_hl_mode);
- TurnOn (A_LOW, enter_low_hl_mode);
- TurnOn (A_RIGHT, enter_right_hl_mode);
- TurnOn (A_TOP, enter_top_hl_mode);
- TurnOn (A_VERTICAL, enter_vertical_hl_mode);
+ SetColorsIf((pair != 0) || fix_pair0, previous_attr);
+ } else if (set_attributes && !used_ncv) {
+ if (turn_on || turn_off) {
+ TPUTS_TRACE("set_attributes");
+ tputs(tparm(set_attributes,
+ (newmode & A_STANDOUT) != 0,
+ (newmode & A_UNDERLINE) != 0,
+ (newmode & A_REVERSE) != 0,
+ (newmode & A_BLINK) != 0,
+ (newmode & A_DIM) != 0,
+ (newmode & A_BOLD) != 0,
+ (newmode & A_INVIS) != 0,
+ (newmode & A_PROTECT) != 0,
+ (newmode & A_ALTCHARSET) != 0), 1, outc);
+ previous_attr &= ~A_COLOR;
}
+ SetColorsIf((pair != 0) || fix_pair0, previous_attr);
+ } else {
- if (reverse)
- newmode |= A_REVERSE;
+ T(("turning %s off", _traceattr(turn_off)));
- if (SP)
- SP->_current_attr = newmode;
- else
- previous_attr = newmode;
+ TurnOff(A_ALTCHARSET, exit_alt_charset_mode);
- returnCode(OK);
+ if (!SP || SP->_use_rmul) {
+ TurnOff(A_UNDERLINE, exit_underline_mode);
+ }
+
+ if (!SP || SP->_use_rmso) {
+ TurnOff(A_STANDOUT, exit_standout_mode);
+ }
+
+ if (turn_off && exit_attribute_mode) {
+ doPut(exit_attribute_mode);
+ turn_on |= (newmode & (chtype) (~A_COLOR));
+ previous_attr &= ~A_COLOR;
+ }
+ SetColorsIf((pair != 0) || fix_pair0, previous_attr);
+
+ T(("turning %s on", _traceattr(turn_on)));
+ /* *INDENT-OFF* */
+ TurnOn(A_ALTCHARSET, enter_alt_charset_mode);
+ TurnOn(A_BLINK, enter_blink_mode);
+ TurnOn(A_BOLD, enter_bold_mode);
+ TurnOn(A_DIM, enter_dim_mode);
+ TurnOn(A_REVERSE, enter_reverse_mode);
+ TurnOn(A_STANDOUT, enter_standout_mode);
+ TurnOn(A_PROTECT, enter_protected_mode);
+ TurnOn(A_INVIS, enter_secure_mode);
+ TurnOn(A_UNDERLINE, enter_underline_mode);
+ TurnOn(A_HORIZONTAL, enter_horizontal_hl_mode);
+ TurnOn(A_LEFT, enter_left_hl_mode);
+ TurnOn(A_LOW, enter_low_hl_mode);
+ TurnOn(A_RIGHT, enter_right_hl_mode);
+ TurnOn(A_TOP, enter_top_hl_mode);
+ TurnOn(A_VERTICAL, enter_vertical_hl_mode);
+ /* *INDENT-ON* */
+
+ }
+
+ if (reverse)
+ newmode |= A_REVERSE;
+
+ if (SP)
+ SP->_current_attr = newmode;
+ else
+ previous_attr = newmode;
+
+ returnCode(OK);
}
-int vidattr(attr_t newmode)
+int
+vidattr(attr_t newmode)
{
- T((T_CALLED("vidattr(%s)"), _traceattr(newmode)));
+ T((T_CALLED("vidattr(%s)"), _traceattr(newmode)));
- returnCode(vidputs(newmode, _nc_outch));
+ returnCode(vidputs(newmode, _nc_outch));
}
-chtype termattrs(void)
+chtype
+termattrs(void)
{
- chtype attrs = A_NORMAL;
+ chtype attrs = A_NORMAL;
- if (enter_alt_charset_mode)
- attrs |= A_ALTCHARSET;
+ if (enter_alt_charset_mode)
+ attrs |= A_ALTCHARSET;
- if (enter_blink_mode)
- attrs |= A_BLINK;
+ if (enter_blink_mode)
+ attrs |= A_BLINK;
- if (enter_bold_mode)
- attrs |= A_BOLD;
+ if (enter_bold_mode)
+ attrs |= A_BOLD;
- if (enter_dim_mode)
- attrs |= A_DIM;
+ if (enter_dim_mode)
+ attrs |= A_DIM;
- if (enter_reverse_mode)
- attrs |= A_REVERSE;
+ if (enter_reverse_mode)
+ attrs |= A_REVERSE;
- if (enter_standout_mode)
- attrs |= A_STANDOUT;
+ if (enter_standout_mode)
+ attrs |= A_STANDOUT;
- if (enter_protected_mode)
- attrs |= A_PROTECT;
+ if (enter_protected_mode)
+ attrs |= A_PROTECT;
- if (enter_secure_mode)
- attrs |= A_INVIS;
+ if (enter_secure_mode)
+ attrs |= A_INVIS;
- if (enter_underline_mode)
- attrs |= A_UNDERLINE;
+ if (enter_underline_mode)
+ attrs |= A_UNDERLINE;
- if (SP->_coloron)
- attrs |= A_COLOR;
+ if (SP->_coloron)
+ attrs |= A_COLOR;
- return(attrs);
+ return (attrs);
}
-
-/* $OpenBSD: tty_update.c,v 1.7 2000/03/10 01:35:05 millert Exp $ */
+/* $OpenBSD: tty_update.c,v 1.8 2000/03/26 16:45:04 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
#include <term.h>
-MODULE_ID("$From: tty_update.c,v 1.131 2000/02/26 23:22:11 tom Exp $")
+MODULE_ID("$From: tty_update.c,v 1.134 2000/03/26 02:17:10 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
if (!back_color_erase && SP->_coloron) {
if (ch & A_COLOR)
return FALSE;
+#ifdef NCURSES_EXT_FUNCS
if (!SP->_default_color)
return FALSE;
if (SP->_default_fg != C_MASK || SP->_default_bg != C_MASK)
return FALSE;
+#endif
}
return ((ch & ~(NONBLANK_ATTR | A_COLOR)) == BLANK);
}
#ifdef NCURSES_EXT_FUNCS
if (SP->_coloron
&& !SP->_default_color) {
- _nc_do_color(0, FALSE, _nc_outch);
+ _nc_do_color(COLOR_PAIR(SP->_current_attr), 0, FALSE, _nc_outch);
if (!back_color_erase) {
fast_clear = FALSE;
}
if (SP->_coloron
&& !SP->_default_color) {
SP->_default_color = TRUE;
- _nc_do_color(0, FALSE, _nc_outch);
+ _nc_do_color(-1, 0, FALSE, _nc_outch);
SP->_default_color = FALSE;
}
#endif
######## TERMINAL TYPE DESCRIPTIONS SOURCE FILE
#
-# $OpenBSD: termtypes.master,v 1.19 2000/03/23 14:29:35 millert Exp $
+# $OpenBSD: termtypes.master,v 1.20 2000/03/26 16:45:00 millert Exp $
#
# This version of terminfo.src is distributed with ncurses.
# Report bugs to
# bug-ncurses@gnu.org
#
# Version 10.2.1
-# Date: 2000/03/19 23:06:50
+# Date: 2000/03/26 00:53:29
# terminfo syntax
#
# Eric S. Raymond (current maintainer)
# This is better than klone+color, it doesn't assume white-on-black as the
# default color pair, but many `ANSI' terminals don't grok the <op> cap.
ecma+color|color control for ECMA-48-compatible terminals,
+ AX,
colors#8, ncv#3, pairs#64,
op=\E[39;49m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
# CRT is shareware. It implements some xterm features, including mouse.
crt|crt-vt220|CRT 2.3 emulating VT220,
bce, msgr,
- colors#8, pairs#64,
- hts=\EH, op=\E[39;49m, setab=\E[4%p1%dm,
- setaf=\E[3%p1%dm, setb=\E[4%p1%dm, setf=\E[3%p1%dm,
- u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c,
- use=vt220,
+ ncv@,
+ hts=\EH, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, use=vt220, use=ecma+color,
# This entry is for Tera Term Pro version 2.3, for MS-Windows 95/NT written by
# T. Teranishi dated Mar 10, 1998. It is a free software terminal emulator
# The name has been changed and some aliases have been removed.
xterm-xf86-v32|xterm terminal emulator (XFree86 3.2 Window System),
OTbs, am, bce, km, mir, msgr, xenl,
- colors#8, cols#80, it#8, lines#24, pairs#64,
+ cols#80, it#8, lines#24, ncv@,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M,
kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
kf9=\E[20~, kfnd=\E[1~, khome=\EOH, kich1=\E[2~,
kmous=\E[M, knp=\E[6~, kpp=\E[5~, kslt=\E[4~, meml=\El,
- memu=\Em, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O,
- rmam=\E[?7l, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l,
- rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m, rs1=^O,
+ memu=\Em, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
+ rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
+ rmso=\E[27m, rmul=\E[24m, rs1=^O,
rs2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, sc=\E7,
- setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c,
vpa=\E[%i%p1%dd,
+ use=ecma+color,
# This is the stock xterm entry supplied with XFree86 3.3, which uses VT100
# codes for F1-F4 except while in VT220 mode.
kterm|kterm kanji terminal emulator (X window system),
eslok, hs,
acsc@, csr=\E[%i%p1%d;%p2%dr, dsl=\E[?H, enacs@, fsl=\E[?F,
- kmous=\E[M, op=\E[39;49m, rc=\E8, rmacs@, sc=\E7, smacs@,
- tsl=\E[?E\E[?%i%dT,
- use=xterm-r6, use=klone+color,
+ kmous=\E[M, rc=\E8, rmacs@, sc=\E7, smacs@,
+ tsl=\E[?E\E[?%i%dT, use=xterm-r6,
+ use=ecma+color,
# See the note on ICH/ICH1 VERSUS RMIR/SMIR near the end of file
xterm-nic|xterm with ich/ich1 suppressed for non-curses programs,
ich@, ich1@,
# and 27, but they are not present in the terminfo or termcap.
color_xterm|cx|cx100|color_xterm color terminal emulator for X,
OTbs, am, km, mir, msgr, xenl,
- colors#8, cols#80, it#8, lines#65, pairs#64,
+ cols#80, it#8, lines#65, ncv@,
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, bold=\E[1m, clear=\E[H\E[2J, cr=^M,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf2=\E[12~,
kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~,
kf8=\E[19~, kf9=\E[20~, khome=\E[7~, kich1=\E[2~,
- kmous=\E[M, knp=\E[6~, kpp=\E[5~, op=\E[39;49m, rc=\E8,
- rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
- rmcup=\E>\E[?41;1r, rmir=\E[4l, rmso=\E[27m, rmul=\E[24m,
+ kmous=\E[M, knp=\E[6~, kpp=\E[5~, rc=\E8, rev=\E[7m, ri=\EM,
+ rmacs=^O, rmam=\E[?7l, rmcup=\E>\E[?41;1r, rmir=\E[4l,
+ rmso=\E[27m, rmul=\E[24m,
rs1=\E(B\017\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E<,
- sc=\E7, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
+ sc=\E7,
sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
sgr0=\E[m, smacs=^N, smam=\E[?7h,
smcup=\E[?1;41s\E[?1;41h\E=, smir=\E[4h, smso=\E[7m,
smul=\E[4m,
+ use=ecma+color,
# The 'nxterm' distributed with Redhat Linux 5.2 is a slight rehack of
# xterm-sb_right-ansi-3d, which implements ANSI colors, but does not support
smcup=\E7\E[?47h, smir=\E[4h, smkx=\E=, smso=\E[7m,
smul=\E[4m, tbc=\E[3g,
rxvt|rxvt terminal emulator (X Window System),
- colors#8, pairs#64,
- op=\E[39;49m, setab=\E[%p1%{40}%+%dm,
- setaf=\E[%p1%{30}%+%dm, sgr0=\E[m\017, use=rxvt-basic,
+ ncv@,
+ sgr0=\E[m\017, use=rxvt-basic, use=ecma+color,
# These (xtermc and xtermm) are distributed with Solaris. They refer to a
# variant of xterm which is apparently no longer supported, but are interesting
# AX (bool) Does understand ANSI set default fg/bg color
# (\E[39m / \E[49m).
screen|VT 100/ANSI X3.64 virtual terminal,
- OTbs, OTpt, am, km, mir, msgr, xenl, AX, G0,
+ OTbs, OTpt, am, km, mir, msgr, xenl, G0,
colors#8, cols#80, it#8, lines#24, pairs#64,
acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
# Corrected Sun Aug 9 1998 by Alexander V. Lukyanov <lav@video.yars.free.net>
dtterm|CDE desktop terminal,
am, mir, msgr, xenl, xon,
- colors#8, cols#80, it#8, lines#24, lm#0, pairs#64,
+ cols#80, it#8, lines#24, lm#0, ncv@,
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~,
kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
kfnd=\E[1~, khlp=\E[28~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~,
- kslt=\E[4~, nel=\EE, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM,
- rmacs=^O, rmam=\E[?7l, rmir=\E[4l, rmso=\E[22;27m,
- rmul=\E[24m, sc=\E7, setab=\E[%p1%{40}%+%dm,
- setaf=\E[%p1%{30}%+%dm,
+ kslt=\E[4~, nel=\EE, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O,
+ rmam=\E[?7l, rmir=\E[4l, rmso=\E[22;27m, rmul=\E[24m,
+ sc=\E7,
sgr=\E[0%?%p1%t;2;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smir=\E[4h,
smso=\E[2;7m, smul=\E[4m, tbc=\E[3g,
+ use=ecma+color,
#### Non-Unix Consoles
#
# * update OTxx capabilities for changes on 2000/3/4.
# * revert part of vt220 change (request by Todd C Miller for OpenBSD)
#
+# 2000/3/26
+# * move screen's AX extension to ecma+color, modify several entries to
+# use that, adjusting ncv as needed -TD
+#
# The following sets edit modes for GNU EMACS.
# Local Variables:
# fill-prefix:"\t"
'\" t
-.\" $OpenBSD: infocmp.1tbl,v 1.7 2000/03/13 23:53:41 millert Exp $
+.\" $OpenBSD: infocmp.1tbl,v 1.8 2000/03/26 16:45:04 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: infocmp.1m,v 1.23 2000/03/12 02:52:56 tom Exp $
+.\" $From: infocmp.1m,v 1.24 2000/03/19 03:03:31 tom Exp $
.TH infocmp 1 ""
.ds n 5
.ds d /usr/share/terminfo
\fB-G\fR
Display constant literals in decimal form
rather than their character equivalents.
+.TP
+\fB-a\fR
+tells \fBinfocmp\fP to retain commented-out capabilities rather than discarding
+them. Capabilities are commented by prefixing them with a period.
.TP 5
\fB-q\fR
Make the comparison listing shorter by omitting subheadings, and using
-"-" for absent capabilities, "@" for cancelled rather than "NULL".
+"-" for absent capabilities, "@" for canceled rather than "NULL".
.TP 5
\fB-R\fR\fIsubset\fR
Restrict output to a given subset. This option is for use with archaic
-versions of terminfo like those on SVr1, Ultrix, or HP/UX that don't support
-the full set of SVR4/XSI Curses terminfo; and outright broken ports like AIX
+versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
+the full set of SVR4/XSI Curses terminfo; and variants such as AIX
that have their own extensions incompatible with SVr4/XSI. Available terminfo
subsets are "SVr1", "Ultrix", "HP", and "AIX"; see \fBterminfo\fR(\*n) for
details. You can also choose the subset "BSD" which selects only capabilities
\fB-G\fR,
\fB-R\fR,
\fB-T\fR,
+\fB-a\fR,
\fB-e\fR,
\fB-f\fR,
\fB-g\fR,
-/* $OpenBSD: infocmp.c,v 1.9 2000/03/13 23:53:41 millert Exp $ */
+/* $OpenBSD: infocmp.c,v 1.10 2000/03/26 16:45:04 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
#include <term_entry.h>
#include <dump_entry.h>
-MODULE_ID("$From: infocmp.c,v 1.52 2000/03/12 02:34:09 tom Exp $")
+MODULE_ID("$From: infocmp.c,v 1.54 2000/03/19 02:56:14 tom Exp $")
#define L_CURL "{"
#define R_CURL "}"
static bool limited = TRUE; /* "-r" option is not set */
static bool quiet = FALSE;
-static char *bool_sep = ":";
-static char *s_absent = "NULL";
-static char *s_cancel = "NULL";
+static const char *bool_sep = ":";
+static const char *s_absent = "NULL";
+static const char *s_cancel = "NULL";
static const char *tversion; /* terminfo version selected */
static int itrace; /* trace flag for debugging */
static int mwidth = 60;
}
}
-static char *
+static const char *
dump_boolean(int val)
/* display the value of a boolean capability */
{
," -R subset (see manpage)"
," -T eliminate size limits (test)"
," -V print version"
+#if NCURSES_XNAMES
+ ," -a with -F, list commented-out caps"
+#endif
," -c list common capabilities"
," -d list different capabilities"
," -e format output for C initializer"
/* where is the terminfo database location going to default to? */
restdir = firstdir = 0;
- while ((c = getopt(argc, argv, "deEcCfFGgIinlLpqrR:s:uv:Vw:A:B:1T")) != EOF)
+ while ((c = getopt(argc, argv, "adeEcCfFGgIinlLpqrR:s:uv:Vw:A:B:1T")) != EOF)
switch (c) {
+#if NCURSES_XNAMES
+ case 'a':
+ _nc_disable_period = TRUE;
+ use_extended_names(TRUE);
+ break;
+#endif
case 'd':
compare = C_DIFFERENCE;
break;
'\" t
-.\" $OpenBSD: captoinfo.1tbl,v 1.4 1999/01/18 18:57:52 millert Exp $
+.\" $OpenBSD: captoinfo.1tbl,v 1.5 2000/03/26 16:45:04 millert Exp $
.\"
.\"***************************************************************************
-.\" 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 *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: captoinfo.1m,v 1.13 1998/12/26 19:57:11 tom Exp $
+.\" $From: captoinfo.1m,v 1.14 2000/03/19 02:20:28 tom Exp $
.TH captoinfo 1 ""
.ds n 5
.ds d /usr/share/terminfo
These will be discarded with a warning message.
.SH NOTES
This utility is actually a link to \fItic\fR(1), running in \fI-I\fR mode.
+You can use other \fItic\fR options such as \fB-f\fR and \fB-x\fR.
The trace option isn't identical to SVr4's. Under SVr4, instead of following
the -v with a trace level n, you repeat it n times.
'\" t
-.\" $OpenBSD: infotocap.1,v 1.1 1999/12/12 04:49:19 millert Exp $
+.\" $OpenBSD: infotocap.1,v 1.2 2000/03/26 16:45:04 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 *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: infotocap.1m,v 1.1 1999/12/11 19:25:27 tom Exp $
+.\" $From: infotocap.1m,v 1.2 2000/03/19 02:19:49 tom Exp $
.TH infotocap 1M ""
.ds n 5
.ds d /usr/share/terminfo
Compiled terminal description database.
.SH NOTES
This utility is actually a link to \fItic\fR(1M), running in \fI-C\fR mode.
+You can use other \fItic\fR options such as \fB-f\fR and \fB-x\fR.
.SH SEE ALSO
\fBcurses\fR(3X),
\fBtic\fR(1M),
-.\" $OpenBSD: tic.1,v 1.9 2000/01/08 06:26:24 millert Exp $
+.\" $OpenBSD: tic.1,v 1.10 2000/03/26 16:45:04 millert Exp $
.\"
.\"***************************************************************************
-.\" Copyright (c) 1998,1999 Free Software Foundation, Inc. *
+.\" Copyright (c) 1998,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 *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: tic.1m,v 1.25 1999/03/07 02:07:06 tom Exp $
+.\" $From: tic.1m,v 1.26 2000/03/19 02:18:18 tom Exp $
.TH tic 1 ""
.ds n 5
.ds d /usr/share/terminfo
N\
R\
T\
+a\
c\
f\
r\
directory first, look at \fI$HOME/.terminfo\fR if TERMINFO is not set, and
finally look in \fI\*d\fR.
.TP
+\fB-a\fR
+tells \fBtic\fP to retain commented-out capabilities rather than discarding
+them. Capabilities are commented by prefixing them with a period.
+This sets the \fB-x\fR option, because it treats the commented-out
+entries as user-defined names.
+.TP
\fB-c\fR
-specifies to only check \fIfile\fR for errors, including syntax problems and
+tells \fBtic\fP to only check \fIfile\fR for errors, including syntax problems and
bad use links. If you specify \fB-C\fR (\fB-I\fR) with this option, the code
will print warnings about entries which, after use resolution, are more than
1023 (4096) bytes long. Due to a fixed buffer length in older termcap
.TP
\fB-x\fR
Treat unknown capabilities as user-defined.
+That is, if you supply a capability name which \fBtic\fP does not recognize,
+it will infer its type (boolean, number or string) from the syntax and
+make an extended table entry for that.
.TP
\fIfile\fR
contains one or more \fBterminfo\fR terminal descriptions in source
error messages, and can be parsed by GNU Emacs's compile facility.
The
-\fB-o\fR,
+\fB-C\fR,
\fB-G\fR,
\fB-I\fR,
-\fB-C\fR,
\fB-N\fR,
\fB-R\fR,
+\fB-T\fR,
+\fB-a\fR,
\fB-e\fR,
\fB-f\fR,
\fB-g\fR,
-\fB-T\fR,
+\fB-o\fR,
\fB-r\fR,
\fB-s\fR and
\fB-x\fR
#include <dump_entry.h>
#include <term_entry.h>
-MODULE_ID("$From: tic.c,v 1.64 2000/03/11 21:45:07 tom Exp $")
+MODULE_ID("$From: tic.c,v 1.67 2000/03/19 02:08:10 tom Exp $")
const char *_nc_progname = "tic";
" -N disable smart defaults for source translation",
" -R restrict translation to given terminfo/termcap version",
" -T remove size-restrictions on compiled description",
+#if NCURSES_XNAMES
+ " -a retain commented-out capabilities (sets -x also)",
+#endif
" -c check only, validate input without compiling or translating",
" -f format complex strings for readability",
" -G format %{number} to %'char'",
* be optional.
*/
while ((this_opt = getopt(argc, argv,
- "0123456789CILNR:TVce:fGgo:rsvwx")) != -1) {
+ "0123456789CILNR:TVace:fGgo:rsvwx")) != -1) {
if (isdigit(this_opt)) {
switch (last_opt) {
case 'v':
width = 0;
break;
#if NCURSES_XNAMES
+ case 'a':
+ _nc_disable_period = TRUE;
+ /* FALLTHRU */
case 'x':
use_extended_names(TRUE);
break;
if (!check_only) {
if (!infodump && !capdump) {
_nc_set_writedir(outdir);
- for_entry_list(qp)
+ for_entry_list(qp) {
if (matches(namelst, qp->tterm.term_names))
- write_it(qp);
+ write_it(qp);
+ }
} else {
/* this is in case infotocap() generates warnings */
_nc_curr_col = _nc_curr_line = -1;
}
static void
-check_sgr(TERMTYPE * tp, char *zero, int num, char *cap, char *name)
+check_sgr(TERMTYPE * tp, char *zero, int num, char *cap, const char *name)
{
char *test = tparm(set_attributes,
num == 1,