=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tic/dump_entry.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** src/usr.bin/tic/dump_entry.c 1998/07/27 03:26:10 1.1 --- src/usr.bin/tic/dump_entry.c 1998/11/03 21:59:53 1.2 *************** *** 1,3 **** --- 1,5 ---- + /* $OpenBSD: dump_entry.c,v 1.2 1998/11/03 21:59:53 millert Exp $ */ + /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * * * *************** *** 38,47 **** #include /* this C file is generated */ #include /* so is this */ ! MODULE_ID("$Id: dump_entry.c,v 1.1 1998/07/27 03:26:10 millert Exp $") #define INDENT 8 static int tversion; /* terminfo version */ static int outform; /* output format to use */ static int sortmode; /* sort mode to use */ --- 40,51 ---- #include /* this C file is generated */ #include /* so is this */ ! MODULE_ID("$From: dump_entry.c,v 1.29 1998/09/26 13:15:00 tom Exp $") #define INDENT 8 + #define DISCARD(string) string = ABSENT_STRING + static int tversion; /* terminfo version */ static int outform; /* output format to use */ static int sortmode; /* sort mode to use */ *************** *** 451,457 **** int fmt_entry(TERMTYPE *tterm, int (*pred)(int type, int idx), bool suppress_untranslatable, ! bool infodump) { int i, j; char buffer[MAX_TERMINFO_LENGTH]; --- 455,462 ---- int fmt_entry(TERMTYPE *tterm, int (*pred)(int type, int idx), bool suppress_untranslatable, ! bool infodump, ! bool numbers) { int i, j; char buffer[MAX_TERMINFO_LENGTH]; *************** *** 557,562 **** --- 562,568 ---- * them to be output as defined and empty. */ if (outform==F_TERMCAP) + { #undef CUR #define CUR tterm-> if (insert_character || parm_ich) *************** *** 576,581 **** --- 582,598 ---- } } + if (init_3string != 0 + && termcap_reset != 0 + && !strcmp(init_3string, termcap_reset)) + DISCARD(init_3string); + + if (reset_2string != 0 + && termcap_reset != 0 + && !strcmp(reset_2string, termcap_reset)) + DISCARD(reset_2string); + } + predval = pred(STRING, i); buffer[0] = '\0'; if (predval != FAIL) { *************** *** 586,592 **** sprintf(buffer, "%s@", str_names[i]); else if (outform == F_TERMCAP || outform == F_TCONVERR) { ! char *srccap = _nc_tic_expand(tterm->Strings[i], FALSE); char *cv = _nc_infotocap(str_names[i], srccap, parametrized[i]); if (cv == 0) --- 603,609 ---- sprintf(buffer, "%s@", str_names[i]); else if (outform == F_TERMCAP || outform == F_TCONVERR) { ! char *srccap = _nc_tic_expand(tterm->Strings[i], FALSE, numbers); char *cv = _nc_infotocap(str_names[i], srccap, parametrized[i]); if (cv == 0) *************** *** 604,610 **** } else { ! char *src = _nc_tic_expand(tterm->Strings[i], outform==F_TERMINFO); sprintf(buffer, "%s=", str_names[i]); if (pretty && outform==F_TERMINFO) fmt_complex(buffer + strlen(buffer), src, 1); --- 621,627 ---- } else { ! char *src = _nc_tic_expand(tterm->Strings[i], outform==F_TERMINFO, numbers); sprintf(buffer, "%s=", str_names[i]); if (pretty && outform==F_TERMINFO) fmt_complex(buffer + strlen(buffer), src, 1); *************** *** 663,669 **** if (box_ok) { (void) strcpy(buffer, "box1="); ! (void) strcat(buffer, _nc_tic_expand(boxchars, outform==F_TERMINFO)); WRAP_CONCAT; } } --- 680,686 ---- if (box_ok) { (void) strcpy(buffer, "box1="); ! (void) strcat(buffer, _nc_tic_expand(boxchars, outform==F_TERMINFO, numbers)); WRAP_CONCAT; } } *************** *** 708,714 **** return(infodump ? len : termcap_length(outbuf)); } ! int dump_entry(TERMTYPE *tterm, bool limited, int (*pred)(int type, int idx)) /* dump a single entry */ { int len, critlen; --- 725,731 ---- return(infodump ? len : termcap_length(outbuf)); } ! int dump_entry(TERMTYPE *tterm, bool limited, bool numbers, int (*pred)(int type, int idx)) /* dump a single entry */ { int len, critlen; *************** *** 729,739 **** infodump = TRUE; } ! if (((len = fmt_entry(tterm, pred, FALSE, infodump)) > critlen) && limited) { (void) printf("# (untranslatable capabilities removed to fit entry within %d bytes)\n", critlen); ! if ((len = fmt_entry(tterm, pred, TRUE, infodump)) > critlen) { /* * We pick on sgr because it's a nice long string capability that --- 746,756 ---- infodump = TRUE; } ! if (((len = fmt_entry(tterm, pred, FALSE, infodump, numbers)) > critlen) && limited) { (void) printf("# (untranslatable capabilities removed to fit entry within %d bytes)\n", critlen); ! if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) { /* * We pick on sgr because it's a nice long string capability that *************** *** 743,749 **** set_attributes = ABSENT_STRING; (void) printf("# (sgr removed to fit entry within %d bytes)\n", critlen); ! if ((len = fmt_entry(tterm, pred, TRUE, infodump)) > critlen) { int oldversion = tversion; --- 760,766 ---- set_attributes = ABSENT_STRING; (void) printf("# (sgr removed to fit entry within %d bytes)\n", critlen); ! if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) { int oldversion = tversion; *************** *** 751,757 **** (void) printf("# (terminfo-only capabilities suppressed to fit entry within %d bytes)\n", critlen); ! if ((len = fmt_entry(tterm, pred, TRUE, infodump)) > critlen) { (void) fprintf(stderr, "warning: %s entry is %d bytes long\n", --- 768,774 ---- (void) printf("# (terminfo-only capabilities suppressed to fit entry within %d bytes)\n", critlen); ! if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) { (void) fprintf(stderr, "warning: %s entry is %d bytes long\n",