summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-05-10 09:41:35 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-05-10 09:41:35 +0000
commitc1662ec68d00b00641d12f2bf30658916311f6e1 (patch)
tree8802df3299f7645915d965a39ab236b43a323f91
parent754df1717eab9c3d5063f4017635939418458ddb (diff)
xdv2pdf: remove obsolete code
git-svn-id: svn://tug.org/texlive/trunk@18184 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/xdv2pdf/ChangeLog6
-rw-r--r--Build/source/texk/xdv2pdf/xdv2pdf_main.c210
-rw-r--r--Build/source/texk/xdv2pdf/xdv_kpse_formats.h12
3 files changed, 9 insertions, 219 deletions
diff --git a/Build/source/texk/xdv2pdf/ChangeLog b/Build/source/texk/xdv2pdf/ChangeLog
index 4f2ae361790..dea22420a2a 100644
--- a/Build/source/texk/xdv2pdf/ChangeLog
+++ b/Build/source/texk/xdv2pdf/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-09 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * xdv2pdf_main.c, xdv_kpse_formats.h (XDV2PDF_OLD_FORMATS):
+ Remove old code (with partial copies from kpathsea).
+ Move extern declaration of xdv2pdf() to header file.
+
2010-03-29 Peter Breitenlohner <peb@mppmu.mpg.de>
* configure.ac: Remove AC_TYPE_SIZE_T, now part of KPSE_COMMON.
diff --git a/Build/source/texk/xdv2pdf/xdv2pdf_main.c b/Build/source/texk/xdv2pdf/xdv2pdf_main.c
index 018ff7ceffe..af940593d2f 100644
--- a/Build/source/texk/xdv2pdf/xdv2pdf_main.c
+++ b/Build/source/texk/xdv2pdf/xdv2pdf_main.c
@@ -37,228 +37,22 @@ authorization from SIL International.
#define MAC_OS_X_VERSION_MIN_REQUIRED 1020
-#include <kpathsea/config.h>
-
-#include <kpathsea/c-fopen.h>
-#include <kpathsea/c-pathch.h>
-#include <stdarg.h>
-#include <kpathsea/cnf.h>
-#include <kpathsea/concatn.h>
-#include <kpathsea/default.h>
-#include <kpathsea/expand.h>
-#include <kpathsea/fontmap.h>
-#include <kpathsea/paths.h>
-#include <kpathsea/pathsearch.h>
+#include <kpathsea/progname.h>
#include <kpathsea/tex-file.h>
-#include <kpathsea/tex-make.h>
-#include <kpathsea/variable.h>
#include "xdv_kpse_formats.h"
/* The program name, for `.PROG' construct in texmf.cnf. (-program) */
string progname = NULL;
-extern int xdv2pdf(int argc, char** argv);
-
-#ifdef XDV2PDF_OLD_FORMATS
-
-#ifndef DEFAULT_OTFFONTS
-#define DEFAULT_OTFFONTS ".:/usr/local/teTeX/share/texmf/fonts/otf//:/usr/TeX/texmf/fonts/otf//"
-#endif
-
-#define INIT_FORMAT(text, default_path, envs) \
- FMT_INFO.type = text; \
- init_path (&FMT_INFO, default_path, envs, NULL)
-
-#define OTFFONTS_ENVS "OTFFONTS"
-
-#define TFM_ENVS "TFMFONTS", "TEXFONTS"
-#define CNF_ENVS "TEXMFCNF"
-#define DB_ENVS "TEXMFDBS"
-#define DVIPS_CONFIG_ENVS "TEXCONFIG"
-#define FONTMAP_ENVS "TEXFONTMAPS", "TEXFONTS", DVIPS_CONFIG_ENVS /* try TEXCONFIG for teTeX 2 */
-#define TEX_PS_HEADER_ENVS "TEXPSHEADERS", "PSHEADERS"
-#define ENC_ENVS "ENCFONTS", "TEXFONTS", TEX_PS_HEADER_ENVS
-#define TYPE1_ENVS "T1FONTS", "T1INPUTS", "TEXFONTS", TEX_PS_HEADER_ENVS
-
-#define FMT_INFO kpse_format_info[format]
-/* Call kpse_set_add_suffixes. */
-#define SUFFIXES(args) kpse_set_suffixes(format, false, args, NULL)
-#define ALT_SUFFIXES(args) kpse_set_suffixes(format, true, args, NULL)
-
-/* Macro subroutines for `init_path'. TRY_ENV checks if an envvar ENAME
- is set and non-null, and sets var to ENAME if so. */
-#define TRY_ENV(ename) do { \
- string evar = ename; \
-} while (0)
-
-/* And EXPAND_DEFAULT calls kpse_expand_default on try_path and the
- present info->path. */
-#define EXPAND_DEFAULT(try_path, source_string) \
- if (try_path) { \
- info->raw_path = try_path; \
- info->path = kpse_expand_default (try_path, info->path); \
- info->path_source = source_string; \
- }
-
-static string
-remove_dbonly(const_string path)
-{
- string ret = XTALLOC(strlen (path) + 1, char), q=ret;
- const_string p=path;
- boolean new_elt=true;
-
- while (*p) {
- if (new_elt && *p && *p == '!' && *(p+1) == '!')
- p += 2;
- else {
- new_elt = (*p == ENV_SEP);
- *q++ = *p++;
- }
- }
- *q = '\0';
- return(ret);
-}
-
-/* Find the final search path to use for the format entry INFO, given
- the compile-time default (DEFAULT_PATH), and the environment
- variables to check (the remaining arguments, terminated with NULL).
- We set the `path' and `path_source' members of INFO. The
- `client_path' member must already be set upon entry. */
-
-static void
-init_path(kpse_format_info_type *info, const_string default_path, ...)
-{
- string env_name;
- string var = NULL;
- va_list ap;
-
- va_start (ap, default_path);
-
- info->default_path = default_path;
-
- /* First envvar that's set to a nonempty value will exit the loop. If
- none are set, we want the first cnf entry that matches. Find the
- cnf entries simultaneously, to avoid having to go through envvar
- list twice -- because of the PVAR?C macro, that would mean having
- to create a str_list and then use it twice. Yuck. */
- while ((env_name = va_arg (ap, string)) != NULL) {
- /* Since sh doesn't like envvar names with `.', check PATH_prog
- as well as PATH.prog. */
- if (!var) {
- /* Try PATH.prog. */
- string evar = concat3 (env_name, ".", kpse_program_name);
- string env_value = getenv (evar);
- if (env_value && *env_value) {
- var = evar;
- } else {
- free (evar);
- /* Try PATH_prog. */
- evar = concat3 (env_name, "_", kpse_program_name);
- env_value = getenv (evar);
- if (env_value && *env_value) {
- var = evar;
- } else {
- free (evar);
- /* Try simply PATH. */
- env_value = getenv (env_name);
- if (env_value && *env_value) {
- var = env_name;
- }
- }
- }
- }
-
- /* If we are initializing the cnf path, don't try to get any
- values from the cnf files; that's infinite loop time. */
- if (!info->cnf_path && info != &kpse_format_info[kpse_cnf_format])
- info->cnf_path = kpse_cnf_get (env_name);
-
- if (var && info->cnf_path)
- break;
- }
- va_end (ap);
-
- /* Expand any extra :'s. For each level, we replace an extra : with
- the path at the next lower level. For example, an extra : in a
- user-set envvar should be replaced with the path from the cnf file.
- things are complicated because none of the levels above the very
- bottom are guaranteed to exist. */
-
- /* Assume we can reliably start with the compile-time default. */
- info->path = info->raw_path = info->default_path;
- info->path_source = "compile-time paths.h";
-
- EXPAND_DEFAULT (info->cnf_path, "texmf.cnf");
- EXPAND_DEFAULT (info->client_path, "program config file");
- if (var)
- EXPAND_DEFAULT (getenv (var), concat (var, " environment variable"));
- EXPAND_DEFAULT (info->override_path, "application override variable");
- info->path = kpse_brace_expand (info->path);
-}
-
-#endif /* XDV2PDF_OLD_FORMATS */
-
int
main(int argc, char** argv)
{
-#ifdef XDV2PDF_OLD_FORMATS
-
- kpse_file_format_type format;
-
- kpse_set_program_name (argv[0], progname);
-
- /* It seems to be critical that I do a kpse_cnf_get to trigger the reading of texmf.cnf files
- BEFORE the INIT_FORMAT stuff below. I don't really understand all the interactions
- of search paths, config files, etc., but for now this is working for me. */
- kpse_cnf_get("TETEXDIR");
-
- format = kpse_cnf_format;
- INIT_FORMAT ("cnf", DEFAULT_TEXMFCNF, CNF_ENVS);
- SUFFIXES (".cnf");
-
- format = kpse_db_format;
- INIT_FORMAT ("ls-R", DEFAULT_TEXMFDBS, DB_ENVS);
- SUFFIXES ("ls-R");
- FMT_INFO.path = remove_dbonly (FMT_INFO.path);
-
- format = xdv_kpse_pfb_format;
- INIT_FORMAT ("type1 fonts", DEFAULT_T1FONTS, TYPE1_ENVS);
- FMT_INFO.binmode = true;
- FMT_INFO.suffix_search_only = true;
- SUFFIXES (".pfb");
-
- format = xdv_kpse_otf_format;
- INIT_FORMAT ("otf fonts", DEFAULT_OTFFONTS, OTFFONTS_ENVS);
- FMT_INFO.binmode = true;
- FMT_INFO.suffix_search_only = true;
- SUFFIXES (".otf");
-
- format = xdv_kpse_tfm_format;
- INIT_FORMAT ("tfm", DEFAULT_TFMFONTS, TFM_ENVS);
- FMT_INFO.binmode = true;
- FMT_INFO.suffix_search_only = true;
- SUFFIXES (".tfm");
-
- format = xdv_kpse_font_map_format;
- INIT_FORMAT ("map", DEFAULT_TEXFONTMAPS, FONTMAP_ENVS);
- FMT_INFO.suffix_search_only = true;
- SUFFIXES (".map");
-
- format = xdv_kpse_enc_format;
- INIT_FORMAT ("enc files", DEFAULT_ENCFONTS, ENC_ENVS);
- FMT_INFO.suffix_search_only = true;
- SUFFIXES (".enc");
-
-#else /* not XDV2PDF_OLD_FORMATS */
-
kpse_set_program_name (argv[0], progname);
/* Initialize type1 search path and change the suffix list. */
kpse_init_format (kpse_type1_format);
kpse_set_suffixes (kpse_type1_format, false, ".pfb", NULL);
-#endif /* not XDV2PDF_OLD_FORMATS */
-
- return xdv2pdf(argc, argv);
+ return xdv2pdf(argc, argv);
}
diff --git a/Build/source/texk/xdv2pdf/xdv_kpse_formats.h b/Build/source/texk/xdv2pdf/xdv_kpse_formats.h
index e480c36bd6c..91efa889c1a 100644
--- a/Build/source/texk/xdv2pdf/xdv_kpse_formats.h
+++ b/Build/source/texk/xdv2pdf/xdv_kpse_formats.h
@@ -28,20 +28,10 @@ use or other dealings in this Software without prior written
authorization from SIL International.
\****************************************************************************/
-#ifdef XDV2PDF_OLD_FORMATS
-
-#define xdv_kpse_otf_format 0
-#define xdv_kpse_pfb_format 1
-#define xdv_kpse_tfm_format 2
-#define xdv_kpse_font_map_format 3
-#define xdv_kpse_enc_format 4
-
-#else /* not XDV2PDF_OLD_FORMATS */
-
#define xdv_kpse_otf_format kpse_opentype_format
#define xdv_kpse_pfb_format kpse_type1_format
#define xdv_kpse_tfm_format kpse_tfm_format
#define xdv_kpse_font_map_format kpse_fontmap_format
#define xdv_kpse_enc_format kpse_enc_format
-#endif /* not XDV2PDF_OLD_FORMATS */
+extern int xdv2pdf(int argc, char** argv);