diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-09-14 03:34:50 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-09-14 03:34:50 +0000 |
commit | 00653d612add044de9f941c7b2c562bebe60d1e8 (patch) | |
tree | 46f2e9aa6440270f015d3e9d3d17f4d4ed709691 /Build/source/texk/dvipdfm-x/dpxfile.c | |
parent | fb833e57545c4b4d76e01406904fdfd83f057447 (diff) |
Cleanup. Remove duplicated code. Reorganize global variables. (S. Hirata)
git-svn-id: svn://tug.org/texlive/trunk@48663 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/dpxfile.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/dpxfile.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/Build/source/texk/dvipdfm-x/dpxfile.c b/Build/source/texk/dvipdfm-x/dpxfile.c index 3a3860412f9..856422cc1f5 100644 --- a/Build/source/texk/dvipdfm-x/dpxfile.c +++ b/Build/source/texk/dvipdfm-x/dpxfile.c @@ -36,6 +36,7 @@ #include "error.h" #include "mem.h" +#include "dpxconf.h" #include "dpxutil.h" #include "mfileio.h" @@ -70,16 +71,6 @@ #endif #endif /* MIKTEX || TESTCOMPILE */ -static int verbose = 0; -int keep_cache = 0; - -void -dpx_file_set_verbose (void) -{ - verbose++; -} - - /* Kpathsea library does not check file type. */ static int qcheck_filetype (const char *fqpn, dpx_res_type type); @@ -359,7 +350,7 @@ insistupdate (const char *filename, #else kpse_format_info_type *fif; kpse_format_info_type *fir; - if (verbose < 1) + if (dpx_conf.verbose_level < 1) return; fif = &kpse_format_info[foolformat]; fir = &kpse_format_info[realformat]; @@ -431,7 +422,7 @@ dpx_open_file (const char *filename, dpx_res_type type) switch (type) { case DPX_RES_TYPE_FONTMAP: fqpn = dpx_find_fontmap_file(filename); - if (verbose) { + if (dpx_conf.verbose_level > 0) { if (fqpn != NULL) MESG(fqpn); } @@ -969,7 +960,7 @@ dpx_delete_old_cache (int life) time_t limit; if (life == -2) { - keep_cache = -1; + dpx_conf.file.keep_cache = -1; return; } @@ -977,7 +968,7 @@ dpx_delete_old_cache (int life) pathname = NEW(strlen(dir)+1+strlen(PREFIX)+MAX_KEY_LEN*2 + 1, char); limit = time(NULL) - life * 60 * 60; - if (life >= 0) keep_cache = 1; + if (life >= 0) dpx_conf.file.keep_cache = 1; if ((dp = opendir(dir)) != NULL) { while((de = readdir(dp)) != NULL) { if (dpx_clear_cache_filter(de)) { @@ -1001,7 +992,7 @@ dpx_delete_temp_file (char *tmp, int force) { if (!tmp) return; - if (force || keep_cache != 1) remove (tmp); + if (force || dpx_conf.file.keep_cache != 1) remove (tmp); RELEASE(tmp); return; |