wdvi

network DVI viewer
Log | Files | Refs

commit 479333262ab24b7d49375155a6bf22fd3bf84c53
parent 967f233b1487ee0a626e699f8e3c0fe23ee2adbb
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Sat, 28 Aug 2021 15:17:35 +0000

Remove EXTRA_APP_DEFAULTS

Diffstat:
Mxdvi.c | 91+++----------------------------------------------------------------------------
Mxdvi.h | 4----
2 files changed, 3 insertions(+), 92 deletions(-)

diff --git a/xdvi.c b/xdvi.c @@ -314,17 +314,8 @@ static const char base_translations[] = "" static char XtRBool3[] = "Bool3"; /* resource for Bool3 */ -#if EXTRA_APP_DEFAULTS -static XtResource pre_app_resources[] = { -{"name", "Name", XtRString, sizeof(char *), - offset(progname), XtRString, (XtPointer) NULL}, -{"debugLevel", "DebugLevel", XtRString, sizeof(char *), - offset(debug_arg), XtRString, (XtPointer) NULL}, -}; -#endif - static XtResource application_resources[] = { -#if CFGFILE && !EXTRA_APP_DEFAULTS +#if CFGFILE {"name", "Name", XtRString, sizeof(char *), offset(progname), XtRString, (XtPointer) NULL}, #endif @@ -395,10 +386,8 @@ static XtResource application_resources[] = { offset(copy), XtRString, "false"}, {"thorough", "Thorough", XtRBoolean, sizeof(Boolean), offset(thorough), XtRString, "false"}, -#if !EXTRA_APP_DEFAULTS {"debugLevel", "DebugLevel", XtRString, sizeof(char *), offset(debug_arg), XtRString, (XtPointer) NULL}, -#endif {"version", "Version", XtRBoolean, sizeof(Boolean), offset(version_flag), XtRString, "false"}, {"magnifierSize1", "MagnifierSize", XtRString, sizeof(char *), @@ -1058,44 +1047,6 @@ set_paper_type() { } -#if EXTRA_APP_DEFAULTS - -/* - * Information on how to search for miscellaneous text files. - */ - -#include "filf-app.h" /* application-related defs, etc. */ -#include "filefind.h" - -static const char no_f_str_text[] = "/%f"; - -static struct findrec search_text = { - /* path1 */ NULL, -#if CFGFILE - /* envptr */ NULL, -#endif - /* path2 */ ".:%S", - /* type */ "miscellaneous text", - /* fF_etc */ "fF", - /* x_var_char */ 'f', - /* n_var_opts */ 2, - /* no_f_str */ no_f_str_text, - /* no_f_str_end */ no_f_str_text + sizeof(no_f_str_text) - 1, - /* abs_str */ "%f", - /* pct_s_str */ ":xdvi:web2c", - { - /* v.stephead */ NULL, - /* v.pct_s_head */ NULL, - /* v.pct_s_count */ 0, - /* v.pct_s_atom */ NULL, - /* v.rootp */ NULL, - } -}; - -#endif /* EXTRA_APP_DEFAULTS */ - - - struct modifierinf { int len; const char *name; @@ -1441,40 +1392,6 @@ or invalid argument:\n\t\"%s\", \"%s\".", <Btn1Down>:set()\n\ <Btn1Up>:notify()unset()"); -#if EXTRA_APP_DEFAULTS - /* get resource.progname and resource.debug_arg */ - XtGetApplicationResources(top_level, (XtPointer) &resource, - pre_app_resources, XtNumber(pre_app_resources), (ArgList) NULL, 0); - - if (resource.progname != NULL) - prog = resource.progname; - if (resource.debug_arg != NULL) - debug = isdigit(*resource.debug_arg) ? atoi(resource.debug_arg) - : DBG_ALL; - - readconfig(); - - search_text.path1 = getenv("XDVIINPUTS"); - search_text.envptr = ffgetenv("XDVIINPUTS"); - /* clear it if it's a getenv() placeholder */ - if (search_text.envptr != NULL && search_text.envptr->value == NULL) - search_text.envptr = NULL; - - { - FILE *f; - const char *path; - XrmDatabase db; - - f = filefind("XDvi", &search_text, &path); - if (f != NULL) { - fclose(f); /* too early to worry about n_files_left */ - db = XtScreenDatabase(SCRN); - (void) XrmCombineFileDatabase(path, &db, False); - free((char *) path); - } - } -#endif /* EXTRA_APP_DEFAULTS */ - { XrmDatabase db = XtScreenDatabase(SCRN); @@ -1493,7 +1410,7 @@ or invalid argument:\n\t\"%s\", \"%s\".", (ArgList) NULL, 0); shrink_factor = resource.shrinkfactor; -#if CFGFILE && !EXTRA_APP_DEFAULTS +#if CFGFILE if (resource.progname != NULL) prog = resource.progname; #endif @@ -1504,11 +1421,9 @@ or invalid argument:\n\t\"%s\", \"%s\".", exit(0); } -#if !EXTRA_APP_DEFAULTS if (resource.debug_arg != NULL) debug = isdigit(*resource.debug_arg) ? atoi(resource.debug_arg) : DBG_ALL; -#endif /* Check early for whether to pass off to a different xdvi process * (-sourceposition argument for reverse source special lookup). */ @@ -1730,7 +1645,7 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr); if (mg_size[i].h <= 0) mg_size[i].w = 0; } } -#if CFGFILE && !EXTRA_APP_DEFAULTS +#if CFGFILE readconfig(); /* read config file(s). */ #endif diff --git a/xdvi.h b/xdvi.h @@ -56,10 +56,6 @@ NOTE: #define WORDS_BIGENDIAN 1 #endif -#if EXTRA_APP_DEFAULTS && !SELFAUTO -#define SELFAUTO 1 -#endif - #if SELFAUTO && !defined(DEFAULT_CONFIG_PATH) #define DEFAULT_CONFIG_PATH \ ".:$SELFAUTOLOC:$SELFAUTODIR:$SELFAUTOPARENT:$SELFAUTODIR/share/texmf/web2c:$SELFAUTOPARENT/share/texmf/web2c:$SELFAUTODIR/texmf/web2c:$SELFAUTOPARENT/texmf/web2c:$TETEXDIR:$TEXMF/web2c"