Lines Matching +full:embedded +full:- +full:trace +full:- +full:extension
2 * Copyright 2018-2023,2024 Thomas E. Dickey *
3 * Copyright 1998-2017,2018 Free Software Foundation, Inc. *
31 * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
37 * tic.c --- Main program for terminfo compiler
75 [-e names] \
76 [-o dir] \
77 [-R name] \
78 [-v[n]] \
79 [-V] \
80 [-w[n]] \
81 [-\
101 source-file\n";
152 DATA(" -0 format translation output all capabilities on one line") in usage()
153 DATA(" -1 format translation output one capability per line") in usage()
155 DATA(" -a retain commented-out capabilities (sets -x also)") in usage()
157 DATA(" -C translate entries to termcap source form") in usage()
158 DATA(" -D print list of tic's database locations (first must be writable)") in usage()
159 DATA(" -c check only, validate input without compiling or translating") in usage()
160 DATA(" -e<names> translate/compile only entries named by comma-separated list") in usage()
161 DATA(" -f format complex strings for readability") in usage()
162 DATA(" -G format %{number} to %'char'") in usage()
163 DATA(" -g format %'char' to %{number}") in usage()
164 DATA(" -I translate entries to terminfo source form") in usage()
165 DATA(" -K translate entries to termcap source form with BSD syntax") in usage()
166 DATA(" -L translate entries to full terminfo source form") in usage()
167 DATA(" -N disable smart defaults for source translation") in usage()
168 DATA(" -o<dir> set output directory for compiled entry writes") in usage()
169 DATA(" -Q[n] dump compiled description") in usage()
170 DATA(" -q brief listing, removes headers") in usage()
171 DATA(" -R<name> restrict translation to given terminfo/termcap version") in usage()
172 DATA(" -r force resolution of all use entries in source translation") in usage()
173 DATA(" -s print summary statistics") in usage()
174 DATA(" -T remove size-restrictions on compiled description") in usage()
176 DATA(" -t suppress commented-out capabilities") in usage()
178 DATA(" -U suppress post-processing of entries") in usage()
179 DATA(" -V print version") in usage()
180 DATA(" -W wrap long strings according to -w[n] option") in usage()
181 DATA(" -v[n] set verbosity level") in usage()
182 DATA(" -w[n] set format width for translation output") in usage()
184 DATA(" -x treat unknown capabilities as user-defined") in usage()
214 s = ep->tterm.Strings[n]; in write_it()
247 _nc_set_type(_nc_first_name(ep->tterm.term_names)); in write_it()
248 _nc_curr_line = (int) ep->startline; in write_it()
249 _nc_write_entry(&ep->tterm); in write_it()
258 * This is strictly a core-economy kluge. The really clean way to handle in immedhook()
260 * name-collision checks and entry writes in one swell foop. But the in immedhook()
261 * terminfo master file is large enough that some core-poor systems swap in immedhook()
268 * adding the entry to the in-core list when this hook fires. If some in immedhook()
290 if (ep->nuses == 0) { in immedhook()
295 free(ep->tterm.str_table); in immedhook()
380 while (--len != 0 && isspace(UChar(dst[len]))) in stripped()
433 fprintf(stderr, "%s: %s is not a text-file\n", _nc_progname, filename); in copy_input()
459 if (!strcmp(filename, "-")) { in open_input()
461 } else if (stat(filename, &sb) == -1) { in open_input()
492 /* Parse the "-e" option-value into a list of names */
558 /* does entry in needle list match |-separated field in haystack? */ in matches()
588 if (strcmp(result + need - sizeof(suffix), suffix)) { in valid_db_path()
682 *target = (*target * 10) + (source - '0'); in add_digit()
689 int v_opt = -1; in main()
702 bool literal = FALSE; /* suppress post-processing? */ in main()
729 /* set this directly to avoid interaction with -v and -D options */ in main()
736 * design decision to allow the numeric values for -w, -v options to in main()
740 "0123456789CDIKLNQR:TUVWace:fGgo:qrstvwx")) != -1) { in main()
772 /* the initial version of -K in 20110730 fell-thru here, but the in main()
773 * same flag is useful when reading sources -TD in main()
832 numbers = -1; in main()
871 * If the -v option is set, it may override the $NCURSES_TRACE environment in main()
872 * variable, e.g., for -v3 and up. in main()
896 * One problem with immedhook is it means we can't do -e. Problem in main()
899 * resolution -- in fact it is certain the primitive types at the end in main()
905 "%s: Sorry, -e can't be used without -I or -C\n", in main()
923 /* captoinfo's no-argument case */ in main()
956 if (!strcmp(source_file, "-")) { in main()
999 if (matches(namelst, qp->tterm.term_names)) { in main()
1000 int len = fmt_entry(&qp->tterm, NULL, FALSE, TRUE, infodump, numbers); in main()
1006 _nc_first_name(qp->tterm.term_names), in main()
1015 _nc_curr_col = _nc_curr_line = -1; in main()
1018 if (matches(namelst, qp->tterm.term_names)) { in main()
1020 _nc_set_type(_nc_first_name(qp->tterm.term_names)); in main()
1021 _nc_curr_line = (int) qp->startline; in main()
1022 repair_acsc(&qp->tterm); in main()
1023 dump_entry(&qp->tterm, suppress_untranslatable, in main()
1031 if (matches(namelst, qp->tterm.term_names)) in main()
1036 _nc_curr_col = _nc_curr_line = -1; in main()
1039 if (matches(namelst, qp->tterm.term_names)) { in main()
1040 long j = qp->cend - qp->cstart; in main()
1044 _nc_set_type(_nc_first_name(qp->tterm.term_names)); in main()
1047 (void) fseek(tmp_fp, qp->cstart, SEEK_SET); in main()
1048 while (j-- > 0) { in main()
1060 repair_acsc(&qp->tterm); in main()
1061 dump_entry(&qp->tterm, suppress_untranslatable, in main()
1063 for (j = 0; j < (long) qp->nuses; j++) in main()
1064 dump_uses(qp->uses[j].name, !capdump); in main()
1075 (void) fseek(tmp_fp, _nc_tail->cend, SEEK_SET); in main()
1112 * references to locations in the arrays Booleans, Numbers, and Strings ---
1116 #define CUR tp->
1119 * Check if the alternate character-set capabilities are consistent.
1137 * vt100-like is frequently used, but perhaps ena_acs is missing, etc. in check_acs()
1165 _nc_warning("VT100-style rmacs/smacs require enacs"); in check_acs()
1198 _nc_warning("acsc is missing some line-drawing mapping: %s", missing); in check_acs()
1331 long result = -1; in keypad_index()
1334 const char *list = "PQRSwxymtuvlqrsPpn"; /* app-keypad except "Enter" */ in keypad_index()
1337 result = (long) (test - list); in keypad_index()
1434 } else if (strchr(tp->term_names, '+') == NULL) { in check_cursor()
1461 _nc_warning("terminal lacks cursor column-addressing"); in check_cursor()
1463 _nc_warning("terminal lacks cursor row-addressing"); in check_cursor()
1467 /* it is rare to have an insert-line feature without a matching delete */ in check_cursor()
1472 /* if we have a parameterized form, then the non-parameterized is easy */ in check_cursor()
1540 * Do a quick sanity-check for vt100-style keypads to see if the 5-key keypad
1585 if (list[j] > list[j - 1]) { in check_keypad()
1590 if (increase != (MAX_KP - 1)) { in check_keypad()
1595 for (j = 0, last = -1; j < MAX_KP; ++j) { in check_keypad()
1600 for (k = 0, kk = -1, test = 100; k < 5; ++k) { in check_keypad()
1652 * These warnings are useful for consistency checks - it is possible that in check_keypad()
1692 * If we have a parameterized form, then the non-parameterized is easy. in check_printer()
1693 * note: parameterized/non-parameterized margin settings are unrelated. in check_printer()
1730 char *name = _nc_first_name(tp->term_names); in check_screen()
1804 /* *INDENT-OFF* */ in expected_params()
1809 DATA( "S0", 1 ), /* 'screen' extension */ in expected_params()
1869 DATA( "u6", -1 ), in expected_params()
1874 /* *INDENT-ON* */ in expected_params()
1878 int result = 0; /* function-keys, etc., use none */ in expected_params()
1891 * Check for user-capabilities that happen to be used in ncurses' terminal
1907 * If a given name is likely to be a user-capability, return the number of
1908 * parameters it would be used with. If not, return -1.
1910 * ncurses assumes that u6 could be used for getting the cursor-position, but
1914 * The other string-capability extensions (see terminfo.src) which could have
1921 int result = -1; in is_user_capability()
1931 result = (int) p->ute_argc; in is_user_capability()
2030 n = (*s - '0'); in check_params()
2134 *flag = -1; in skip_DECSCNM()
2180 } else if (!(isalnum(UChar(*q)) || strchr("+-.", *q) != 0)) { in check_delays()
2193 (int) (q - base), base); in check_delays()
2195 _nc_warning("function-key %s has delay", name); in check_delays()
2197 _nc_warning("non-line capability using proportional delay: %s", name); in check_delays()
2200 strchr(_nc_first_name(tp->term_names), '+') == NULL) { in check_delays()
2208 p = q - 1; /* restart scan */ in check_delays()
2221 _nc_warning("expected delay embedded within %s", name); in check_delays()
2227 * Check for missing delay when using VT100 reverse-video. in check_delays()
2259 _nc_SLIMIT(sizeof(blob) - (size_t) (next - blob)) in check_1_infotocap()
2305 #define myParam(n) (p_is_s[n - 1] != 0 ? ((TPARM_ARG) strings[n]) : numbers[n]) in check_1_infotocap()
2334 (*delays) = (*delays) * 10 + (*src++ - '0'); in parse_delay_value()
2342 (*delays) += (*src++ - '0') / gotdot; in parse_delay_value()
2355 *delays = -(*delays); in parse_delay_value()
2389 * Compare terminfo- and termcap-strings, factoring out delays.
2392 same_ti_tc(const char *ti, const char *tc, bool * embedded) in same_ti_tc() argument
2399 *embedded = FALSE; in same_ti_tc()
2415 *embedded = TRUE; in same_ti_tc()
2429 if (*embedded) { in same_ti_tc()
2433 *embedded = FALSE; /* report only one problem */ in same_ti_tc()
2451 _nc_warning("tic-expansion of %s failed", name); in check_infotocap()
2454 bool embedded; in check_infotocap() local
2462 _nc_warning("tic-conversion of %s failed", name); in check_infotocap()
2486 _nc_warning("tparm-conversion of %s(%d) differs between\n\tterminfo %s\n\ttermcap %s", in check_infotocap()
2494 } else if (params == 0 && !same_ti_tc(ti_value, tc_value, &embedded)) { in check_infotocap()
2495 if (embedded) { in check_infotocap()
2496 _nc_warning("termcap equivalent of %s cannot use embedded delay", name); in check_infotocap()
2498 _nc_warning("tic-conversion of %s changed value\n\tfrom %s\n\tto %s", in check_infotocap()
2516 * the latter may have a worst-case delay on the end.
2669 #ifdef TRACE
2671 * If tic is compiled with TRACE, we'll be able to see the output from the
2710 char *a = tp->Strings[all_fkeys[j].offset]; in get_fkey_list()
2722 result[used].keycode = -1; in get_fkey_list()
2724 result[used].value = tp->Strings[j]; in get_fkey_list()
2736 if (data->keycode > 0) { in show_fkey_name()
2737 fprintf(stderr, " %s", keyname(data->keycode)); in show_fkey_name()
2738 fprintf(stderr, " (capability \"%s\")", data->name); in show_fkey_name()
2740 fprintf(stderr, " capability \"%s\"", data->name); in show_fkey_name()
2800 /* *INDENT-OFF* */ in check_conflict()
2816 /* *INDENT-ON* */ in check_conflict()
2870 if (similar_sgr(-1, trimmed, test) || in check_exit_attribute()
2871 similar_sgr(-1, untrimmed, test)) { in check_exit_attribute()
2915 int ncv = ((code != 0) ? (1 << (code - 1)) : 0); in check_sgr_param()
2927 param = 10 * param + (*test - '0'); in check_sgr_param()
2936 if ((skips-- <= 0) && (param == code)) in check_sgr_param()
2948 _nc_warning("\"%s\" SGR-attribute used in %s", in check_sgr_param()
2961 int result = -1; in standard_type()
2965 result = np->nte_type; in standard_type()
3033 while (p-- > 0) { in check_ANSI_cap()
3102 size_t have = strlen(value) - 1; in isValidEscape()
3116 int result = -1; in guess_ANSI_VTxx()
3119 /* VT100s have scrolling region, but ANSI (ECMA-48) does not specify */ in guess_ANSI_VTxx()
3149 * In particular, any ECMA-48 terminal should support these, though the details
3172 if (strchr(tp->term_names, '+') != NULL) in check_user_6789()
3178 _nc_warning("expected u8/u9 for device-attributes"); in check_user_6789()
3183 _nc_warning("expected u6/u7 for cursor-position"); in check_user_6789()
3192 /* other sanity-checks (things that we don't want in the normal
3203 char *a = tp->Strings[j]; in check_termtype()
3222 /* in extended mode, verify that each extension is expected type */ in check_termtype()
3337 #ifdef TRACE in check_termtype()
3341 ("can write to lower-right directly")); in check_termtype()
3344 ("can write to lower-right by suppressing automargin")); in check_termtype()
3348 ("can write to lower-right by using inserts")); in check_termtype()
3351 ("cannot write to lower-right")); in check_termtype()
3356 * Some standard applications (e.g., vi) and some non-curses in check_termtype()
3363 _nc_warning("non-curses applications may be confused by ich1 with smir/rmir"); in check_termtype()
3367 * Finally, do the non-verbose checks in check_termtype()