wdvi

network DVI viewer
Log | Files | Refs

commit 45835f5a6cb4df64ac25b2a2c1d193894a0ee958
parent ce21475c202a0fcbf05efd5d88fca490f09fba61
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Thu, 26 Aug 2021 01:04:35 +0000

Remove USE_GF support.

It looks like gf (generic fonts) are not used much anymore.

Diffstat:
Mdvi-draw.c | 6------
Mdvi-init.c | 4----
Mfilefind.c | 101++++++-------------------------------------------------------------------------
Mfilefind.h | 6------
Mfont-open.c | 38--------------------------------------
Mxdvi.c | 6------
6 files changed, 7 insertions(+), 154 deletions(-)

diff --git a/dvi-draw.c b/dvi-draw.c @@ -2170,12 +2170,6 @@ static struct findrec search_tex = { /* no_f_str */ no_f_str_tex, /* no_f_str_end */ no_f_str_tex + sizeof(no_f_str_tex) - 1, /* abs_str */ "%f", -#if USE_GF - /* no_f_str_flags */ F_FILE_USED, - /* abs_str_flags */ F_FILE_USED, - /* pk_opt_char */ 'f', - /* pk_gf_addr */ NULL, -#endif /* pct_s_str */ "%qtex//", { /* v.stephead */ NULL, diff --git a/dvi-init.c b/dvi-init.c @@ -271,10 +271,6 @@ load_font(fontp) magic = two(fontp->file); if (magic == PK_MAGIC) read_PK_index(fontp, WIDENINT hushcs); else -#if USE_GF - if (magic == GF_MAGIC) read_GF_index(fontp, WIDENINT hushcs); - else -#endif if (magic == VF_MAGIC) read_VF_index(fontp, WIDENINT hushcs); else oops("Cannot recognize format for font file %s", fontp->filename); diff --git a/filefind.c b/filefind.c @@ -115,10 +115,6 @@ static int seqno; static struct texmfrec *texmfhead = NULL; static struct rootrec **rootpp; static const struct atomrec *treeatom; -#if USE_GF -static int gflags; /* global flags */ -static Boolean pk_second_pass; -#endif /* dummy records for handling %s after // or wild cards */ static struct atomrec pct_s_dummy = {NULL, NULL, NULL, F_PCT_S}; @@ -976,10 +972,6 @@ atomize(p0, sp) if (*p == '%' && p[1] != '\0' && p[1] != '/') { ++p; if (*p == 'f') sp->flags |= F_FILE_USED; -#if USE_GF - /* set it in sp because we may never reach try_to_open*/ - else if (*p == lrec.pk_opt_char) sp->flags |= F_PK_USED; -#endif else if (*p == 's' && (p[1] == '\0' || IS_SEP(p[1]))) { --p; percent_s = True; @@ -1082,10 +1074,6 @@ prescan2(sp, p, skip) flags |= F_FILE_USED | F_VARIABLE; else if (*p == 'F' || *p == lrec.x_var_char) flags |= F_VARIABLE; -#if USE_GF - else if (*p == lrec.pk_opt_char) - flags |= F_PK_USED; -#endif /* %c and %C are sorted out later. */ } else if (*p == '*' || *p == '?' || *p == '[') { @@ -1295,9 +1283,6 @@ atomize_pct_s() dummy.flags = 0; atomize(sp->str, &dummy); *app = dummy.atom; -#if USE_GF - dummy.atom->flags |= dummy.flags; -#endif } } @@ -1564,27 +1549,11 @@ xlat(stat_in, stat_ret, pos0, p, lastp) /* - * TRY_TO_OPEN - Try to open the file. Exit via longjmp() if success. + * Try to open the file. Exit via longjmp() if success. */ - -#if USE_GF -#define TRY_TO_OPEN(pos, flags) try_to_open(pos, flags) -#else -#define TRY_TO_OPEN(pos, flags) try_to_open(pos) -#endif - static void -TRY_TO_OPEN(pos, flags) - unsigned pos; -#if USE_GF - int flags; -#endif +try_to_open(unsigned pos, int flags) { -#if USE_GF - gflags |= flags; - if (pk_second_pass && !(flags & F_PK_USED)) - return; -#endif ffline[pos] = '\0'; if (FFDEBUG) @@ -2201,7 +2170,7 @@ do_tree_search(treepp, atom, goback, pos, flags) */ if (atom == NULL) { - TRY_TO_OPEN(pos - 1, flags); + try_to_open(pos - 1, flags); return; } @@ -2255,7 +2224,7 @@ do_tree_search(treepp, atom, goback, pos, flags) if (atom->next == NULL && !(atom->flags & F_WILD)) /* if we can try a file */ - TRY_TO_OPEN(xlat(NULL, NULL, pos, atom->p, atom->p_end), + try_to_open(xlat(NULL, NULL, pos, atom->p, atom->p_end), flags | atom->flags); if (*treepp == &not_read_yet) /* if readdir() not done yet */ @@ -2296,17 +2265,6 @@ begin_tree_search(status, oneatom, twoatom) { struct treerec **tpp; -#if USE_GF - { - int flags = status->flags; - - if (twoatom != NULL) - flags |= twoatom->flags; - if (pk_second_pass && !(flags & F_PK_USED)) - return; - } -#endif - #if 0 { const struct atomrec *atom; @@ -2426,7 +2384,7 @@ begin_tree_search(status, oneatom, twoatom) stat1.pos += len; (void) xlat(&stat1, &stat1, 0, r->fullpat, r->fullpat_end); - TRY_TO_OPEN(stat1.pos, stat1.flags); + try_to_open(stat1.pos, stat1.flags); return; } lp = lp->next; @@ -2437,9 +2395,6 @@ begin_tree_search(status, oneatom, twoatom) } if ((r->flags & (F_QUICKFIND | F_QUICKONLY)) == (F_QUICKFIND | F_QUICKONLY)) { -#if USE_GF - gflags |= status->flags; -#endif return; } } @@ -2483,11 +2438,8 @@ dostep(sp, stat0) if (!(status.flags & F_FILE_USED)) { (void) xlat(&status, &status, 0, lrec.no_f_str, lrec.no_f_str_end); -#if USE_GF - status.flags |= lrec.no_f_str_flags; -#endif } - TRY_TO_OPEN(status.pos, status.flags); + try_to_open(status.pos, status.flags); } } @@ -2615,19 +2567,7 @@ pathpart(p) } bcopy(tp->str, ffline + status.pos, tp->len); status.pos += tp->len; -#if ! USE_GF - dostep(sp, &status); -#else - if (lrec.pk_gf_addr != NULL) *lrec.pk_gf_addr = "pk"; - pk_second_pass = False; - gflags = 0; dostep(sp, &status); - if (gflags & F_PK_USED) { - *lrec.pk_gf_addr = "gf"; - pk_second_pass = True; - dostep(sp, &status); - } -#endif } } else { @@ -2640,19 +2580,7 @@ pathpart(p) bcopy(sp->home, ffline, len); status.pos = len; } -#if ! USE_GF - dostep(sp, &status); -#else - if (lrec.pk_gf_addr != NULL) *lrec.pk_gf_addr = "pk"; - pk_second_pass = False; - gflags = 0; dostep(sp, &status); - if (gflags & F_PK_USED) { - *lrec.pk_gf_addr = "gf"; - pk_second_pass = True; - dostep(sp, &status); - } -#endif } return sp->nextpart; @@ -2769,24 +2697,9 @@ filefind(name, srchtype, path_ret) bcopy(pw->pw_dir, ffline, pos0); fF_values[0] = fF_values[1] = name; } -#if ! USE_GF - pos = xlat(NULL, NULL, pos0, lrec.abs_str, - lrec.abs_str + strlen(lrec.abs_str)); - TRY_TO_OPEN(pos, 0); -#else - if (lrec.pk_gf_addr != NULL) *lrec.pk_gf_addr = "pk"; - pk_second_pass = False; pos = xlat(NULL, NULL, pos0, lrec.abs_str, lrec.abs_str + strlen(lrec.abs_str)); - TRY_TO_OPEN(pos, lrec.abs_str_flags); - if (lrec.abs_str_flags & F_PK_USED) { - *lrec.pk_gf_addr = "gf"; - pk_second_pass = True; - pos = xlat(NULL, NULL, pos0, lrec.abs_str, - lrec.abs_str + strlen(lrec.abs_str)); - TRY_TO_OPEN(pos, lrec.abs_str_flags); - } -#endif + try_to_open(pos, 0); } else { const char *p; diff --git a/filefind.h b/filefind.h @@ -57,12 +57,6 @@ struct findrec { const char *no_f_str; const char *no_f_str_end; const char *abs_str; -#if USE_GF - int no_f_str_flags; - int abs_str_flags; - char pk_opt_char; - const char **pk_gf_addr; -#endif const char *pct_s_str; struct { diff --git a/font-open.c b/font-open.c @@ -70,12 +70,6 @@ static struct findrec search_pkgf = { /* no_f_str */ no_f_str_pkgf, /* no_f_str_end */ no_f_str_pkgf + sizeof(no_f_str_pkgf) - 1, /* abs_str */ "%f.%d%p", -#ifdef USE_GF - /* no_f_str_flags */ F_FILE_USED | F_PK_USED, - /* abs_str_flags */ F_FILE_USED | F_PK_USED, - /* pk_opt_char */ 'p', - /* pk_gf_addr */ &fF_values[4], -#endif /* pct_s_str */ "%qfonts/%p/%m//:%qfonts/%p/modeless//", { /* v.stephead */ NULL, @@ -105,12 +99,6 @@ static struct findrec search_vf = { /* no_f_str */ no_f_str_vf, /* no_f_str_end */ no_f_str_vf + sizeof(no_f_str_vf) - 1, /* abs_str */ "%f.vf", -#ifdef USE_GF - /* no_f_str_flags */ F_FILE_USED, - /* abs_str_flags */ F_FILE_USED, - /* pk_opt_char */ 'f', /* none */ - /* pk_gf_addr */ NULL, -#endif /* pct_s_str */ "%qfonts/vf//", { /* v.stephead */ NULL, @@ -151,12 +139,6 @@ static struct findrec search_dvips_cf = { /* no_f_str */ no_f_str_dvips_cf, /* no_f_str_end */ no_f_str_dvips_cf + sizeof no_f_str_dvips_cf -1, /* abs_str */ "%f", -# if USE_GF - /* no_f_str_flags */ F_FILE_USED, - /* abs_str_flags */ F_FILE_USED, - /* pk_opt_char */ 'f', /* none */ - /* pk_gf_addr */ NULL, -# endif /* pct_s_str */ "%qdvips//", { /* v.stephead */ NULL, @@ -186,12 +168,6 @@ static struct findrec search_fontmap = { /* no_f_str */ no_f_str_fontmap, /* no_f_str_end */ no_f_str_fontmap + sizeof no_f_str_fontmap -1, /* abs_str */ "%f", -# if USE_GF - /* no_f_str_flags */ F_FILE_USED, - /* abs_str_flags */ F_FILE_USED, - /* pk_opt_char */ 'f', /* none */ - /* pk_gf_addr */ NULL, -# endif /* pct_s_str */ "%qfonts/map/{xdvi,dvips,pdftex}//:%qfonts/map//", { /* v.stephead */ NULL, @@ -221,12 +197,6 @@ static struct findrec search_enc = { /* no_f_str */ no_f_str_enc, /* no_f_str_end */ no_f_str_enc + sizeof no_f_str_enc -1, /* abs_str */ "%f", -# if USE_GF - /* no_f_str_flags */ F_FILE_USED, - /* abs_str_flags */ F_FILE_USED, - /* pk_opt_char */ 'f', /* none */ - /* pk_gf_addr */ NULL, -# endif /* pct_s_str */ "%qfonts/enc//", { /* v.stephead */ NULL, @@ -256,12 +226,6 @@ static struct findrec search_type1 = { /* no_f_str */ no_f_str_type1, /* no_f_str_end */ no_f_str_type1 + sizeof(no_f_str_type1) - 1, /* abs_str */ "%f", -# if USE_GF - /* no_f_str_flags */ F_FILE_USED, - /* abs_str_flags */ F_FILE_USED, - /* pk_opt_char */ 'f', - /* pk_gf_addr */ NULL, -# endif /* pct_s_str */ "%qfonts/type1//", { /* v.stephead */ NULL, @@ -1541,9 +1505,7 @@ init_font_open() fF_values[2] = dpi_string; fF_values[3] = bdpi_string; -#ifndef USE_GF fF_values[4] = "pk"; -#endif fF_values[5] = resource.mfmode; #if CFGFILE diff --git a/xdvi.c b/xdvi.c @@ -1144,12 +1144,6 @@ static struct findrec search_text = { /* no_f_str */ no_f_str_text, /* no_f_str_end */ no_f_str_text + sizeof(no_f_str_text) - 1, /* abs_str */ "%f", -#if USE_GF - /* no_f_str_flags */ F_FILE_USED, - /* abs_str_flags */ F_FILE_USED, - /* pk_opt_char */ 'f', - /* pk_gf_addr */ NULL, -#endif /* pct_s_str */ ":xdvi:web2c", { /* v.stephead */ NULL,