xref: /freebsd/contrib/ncurses/progs/dump_entry.h (revision 5b56413d04e608379c9a306373554a8e4d321bc0)
1 /****************************************************************************
2  * Copyright 2018-2020,2021 Thomas E. Dickey                                *
3  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
4  *                                                                          *
5  * Permission is hereby granted, free of charge, to any person obtaining a  *
6  * copy of this software and associated documentation files (the            *
7  * "Software"), to deal in the Software without restriction, including      *
8  * without limitation the rights to use, copy, modify, merge, publish,      *
9  * distribute, distribute with modifications, sublicense, and/or sell       *
10  * copies of the Software, and to permit persons to whom the Software is    *
11  * furnished to do so, subject to the following conditions:                 *
12  *                                                                          *
13  * The above copyright notice and this permission notice shall be included  *
14  * in all copies or substantial portions of the Software.                   *
15  *                                                                          *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23  *                                                                          *
24  * Except as contained in this notice, the name(s) of the above copyright   *
25  * holders shall not be used in advertising or otherwise to promote the     *
26  * sale, use or other dealings in this Software without prior written       *
27  * authorization.                                                           *
28  ****************************************************************************/
29 
30 /****************************************************************************
31  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
32  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
33  *     and: Thomas E. Dickey                        1996-on                 *
34  ****************************************************************************/
35 
36 /*
37  * $Id: dump_entry.h,v 1.44 2021/04/18 19:56:09 tom Exp $
38  *
39  * Dump control definitions and variables
40  */
41 
42 #ifndef DUMP_ENTRY_H
43 #define DUMP_ENTRY_H 1
44 
45 #define NCURSES_OPAQUE    0
46 #define NCURSES_INTERNALS 1
47 #include <curses.h>
48 #include <term.h>
49 
50 /* capability output formats */
51 #define F_TERMINFO	0	/* use terminfo names */
52 #define F_VARIABLE	1	/* use C variable names */
53 #define F_TERMCAP	2	/* termcap names with capability conversion */
54 #define F_TCONVERR	3	/* as T_TERMCAP, no skip of untranslatables */
55 #define F_LITERAL	4	/* like F_TERMINFO, but no smart defaults */
56 
57 /* capability sort modes */
58 #define S_DEFAULT	0	/* sort by terminfo name (implicit) */
59 #define S_NOSORT	1	/* don't sort */
60 #define S_TERMINFO	2	/* sort by terminfo names (explicit) */
61 #define S_VARIABLE	3	/* sort by C variable names */
62 #define S_TERMCAP	4	/* sort by termcap names */
63 
64 /* capability types for the comparison hook */
65 #define CMP_BOOLEAN	0	/* comparison on booleans */
66 #define CMP_NUMBER	1	/* comparison on numerics */
67 #define CMP_STRING	2	/* comparison on strings */
68 #define CMP_USE		3	/* comparison on use capabilities */
69 
70 #ifndef _TERMSORT_H
71 typedef unsigned PredType;
72 typedef unsigned PredIdx;
73 #endif
74 
75 typedef int (*PredFunc) (PredType, PredIdx);
76 typedef void (*PredHook) (PredType, PredIdx, const char *);
77 
78 extern NCURSES_CONST char *nametrans(const char *);
79 extern bool has_params(const char *, bool);
80 extern int fmt_entry(TERMTYPE2 *, PredFunc, int, int, int, int);
81 extern int show_entry(void);
82 extern void compare_entry(PredHook, TERMTYPE2 *, bool);
83 extern void dump_entry(TERMTYPE2 *, int, int, int, PredFunc);
84 extern void dump_init(const char *, int, int, bool, int, int, unsigned, bool,
85 		      bool, int);
86 extern void dump_uses(const char *, bool);
87 extern void repair_acsc(TERMTYPE2 *tp);
88 
89 #define L_CURL "{"
90 #define R_CURL "}"
91 
92 #define FAIL	-1
93 
94 #endif /* DUMP_ENTRY_H */
95