diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-14 11:29:47 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-14 11:29:47 +0000 |
commit | 84fd53484ac1e0aa8d95b4339861c78e979ad52c (patch) | |
tree | 8506e2afadabb0775d8c33534c333db6c12ee83f /Build/source/texk/ttfdump/src | |
parent | 5a59d9768db59127880edef385f6a3bb3671436c (diff) |
ttfdump: Use libkpathsea instead of copying xmalloc() & Co (from W32TeX)
git-svn-id: svn://tug.org/texlive/trunk@27042 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ttfdump/src')
-rw-r--r-- | Build/source/texk/ttfdump/src/ttfdump.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Build/source/texk/ttfdump/src/ttfdump.c b/Build/source/texk/ttfdump/src/ttfdump.c index 0726b3b0e5f..aa1a9ce4b3f 100644 --- a/Build/source/texk/ttfdump/src/ttfdump.c +++ b/Build/source/texk/ttfdump/src/ttfdump.c @@ -1,7 +1,16 @@ #include <string.h> #include <stdio.h> #include <stdlib.h> -#ifdef WIN32 + +#if defined(KPATHSEA) +/* including <kpathsea/kpathsea.h> would yield conflicting typedefs */ +#include <kpathsea/lib.h> +#include <kpathsea/tex-file.h> +#include <kpathsea/c-fopen.h> +#include <kpathsea/progname.h> +#include <kpathsea/c-unistd.h> +#include <kpathsea/getopt.h> +#elif defined(WIN32) #include <getopt.h> #else #include <unistd.h> @@ -74,6 +83,10 @@ main(int argc, char *argv[]) /* print all glyphs by default */ int glyphnum = ALL_GLYF, collection = 0; +#ifdef KPATHSEA + kpse_set_program_name(argv[0], "ttfdump"); +#endif + if (argc < 2) { usage(); @@ -129,9 +142,12 @@ main(int argc, char *argv[]) } if (!strcmp(dumpname, "-")) { +#ifdef WIN32 + _setmode(fileno(stdout), _O_BINARY); +#endif dp_file = stdout; } - else if ((dp_file = fopen(dumpname, "wt")) == NULL) + else if ((dp_file = fopen(dumpname, "wb")) == NULL) { fprintf(stderr, "Can't open dumping file\n"); exit(EXIT_FAILURE); |