File indexing completed on 2024-05-18 08:30:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 #ifndef NCURSES_TERM_ENTRY_H_incl
0043 #define NCURSES_TERM_ENTRY_H_incl 1
0044
0045
0046 #ifdef __cplusplus
0047 extern "C" {
0048 #endif
0049
0050 #include <ncursesw/curses.h>
0051 #include <ncursesw/term.h>
0052
0053
0054
0055
0056 #if NCURSES_XNAMES
0057 #define NUM_BOOLEANS(tp) (tp)->num_Booleans
0058 #define NUM_NUMBERS(tp) (tp)->num_Numbers
0059 #define NUM_STRINGS(tp) (tp)->num_Strings
0060 #define EXT_NAMES(tp,i,limit,index,table) (i >= limit) ? tp->ext_Names[index] : table[i]
0061 #else
0062 #define NUM_BOOLEANS(tp) BOOLCOUNT
0063 #define NUM_NUMBERS(tp) NUMCOUNT
0064 #define NUM_STRINGS(tp) STRCOUNT
0065 #define EXT_NAMES(tp,i,limit,index,table) table[i]
0066 #endif
0067
0068 #define NUM_EXT_NAMES(tp) (unsigned) ((tp)->ext_Booleans + (tp)->ext_Numbers + (tp)->ext_Strings)
0069
0070 #define for_each_boolean(n,tp) for(n = 0; n < NUM_BOOLEANS(tp); n++)
0071 #define for_each_number(n,tp) for(n = 0; n < NUM_NUMBERS(tp); n++)
0072 #define for_each_string(n,tp) for(n = 0; n < NUM_STRINGS(tp); n++)
0073
0074 #if NCURSES_XNAMES
0075 #define for_each_ext_boolean(n,tp) for(n = BOOLCOUNT; (int) n < (int) NUM_BOOLEANS(tp); n++)
0076 #define for_each_ext_number(n,tp) for(n = NUMCOUNT; (int) n < (int) NUM_NUMBERS(tp); n++)
0077 #define for_each_ext_string(n,tp) for(n = STRCOUNT; (int) n < (int) NUM_STRINGS(tp); n++)
0078 #endif
0079
0080 #define ExtBoolname(tp,i,names) EXT_NAMES(tp, i, BOOLCOUNT, (i - (tp->num_Booleans - tp->ext_Booleans)), names)
0081 #define ExtNumname(tp,i,names) EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names)
0082 #define ExtStrname(tp,i,names) EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names)
0083
0084
0085
0086
0087
0088 #ifdef NCURSES_INTERNALS
0089
0090
0091
0092
0093
0094 typedef enum {
0095 dbdTIC = 0,
0096 #if NCURSES_USE_DATABASE
0097 dbdEnvOnce,
0098 dbdHome,
0099 dbdEnvList,
0100 dbdCfgList,
0101 dbdCfgOnce,
0102 #endif
0103 #if NCURSES_USE_TERMCAP
0104 dbdEnvOnce2,
0105 dbdEnvList2,
0106 dbdCfgList2,
0107 #endif
0108 dbdLAST
0109 } DBDIRS;
0110
0111 #define MAX_USES 32
0112 #define MAX_CROSSLINKS 16
0113
0114 typedef struct entry ENTRY;
0115
0116 typedef struct {
0117 char *name;
0118 ENTRY *link;
0119 long line;
0120 } ENTRY_USES;
0121
0122 struct entry {
0123 TERMTYPE2 tterm;
0124 unsigned nuses;
0125 ENTRY_USES uses[MAX_USES];
0126 int ncrosslinks;
0127 ENTRY *crosslinks[MAX_CROSSLINKS];
0128 long cstart;
0129 long cend;
0130 long startline;
0131 ENTRY *next;
0132 ENTRY *last;
0133 };
0134
0135 extern NCURSES_EXPORT_VAR(ENTRY *) _nc_head;
0136 extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail;
0137 #define for_entry_list(qp) for (qp = _nc_head; qp; qp = qp->next)
0138 #define for_entry_list2(qp,q0) for (qp = q0; qp; qp = qp->next)
0139
0140 #define MAX_LINE 132
0141
0142 #define NULLHOOK (bool(*)(ENTRY *))0
0143
0144
0145
0146
0147
0148 #define WANTED(s) ((s) == ABSENT_STRING)
0149 #define PRESENT(s) (((s) != ABSENT_STRING) && ((s) != CANCELLED_STRING))
0150
0151 #define ANDMISSING(p,q) \
0152 { \
0153 if (PRESENT(p) && !PRESENT(q)) \
0154 _nc_warning(#p " but no " #q); \
0155 }
0156
0157 #define PAIRED(p,q) \
0158 { \
0159 if (PRESENT(q) && !PRESENT(p)) \
0160 _nc_warning(#q " but no " #p); \
0161 if (PRESENT(p) && !PRESENT(q)) \
0162 _nc_warning(#p " but no " #q); \
0163 }
0164
0165
0166
0167
0168
0169
0170 extern NCURSES_EXPORT(ENTRY *) _nc_copy_entry (ENTRY *oldp);
0171 extern NCURSES_EXPORT(char *) _nc_save_str (const char *const);
0172 extern NCURSES_EXPORT(void) _nc_init_entry (ENTRY *const);
0173 extern NCURSES_EXPORT(void) _nc_merge_entry (ENTRY *const, ENTRY *const);
0174 extern NCURSES_EXPORT(void) _nc_wrap_entry (ENTRY *const, bool);
0175
0176
0177 extern NCURSES_EXPORT(void) _nc_align_termtype (TERMTYPE2 *, TERMTYPE2 *);
0178
0179
0180 extern NCURSES_EXPORT(void) _nc_free_termtype1 (TERMTYPE *);
0181 extern NCURSES_EXPORT(void) _nc_free_termtype2 (TERMTYPE2 *);
0182
0183
0184 extern NCURSES_EXPORT(char *) _nc_trim_sgr0 (TERMTYPE2 *);
0185
0186
0187 #if NCURSES_XNAMES
0188 extern NCURSES_EXPORT_VAR(bool) _nc_user_definable;
0189 extern NCURSES_EXPORT_VAR(bool) _nc_disable_period;
0190 #endif
0191 extern NCURSES_EXPORT(int) _nc_parse_entry (ENTRY *, int, bool);
0192 extern NCURSES_EXPORT(int) _nc_capcmp (const char *, const char *);
0193
0194
0195 extern NCURSES_EXPORT(void) _nc_set_writedir (const char *);
0196 extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE2 *const);
0197 extern NCURSES_EXPORT(int) _nc_write_object (TERMTYPE2 *, char *, unsigned *, unsigned);
0198
0199
0200 extern NCURSES_EXPORT(void) _nc_read_entry_source (FILE*, char*, int, bool, bool (*)(ENTRY*));
0201 extern NCURSES_EXPORT(bool) _nc_entry_match (char *, char *);
0202 extern NCURSES_EXPORT(int) _nc_resolve_uses (bool);
0203 extern NCURSES_EXPORT(int) _nc_resolve_uses2 (bool, bool);
0204 extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *);
0205 extern NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype)(TERMTYPE *);
0206 extern NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2)(TERMTYPE2 *, bool);
0207
0208
0209 extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *);
0210
0211 #endif
0212
0213
0214
0215
0216
0217 #undef NCURSES_TACK_1_08
0218 #ifdef NCURSES_INTERNALS
0219 #define NCURSES_TACK_1_08
0220 #else
0221 #define NCURSES_TACK_1_08 GCC_DEPRECATED("upgrade to tack 1.08")
0222 #endif
0223
0224
0225 extern NCURSES_EXPORT(void) _nc_copy_termtype (TERMTYPE *, const TERMTYPE *) NCURSES_TACK_1_08;
0226
0227
0228 extern NCURSES_EXPORT(void) _nc_init_acs (void) NCURSES_TACK_1_08;
0229
0230
0231 extern NCURSES_EXPORT(void) _nc_free_termtype (TERMTYPE *) NCURSES_TACK_1_08;
0232
0233 #ifdef __cplusplus
0234 }
0235 #endif
0236
0237
0238
0239 #endif