From 9514ac28f3554491ec2e1598680e2998528509c9 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 28 Sep 2018 23:14:24 -0400 Subject: [PATCH 01/36] tectonic/xetex-constants.h: rename from constants.h --- src/lib.rs | 2 +- tectonic/tectonic.h | 2 +- tectonic/{constants.h => xetex-constants.h} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename tectonic/{constants.h => xetex-constants.h} (99%) diff --git a/src/lib.rs b/src/lib.rs index e2e68c6bc..3ac30a74b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,4 +66,4 @@ pub use errors::{Error, ErrorKind, Result}; const APP_INFO: app_dirs::AppInfo = app_dirs::AppInfo {name: "Tectonic", author: "TectonicProject"}; -const FORMAT_SERIAL: u32 = 28; // keep synchronized with tectonic/constants.h!! +const FORMAT_SERIAL: u32 = 28; // keep synchronized with tectonic/xetex-constants.h!! diff --git a/tectonic/tectonic.h b/tectonic/tectonic.h index 68098560f..8166bbc95 100644 --- a/tectonic/tectonic.h +++ b/tectonic/tectonic.h @@ -56,7 +56,7 @@ int tt_set_string_variable (char *var_name, char *value); END_EXTERN_C -#include "constants.h" +#include "xetex-constants.h" #include "stringpool.h" #endif /* not TECTONIC_TECTONIC_H */ diff --git a/tectonic/constants.h b/tectonic/xetex-constants.h similarity index 99% rename from tectonic/constants.h rename to tectonic/xetex-constants.h index 10b9f37ca..569cd0d5f 100644 --- a/tectonic/constants.h +++ b/tectonic/xetex-constants.h @@ -1,4 +1,4 @@ -/* tectonic/constants.h: symbolic constants from the WEB code +/* tectonic/xetex-constants.h: symbolic constants from the WEB code Copyright 2017-2018 the Tectonic Project Licensed under the MIT License. */ From 9ce4302203513b5779bed3a582cf471d6437b801 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 28 Sep 2018 23:25:43 -0400 Subject: [PATCH 02/36] tectonic: rename stringpool.[ch] => xetex-stringpool.[ch] Requires a bit of header tidying because some of the XeTeX stringpool functions have the same names as ones in bibtex.c. This tidying is good since we should be clearer about partitioning the namespaces anyway. --- build.rs | 15 +++-------- tectonic/stringpool.h | 19 ------------- tectonic/tectonic.h | 3 --- tectonic/{stringpool.c => xetex-stringpool.c} | 4 +-- tectonic/xetex-stringpool.h | 27 +++++++++++++++++++ tectonic/xetexd.h | 10 +++---- 6 files changed, 36 insertions(+), 42 deletions(-) delete mode 100644 tectonic/stringpool.h rename tectonic/{stringpool.c => xetex-stringpool.c} (97%) create mode 100644 tectonic/xetex-stringpool.h diff --git a/build.rs b/build.rs index 2e0c49331..2ccbdf1b2 100644 --- a/build.rs +++ b/build.rs @@ -9,7 +9,6 @@ extern crate pkg_config; extern crate regex; extern crate sha2; -use std::env; use std::path::PathBuf; @@ -26,10 +25,6 @@ fn main() { let deps = pkg_config::Config::new().cargo_metadata(false).probe(LIBS).unwrap(); - // First, emit the string pool C code. Sigh. - - let out_dir = env::var("OUT_DIR").unwrap(); - // Actually I'm not 100% sure that I can't compile the C and C++ code // into one library, but who cares? @@ -160,7 +155,6 @@ fn main() { .file("tectonic/io.c") .file("tectonic/mathutil.c") .file("tectonic/output.c") - .file("tectonic/stringpool.c") .file("tectonic/synctex.c") .file("tectonic/texmfmp.c") .file("tectonic/xetex0.c") @@ -170,11 +164,11 @@ fn main() { .file("tectonic/xetex-linebreak.c") .file("tectonic/xetex-math.c") .file("tectonic/xetex-shipout.c") + .file("tectonic/xetex-stringpool.c") .define("HAVE_ZLIB", "1") .define("HAVE_ZLIB_COMPRESS2", "1") .define("ZLIB_CONST", "1") - .include(".") - .include(&out_dir); + .include("."); let cppflags = [ "-std=c++14", @@ -215,13 +209,12 @@ fn main() { cppcfg .cpp(true) .flag("-Wall") - .file("tectonic/Engine.cpp") + .file("tectonic/xetex-Engine.cpp") .file("tectonic/XeTeXFontInst.cpp") .file("tectonic/XeTeXFontMgr.cpp") .file("tectonic/XeTeXLayoutInterface.cpp") .file("tectonic/XeTeXOTMath.cpp") - .include(".") - .include(&out_dir); + .include("."); for p in deps.include_paths { ccfg.include(&p); diff --git a/tectonic/stringpool.h b/tectonic/stringpool.h deleted file mode 100644 index 7aba42ad2..000000000 --- a/tectonic/stringpool.h +++ /dev/null @@ -1,19 +0,0 @@ -/* tectonic/stringpool.h: preloaded "string pool" constants - Copyright 2017 the Tectonic Project - Licensed under the MIT License. -*/ - -#ifndef TECTONIC_STRINGPOOL_H -#define TECTONIC_STRINGPOOL_H - -#include "tectonic.h" - -#define EMPTY_STRING (65536L + 1) - -BEGIN_EXTERN_C - -int load_pool_strings(int32_t spare_size); - -END_EXTERN_C - -#endif /* not TECTONIC_STRINGPOOL_H */ diff --git a/tectonic/tectonic.h b/tectonic/tectonic.h index 8166bbc95..f89a820f7 100644 --- a/tectonic/tectonic.h +++ b/tectonic/tectonic.h @@ -56,7 +56,4 @@ int tt_set_string_variable (char *var_name, char *value); END_EXTERN_C -#include "xetex-constants.h" -#include "stringpool.h" - #endif /* not TECTONIC_TECTONIC_H */ diff --git a/tectonic/stringpool.c b/tectonic/xetex-stringpool.c similarity index 97% rename from tectonic/stringpool.c rename to tectonic/xetex-stringpool.c index d7e977994..7b518cbbb 100644 --- a/tectonic/stringpool.c +++ b/tectonic/xetex-stringpool.c @@ -1,5 +1,5 @@ -/* tectonic/stringpool.c: preloaded "string pool" constants - Copyright 2017 the Tectonic Project +/* tectonic/xetex-stringpool.c: preloaded "string pool" constants + Copyright 2017-2018 the Tectonic Project Licensed under the MIT License. */ diff --git a/tectonic/xetex-stringpool.h b/tectonic/xetex-stringpool.h new file mode 100644 index 000000000..d9476a3b5 --- /dev/null +++ b/tectonic/xetex-stringpool.h @@ -0,0 +1,27 @@ +/* tectonic/xetex-stringpool.h: preloaded "string pool" constants + Copyright 2017 the Tectonic Project + Licensed under the MIT License. +*/ + +#ifndef TECTONIC_STRINGPOOL_H +#define TECTONIC_STRINGPOOL_H + +#include "tectonic.h" +#include "xetexd.h" + +#define EMPTY_STRING (65536L + 1) + +BEGIN_EXTERN_C + +int load_pool_strings(int32_t spare_size); +int32_t length(str_number s); +str_number make_string(void); +void append_str(str_number s); +bool str_eq_buf(str_number s, int32_t k); +bool str_eq_str(str_number s, str_number t); +str_number search_string(str_number search); +str_number slow_make_string(void); + +END_EXTERN_C + +#endif /* not TECTONIC_STRINGPOOL_H */ diff --git a/tectonic/xetexd.h b/tectonic/xetexd.h index e6457e463..a7110b88b 100644 --- a/tectonic/xetexd.h +++ b/tectonic/xetexd.h @@ -12,6 +12,7 @@ #include "TECkit_Common.h" #include "XeTeX_ext.h" #include "core-bridge.h" +#include "xetex-constants.h" #ifdef XETEX_MAC /* include this here to avoid conflict between clang's emmintrin.h and @@ -702,13 +703,6 @@ NORETURN void overflow(const char* s, int32_t n); NORETURN void confusion(const char* s); NORETURN void pdf_error(const char* t, const char* p); -int32_t length(str_number s); -str_number make_string(void); -void append_str(str_number s); -bool str_eq_buf(str_number s, int32_t k); -bool str_eq_str(str_number s, str_number t); -str_number search_string(str_number search); -str_number slow_make_string(void); void print_current_string(void); int32_t badness(scaled_t t, scaled_t s); void print_word(memory_word w); @@ -1087,4 +1081,6 @@ tt_history_t tt_run_engine(char *dump_name, char *input_file_name); #define RAW 4 #define ICUMAPPING 5 +#include "xetex-stringpool.h" + #endif /* TECTONIC_XETEXD_H */ From d5174b1c2d6c972b2e724ad771ed583a9f126d65 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 28 Sep 2018 23:33:14 -0400 Subject: [PATCH 03/36] tectonic: rename Engine.{cpp,h} -> xetex-Engine.{cpp,h} --- tectonic/{Engine.cpp => xetex-Engine.cpp} | 2 +- tectonic/{Engine.h => xetex-Engine.h} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tectonic/{Engine.cpp => xetex-Engine.cpp} (99%) rename tectonic/{Engine.h => xetex-Engine.h} (100%) diff --git a/tectonic/Engine.cpp b/tectonic/xetex-Engine.cpp similarity index 99% rename from tectonic/Engine.cpp rename to tectonic/xetex-Engine.cpp index 32b2a2120..866fd1983 100644 --- a/tectonic/Engine.cpp +++ b/tectonic/xetex-Engine.cpp @@ -52,7 +52,7 @@ Last reviewed: Not yet. # include #endif -#include "Engine.h" +#include "xetex-Engine.h" #ifdef TRACING #include diff --git a/tectonic/Engine.h b/tectonic/xetex-Engine.h similarity index 100% rename from tectonic/Engine.h rename to tectonic/xetex-Engine.h From c627840aae3a0dda7722822dc7e9b0b23f65843f Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 28 Sep 2018 23:40:20 -0400 Subject: [PATCH 04/36] tectonic: rename engine-interface.[ch] to xetex-engine-interface.[ch] And tidy up related symbols. These files and functions were badly named because they are specific to the XeTeX engine -- they don't have anything to do with bibtex or dvipdfmx. --- build.rs | 2 +- src/engines/mod.rs | 4 ++-- src/engines/tex.rs | 8 ++++---- tectonic/tectonic.h | 11 ----------- .../{engine-interface.c => xetex-engine-interface.c} | 10 ++++++++-- 5 files changed, 15 insertions(+), 20 deletions(-) rename tectonic/{engine-interface.c => xetex-engine-interface.c} (69%) diff --git a/build.rs b/build.rs index 2ccbdf1b2..203bf592d 100644 --- a/build.rs +++ b/build.rs @@ -150,7 +150,6 @@ fn main() { .file("tectonic/dpx-type1c.c") .file("tectonic/dpx-unicode.c") .file("tectonic/dpx-vf.c") - .file("tectonic/engine-interface.c") .file("tectonic/errors.c") .file("tectonic/io.c") .file("tectonic/mathutil.c") @@ -161,6 +160,7 @@ fn main() { .file("tectonic/XeTeX_ext.c") .file("tectonic/xetexini.c") .file("tectonic/XeTeX_pic.c") + .file("tectonic/xetex-engine-interface.c") .file("tectonic/xetex-linebreak.c") .file("tectonic/xetex-math.c") .file("tectonic/xetex-shipout.c") diff --git a/src/engines/mod.rs b/src/engines/mod.rs index d6db4e9ad..9f7edb769 100644 --- a/src/engines/mod.rs +++ b/src/engines/mod.rs @@ -454,8 +454,8 @@ struct TectonicBridgeApi { extern { fn tt_get_error_message() -> *const libc::c_char; - fn tt_set_int_variable(var_name: *const libc::c_char, value: libc::c_int) -> libc::c_int; - //fn tt_set_string_variable(var_name: *const libc::c_char, value: *const libc::c_char) -> libc::c_int; + fn tt_xetex_set_int_variable(var_name: *const libc::c_char, value: libc::c_int) -> libc::c_int; + //fn tt_xetex_set_string_variable(var_name: *const libc::c_char, value: *const libc::c_char) -> libc::c_int; fn tex_simple_main(api: *const TectonicBridgeApi, dump_name: *const libc::c_char, input_file_name: *const libc::c_char) -> libc::c_int; fn dvipdfmx_simple_main(api: *const TectonicBridgeApi, dviname: *const libc::c_char, diff --git a/src/engines/tex.rs b/src/engines/tex.rs index a57b622c9..598d584ad 100644 --- a/src/engines/tex.rs +++ b/src/engines/tex.rs @@ -105,13 +105,13 @@ impl TexEngine { // initialize globals let v = if self.halt_on_error { 1 } else { 0 }; - unsafe { super::tt_set_int_variable(b"halt_on_error_p\0".as_ptr() as _, v); } + unsafe { super::tt_xetex_set_int_variable(b"halt_on_error_p\0".as_ptr() as _, v); } let v = if self.initex_mode { 1 } else { 0 }; - unsafe { super::tt_set_int_variable(b"in_initex_mode\0".as_ptr() as _, v); } + unsafe { super::tt_xetex_set_int_variable(b"in_initex_mode\0".as_ptr() as _, v); } let v = if self.synctex_enabled { 1 } else { 0 }; - unsafe { super::tt_set_int_variable(b"synctex_enabled\0".as_ptr() as _, v); } + unsafe { super::tt_xetex_set_int_variable(b"synctex_enabled\0".as_ptr() as _, v); } let v = if self.semantic_pagination_enabled { 1 } else { 0 }; - unsafe { super::tt_set_int_variable(b"semantic_pagination_enabled\0".as_ptr() as _, v); } + unsafe { super::tt_xetex_set_int_variable(b"semantic_pagination_enabled\0".as_ptr() as _, v); } unsafe { match super::tex_simple_main(&bridge, cformat.as_ptr(), cinput.as_ptr()) { diff --git a/tectonic/tectonic.h b/tectonic/tectonic.h index f89a820f7..4359be468 100644 --- a/tectonic/tectonic.h +++ b/tectonic/tectonic.h @@ -45,15 +45,4 @@ typedef enum { HISTORY_FATAL_ERROR = 3 } tt_history_t; -/* The actual API */ - -BEGIN_EXTERN_C - -/* engine-interface.c */ - -int tt_set_int_variable (char *var_name, int value); -int tt_set_string_variable (char *var_name, char *value); - -END_EXTERN_C - #endif /* not TECTONIC_TECTONIC_H */ diff --git a/tectonic/engine-interface.c b/tectonic/xetex-engine-interface.c similarity index 69% rename from tectonic/engine-interface.c rename to tectonic/xetex-engine-interface.c index eeeec1536..01735c3c3 100644 --- a/tectonic/engine-interface.c +++ b/tectonic/xetex-engine-interface.c @@ -10,8 +10,14 @@ #include +/* These functions aren't used within the C/C++ library, but are called + * by the Rust code to configure the XeTeX engine before launching it. */ + +int tt_xetex_set_int_variable (char *var_name, int value); +int tt_xetex_set_string_variable (char *var_name, char *value); + int -tt_set_int_variable (char *var_name, int value) +tt_xetex_set_int_variable (char *var_name, int value) { if (streq_ptr(var_name, "halt_on_error_p")) halt_on_error_p = value; @@ -29,7 +35,7 @@ tt_set_int_variable (char *var_name, int value) int -tt_set_string_variable (char *var_name, char *value) +tt_xetex_set_string_variable (char *var_name, char *value) { /* Currently unused; see Git history for how we used to set output_comment */ return 1; From 79f7dfb63d79c280c25b911af8b3a5959fb650f2 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 28 Sep 2018 23:46:47 -0400 Subject: [PATCH 05/36] tectonic: xetex-prefix errors.c Once again, these functions are specific to the XeTeX engine. --- build.rs | 2 +- tectonic/{errors.c => xetex-errors.c} | 0 tectonic/xetexd.h | 14 ++++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) rename tectonic/{errors.c => xetex-errors.c} (100%) diff --git a/build.rs b/build.rs index 203bf592d..74fd77a55 100644 --- a/build.rs +++ b/build.rs @@ -150,7 +150,6 @@ fn main() { .file("tectonic/dpx-type1c.c") .file("tectonic/dpx-unicode.c") .file("tectonic/dpx-vf.c") - .file("tectonic/errors.c") .file("tectonic/io.c") .file("tectonic/mathutil.c") .file("tectonic/output.c") @@ -161,6 +160,7 @@ fn main() { .file("tectonic/xetexini.c") .file("tectonic/XeTeX_pic.c") .file("tectonic/xetex-engine-interface.c") + .file("tectonic/xetex-errors.c") .file("tectonic/xetex-linebreak.c") .file("tectonic/xetex-math.c") .file("tectonic/xetex-shipout.c") diff --git a/tectonic/errors.c b/tectonic/xetex-errors.c similarity index 100% rename from tectonic/errors.c rename to tectonic/xetex-errors.c diff --git a/tectonic/xetexd.h b/tectonic/xetexd.h index a7110b88b..62adfec19 100644 --- a/tectonic/xetexd.h +++ b/tectonic/xetexd.h @@ -697,12 +697,6 @@ void print_hex(int32_t n); void print_roman_int(int32_t n); void print_scaled(scaled_t s); -void error(void); -NORETURN void fatal_error(const char* s); -NORETURN void overflow(const char* s, int32_t n); -NORETURN void confusion(const char* s); -NORETURN void pdf_error(const char* t, const char* p); - void print_current_string(void); int32_t badness(scaled_t t, scaled_t s); void print_word(memory_word w); @@ -1005,6 +999,14 @@ str_number tokens_to_string(int32_t p); void scan_pdf_ext_toks(void); void compare_strings(void); +/* xetex-errors */ + +void error(void); +NORETURN void fatal_error(const char* s); +NORETURN void overflow(const char* s, int32_t n); +NORETURN void confusion(const char* s); +NORETURN void pdf_error(const char* t, const char* p); + /* xetex-math */ void initialize_math_variables(void); From 6ad5bac8cfb9acfb37effa6ebb70704ca42ae170 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sat, 29 Sep 2018 00:00:20 -0400 Subject: [PATCH 06/36] tectonic/core-foundation.h: add this This is intended to be the header that does the basic grunt work of defining foundational types and setting up basic portability matters. At the moment it's just stealing definitions from tectonic.h, but I'll move more things here. --- tectonic/core-foundation.h | 46 ++++++++++++++++++++++++++++++++++++++ tectonic/tectonic.h | 30 +------------------------ 2 files changed, 47 insertions(+), 29 deletions(-) create mode 100644 tectonic/core-foundation.h diff --git a/tectonic/core-foundation.h b/tectonic/core-foundation.h new file mode 100644 index 000000000..8e462082f --- /dev/null +++ b/tectonic/core-foundation.h @@ -0,0 +1,46 @@ +/* tectonic/core-foundation.h: the first header to include in Tectonic's C/C++ code + Copyright 2016-2018 the Tectonic Project + Licensed under the MIT License. +*/ + +/* This header should (eventually ...) be included first in all of Tectonic's + * C/C++ files. It essentially concerns itself with defining basic types and + * portability. + */ + +#ifndef TECTONIC_CORE_FOUNDATION_H +#define TECTONIC_CORE_FOUNDATION_H + +/* Universal headers */ + +#include +#include /* for int32_t */ + +/* Convenience for C++: this way Emacs doesn't try to indent the prototypes, + * which I find annoying. */ + +#ifdef __cplusplus +#define BEGIN_EXTERN_C extern "C" { +#define END_EXTERN_C } +#else +#define BEGIN_EXTERN_C +#define END_EXTERN_C +#endif + +/* Portability: NORETURN annotation */ + +#if defined __GNUC__ && __GNUC__ >= 3 +#define NORETURN __attribute__((__noreturn__)) +#else +#define NORETURN +#endif + +/* Portability: annotations to validate args of printf-like functions */ + +#if defined __GNUC__ && __GNUC__ >= 3 +#define PRINTF_FUNC(ifmt,iarg) __attribute__((format(printf, ifmt, iarg))) +#else +#define PRINTF_FUNC(ifmt,iarg) +#endif + +#endif /* not TECTONIC_CORE_FOUNDATION_H */ diff --git a/tectonic/tectonic.h b/tectonic/tectonic.h index 4359be468..1cf8197ff 100644 --- a/tectonic/tectonic.h +++ b/tectonic/tectonic.h @@ -6,35 +6,7 @@ #ifndef TECTONIC_TECTONIC_H #define TECTONIC_TECTONIC_H -#include -#include /* for int32_t */ - -/* Convenience for C++: this way Emacs doesn't try to indent the prototypes, - * which I find annoying. */ - -#ifdef __cplusplus -#define BEGIN_EXTERN_C extern "C" { -#define END_EXTERN_C } -#else -#define BEGIN_EXTERN_C -#define END_EXTERN_C -#endif - -/* NORETURN portability */ - -#if defined __GNUC__ && __GNUC__ >= 3 -#define NORETURN __attribute__((__noreturn__)) -#else -#define NORETURN -#endif - -/* Ditto for printf argument checking */ - -#if defined __GNUC__ && __GNUC__ >= 3 -#define PRINTF_FUNC(ifmt,iarg) __attribute__((format(printf, ifmt, iarg))) -#else -#define PRINTF_FUNC(ifmt,iarg) -#endif +#include "core-foundation.h" /* TeX-specific enums */ From 20d2484857382f2b195cb423f6264d2821304eb6 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sat, 29 Sep 2018 00:05:23 -0400 Subject: [PATCH 07/36] tectonic/core-foundation.h: move some things here from internals.h --- tectonic/core-foundation.h | 33 +++++++++++++++++++++++++++++++++ tectonic/internals.h | 32 -------------------------------- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/tectonic/core-foundation.h b/tectonic/core-foundation.h index 8e462082f..91a67b93d 100644 --- a/tectonic/core-foundation.h +++ b/tectonic/core-foundation.h @@ -11,10 +11,24 @@ #ifndef TECTONIC_CORE_FOUNDATION_H #define TECTONIC_CORE_FOUNDATION_H +/* High-level defines */ + +#define _DARWIN_USE_64_BIT_INODE 1 + /* Universal headers */ +#include +#include +#include +#include +#include +#include +#include +#include #include #include /* for int32_t */ +#include +#include /* Convenience for C++: this way Emacs doesn't try to indent the prototypes, * which I find annoying. */ @@ -43,4 +57,23 @@ #define PRINTF_FUNC(ifmt,iarg) #endif +/* Portability: inline annotation */ + +#ifdef _MSC_VER +# ifndef __cplusplus +# define inline __inline +# endif +#endif + +/* Portability: MSVC variations on various common functions */ + +#ifdef _MSC_VER +# define strcasecmp _stricmp +# define strncasecmp _strnicmp +# if defined(_VC_CRT_MAJOR_VERSION) && _VC_CRT_MAJOR_VERSION < 14 +# define snprintf _snprintf +# define strtoll _strtoi64 +# endif +#endif + #endif /* not TECTONIC_CORE_FOUNDATION_H */ diff --git a/tectonic/internals.h b/tectonic/internals.h index 65656974f..d07301876 100644 --- a/tectonic/internals.h +++ b/tectonic/internals.h @@ -9,43 +9,11 @@ #include "tectonic.h" #include "core-bridge.h" -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include #include -#ifndef _MSC_VER -# include -# include -# include -#else -# ifndef __cplusplus -# define inline __inline -# endif -# define strcasecmp _stricmp -# define strncasecmp _strnicmp -# if defined(_VC_CRT_MAJOR_VERSION) && _VC_CRT_MAJOR_VERSION < 14 -# define snprintf _snprintf -# define strtoll _strtoi64 -# endif -#endif - -/* high-level defines */ - -#define _DARWIN_USE_64_BIT_INODE 1 - /* other lame #defines */ #ifndef isblank From 67a5811029df953c8032496bd0fc5e7129323d11 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sat, 29 Sep 2018 00:15:02 -0400 Subject: [PATCH 08/36] tectonic/core-strutils.h: add this Pulling more functions out of internals.h, which I'd like to get rid of since its name is not super helpful and it currently contains a big mish-mash of functionality. --- tectonic/core-strutils.h | 40 ++++++++++++++++++++++++++++++++++++++++ tectonic/internals.h | 26 +------------------------- 2 files changed, 41 insertions(+), 25 deletions(-) create mode 100644 tectonic/core-strutils.h diff --git a/tectonic/core-strutils.h b/tectonic/core-strutils.h new file mode 100644 index 000000000..9cc734c1f --- /dev/null +++ b/tectonic/core-strutils.h @@ -0,0 +1,40 @@ +/* tectonic/core-strutils.h: miscellaneous C string utilities + Copyright 2016-2018 the Tectonic Project + Licensed under the MIT License. +*/ + +#ifndef TECTONIC_CORE_STRUTILS_H +#define TECTONIC_CORE_STRUTILS_H + +#include "core-foundation.h" + +#ifndef isblank +#define isblank(c) ((c) == ' ' || (c) == '\t') +#endif +#define ISBLANK(c) (isascii (c) && isblank ((unsigned char)c)) + +/* Note that we explicitly do *not* change this on Windows. For maximum + * portability, we should probably accept *either* forward or backward slashes + * as directory separators. */ +#define IS_DIR_SEP(ch) ((ch) == '/') + +static inline bool streq_ptr(const char *s1, const char *s2) { + if (s1 && s2) + return strcmp(s1, s2) == 0; + return false; +} + +static inline const char *strstartswith(const char *s, const char *prefix) { + size_t length; + + length = strlen(prefix); + if (strncmp(s, prefix, length) == 0) + return s + length; + return NULL; +} + +BEGIN_EXTERN_C +/* Nothing here yet. */ +END_EXTERN_C + +#endif /* not TECTONIC_CORE_STRUTILS_H */ diff --git a/tectonic/internals.h b/tectonic/internals.h index d07301876..1a91ba0a8 100644 --- a/tectonic/internals.h +++ b/tectonic/internals.h @@ -8,37 +8,13 @@ #include "tectonic.h" #include "core-bridge.h" +#include "core-strutils.h" #include #include #include #include -/* other lame #defines */ - -#ifndef isblank -#define isblank(c) ((c) == ' ' || (c) == '\t') -#endif -#define ISBLANK(c) (isascii (c) && isblank ((unsigned char)c)) - -#define DIR_SEP '/' -#define IS_DIR_SEP(ch) ((ch) == DIR_SEP) - -static inline bool streq_ptr(const char *s1, const char *s2) { - if (s1 && s2) - return strcmp(s1, s2) == 0; - return false; -} - -static inline const char *strstartswith(const char *s, const char *prefix) { - size_t length; - - length = strlen(prefix); - if (strncmp(s, prefix, length) == 0) - return s + length; - return NULL; -} - /* Core typedefs. */ typedef int32_t scaled_t; From 2eea4789567b73626c922f72c0deadc8f39c1664 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sat, 29 Sep 2018 00:19:40 -0400 Subject: [PATCH 09/36] tectonic: the `real_point` type doesn't need to be global It's only used inside one function in xetex0.c, and a helper function that assists it. --- tectonic/core-kpathutil.c | 11 ----------- tectonic/internals.h | 6 ------ tectonic/xetex0.c | 21 ++++++++++++++++++++- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/tectonic/core-kpathutil.c b/tectonic/core-kpathutil.c index 9469547b5..54cc348b6 100644 --- a/tectonic/core-kpathutil.c +++ b/tectonic/core-kpathutil.c @@ -116,17 +116,6 @@ make_rotation(transform_t* t, double a) t->y = 0.0; } -void -transform_point(real_point* p, const transform_t* t) -{ - real_point r; - - r.x = t->a * p->x + t->c * p->y + t->x; - r.y = t->b * p->x + t->d * p->y + t->y; - - *p = r; -} - void transform_concat(transform_t* t1, const transform_t* t2) { diff --git a/tectonic/internals.h b/tectonic/internals.h index 1a91ba0a8..629b11f28 100644 --- a/tectonic/internals.h +++ b/tectonic/internals.h @@ -30,11 +30,6 @@ typedef struct { double y; } transform_t; -typedef struct { - float x; - float y; -} real_point; - typedef struct { float x; float y; @@ -103,7 +98,6 @@ void make_identity(transform_t* t); void make_scale(transform_t* t, double xscale, double yscale); void make_translation(transform_t* t, double dx, double dy); void make_rotation(transform_t* t, double a); -void transform_point(real_point* p, const transform_t* t); void transform_concat(transform_t* t1, const transform_t* t2); static inline void *mfree(void *ptr) { diff --git a/tectonic/xetex0.c b/tectonic/xetex0.c index da79accbd..b3c411f66 100644 --- a/tectonic/xetex0.c +++ b/tectonic/xetex0.c @@ -16977,7 +16977,26 @@ void new_write_whatsit(small_number w) mem[cur_list.tail + 1].b32.s0 = cur_val; } -void load_picture(bool is_pdf) + +typedef struct { + float x; + float y; +} real_point; + +static void +transform_point(real_point* p, const transform_t* t) +{ + real_point r; + + r.x = t->a * p->x + t->c * p->y + t->x; + r.y = t->b * p->x + t->d * p->y + t->y; + + *p = r; +} + + +void +load_picture(bool is_pdf) { char *pic_path; real_rect bounds; From c166876008818a48162728bcdecb51fd1201559e Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sat, 29 Sep 2018 00:28:18 -0400 Subject: [PATCH 10/36] tectonic/XeTeX_pic.c: move load_picture() here This allows us to make several functions static and remove some types from the global headers. --- tectonic/XeTeX_ext.h | 1 - tectonic/XeTeX_pic.c | 451 +++++++++++++++++++++++++++++++++++++- tectonic/core-kpathutil.c | 62 ------ tectonic/internals.h | 25 --- tectonic/xetex0.c | 364 ------------------------------ 5 files changed, 450 insertions(+), 453 deletions(-) diff --git a/tectonic/XeTeX_ext.h b/tectonic/XeTeX_ext.h index 37a702ce0..e34d134e7 100644 --- a/tectonic/XeTeX_ext.h +++ b/tectonic/XeTeX_ext.h @@ -154,7 +154,6 @@ double read_double(const char** s); unsigned int read_rgb_a(const char** cp); int count_pdf_file_pages(void); -int find_pic_file(char** path, real_rect* bounds, int pdfBoxType, int page); int maketexstring(const char* s); void set_cp_code(int fontNum, unsigned int code, int side, int value); diff --git a/tectonic/XeTeX_pic.c b/tectonic/XeTeX_pic.c index c4ed11352..68f2c9640 100644 --- a/tectonic/XeTeX_pic.c +++ b/tectonic/XeTeX_pic.c @@ -50,6 +50,30 @@ XeTeX_pic.c #include "dpx-bmpimage.h" +/* load_picture() needs some helper types and functions */ + +typedef struct { + float x; + float y; +} real_point; + +typedef struct { + double a; + double b; + double c; + double d; + double x; + double y; +} transform_t; + +typedef struct { + float x; + float y; + float wd; + float ht; +} real_rect; + + int count_pdf_file_pages (void) { @@ -197,7 +221,7 @@ get_image_size_in_inches (rust_input_handle_t handle, float *width, float *heigh return full path in *path return bounds (tex points) in *bounds */ -int +static int find_pic_file (char **path, real_rect *bounds, int pdfBoxType, int page) { int err = -1; @@ -225,3 +249,428 @@ find_pic_file (char **path, real_rect *bounds, int pdfBoxType, int page) return err; } + + +static void +transform_point(real_point* p, const transform_t* t) +{ + real_point r; + + r.x = t->a * p->x + t->c * p->y + t->x; + r.y = t->b * p->x + t->d * p->y + t->y; + + *p = r; +} + + +static void +make_identity(transform_t* t) +{ + t->a = 1.0; + t->b = 0.0; + t->c = 0.0; + t->d = 1.0; + t->x = 0.0; + t->y = 0.0; +} + + +static void +make_scale(transform_t* t, double xscale, double yscale) +{ + t->a = xscale; + t->b = 0.0; + t->c = 0.0; + t->d = yscale; + t->x = 0.0; + t->y = 0.0; +} + + +static void +make_translation(transform_t* t, double dx, double dy) +{ + t->a = 1.0; + t->b = 0.0; + t->c = 0.0; + t->d = 1.0; + t->x = dx; + t->y = dy; +} + + +static void +make_rotation(transform_t* t, double a) +{ + t->a = cos(a); + t->b = sin(a); + t->c = -sin(a); + t->d = cos(a); + t->x = 0.0; + t->y = 0.0; +} + + +static void +transform_concat(transform_t* t1, const transform_t* t2) +{ + transform_t r; + + r.a = t1->a * t2->a + t1->b * t2->c + 0.0 * t2->x; + r.b = t1->a * t2->b + t1->b * t2->d + 0.0 * t2->y; + r.c = t1->c * t2->a + t1->d * t2->c + 0.0 * t2->x; + r.d = t1->c * t2->b + t1->d * t2->d + 0.0 * t2->y; + r.x = t1->x * t2->a + t1->y * t2->c + 1.0 * t2->x; + r.y = t1->x * t2->b + t1->y * t2->d + 1.0 * t2->y; + + *t1 = r; +} + + +#define SET_POINT(P,X,Y) do { (P).x = (X); (P).y = (Y); } while (0) + +void +load_picture(bool is_pdf) +{ + char *pic_path; + real_rect bounds; + transform_t t, t2; + real_point corners[4]; + double x_size_req, y_size_req; + bool check_keywords; + double xmin, xmax, ymin, ymax; + small_number i; + int32_t page; + int32_t pdf_box_type; + int32_t result; + scan_file_name(); + pack_file_name(cur_name, cur_area, cur_ext); + pdf_box_type = 0; + page = 0; + if (is_pdf) { + if (scan_keyword("page")) { + scan_int(); + page = cur_val; + } + pdf_box_type = pdfbox_none; + if (scan_keyword("crop")) + pdf_box_type = pdfbox_crop; + else if (scan_keyword("media")) + pdf_box_type = pdfbox_media; + else if (scan_keyword("bleed")) + pdf_box_type = pdfbox_bleed; + else if (scan_keyword("trim")) + pdf_box_type = pdfbox_trim; + else if (scan_keyword("art")) + pdf_box_type = pdfbox_art; + } + if (pdf_box_type == pdfbox_none) + result = find_pic_file(&pic_path, &bounds, pdfbox_crop, page); + else + result = find_pic_file(&pic_path, &bounds, pdf_box_type, page); + SET_POINT(corners[0], bounds.x, bounds.y); + SET_POINT(corners[1], corners[0].x, bounds.y + bounds.ht); + SET_POINT(corners[2], bounds.x + bounds.wd, corners[1].y); + SET_POINT(corners[3], corners[2].x, corners[0].y); + x_size_req = 0.0; + y_size_req = 0.0; + make_identity(&t); + check_keywords = true; + while (check_keywords) { + + if (scan_keyword("scaled")) { + scan_int(); + if ((x_size_req == 0.0) && (y_size_req == 0.0)) { + make_scale(&t2, cur_val / ((double)1000.0), cur_val / ((double)1000.0)); + { + register int32_t for_end; + i = 0; + for_end = 3; + if (i <= for_end) + do + transform_point(&corners[i], &t2); + while (i++ < for_end); + } + transform_concat(&t, &t2); + } + } else if (scan_keyword("xscaled")) { + scan_int(); + if ((x_size_req == 0.0) && (y_size_req == 0.0)) { + make_scale(&t2, cur_val / ((double)1000.0), 1.0); + { + register int32_t for_end; + i = 0; + for_end = 3; + if (i <= for_end) + do + transform_point(&corners[i], &t2); + while (i++ < for_end); + } + transform_concat(&t, &t2); + } + } else if (scan_keyword("yscaled")) { + scan_int(); + if ((x_size_req == 0.0) && (y_size_req == 0.0)) { + make_scale(&t2, 1.0, cur_val / ((double)1000.0)); + { + register int32_t for_end; + i = 0; + for_end = 3; + if (i <= for_end) + do + transform_point(&corners[i], &t2); + while (i++ < for_end); + } + transform_concat(&t, &t2); + } + } else if (scan_keyword("width")) { + scan_dimen(false, false, false); + if (cur_val <= 0) { + { + if (file_line_error_style_p) + print_file_line(); + else + print_nl_cstr("! "); + print_cstr("Improper image "); + } + print_cstr("size ("); + print_scaled(cur_val); + print_cstr("pt) will be ignored"); + { + help_ptr = 2; + help_line[1] = "I can't scale images to zero or negative sizes,"; + help_line[0] = "so I'm ignoring this."; + } + error(); + } else + x_size_req = Fix2D(cur_val); + } else if (scan_keyword("height")) { + scan_dimen(false, false, false); + if (cur_val <= 0) { + { + if (file_line_error_style_p) + print_file_line(); + else + print_nl_cstr("! "); + print_cstr("Improper image "); + } + print_cstr("size ("); + print_scaled(cur_val); + print_cstr("pt) will be ignored"); + { + help_ptr = 2; + help_line[1] = "I can't scale images to zero or negative sizes,"; + help_line[0] = "so I'm ignoring this."; + } + error(); + } else + y_size_req = Fix2D(cur_val); + } else if (scan_keyword("rotated")) { + scan_decimal(); + if ((x_size_req != 0.0) || (y_size_req != 0.0)) { + { + xmin = 1000000.0; + xmax = -(int32_t) xmin; + ymin = xmin; + ymax = xmax; + { + register int32_t for_end; + i = 0; + for_end = 3; + if (i <= for_end) + do { + if (corners[i].x < xmin) + xmin = corners[i].x; + if (corners[i].x > xmax) + xmax = corners[i].x; + if (corners[i].y < ymin) + ymin = corners[i].y; + if (corners[i].y > ymax) + ymax = corners[i].y; + } + while (i++ < for_end); + } + } + if (x_size_req == 0.0) { + make_scale(&t2, y_size_req / ((double)(ymax - ymin)), + y_size_req / ((double)(ymax - ymin))); + } else if (y_size_req == 0.0) { + make_scale(&t2, x_size_req / ((double)(xmax - xmin)), + x_size_req / ((double)(xmax - xmin))); + } else { + + make_scale(&t2, x_size_req / ((double)(xmax - xmin)), + y_size_req / ((double)(ymax - ymin))); + } + { + register int32_t for_end; + i = 0; + for_end = 3; + if (i <= for_end) + do + transform_point(&corners[i], &t2); + while (i++ < for_end); + } + x_size_req = 0.0; + y_size_req = 0.0; + transform_concat(&t, &t2); + } + make_rotation(&t2, Fix2D(cur_val) * M_PI / ((double)180.0)); + { + register int32_t for_end; + i = 0; + for_end = 3; + if (i <= for_end) + do + transform_point(&corners[i], &t2); + while (i++ < for_end); + } + { + xmin = 1000000.0; + xmax = -(int32_t) xmin; + ymin = xmin; + ymax = xmax; + { + register int32_t for_end; + i = 0; + for_end = 3; + if (i <= for_end) + do { + if (corners[i].x < xmin) + xmin = corners[i].x; + if (corners[i].x > xmax) + xmax = corners[i].x; + if (corners[i].y < ymin) + ymin = corners[i].y; + if (corners[i].y > ymax) + ymax = corners[i].y; + } + while (i++ < for_end); + } + } + SET_POINT(corners[0], xmin, ymin); + SET_POINT(corners[1], xmin, ymax); + SET_POINT(corners[2], xmax, ymax); + SET_POINT(corners[3], xmax, ymin); + transform_concat(&t, &t2); + } else + check_keywords = false; + } + if ((x_size_req != 0.0) || (y_size_req != 0.0)) { + { + xmin = 1000000.0; + xmax = -(int32_t) xmin; + ymin = xmin; + ymax = xmax; + { + register int32_t for_end; + i = 0; + for_end = 3; + if (i <= for_end) + do { + if (corners[i].x < xmin) + xmin = corners[i].x; + if (corners[i].x > xmax) + xmax = corners[i].x; + if (corners[i].y < ymin) + ymin = corners[i].y; + if (corners[i].y > ymax) + ymax = corners[i].y; + } + while (i++ < for_end); + } + } + if (x_size_req == 0.0) { + make_scale(&t2, y_size_req / ((double)(ymax - ymin)), y_size_req / ((double)(ymax - ymin))); + } else if (y_size_req == 0.0) { + make_scale(&t2, x_size_req / ((double)(xmax - xmin)), x_size_req / ((double)(xmax - xmin))); + } else { + + make_scale(&t2, x_size_req / ((double)(xmax - xmin)), y_size_req / ((double)(ymax - ymin))); + } + { + register int32_t for_end; + i = 0; + for_end = 3; + if (i <= for_end) + do + transform_point(&corners[i], &t2); + while (i++ < for_end); + } + x_size_req = 0.0; + y_size_req = 0.0; + transform_concat(&t, &t2); + } + { + xmin = 1000000.0; + xmax = -(int32_t) xmin; + ymin = xmin; + ymax = xmax; + { + register int32_t for_end; + i = 0; + for_end = 3; + if (i <= for_end) + do { + if (corners[i].x < xmin) + xmin = corners[i].x; + if (corners[i].x > xmax) + xmax = corners[i].x; + if (corners[i].y < ymin) + ymin = corners[i].y; + if (corners[i].y > ymax) + ymax = corners[i].y; + } + while (i++ < for_end); + } + } + make_translation(&t2, -(int32_t) xmin * 72 / ((double)72.27), -(int32_t) ymin * 72 / ((double)72.27)); + transform_concat(&t, &t2); + if (result == 0) { + new_whatsit(PIC_NODE, + PIC_NODE_SIZE + (strlen(pic_path) + sizeof(memory_word) - 1) / sizeof(memory_word)); + if (is_pdf) { + mem[cur_list.tail].b16.s0 = PDF_NODE; + } + PIC_NODE_path_len(cur_list.tail) = strlen(pic_path); + mem[cur_list.tail + 4].b16.s0 = page; + mem[cur_list.tail + 8].b16.s1 = pdf_box_type; + mem[cur_list.tail + 1].b32.s1 = D2Fix(xmax - xmin); + mem[cur_list.tail + 3].b32.s1 = D2Fix(ymax - ymin); + mem[cur_list.tail + 2].b32.s1 = 0; + mem[cur_list.tail + 5].b32.s0 = D2Fix(t.a); + mem[cur_list.tail + 5].b32.s1 = D2Fix(t.b); + mem[cur_list.tail + 6].b32.s0 = D2Fix(t.c); + mem[cur_list.tail + 6].b32.s1 = D2Fix(t.d); + mem[cur_list.tail + 7].b32.s0 = D2Fix(t.x); + mem[cur_list.tail + 7].b32.s1 = D2Fix(t.y); + memcpy(PIC_NODE_path(cur_list.tail), pic_path, strlen(pic_path)); + free(pic_path); + } else { + + { + if (file_line_error_style_p) + print_file_line(); + else + print_nl_cstr("! "); + print_cstr("Unable to load picture or PDF file '"); + } + print_file_name(cur_name, cur_area, cur_ext); + print('\''); + if (result == -43) { + { + help_ptr = 2; + help_line[1] = "The requested image couldn't be read because"; + help_line[0] = "the file was not found."; + } + } else { + + { + help_ptr = 2; + help_line[1] = "The requested image couldn't be read because"; + help_line[0] = "it was not a recognized image format."; + } + } + error(); + } +} diff --git a/tectonic/core-kpathutil.c b/tectonic/core-kpathutil.c index 54cc348b6..52e48df4d 100644 --- a/tectonic/core-kpathutil.c +++ b/tectonic/core-kpathutil.c @@ -68,65 +68,3 @@ xstrdup (const char *s) char *new_string = xmalloc(strlen (s) + 1); return strcpy(new_string, s); } - - -/* trans.c */ - -void -make_identity(transform_t* t) -{ - t->a = 1.0; - t->b = 0.0; - t->c = 0.0; - t->d = 1.0; - t->x = 0.0; - t->y = 0.0; -} - -void -make_scale(transform_t* t, double xscale, double yscale) -{ - t->a = xscale; - t->b = 0.0; - t->c = 0.0; - t->d = yscale; - t->x = 0.0; - t->y = 0.0; -} - -void -make_translation(transform_t* t, double dx, double dy) -{ - t->a = 1.0; - t->b = 0.0; - t->c = 0.0; - t->d = 1.0; - t->x = dx; - t->y = dy; -} - -void -make_rotation(transform_t* t, double a) -{ - t->a = cos(a); - t->b = sin(a); - t->c = -sin(a); - t->d = cos(a); - t->x = 0.0; - t->y = 0.0; -} - -void -transform_concat(transform_t* t1, const transform_t* t2) -{ - transform_t r; - - r.a = t1->a * t2->a + t1->b * t2->c + 0.0 * t2->x; - r.b = t1->a * t2->b + t1->b * t2->d + 0.0 * t2->y; - r.c = t1->c * t2->a + t1->d * t2->c + 0.0 * t2->x; - r.d = t1->c * t2->b + t1->d * t2->d + 0.0 * t2->y; - r.x = t1->x * t2->a + t1->y * t2->c + 1.0 * t2->x; - r.y = t1->x * t2->b + t1->y * t2->d + 1.0 * t2->y; - - *t1 = r; -} diff --git a/tectonic/internals.h b/tectonic/internals.h index 629b11f28..94385d8b2 100644 --- a/tectonic/internals.h +++ b/tectonic/internals.h @@ -19,26 +19,6 @@ typedef int32_t scaled_t; -/* affine transforms */ - -typedef struct { - double a; - double b; - double c; - double d; - double x; - double y; -} transform_t; - -typedef struct { - float x; - float y; - float wd; - float ht; -} real_rect; - -#define SET_POINT(P,X,Y) do { (P).x = (X); (P).y = (Y); } while (0) - /* Unicode files */ typedef struct { @@ -94,11 +74,6 @@ char *xstrdup (const char *s); void *xmalloc (size_t size); void *xrealloc (void *old_address, size_t new_size); void *xcalloc (size_t nelem, size_t elsize); -void make_identity(transform_t* t); -void make_scale(transform_t* t, double xscale, double yscale); -void make_translation(transform_t* t, double dx, double dy); -void make_rotation(transform_t* t, double a); -void transform_concat(transform_t* t1, const transform_t* t2); static inline void *mfree(void *ptr) { free(ptr); diff --git a/tectonic/xetex0.c b/tectonic/xetex0.c index b3c411f66..d8d91f1da 100644 --- a/tectonic/xetex0.c +++ b/tectonic/xetex0.c @@ -16977,370 +16977,6 @@ void new_write_whatsit(small_number w) mem[cur_list.tail + 1].b32.s0 = cur_val; } - -typedef struct { - float x; - float y; -} real_point; - -static void -transform_point(real_point* p, const transform_t* t) -{ - real_point r; - - r.x = t->a * p->x + t->c * p->y + t->x; - r.y = t->b * p->x + t->d * p->y + t->y; - - *p = r; -} - - -void -load_picture(bool is_pdf) -{ - char *pic_path; - real_rect bounds; - transform_t t, t2; - real_point corners[4]; - double x_size_req, y_size_req; - bool check_keywords; - double xmin, xmax, ymin, ymax; - small_number i; - int32_t page; - int32_t pdf_box_type; - int32_t result; - scan_file_name(); - pack_file_name(cur_name, cur_area, cur_ext); - pdf_box_type = 0; - page = 0; - if (is_pdf) { - if (scan_keyword("page")) { - scan_int(); - page = cur_val; - } - pdf_box_type = pdfbox_none; - if (scan_keyword("crop")) - pdf_box_type = pdfbox_crop; - else if (scan_keyword("media")) - pdf_box_type = pdfbox_media; - else if (scan_keyword("bleed")) - pdf_box_type = pdfbox_bleed; - else if (scan_keyword("trim")) - pdf_box_type = pdfbox_trim; - else if (scan_keyword("art")) - pdf_box_type = pdfbox_art; - } - if (pdf_box_type == pdfbox_none) - result = find_pic_file(&pic_path, &bounds, pdfbox_crop, page); - else - result = find_pic_file(&pic_path, &bounds, pdf_box_type, page); - SET_POINT(corners[0], bounds.x, bounds.y); - SET_POINT(corners[1], corners[0].x, bounds.y + bounds.ht); - SET_POINT(corners[2], bounds.x + bounds.wd, corners[1].y); - SET_POINT(corners[3], corners[2].x, corners[0].y); - x_size_req = 0.0; - y_size_req = 0.0; - make_identity(&t); - check_keywords = true; - while (check_keywords) { - - if (scan_keyword("scaled")) { - scan_int(); - if ((x_size_req == 0.0) && (y_size_req == 0.0)) { - make_scale(&t2, cur_val / ((double)1000.0), cur_val / ((double)1000.0)); - { - register int32_t for_end; - i = 0; - for_end = 3; - if (i <= for_end) - do - transform_point(&corners[i], &t2); - while (i++ < for_end); - } - transform_concat(&t, &t2); - } - } else if (scan_keyword("xscaled")) { - scan_int(); - if ((x_size_req == 0.0) && (y_size_req == 0.0)) { - make_scale(&t2, cur_val / ((double)1000.0), 1.0); - { - register int32_t for_end; - i = 0; - for_end = 3; - if (i <= for_end) - do - transform_point(&corners[i], &t2); - while (i++ < for_end); - } - transform_concat(&t, &t2); - } - } else if (scan_keyword("yscaled")) { - scan_int(); - if ((x_size_req == 0.0) && (y_size_req == 0.0)) { - make_scale(&t2, 1.0, cur_val / ((double)1000.0)); - { - register int32_t for_end; - i = 0; - for_end = 3; - if (i <= for_end) - do - transform_point(&corners[i], &t2); - while (i++ < for_end); - } - transform_concat(&t, &t2); - } - } else if (scan_keyword("width")) { - scan_dimen(false, false, false); - if (cur_val <= 0) { - { - if (file_line_error_style_p) - print_file_line(); - else - print_nl_cstr("! "); - print_cstr("Improper image "); - } - print_cstr("size ("); - print_scaled(cur_val); - print_cstr("pt) will be ignored"); - { - help_ptr = 2; - help_line[1] = "I can't scale images to zero or negative sizes,"; - help_line[0] = "so I'm ignoring this."; - } - error(); - } else - x_size_req = Fix2D(cur_val); - } else if (scan_keyword("height")) { - scan_dimen(false, false, false); - if (cur_val <= 0) { - { - if (file_line_error_style_p) - print_file_line(); - else - print_nl_cstr("! "); - print_cstr("Improper image "); - } - print_cstr("size ("); - print_scaled(cur_val); - print_cstr("pt) will be ignored"); - { - help_ptr = 2; - help_line[1] = "I can't scale images to zero or negative sizes,"; - help_line[0] = "so I'm ignoring this."; - } - error(); - } else - y_size_req = Fix2D(cur_val); - } else if (scan_keyword("rotated")) { - scan_decimal(); - if ((x_size_req != 0.0) || (y_size_req != 0.0)) { - { - xmin = 1000000.0; - xmax = -(int32_t) xmin; - ymin = xmin; - ymax = xmax; - { - register int32_t for_end; - i = 0; - for_end = 3; - if (i <= for_end) - do { - if (corners[i].x < xmin) - xmin = corners[i].x; - if (corners[i].x > xmax) - xmax = corners[i].x; - if (corners[i].y < ymin) - ymin = corners[i].y; - if (corners[i].y > ymax) - ymax = corners[i].y; - } - while (i++ < for_end); - } - } - if (x_size_req == 0.0) { - make_scale(&t2, y_size_req / ((double)(ymax - ymin)), - y_size_req / ((double)(ymax - ymin))); - } else if (y_size_req == 0.0) { - make_scale(&t2, x_size_req / ((double)(xmax - xmin)), - x_size_req / ((double)(xmax - xmin))); - } else { - - make_scale(&t2, x_size_req / ((double)(xmax - xmin)), - y_size_req / ((double)(ymax - ymin))); - } - { - register int32_t for_end; - i = 0; - for_end = 3; - if (i <= for_end) - do - transform_point(&corners[i], &t2); - while (i++ < for_end); - } - x_size_req = 0.0; - y_size_req = 0.0; - transform_concat(&t, &t2); - } - make_rotation(&t2, Fix2D(cur_val) * M_PI / ((double)180.0)); - { - register int32_t for_end; - i = 0; - for_end = 3; - if (i <= for_end) - do - transform_point(&corners[i], &t2); - while (i++ < for_end); - } - { - xmin = 1000000.0; - xmax = -(int32_t) xmin; - ymin = xmin; - ymax = xmax; - { - register int32_t for_end; - i = 0; - for_end = 3; - if (i <= for_end) - do { - if (corners[i].x < xmin) - xmin = corners[i].x; - if (corners[i].x > xmax) - xmax = corners[i].x; - if (corners[i].y < ymin) - ymin = corners[i].y; - if (corners[i].y > ymax) - ymax = corners[i].y; - } - while (i++ < for_end); - } - } - SET_POINT(corners[0], xmin, ymin); - SET_POINT(corners[1], xmin, ymax); - SET_POINT(corners[2], xmax, ymax); - SET_POINT(corners[3], xmax, ymin); - transform_concat(&t, &t2); - } else - check_keywords = false; - } - if ((x_size_req != 0.0) || (y_size_req != 0.0)) { - { - xmin = 1000000.0; - xmax = -(int32_t) xmin; - ymin = xmin; - ymax = xmax; - { - register int32_t for_end; - i = 0; - for_end = 3; - if (i <= for_end) - do { - if (corners[i].x < xmin) - xmin = corners[i].x; - if (corners[i].x > xmax) - xmax = corners[i].x; - if (corners[i].y < ymin) - ymin = corners[i].y; - if (corners[i].y > ymax) - ymax = corners[i].y; - } - while (i++ < for_end); - } - } - if (x_size_req == 0.0) { - make_scale(&t2, y_size_req / ((double)(ymax - ymin)), y_size_req / ((double)(ymax - ymin))); - } else if (y_size_req == 0.0) { - make_scale(&t2, x_size_req / ((double)(xmax - xmin)), x_size_req / ((double)(xmax - xmin))); - } else { - - make_scale(&t2, x_size_req / ((double)(xmax - xmin)), y_size_req / ((double)(ymax - ymin))); - } - { - register int32_t for_end; - i = 0; - for_end = 3; - if (i <= for_end) - do - transform_point(&corners[i], &t2); - while (i++ < for_end); - } - x_size_req = 0.0; - y_size_req = 0.0; - transform_concat(&t, &t2); - } - { - xmin = 1000000.0; - xmax = -(int32_t) xmin; - ymin = xmin; - ymax = xmax; - { - register int32_t for_end; - i = 0; - for_end = 3; - if (i <= for_end) - do { - if (corners[i].x < xmin) - xmin = corners[i].x; - if (corners[i].x > xmax) - xmax = corners[i].x; - if (corners[i].y < ymin) - ymin = corners[i].y; - if (corners[i].y > ymax) - ymax = corners[i].y; - } - while (i++ < for_end); - } - } - make_translation(&t2, -(int32_t) xmin * 72 / ((double)72.27), -(int32_t) ymin * 72 / ((double)72.27)); - transform_concat(&t, &t2); - if (result == 0) { - new_whatsit(PIC_NODE, - PIC_NODE_SIZE + (strlen(pic_path) + sizeof(memory_word) - 1) / sizeof(memory_word)); - if (is_pdf) { - mem[cur_list.tail].b16.s0 = PDF_NODE; - } - PIC_NODE_path_len(cur_list.tail) = strlen(pic_path); - mem[cur_list.tail + 4].b16.s0 = page; - mem[cur_list.tail + 8].b16.s1 = pdf_box_type; - mem[cur_list.tail + 1].b32.s1 = D2Fix(xmax - xmin); - mem[cur_list.tail + 3].b32.s1 = D2Fix(ymax - ymin); - mem[cur_list.tail + 2].b32.s1 = 0; - mem[cur_list.tail + 5].b32.s0 = D2Fix(t.a); - mem[cur_list.tail + 5].b32.s1 = D2Fix(t.b); - mem[cur_list.tail + 6].b32.s0 = D2Fix(t.c); - mem[cur_list.tail + 6].b32.s1 = D2Fix(t.d); - mem[cur_list.tail + 7].b32.s0 = D2Fix(t.x); - mem[cur_list.tail + 7].b32.s1 = D2Fix(t.y); - memcpy(PIC_NODE_path(cur_list.tail), pic_path, strlen(pic_path)); - free(pic_path); - } else { - - { - if (file_line_error_style_p) - print_file_line(); - else - print_nl_cstr("! "); - print_cstr("Unable to load picture or PDF file '"); - } - print_file_name(cur_name, cur_area, cur_ext); - print('\''); - if (result == -43) { - { - help_ptr = 2; - help_line[1] = "The requested image couldn't be read because"; - help_line[0] = "the file was not found."; - } - } else { - - { - help_ptr = 2; - help_line[1] = "The requested image couldn't be read because"; - help_line[0] = "it was not a recognized image format."; - } - } - error(); - } -} - void scan_and_pack_name(void) { scan_file_name(); From 9b478581f383fae0a426aae6e94c4e05c7b9a0b5 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sat, 29 Sep 2018 00:35:15 -0400 Subject: [PATCH 11/36] tectonic/core-foundation.h: move ssize_t compat foo here It was in core-bridge.h, but this is a better place for it. --- tectonic/core-bridge.h | 9 +-------- tectonic/core-foundation.h | 14 +++++++++++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/tectonic/core-bridge.h b/tectonic/core-bridge.h index bbad80e4a..c0f5f42ba 100644 --- a/tectonic/core-bridge.h +++ b/tectonic/core-bridge.h @@ -6,16 +6,9 @@ #ifndef TECTONIC_CORE_BRIDGE_H #define TECTONIC_CORE_BRIDGE_H +#include "core-foundation.h" #include "tectonic.h" -#include /* size_t */ -#include /* ssize_t */ - -#if defined(_MSC_VER) -#include -typedef SSIZE_T ssize_t; -#endif - /* The weird enum values are historical and could be rationalized. But it is * good to write them explicitly since they must be kept in sync with * `src/engines/mod.rs`. diff --git a/tectonic/core-foundation.h b/tectonic/core-foundation.h index 91a67b93d..ea5676aea 100644 --- a/tectonic/core-foundation.h +++ b/tectonic/core-foundation.h @@ -26,9 +26,11 @@ #include #include #include -#include /* for int32_t */ +#include +#include #include #include +#include /* Convenience for C++: this way Emacs doesn't try to indent the prototypes, * which I find annoying. */ @@ -76,4 +78,14 @@ # endif #endif +/* Portability: ssize_t + * + * On Unix, sys/types.h gives ssize_t. On MSVC we need to do the following: + */ + +#if defined(_MSC_VER) +#include +typedef SSIZE_T ssize_t; +#endif + #endif /* not TECTONIC_CORE_FOUNDATION_H */ From c1135236e127677b3e692267f6cb1b5e9e8b1aee Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sat, 29 Sep 2018 00:41:50 -0400 Subject: [PATCH 12/36] tectonic/xetex-scaledmath.c: rename from mathutil.c And move its prototypes to continue the process of emptying out "internals.h" --- build.rs | 2 +- tectonic/internals.h | 13 +------------ tectonic/xetex-core.h | 2 ++ tectonic/{mathutil.c => xetex-scaledmath.c} | 0 tectonic/xetexd.h | 8 ++++++++ 5 files changed, 12 insertions(+), 13 deletions(-) rename tectonic/{mathutil.c => xetex-scaledmath.c} (100%) diff --git a/build.rs b/build.rs index 74fd77a55..aa0d35049 100644 --- a/build.rs +++ b/build.rs @@ -151,7 +151,6 @@ fn main() { .file("tectonic/dpx-unicode.c") .file("tectonic/dpx-vf.c") .file("tectonic/io.c") - .file("tectonic/mathutil.c") .file("tectonic/output.c") .file("tectonic/synctex.c") .file("tectonic/texmfmp.c") @@ -163,6 +162,7 @@ fn main() { .file("tectonic/xetex-errors.c") .file("tectonic/xetex-linebreak.c") .file("tectonic/xetex-math.c") + .file("tectonic/xetex-scaledmath.c") .file("tectonic/xetex-shipout.c") .file("tectonic/xetex-stringpool.c") .define("HAVE_ZLIB", "1") diff --git a/tectonic/internals.h b/tectonic/internals.h index 94385d8b2..df9540365 100644 --- a/tectonic/internals.h +++ b/tectonic/internals.h @@ -1,5 +1,5 @@ /* tectonic/internals.h: global, private header for Tectonic - Copyright 2016 the Tectonic Project + Copyright 2016-2018 the Tectonic Project Licensed under the MIT License. */ @@ -15,10 +15,6 @@ #include #include -/* Core typedefs. */ - -typedef int32_t scaled_t; - /* Unicode files */ typedef struct { @@ -62,13 +58,6 @@ int get_uni_c(UFILE* f); int input_line(UFILE* f); void make_utf16_name(void); -/* mathutil.c */ -int32_t tex_round (double); -int32_t half(int32_t x); -scaled_t mult_and_add(int32_t n, scaled_t x, scaled_t y, scaled_t max_answer); -scaled_t x_over_n(scaled_t x, int32_t n); -scaled_t xn_over_d(scaled_t x, int32_t n, int32_t d); - /* core-kpathutil.c */ char *xstrdup (const char *s); void *xmalloc (size_t size); diff --git a/tectonic/xetex-core.h b/tectonic/xetex-core.h index 2132f2e1b..38aebacbe 100644 --- a/tectonic/xetex-core.h +++ b/tectonic/xetex-core.h @@ -42,6 +42,8 @@ /* our typedefs */ +typedef int32_t scaled_t; + typedef uint32_t OTTag; typedef uint16_t GlyphID; diff --git a/tectonic/mathutil.c b/tectonic/xetex-scaledmath.c similarity index 100% rename from tectonic/mathutil.c rename to tectonic/xetex-scaledmath.c diff --git a/tectonic/xetexd.h b/tectonic/xetexd.h index 62adfec19..9ca7c1711 100644 --- a/tectonic/xetexd.h +++ b/tectonic/xetexd.h @@ -1024,6 +1024,14 @@ void math_fraction(void); void math_left_right(void); void flush_math(void); +/* xetex-scaledmath */ + +int32_t tex_round(double); +int32_t half(int32_t x); +scaled_t mult_and_add(int32_t n, scaled_t x, scaled_t y, scaled_t max_answer); +scaled_t x_over_n(scaled_t x, int32_t n); +scaled_t xn_over_d(scaled_t x, int32_t n, int32_t d); + /* xetex-shipout */ void initialize_shipout_variables(void); From a517bdeeaf34f7e3803cfff2a9e95ab44bc3b315 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sat, 29 Sep 2018 00:52:17 -0400 Subject: [PATCH 13/36] tectonic/xetex-io.c: rename from io.c And add xetex-io.h, stealing a lot of definitions from "internals.h". Once again, these routines are specific to the XeTeX engine. --- build.rs | 2 +- tectonic/internals.h | 36 -------------------------------- tectonic/{io.c => xetex-io.c} | 11 ++++------ tectonic/xetex-io.h | 39 +++++++++++++++++++++++++++++++++++ tectonic/xetex0.c | 2 +- tectonic/xetexd.h | 3 +++ 6 files changed, 48 insertions(+), 45 deletions(-) rename tectonic/{io.c => xetex-io.c} (98%) create mode 100644 tectonic/xetex-io.h diff --git a/build.rs b/build.rs index aa0d35049..479e86982 100644 --- a/build.rs +++ b/build.rs @@ -150,7 +150,6 @@ fn main() { .file("tectonic/dpx-type1c.c") .file("tectonic/dpx-unicode.c") .file("tectonic/dpx-vf.c") - .file("tectonic/io.c") .file("tectonic/output.c") .file("tectonic/synctex.c") .file("tectonic/texmfmp.c") @@ -160,6 +159,7 @@ fn main() { .file("tectonic/XeTeX_pic.c") .file("tectonic/xetex-engine-interface.c") .file("tectonic/xetex-errors.c") + .file("tectonic/xetex-io.c") .file("tectonic/xetex-linebreak.c") .file("tectonic/xetex-math.c") .file("tectonic/xetex-scaledmath.c") diff --git a/tectonic/internals.h b/tectonic/internals.h index df9540365..bfb4b31d6 100644 --- a/tectonic/internals.h +++ b/tectonic/internals.h @@ -15,16 +15,6 @@ #include #include -/* Unicode files */ - -typedef struct { - rust_input_handle_t handle; - long savedChar; - short skipNextLF; - short encodingMode; - void *conversionData; -} UFILE; - typedef enum { SELECTOR_FILE_0 = 0, SELECTOR_FILE_15 = 15, @@ -39,25 +29,6 @@ typedef enum { BEGIN_EXTERN_C -/* Unicode constants */ - -extern const uint32_t offsetsFromUTF8[6]; -extern const uint8_t bytesFromUTF8[256]; -extern const uint8_t firstByteMark[7]; - -/* - Functions -*/ - -/* io.c */ -rust_input_handle_t tt_open_input (int filefmt); -void set_input_file_encoding(UFILE *f, int32_t mode, int32_t encodingData); -void u_close(UFILE *f); -int u_open_in(UFILE **f, int32_t filefmt, const char* fopen_mode, int32_t mode, int32_t encodingData); -int get_uni_c(UFILE* f); -int input_line(UFILE* f); -void make_utf16_name(void); - /* core-kpathutil.c */ char *xstrdup (const char *s); void *xmalloc (size_t size); @@ -69,13 +40,6 @@ static inline void *mfree(void *ptr) { return NULL; } -/* - State variables -*/ - -/* openclose.c */ -extern char *fullnameoffile; - END_EXTERN_C #endif /* not TECTONIC_INTERNALS_H */ diff --git a/tectonic/io.c b/tectonic/xetex-io.c similarity index 98% rename from tectonic/io.c rename to tectonic/xetex-io.c index 9a881126e..55b34299e 100644 --- a/tectonic/io.c +++ b/tectonic/xetex-io.c @@ -1,5 +1,5 @@ -/* tectonic/io.c: low-level input/output functions - Copyright 2016 The Tectonic Project +/* tectonic/xetex-io.c: low-level input/output functions tied to the XeTeX engine + Copyright 2016-2018 The Tectonic Project Licensed under the MIT License. */ @@ -21,7 +21,7 @@ char *fullnameoffile; /* Defaults to NULL. */ rust_input_handle_t -tt_open_input (int filefmt) +tt_xetex_open_input (int filefmt) { char *fname = NULL; rust_input_handle_t handle; @@ -45,9 +45,6 @@ tt_open_input (int filefmt) return handle; } - -/* XeTeX I/O */ - /* tables/values used in UTF-8 interpretation - code is based on ConvertUTF.[ch] sample code published by the Unicode consortium */ @@ -125,7 +122,7 @@ u_open_in(UFILE **f, int32_t filefmt, const char *fopen_mode, int32_t mode, int3 rust_input_handle_t handle; int B1, B2; - handle = tt_open_input (filefmt); + handle = tt_xetex_open_input (filefmt); if (handle == NULL) return 0; diff --git a/tectonic/xetex-io.h b/tectonic/xetex-io.h new file mode 100644 index 000000000..50db47f61 --- /dev/null +++ b/tectonic/xetex-io.h @@ -0,0 +1,39 @@ +/* tectonic/xetex-io.h: XeTeX-specific low-level I/O routines + Copyright 2016-2018 the Tectonic Project + Licensed under the MIT License. +*/ + +#ifndef TECTONIC_XETEX_IO_H +#define TECTONIC_XETEX_IO_H + +#include "core-foundation.h" +#include "core-bridge.h" + + +typedef struct { + rust_input_handle_t handle; + long savedChar; + short skipNextLF; + short encodingMode; + void *conversionData; +} UFILE; + + +BEGIN_EXTERN_C + +extern char *fullnameoffile; +extern const uint32_t offsetsFromUTF8[6]; +extern const uint8_t bytesFromUTF8[256]; +extern const uint8_t firstByteMark[7]; + +rust_input_handle_t tt_xetex_open_input(int filefmt); +void set_input_file_encoding(UFILE *f, int32_t mode, int32_t encodingData); +void u_close(UFILE *f); +int u_open_in(UFILE **f, int32_t filefmt, const char* fopen_mode, int32_t mode, int32_t encodingData); +int get_uni_c(UFILE* f); +int input_line(UFILE* f); +void make_utf16_name(void); + +END_EXTERN_C + +#endif /* not TECTONIC_XETEX_IO_H */ diff --git a/tectonic/xetex0.c b/tectonic/xetex0.c index d8d91f1da..f970360af 100644 --- a/tectonic/xetex0.c +++ b/tectonic/xetex0.c @@ -11341,7 +11341,7 @@ read_font_info(int32_t u, str_number nom, str_number aire, scaled_t s) pack_file_name(nom, aire, EMPTY_STRING); check_for_tfm_font_mapping(); - tfm_file = tt_open_input (TTIF_TFM); + tfm_file = tt_xetex_open_input (TTIF_TFM); if (tfm_file == NULL) { if (!quoted_filename) { g = load_native_font(u, nom, aire, s); diff --git a/tectonic/xetexd.h b/tectonic/xetexd.h index 9ca7c1711..e10d18048 100644 --- a/tectonic/xetexd.h +++ b/tectonic/xetexd.h @@ -312,6 +312,9 @@ bool is_new_source(str_number, int); pool_pointer make_src_special(str_number, int); void remember_source_info(str_number, int); +/* Needed here for UFILE */ +#include "xetex-io.h" + /* variables! */ /* All the following variables are defined in xetexini.c */ From a9cfe3707d3e67bbdabae709ca6de0e5408ab5ed Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sat, 29 Sep 2018 00:56:44 -0400 Subject: [PATCH 14/36] tectonic/xetex-core.h: move selector_t here from internals.h Honestly this isn't a way better location, but it's at least a *bit* better than "internals.h". And I'm trying to nuke the latter entirely. --- tectonic/internals.h | 11 ----------- tectonic/xetex-core.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tectonic/internals.h b/tectonic/internals.h index bfb4b31d6..45919b194 100644 --- a/tectonic/internals.h +++ b/tectonic/internals.h @@ -15,17 +15,6 @@ #include #include -typedef enum { - SELECTOR_FILE_0 = 0, - SELECTOR_FILE_15 = 15, - SELECTOR_NO_PRINT = 16, - SELECTOR_TERM_ONLY = 17, - SELECTOR_LOG_ONLY = 18, - SELECTOR_TERM_AND_LOG = 19, - SELECTOR_PSEUDO = 20, - SELECTOR_NEW_STRING = 21 -} selector_t; - BEGIN_EXTERN_C diff --git a/tectonic/xetex-core.h b/tectonic/xetex-core.h index 38aebacbe..87ef6f4e6 100644 --- a/tectonic/xetex-core.h +++ b/tectonic/xetex-core.h @@ -73,6 +73,17 @@ typedef struct { float yMax; } GlyphBBox; +typedef enum { + SELECTOR_FILE_0 = 0, + SELECTOR_FILE_15 = 15, + SELECTOR_NO_PRINT = 16, + SELECTOR_TERM_ONLY = 17, + SELECTOR_LOG_ONLY = 18, + SELECTOR_TERM_AND_LOG = 19, + SELECTOR_PSEUDO = 20, + SELECTOR_NEW_STRING = 21 +} selector_t; + #ifdef XETEX_MAC #include typedef CTFontDescriptorRef PlatformFontRef; From f24b4b6192e75d9716f5194dbaee568f93658e3f Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sat, 29 Sep 2018 11:29:09 -0400 Subject: [PATCH 15/36] tectonic/core-foundation.h: always provide M_PI The 0.1.10 Tectonic package on Conda fails to build on Windows because it is undefined. There weren't any problems on Tectonic's CI, though, so it must be version-dependent. --- tectonic/core-foundation.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tectonic/core-foundation.h b/tectonic/core-foundation.h index ea5676aea..e9fdaa734 100644 --- a/tectonic/core-foundation.h +++ b/tectonic/core-foundation.h @@ -88,4 +88,16 @@ typedef SSIZE_T ssize_t; #endif +/* Portability: M_PI + * + * MSVC doesn't always define it. Based on research, sometimes #defining + * _USE_MATH_DEFINES should fix the problem, but it's not clear if that + * *always* works in all versions, and it's easy to cut to the heart of the + * matter: + */ + +#ifndef M_PI +# define M_PI 3.14159265358979 +#endif + #endif /* not TECTONIC_CORE_FOUNDATION_H */ From 12fee667c806be9a3bd72e541478c7cf4922ff87 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 11:57:20 -0400 Subject: [PATCH 16/36] tectonic/core-memory.c: rename from core-kpathsea.c The last bit in "internals.h" was some dynamic memory routines. Break those out into their own files. Now "internals.h" is basicaly superfluous. --- build.rs | 2 +- tectonic/XeTeXFontInst.cpp | 1 + tectonic/XeTeXFontMgr.cpp | 3 +++ tectonic/XeTeXLayoutInterface.cpp | 3 +++ tectonic/XeTeXOTMath.cpp | 3 +++ tectonic/{core-kpathutil.c => core-memory.c} | 7 +++--- tectonic/core-memory.h | 25 ++++++++++++++++++++ tectonic/internals.h | 17 +------------ 8 files changed, 41 insertions(+), 20 deletions(-) rename tectonic/{core-kpathutil.c => core-memory.c} (91%) create mode 100644 tectonic/core-memory.h diff --git a/build.rs b/build.rs index 479e86982..b6349a446 100644 --- a/build.rs +++ b/build.rs @@ -78,7 +78,7 @@ fn main() { ccfg .file("tectonic/bibtex.c") .file("tectonic/core-bridge.c") - .file("tectonic/core-kpathutil.c") + .file("tectonic/core-memory.c") .file("tectonic/dpx-agl.c") .file("tectonic/dpx-bmpimage.c") .file("tectonic/dpx-cff.c") diff --git a/tectonic/XeTeXFontInst.cpp b/tectonic/XeTeXFontInst.cpp index 44e26b9f4..3d3ed23cb 100644 --- a/tectonic/XeTeXFontInst.cpp +++ b/tectonic/XeTeXFontInst.cpp @@ -42,6 +42,7 @@ authorization from the copyright holders. #include "tectonic.h" #include "internals.h" #include "core-bridge.h" +#include "core-memory.h" #include "XeTeXFontInst.h" #include "XeTeXLayoutInterface.h" diff --git a/tectonic/XeTeXFontMgr.cpp b/tectonic/XeTeXFontMgr.cpp index 24bb2f3bb..6a3fcbe7b 100644 --- a/tectonic/XeTeXFontMgr.cpp +++ b/tectonic/XeTeXFontMgr.cpp @@ -30,6 +30,9 @@ use or other dealings in this Software without prior written authorization from the copyright holders. \****************************************************************************/ +#include "core-foundation.h" +#include "core-memory.h" + #include "tectonic.h" #include "internals.h" diff --git a/tectonic/XeTeXLayoutInterface.cpp b/tectonic/XeTeXLayoutInterface.cpp index c31cd695d..8d823dec8 100644 --- a/tectonic/XeTeXLayoutInterface.cpp +++ b/tectonic/XeTeXLayoutInterface.cpp @@ -31,6 +31,9 @@ use or other dealings in this Software without prior written authorization from the copyright holders. \****************************************************************************/ +#include "core-foundation.h" +#include "core-memory.h" + #include "tectonic.h" #include "internals.h" diff --git a/tectonic/XeTeXOTMath.cpp b/tectonic/XeTeXOTMath.cpp index b017a5d27..3f5775521 100644 --- a/tectonic/XeTeXOTMath.cpp +++ b/tectonic/XeTeXOTMath.cpp @@ -31,6 +31,9 @@ use or other dealings in this Software without prior written authorization from the copyright holders. \****************************************************************************/ +#include "core-foundation.h" +#include "core-memory.h" + #include #include "tectonic.h" diff --git a/tectonic/core-kpathutil.c b/tectonic/core-memory.c similarity index 91% rename from tectonic/core-kpathutil.c rename to tectonic/core-memory.c index 52e48df4d..179ca644a 100644 --- a/tectonic/core-kpathutil.c +++ b/tectonic/core-memory.c @@ -1,4 +1,4 @@ -/* Collected kpathsea files in the tidied workalike version. +/* tectonic/core-memory.c: basic C dynamic memory helpers Copyright 1993, 1994, 1995, 2008, 2009, 2010, 2011 Karl Berry. Copyright 1997, 2002, 2005 Olaf Weber. @@ -16,8 +16,9 @@ You should have received a copy of the GNU Lesser General Public License along with this library; if not, see . */ -#include "tectonic.h" -#include "internals.h" +#include "core-foundation.h" +#include "core-bridge.h" /* _tt_abort */ +#include "core-memory.h" void * diff --git a/tectonic/core-memory.h b/tectonic/core-memory.h new file mode 100644 index 000000000..00bb199f7 --- /dev/null +++ b/tectonic/core-memory.h @@ -0,0 +1,25 @@ +/* tectonic/core-memory.h: basic dynamic memory helpers + Copyright 2016-2018 the Tectonic Project + Licensed under the MIT License. +*/ + +#ifndef TECTONIC_CORE_MEMORY_H +#define TECTONIC_CORE_MEMORY_H + +#include "core-foundation.h" + +BEGIN_EXTERN_C + +char *xstrdup (const char *s); +void *xmalloc (size_t size); +void *xrealloc (void *old_address, size_t new_size); +void *xcalloc (size_t nelem, size_t elsize); + +static inline void *mfree(void *ptr) { + free(ptr); + return NULL; +} + +END_EXTERN_C + +#endif /* not TECTONIC_CORE_MEMORY_H */ diff --git a/tectonic/internals.h b/tectonic/internals.h index 45919b194..07913a45e 100644 --- a/tectonic/internals.h +++ b/tectonic/internals.h @@ -8,6 +8,7 @@ #include "tectonic.h" #include "core-bridge.h" +#include "core-memory.h" #include "core-strutils.h" #include @@ -15,20 +16,4 @@ #include #include - -BEGIN_EXTERN_C - -/* core-kpathutil.c */ -char *xstrdup (const char *s); -void *xmalloc (size_t size); -void *xrealloc (void *old_address, size_t new_size); -void *xcalloc (size_t nelem, size_t elsize); - -static inline void *mfree(void *ptr) { - free(ptr); - return NULL; -} - -END_EXTERN_C - #endif /* not TECTONIC_INTERNALS_H */ From 1f79ca096167d786d903e50b77edb7be9c56e605 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 12:07:53 -0400 Subject: [PATCH 17/36] tectonic: start working on excising internals.h --- tectonic/XeTeXFontInst.cpp | 5 +---- tectonic/XeTeXFontMgr.cpp | 6 +----- tectonic/XeTeXLayoutInterface.cpp | 6 +----- tectonic/XeTeXLayoutInterface.h | 2 -- tectonic/XeTeX_ext.c | 3 +-- tectonic/XeTeX_ext.h | 2 -- tectonic/XeTeX_pic.c | 3 +-- tectonic/bibtex.c | 6 +++++- 8 files changed, 10 insertions(+), 23 deletions(-) diff --git a/tectonic/XeTeXFontInst.cpp b/tectonic/XeTeXFontInst.cpp index 3d3ed23cb..ea71fb141 100644 --- a/tectonic/XeTeXFontInst.cpp +++ b/tectonic/XeTeXFontInst.cpp @@ -39,10 +39,7 @@ authorization from the copyright holders. * originally based on PortableFontInstance.cpp from ICU */ -#include "tectonic.h" -#include "internals.h" -#include "core-bridge.h" -#include "core-memory.h" +#include "xetex-core.h" #include "XeTeXFontInst.h" #include "XeTeXLayoutInterface.h" diff --git a/tectonic/XeTeXFontMgr.cpp b/tectonic/XeTeXFontMgr.cpp index 6a3fcbe7b..ce14d8115 100644 --- a/tectonic/XeTeXFontMgr.cpp +++ b/tectonic/XeTeXFontMgr.cpp @@ -30,11 +30,7 @@ use or other dealings in this Software without prior written authorization from the copyright holders. \****************************************************************************/ -#include "core-foundation.h" -#include "core-memory.h" - -#include "tectonic.h" -#include "internals.h" +#include "xetex-core.h" #include "XeTeX_web.h" diff --git a/tectonic/XeTeXLayoutInterface.cpp b/tectonic/XeTeXLayoutInterface.cpp index 8d823dec8..ccd2c76bd 100644 --- a/tectonic/XeTeXLayoutInterface.cpp +++ b/tectonic/XeTeXLayoutInterface.cpp @@ -31,11 +31,7 @@ use or other dealings in this Software without prior written authorization from the copyright holders. \****************************************************************************/ -#include "core-foundation.h" -#include "core-memory.h" - -#include "tectonic.h" -#include "internals.h" +#include "xetex-core.h" #include // We need this first #include diff --git a/tectonic/XeTeXLayoutInterface.h b/tectonic/XeTeXLayoutInterface.h index 754a29e0b..dabbe0f1a 100644 --- a/tectonic/XeTeXLayoutInterface.h +++ b/tectonic/XeTeXLayoutInterface.h @@ -34,8 +34,6 @@ authorization from the copyright holders. #ifndef XETEX_LAYOUT_INTERFACE_H #define XETEX_LAYOUT_INTERFACE_H 1 -#include "tectonic.h" -#include "internals.h" #include "xetex-core.h" BEGIN_EXTERN_C diff --git a/tectonic/XeTeX_ext.c b/tectonic/XeTeX_ext.c index 9ff2eadb8..debe48e93 100644 --- a/tectonic/XeTeX_ext.c +++ b/tectonic/XeTeX_ext.c @@ -36,8 +36,7 @@ authorization from the copyright holders. * additional plain C extensions for XeTeX - mostly platform-neutral */ -#include "tectonic.h" -#include "internals.h" +#include "xetex-core.h" #include "XeTeX_ext.h" #include "TECkit_Engine.h" #include "XeTeXLayoutInterface.h" diff --git a/tectonic/XeTeX_ext.h b/tectonic/XeTeX_ext.h index e34d134e7..02eb86273 100644 --- a/tectonic/XeTeX_ext.h +++ b/tectonic/XeTeX_ext.h @@ -35,8 +35,6 @@ authorization from the copyright holders. #ifndef __XETEXEXT_H #define __XETEXEXT_H -#include "tectonic.h" -#include "internals.h" #include "xetex-core.h" #include "XeTeXLayoutInterface.h" diff --git a/tectonic/XeTeX_pic.c b/tectonic/XeTeX_pic.c index 68f2c9640..fc9860956 100644 --- a/tectonic/XeTeX_pic.c +++ b/tectonic/XeTeX_pic.c @@ -36,8 +36,7 @@ XeTeX_pic.c only needs to get image dimensions, not actually load/process the file */ -#include "tectonic.h" -#include "internals.h" +#include "xetex-core.h" #include "xetexd.h" #include "XeTeX_ext.h" #include "core-bridge.h" diff --git a/tectonic/bibtex.c b/tectonic/bibtex.c index 353d5d772..b1030cb7f 100644 --- a/tectonic/bibtex.c +++ b/tectonic/bibtex.c @@ -1,5 +1,9 @@ #include "bibtex.h" -#include "internals.h" + +#include "core-bridge.h" +#include "core-memory.h" + +#include /* EOF, snprintf */ /* hack: the name eof conflicts with other function declarations under mingw. */ #define eof tectonic_eof From cd21ef765119803106dd623c673768d5009abfc9 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 12:22:48 -0400 Subject: [PATCH 18/36] tectonic: replace internals.h with universal dpx-core.h in dpx-*.h Have every xdvipdfmx header include a new "dpx-core.h" before doing anything else. At the moment the new "dpx-core.h" just includes "core-foundation.h", but I might add additional items that are essentially universal in the xdvipdfmx codebase. The main thing is to ensure that "core-foundatiion.h" is included before any other headers. --- tectonic/dpx-agl.h | 2 ++ tectonic/dpx-bmpimage.h | 1 + tectonic/dpx-cff.h | 2 ++ tectonic/dpx-cff_dict.h | 2 ++ tectonic/dpx-cff_limits.h | 2 ++ tectonic/dpx-cff_stdstr.h | 2 ++ tectonic/dpx-cff_types.h | 2 ++ tectonic/dpx-cid.h | 2 ++ tectonic/dpx-cid_basefont.h | 2 ++ tectonic/dpx-cid_p.h | 2 ++ tectonic/dpx-cidtype0.h | 2 ++ tectonic/dpx-cidtype2.h | 2 ++ tectonic/dpx-cmap.h | 2 ++ tectonic/dpx-cmap_p.h | 2 ++ tectonic/dpx-cmap_read.h | 2 ++ tectonic/dpx-cmap_write.h | 2 ++ tectonic/dpx-core.h | 11 +++++++++++ tectonic/dpx-cs_type2.h | 2 ++ tectonic/dpx-dpxconf.h | 2 ++ tectonic/dpx-dpxcrypt.h | 2 ++ tectonic/dpx-dpxfile.h | 1 + tectonic/dpx-dpxutil.h | 2 ++ tectonic/dpx-dvi.h | 2 ++ tectonic/dpx-dvicodes.h | 2 ++ tectonic/dpx-dvipdfmx.h | 2 ++ tectonic/dpx-epdf.h | 2 ++ tectonic/dpx-error.h | 3 ++- tectonic/dpx-fontmap.h | 2 ++ tectonic/dpx-jp2image.h | 2 ++ tectonic/dpx-jpegimage.h | 1 + tectonic/dpx-mem.h | 2 ++ tectonic/dpx-mfileio.h | 2 ++ tectonic/dpx-mpost.h | 2 ++ tectonic/dpx-numbers.h | 2 ++ tectonic/dpx-otl_conf.h | 2 ++ tectonic/dpx-otl_opt.h | 2 ++ tectonic/dpx-pdfcolor.h | 2 ++ tectonic/dpx-pdfdev.h | 2 ++ tectonic/dpx-pdfdoc.h | 2 ++ tectonic/dpx-pdfdraw.h | 2 ++ tectonic/dpx-pdfencoding.h | 2 ++ tectonic/dpx-pdfencrypt.h | 2 ++ tectonic/dpx-pdffont.h | 2 ++ tectonic/dpx-pdflimits.h | 2 ++ tectonic/dpx-pdfnames.h | 2 ++ tectonic/dpx-pdfobj.h | 2 ++ tectonic/dpx-pdfparse.h | 2 ++ tectonic/dpx-pdfresource.h | 2 ++ tectonic/dpx-pdfximage.h | 2 ++ tectonic/dpx-pkfont.h | 2 ++ tectonic/dpx-pngimage.h | 2 ++ tectonic/dpx-pst.h | 2 ++ tectonic/dpx-pst_obj.h | 2 ++ tectonic/dpx-sfnt.h | 2 ++ tectonic/dpx-spc_color.h | 2 ++ tectonic/dpx-spc_dvipdfmx.h | 2 ++ tectonic/dpx-spc_dvips.h | 2 ++ tectonic/dpx-spc_html.h | 2 ++ tectonic/dpx-spc_misc.h | 2 ++ tectonic/dpx-spc_pdfm.h | 2 ++ tectonic/dpx-spc_tpic.h | 2 ++ tectonic/dpx-spc_util.h | 2 ++ tectonic/dpx-spc_xtx.h | 2 ++ tectonic/dpx-specials.h | 2 ++ tectonic/dpx-subfont.h | 2 ++ tectonic/dpx-system.h | 2 ++ tectonic/dpx-t1_char.h | 2 ++ tectonic/dpx-t1_load.h | 2 ++ tectonic/dpx-tfm.h | 2 ++ tectonic/dpx-truetype.h | 2 ++ tectonic/dpx-tt_aux.h | 2 ++ tectonic/dpx-tt_cmap.h | 2 ++ tectonic/dpx-tt_glyf.h | 2 ++ tectonic/dpx-tt_gsub.h | 2 ++ tectonic/dpx-tt_post.h | 2 ++ tectonic/dpx-tt_table.h | 2 ++ tectonic/dpx-type0.h | 2 ++ tectonic/dpx-type1.h | 2 ++ tectonic/dpx-type1c.h | 2 ++ tectonic/dpx-unicode.h | 2 ++ tectonic/dpx-vf.h | 2 ++ 81 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 tectonic/dpx-core.h diff --git a/tectonic/dpx-agl.h b/tectonic/dpx-agl.h index 35b782c1b..bf587291a 100644 --- a/tectonic/dpx-agl.h +++ b/tectonic/dpx-agl.h @@ -23,6 +23,8 @@ #ifndef _AGL_H_ #define _AGL_H_ +#include "dpx-core.h" + #include #include diff --git a/tectonic/dpx-bmpimage.h b/tectonic/dpx-bmpimage.h index e217ff48c..ad5096fd5 100644 --- a/tectonic/dpx-bmpimage.h +++ b/tectonic/dpx-bmpimage.h @@ -24,6 +24,7 @@ #ifndef _BMPIMAGE_H_ #define _BMPIMAGE_H_ +#include "dpx-core.h" #include "core-bridge.h" #include "dpx-mfileio.h" #include "dpx-pdfximage.h" diff --git a/tectonic/dpx-cff.h b/tectonic/dpx-cff.h index 5efc8d22d..f0bbb1da9 100644 --- a/tectonic/dpx-cff.h +++ b/tectonic/dpx-cff.h @@ -21,6 +21,8 @@ #ifndef _CFF_H_ #define _CFF_H_ +#include "dpx-core.h" + #include #include diff --git a/tectonic/dpx-cff_dict.h b/tectonic/dpx-cff_dict.h index 6c932a95a..4fe21f969 100644 --- a/tectonic/dpx-cff_dict.h +++ b/tectonic/dpx-cff_dict.h @@ -21,6 +21,8 @@ #ifndef _CFF_DICT_H_ #define _CFF_DICT_H_ +#include "dpx-core.h" + #include "dpx-cff_types.h" #include "dpx-cff.h" diff --git a/tectonic/dpx-cff_limits.h b/tectonic/dpx-cff_limits.h index aec553e07..0c69ea94e 100644 --- a/tectonic/dpx-cff_limits.h +++ b/tectonic/dpx-cff_limits.h @@ -21,6 +21,8 @@ #ifndef _CFF_LIMITS_H_ #define _CFF_LIMITS_H_ +#include "dpx-core.h" + #include #define CFF_INT_MAX 0x7fffffff diff --git a/tectonic/dpx-cff_stdstr.h b/tectonic/dpx-cff_stdstr.h index 5f08e0357..371a6d3bf 100644 --- a/tectonic/dpx-cff_stdstr.h +++ b/tectonic/dpx-cff_stdstr.h @@ -21,6 +21,8 @@ #ifndef _CFF_STDSTR_H_ #define _CFF_STDSTR_H_ +#include "dpx-core.h" + #define CFF_STDSTR_MAX 391 static const char *const cff_stdstr[CFF_STDSTR_MAX] = { diff --git a/tectonic/dpx-cff_types.h b/tectonic/dpx-cff_types.h index b7ef7670a..a60648dcf 100644 --- a/tectonic/dpx-cff_types.h +++ b/tectonic/dpx-cff_types.h @@ -21,6 +21,8 @@ #ifndef _CFF_TYPES_H_ #define _CFF_TYPES_H_ +#include "dpx-core.h" + #include /* CFF Data Types */ diff --git a/tectonic/dpx-cid.h b/tectonic/dpx-cid.h index fb060771b..3df8e1e68 100644 --- a/tectonic/dpx-cid.h +++ b/tectonic/dpx-cid.h @@ -21,6 +21,8 @@ #ifndef _CID_H_ #define _CID_H_ +#include "dpx-core.h" + #include /* CIDFont types */ diff --git a/tectonic/dpx-cid_basefont.h b/tectonic/dpx-cid_basefont.h index ec73e4aa9..cb34fce68 100644 --- a/tectonic/dpx-cid_basefont.h +++ b/tectonic/dpx-cid_basefont.h @@ -21,6 +21,8 @@ #ifndef _CID_BASEFONT_H_ #define _CID_BASEFONT_H_ +#include "dpx-core.h" + /* PLEASE SEND INFORMATION ON FONTS * * Those fonts are only for fixed-pitch glyphs (full-, half-, third-, diff --git a/tectonic/dpx-cid_p.h b/tectonic/dpx-cid_p.h index c73a8d7b8..61306d2c2 100644 --- a/tectonic/dpx-cid_p.h +++ b/tectonic/dpx-cid_p.h @@ -23,6 +23,8 @@ #ifndef _CID_P_H_ #define _CID_P_H_ +#include "dpx-core.h" + #define FONT_FLAG_NONE 0 #define FONT_FLAG_BASEFONT (1 << 0) #define FONT_FLAG_ACCFONT (1 << 1) diff --git a/tectonic/dpx-cidtype0.h b/tectonic/dpx-cidtype0.h index a21f42be1..61126fe55 100644 --- a/tectonic/dpx-cidtype0.h +++ b/tectonic/dpx-cidtype0.h @@ -21,6 +21,8 @@ #ifndef _CIDTYPE0_H_ #define _CIDTYPE0_H_ +#include "dpx-core.h" + #include "dpx-cid.h" #include "dpx-cid_p.h" #include "dpx-fontmap.h" diff --git a/tectonic/dpx-cidtype2.h b/tectonic/dpx-cidtype2.h index 5daad49bf..6e49372b8 100644 --- a/tectonic/dpx-cidtype2.h +++ b/tectonic/dpx-cidtype2.h @@ -21,6 +21,8 @@ #ifndef _CIDTYPE2_H_ #define _CIDTYPE2_H_ +#include "dpx-core.h" + #include "dpx-cid.h" #include "dpx-cid_p.h" diff --git a/tectonic/dpx-cmap.h b/tectonic/dpx-cmap.h index 6e7e60a93..96bb0a214 100644 --- a/tectonic/dpx-cmap.h +++ b/tectonic/dpx-cmap.h @@ -21,6 +21,8 @@ #ifndef _CMAP_H_ #define _CMAP_H_ +#include "dpx-core.h" + #include #include #include diff --git a/tectonic/dpx-cmap_p.h b/tectonic/dpx-cmap_p.h index 39f9a3134..f9f3ee5f0 100644 --- a/tectonic/dpx-cmap_p.h +++ b/tectonic/dpx-cmap_p.h @@ -21,6 +21,8 @@ #ifndef _CMAP_P_H_ #define _CMAP_P_H_ +#include "dpx-core.h" + #include "dpx-cid.h" /* Mapping types, MAP_IS_NAME is not supported. */ diff --git a/tectonic/dpx-cmap_read.h b/tectonic/dpx-cmap_read.h index bc4aecdc4..9fc22f72d 100644 --- a/tectonic/dpx-cmap_read.h +++ b/tectonic/dpx-cmap_read.h @@ -23,6 +23,8 @@ #ifndef _CMAP_READ_H_ #define _CMAP_READ_H_ +#include "dpx-core.h" + #include #include "core-bridge.h" diff --git a/tectonic/dpx-cmap_write.h b/tectonic/dpx-cmap_write.h index 4f4c6ac69..268470c1f 100644 --- a/tectonic/dpx-cmap_write.h +++ b/tectonic/dpx-cmap_write.h @@ -23,6 +23,8 @@ #ifndef _CMAP_WRITE_H_ #define _CMAP_WRITE_H_ +#include "dpx-core.h" + #include "dpx-cmap.h" #include "dpx-pdfobj.h" diff --git a/tectonic/dpx-core.h b/tectonic/dpx-core.h new file mode 100644 index 000000000..867f23189 --- /dev/null +++ b/tectonic/dpx-core.h @@ -0,0 +1,11 @@ +/* tectonic/dpx-core.h: core header for xdvipdvmx C code + Copyright 2018 the Tectonic Project + Licensed under the MIT License. +*/ + +#ifndef TECTONIC_DPX_CORE_H +#define TECTONIC_DPX_CORE_H + +#include "core-foundation.h" + +#endif /* TECTONIC_DPX_CORE_H */ diff --git a/tectonic/dpx-cs_type2.h b/tectonic/dpx-cs_type2.h index db3f41961..767d809de 100644 --- a/tectonic/dpx-cs_type2.h +++ b/tectonic/dpx-cs_type2.h @@ -21,6 +21,8 @@ #ifndef _CS_TYPE2_H_ #define _CS_TYPE2_H_ +#include "dpx-core.h" + #include "dpx-cff_types.h" typedef struct { diff --git a/tectonic/dpx-dpxconf.h b/tectonic/dpx-dpxconf.h index ff93eb08d..0151c4c85 100644 --- a/tectonic/dpx-dpxconf.h +++ b/tectonic/dpx-dpxconf.h @@ -23,6 +23,8 @@ #ifndef _DPXCONF_H_ #define _DPXCONF_H_ +#include "dpx-core.h" + #include #ifdef HAVE_LIBPAPER #include diff --git a/tectonic/dpx-dpxcrypt.h b/tectonic/dpx-dpxcrypt.h index 03965346c..9e3985630 100644 --- a/tectonic/dpx-dpxcrypt.h +++ b/tectonic/dpx-dpxcrypt.h @@ -21,6 +21,8 @@ #ifndef _DPXCRYPT_H_ #define _DPXCRYPT_H_ +#include "dpx-core.h" + #include #include diff --git a/tectonic/dpx-dpxfile.h b/tectonic/dpx-dpxfile.h index 275479ae9..3b71cc234 100644 --- a/tectonic/dpx-dpxfile.h +++ b/tectonic/dpx-dpxfile.h @@ -23,6 +23,7 @@ #ifndef _DPXFILE_H_ #define _DPXFILE_H_ +#include "dpx-core.h" #include "core-bridge.h" #include "dpx-mfileio.h" diff --git a/tectonic/dpx-dpxutil.h b/tectonic/dpx-dpxutil.h index 57bf0b0d7..483ee7713 100644 --- a/tectonic/dpx-dpxutil.h +++ b/tectonic/dpx-dpxutil.h @@ -23,6 +23,8 @@ #ifndef _DPXUTIL_H_ #define _DPXUTIL_H_ +#include "dpx-core.h" + #undef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #undef MAX diff --git a/tectonic/dpx-dvi.h b/tectonic/dpx-dvi.h index 278c75601..3f34bc51f 100644 --- a/tectonic/dpx-dvi.h +++ b/tectonic/dpx-dvi.h @@ -23,6 +23,8 @@ #ifndef _DVI_H_ #define _DVI_H_ +#include "dpx-core.h" + #include #include diff --git a/tectonic/dpx-dvicodes.h b/tectonic/dpx-dvicodes.h index 9134b3f09..0c7943391 100644 --- a/tectonic/dpx-dvicodes.h +++ b/tectonic/dpx-dvicodes.h @@ -23,6 +23,8 @@ #ifndef _DVICODES_H_ #define _DVICODES_H_ +#include "dpx-core.h" + /* DVI op codes */ #define SET_CHAR_0 0 #define SET_CHAR_1 1 diff --git a/tectonic/dpx-dvipdfmx.h b/tectonic/dpx-dvipdfmx.h index 370545c2b..e1fe3696b 100644 --- a/tectonic/dpx-dvipdfmx.h +++ b/tectonic/dpx-dvipdfmx.h @@ -25,6 +25,8 @@ #ifndef _DVIPDFMX_H_ #define _DVIPDFMX_H_ +#include "dpx-core.h" + #include #define DVIPDFMX_PROG_NAME "xdvipdfmx" diff --git a/tectonic/dpx-epdf.h b/tectonic/dpx-epdf.h index a9580bde8..32b443c2d 100644 --- a/tectonic/dpx-epdf.h +++ b/tectonic/dpx-epdf.h @@ -23,6 +23,8 @@ #ifndef _EPDF_H_ #define _EPDF_H_ +#include "dpx-core.h" + #include #include "core-bridge.h" diff --git a/tectonic/dpx-error.h b/tectonic/dpx-error.h index c0c493f3a..8967f34cb 100644 --- a/tectonic/dpx-error.h +++ b/tectonic/dpx-error.h @@ -23,11 +23,12 @@ #ifndef _ERROR_H_ #define _ERROR_H_ +#include "dpx-core.h" + #include #include #include "dpx-system.h" -#include "internals.h" #include "tectonic.h" void shut_up (int quietness); diff --git a/tectonic/dpx-fontmap.h b/tectonic/dpx-fontmap.h index cfa99164a..1409e3416 100644 --- a/tectonic/dpx-fontmap.h +++ b/tectonic/dpx-fontmap.h @@ -23,6 +23,8 @@ #ifndef _FONTMAP_H_ #define _FONTMAP_H_ +#include "dpx-core.h" + #include #define FONTMAP_RMODE_REPLACE 0 diff --git a/tectonic/dpx-jp2image.h b/tectonic/dpx-jp2image.h index 0f3eac0d3..40390848d 100644 --- a/tectonic/dpx-jp2image.h +++ b/tectonic/dpx-jp2image.h @@ -23,6 +23,8 @@ #ifndef _JP2IMAGE_H_ #define _JP2IMAGE_H_ +#include "dpx-core.h" + #include #include "dpx-mfileio.h" diff --git a/tectonic/dpx-jpegimage.h b/tectonic/dpx-jpegimage.h index 460458f8b..3f2ab6d87 100644 --- a/tectonic/dpx-jpegimage.h +++ b/tectonic/dpx-jpegimage.h @@ -23,6 +23,7 @@ #ifndef _JPEGIMAGE_H_ #define _JPEGIMAGE_H_ +#include "dpx-core.h" #include "core-bridge.h" #include "dpx-mfileio.h" #include "dpx-pdfximage.h" diff --git a/tectonic/dpx-mem.h b/tectonic/dpx-mem.h index 9d343ffdc..d99ab4c1d 100644 --- a/tectonic/dpx-mem.h +++ b/tectonic/dpx-mem.h @@ -23,6 +23,8 @@ #ifndef _MEM_H_ #define _MEM_H_ +#include "dpx-core.h" + #include #include diff --git a/tectonic/dpx-mfileio.h b/tectonic/dpx-mfileio.h index f79bcecad..a4f2d1072 100644 --- a/tectonic/dpx-mfileio.h +++ b/tectonic/dpx-mfileio.h @@ -23,6 +23,8 @@ #ifndef _MFILEIO_H_ #define _MFILEIO_H_ +#include "dpx-core.h" + #include #include diff --git a/tectonic/dpx-mpost.h b/tectonic/dpx-mpost.h index 79cb02b6f..96d885927 100644 --- a/tectonic/dpx-mpost.h +++ b/tectonic/dpx-mpost.h @@ -23,6 +23,8 @@ #ifndef _MPOST_H_ #define _MPOST_H_ +#include "dpx-core.h" + #include #include "dpx-mfileio.h" diff --git a/tectonic/dpx-numbers.h b/tectonic/dpx-numbers.h index 8e8bf0261..e51c0acd0 100644 --- a/tectonic/dpx-numbers.h +++ b/tectonic/dpx-numbers.h @@ -23,6 +23,8 @@ #ifndef _NUMBERS_H_ #define _NUMBERS_H_ +#include "dpx-core.h" + #include #include #include diff --git a/tectonic/dpx-otl_conf.h b/tectonic/dpx-otl_conf.h index eafe5a9c0..1fe7c41c2 100644 --- a/tectonic/dpx-otl_conf.h +++ b/tectonic/dpx-otl_conf.h @@ -21,6 +21,8 @@ #ifndef _OTL_CONF_H_ #define _OTL_CONF_H_ +#include "dpx-core.h" + #include "dpx-pdfobj.h" void otl_conf_set_verbose (int level); diff --git a/tectonic/dpx-otl_opt.h b/tectonic/dpx-otl_opt.h index f4d76f784..4d08852c9 100644 --- a/tectonic/dpx-otl_opt.h +++ b/tectonic/dpx-otl_opt.h @@ -21,6 +21,8 @@ #ifndef _OTL_OPT_H_ #define _OTL_OPT_H_ +#include "dpx-core.h" + typedef struct otl_opt otl_opt; diff --git a/tectonic/dpx-pdfcolor.h b/tectonic/dpx-pdfcolor.h index 83107e89f..ebd15d296 100644 --- a/tectonic/dpx-pdfcolor.h +++ b/tectonic/dpx-pdfcolor.h @@ -23,6 +23,8 @@ #ifndef _PDF_COLOR_H_ #define _PDF_COLOR_H_ +#include "dpx-core.h" + #include #include "dpx-pdfobj.h" diff --git a/tectonic/dpx-pdfdev.h b/tectonic/dpx-pdfdev.h index d12c6491d..9e26353e4 100644 --- a/tectonic/dpx-pdfdev.h +++ b/tectonic/dpx-pdfdev.h @@ -23,6 +23,8 @@ #ifndef _PDFDEV_H_ #define _PDFDEV_H_ +#include "dpx-core.h" + #include #include diff --git a/tectonic/dpx-pdfdoc.h b/tectonic/dpx-pdfdoc.h index 86326043e..61ee5253f 100644 --- a/tectonic/dpx-pdfdoc.h +++ b/tectonic/dpx-pdfdoc.h @@ -23,6 +23,8 @@ #ifndef _PDFDOC_H_ #define _PDFDOC_H_ +#include "dpx-core.h" + #include #include "dpx-pdfobj.h" diff --git a/tectonic/dpx-pdfdraw.h b/tectonic/dpx-pdfdraw.h index de0e2de24..bcbff1fe6 100644 --- a/tectonic/dpx-pdfdraw.h +++ b/tectonic/dpx-pdfdraw.h @@ -23,6 +23,8 @@ #ifndef _PDF_DRAW_H_ #define _PDF_DRAW_H_ +#include "dpx-core.h" + #include "dpx-pdfcolor.h" #include "dpx-pdfdev.h" diff --git a/tectonic/dpx-pdfencoding.h b/tectonic/dpx-pdfencoding.h index d054f5286..b987e98b3 100644 --- a/tectonic/dpx-pdfencoding.h +++ b/tectonic/dpx-pdfencoding.h @@ -23,6 +23,8 @@ #ifndef _PDFENCODING_H_ #define _PDFENCODING_H_ +#include "dpx-core.h" + #include "dpx-pdfobj.h" void pdf_encoding_set_verbose (int level); diff --git a/tectonic/dpx-pdfencrypt.h b/tectonic/dpx-pdfencrypt.h index f4b3d6dd5..d07cf7da2 100644 --- a/tectonic/dpx-pdfencrypt.h +++ b/tectonic/dpx-pdfencrypt.h @@ -23,6 +23,8 @@ #ifndef _PDFENCRYPT_H_ #define _PDFENCRYPT_H_ +#include "dpx-core.h" + #include #include "dpx-pdfobj.h" diff --git a/tectonic/dpx-pdffont.h b/tectonic/dpx-pdffont.h index 6192b6f14..3519fd2a6 100644 --- a/tectonic/dpx-pdffont.h +++ b/tectonic/dpx-pdffont.h @@ -23,6 +23,8 @@ #ifndef _PDFFONT_H_ #define _PDFFONT_H_ +#include "dpx-core.h" + #include #include "dpx-fontmap.h" diff --git a/tectonic/dpx-pdflimits.h b/tectonic/dpx-pdflimits.h index bfaef75a9..aac8160a3 100644 --- a/tectonic/dpx-pdflimits.h +++ b/tectonic/dpx-pdflimits.h @@ -23,6 +23,8 @@ #ifndef _PDFLIMITS_H_ #define _PDFLIMITS_H_ +#include "dpx-core.h" + /* * The minimal and maximal PDF version supported by DVIPDFMx. * NOTE: Don't forget to update CIDFont_stdcc_def[] in cid.c diff --git a/tectonic/dpx-pdfnames.h b/tectonic/dpx-pdfnames.h index 0a14e190b..b8f3dc93f 100644 --- a/tectonic/dpx-pdfnames.h +++ b/tectonic/dpx-pdfnames.h @@ -23,6 +23,8 @@ #ifndef _PDF_NAMES_H_ #define _PDF_NAMES_H_ +#include "dpx-core.h" + /* Hash */ #include "dpx-dpxutil.h" #include "dpx-pdfobj.h" diff --git a/tectonic/dpx-pdfobj.h b/tectonic/dpx-pdfobj.h index dc63b476a..b8c067882 100644 --- a/tectonic/dpx-pdfobj.h +++ b/tectonic/dpx-pdfobj.h @@ -23,6 +23,8 @@ #ifndef _PDFOBJ_H_ #define _PDFOBJ_H_ +#include "dpx-core.h" + #include #include #include diff --git a/tectonic/dpx-pdfparse.h b/tectonic/dpx-pdfparse.h index 7053d8581..a36edc5bd 100644 --- a/tectonic/dpx-pdfparse.h +++ b/tectonic/dpx-pdfparse.h @@ -23,6 +23,8 @@ #ifndef _PDFPARSE_H_ #define _PDFPARSE_H_ +#include "dpx-core.h" + #include "dpx-numbers.h" #include "dpx-pdfobj.h" diff --git a/tectonic/dpx-pdfresource.h b/tectonic/dpx-pdfresource.h index 4823105e3..5be55cfa1 100644 --- a/tectonic/dpx-pdfresource.h +++ b/tectonic/dpx-pdfresource.h @@ -23,6 +23,8 @@ #ifndef _PDF_RESOURCE_H_ #define _PDF_RESOURCE_H_ +#include "dpx-core.h" + #include "dpx-pdfobj.h" #define PDF_RES_FLUSH_IMMEDIATE 1 diff --git a/tectonic/dpx-pdfximage.h b/tectonic/dpx-pdfximage.h index 4aeaf3cdf..92719067f 100644 --- a/tectonic/dpx-pdfximage.h +++ b/tectonic/dpx-pdfximage.h @@ -23,6 +23,8 @@ #ifndef _PDFXIMAGE_H_ #define _PDFXIMAGE_H_ +#include "dpx-core.h" + #include "dpx-pdfdev.h" #include "dpx-pdfobj.h" diff --git a/tectonic/dpx-pkfont.h b/tectonic/dpx-pkfont.h index 14af90390..d6c03b4b0 100644 --- a/tectonic/dpx-pkfont.h +++ b/tectonic/dpx-pkfont.h @@ -23,6 +23,8 @@ #ifndef _PK_FONT_H_ #define _PK_FONT_H_ +#include "dpx-core.h" + #include "dpx-pdffont.h" int pdf_font_open_pkfont (pdf_font *font); diff --git a/tectonic/dpx-pngimage.h b/tectonic/dpx-pngimage.h index c7420e2f2..24fcdffaa 100644 --- a/tectonic/dpx-pngimage.h +++ b/tectonic/dpx-pngimage.h @@ -24,6 +24,8 @@ #ifndef _PNGIMAGE_H_ #define _PNGIMAGE_H_ +#include "dpx-core.h" + #include #include "core-bridge.h" diff --git a/tectonic/dpx-pst.h b/tectonic/dpx-pst.h index 30154020a..88de690cb 100644 --- a/tectonic/dpx-pst.h +++ b/tectonic/dpx-pst.h @@ -23,6 +23,8 @@ #ifndef _PST_H_ #define _PST_H_ +#include "dpx-core.h" + #include #include "dpx-dpxutil.h" diff --git a/tectonic/dpx-pst_obj.h b/tectonic/dpx-pst_obj.h index 37bd715a2..e86c3b29a 100644 --- a/tectonic/dpx-pst_obj.h +++ b/tectonic/dpx-pst_obj.h @@ -23,6 +23,8 @@ #ifndef _PST_OBJ_H_ #define _PST_OBJ_H_ +#include "dpx-core.h" + #include "dpx-pst.h" pst_obj *pst_parse_null (unsigned char **inbuf, unsigned char *inbufend); diff --git a/tectonic/dpx-sfnt.h b/tectonic/dpx-sfnt.h index 7ab76cf96..0a0c23aac 100644 --- a/tectonic/dpx-sfnt.h +++ b/tectonic/dpx-sfnt.h @@ -21,6 +21,8 @@ #ifndef _SFNT_H_ #define _SFNT_H_ +#include "dpx-core.h" + #include #include #include diff --git a/tectonic/dpx-spc_color.h b/tectonic/dpx-spc_color.h index d329f202e..fe03c597c 100644 --- a/tectonic/dpx-spc_color.h +++ b/tectonic/dpx-spc_color.h @@ -23,6 +23,8 @@ #ifndef _SPC_COLOR_H_ #define _SPC_COLOR_H_ +#include "dpx-core.h" + #include #include "dpx-specials.h" diff --git a/tectonic/dpx-spc_dvipdfmx.h b/tectonic/dpx-spc_dvipdfmx.h index 47b40c10b..58a9c5db8 100644 --- a/tectonic/dpx-spc_dvipdfmx.h +++ b/tectonic/dpx-spc_dvipdfmx.h @@ -21,6 +21,8 @@ #ifndef _SPC_DVIPDFMX_H_ #define _SPC_DVIPDFMX_H_ +#include "dpx-core.h" + #include #include "dpx-specials.h" diff --git a/tectonic/dpx-spc_dvips.h b/tectonic/dpx-spc_dvips.h index 7063060e6..79431b114 100644 --- a/tectonic/dpx-spc_dvips.h +++ b/tectonic/dpx-spc_dvips.h @@ -23,6 +23,8 @@ #ifndef _SPC_DVIPS_H_ #define _SPC_DVIPS_H_ +#include "dpx-core.h" + #include #include "dpx-specials.h" diff --git a/tectonic/dpx-spc_html.h b/tectonic/dpx-spc_html.h index 99beba93b..76f8ee42e 100644 --- a/tectonic/dpx-spc_html.h +++ b/tectonic/dpx-spc_html.h @@ -23,6 +23,8 @@ #ifndef _SPC_HTML_H_ #define _SPC_HTML_H_ +#include "dpx-core.h" + #include #include "dpx-specials.h" diff --git a/tectonic/dpx-spc_misc.h b/tectonic/dpx-spc_misc.h index c582c8a9e..94f6a52ff 100644 --- a/tectonic/dpx-spc_misc.h +++ b/tectonic/dpx-spc_misc.h @@ -23,6 +23,8 @@ #ifndef _SPC_MISC_H_ #define _SPC_MISC_H_ +#include "dpx-core.h" + #include #include "dpx-specials.h" diff --git a/tectonic/dpx-spc_pdfm.h b/tectonic/dpx-spc_pdfm.h index c83f2c6f1..409fdefc2 100644 --- a/tectonic/dpx-spc_pdfm.h +++ b/tectonic/dpx-spc_pdfm.h @@ -23,6 +23,8 @@ #ifndef _SPC_PDFM_H_ #define _SPC_PDFM_H_ +#include "dpx-core.h" + #include #include "dpx-specials.h" diff --git a/tectonic/dpx-spc_tpic.h b/tectonic/dpx-spc_tpic.h index e4b693a51..2c4cc227a 100644 --- a/tectonic/dpx-spc_tpic.h +++ b/tectonic/dpx-spc_tpic.h @@ -23,6 +23,8 @@ #ifndef _SPC_TPIC_H_ #define _SPC_TPIC_H_ +#include "dpx-core.h" + #include #include "dpx-specials.h" diff --git a/tectonic/dpx-spc_util.h b/tectonic/dpx-spc_util.h index e075ea5b3..edf07c9e5 100644 --- a/tectonic/dpx-spc_util.h +++ b/tectonic/dpx-spc_util.h @@ -23,6 +23,8 @@ #ifndef _SPC_UTIL_H_ #define _SPC_UTIL_H_ +#include "dpx-core.h" + #include "dpx-pdfcolor.h" #include "dpx-pdfdev.h" diff --git a/tectonic/dpx-spc_xtx.h b/tectonic/dpx-spc_xtx.h index 42b8c7d6c..a7771230a 100644 --- a/tectonic/dpx-spc_xtx.h +++ b/tectonic/dpx-spc_xtx.h @@ -29,6 +29,8 @@ #ifndef _SPC_XTX_H_ #define _SPC_XTX_H_ +#include "dpx-core.h" + #include #include "dpx-specials.h" diff --git a/tectonic/dpx-specials.h b/tectonic/dpx-specials.h index 55779e7d9..5b65fe9ab 100644 --- a/tectonic/dpx-specials.h +++ b/tectonic/dpx-specials.h @@ -23,6 +23,8 @@ #ifndef _SPECIALS_H_ #define _SPECIALS_H_ +#include "dpx-core.h" + #include "tectonic.h" struct spc_env { diff --git a/tectonic/dpx-subfont.h b/tectonic/dpx-subfont.h index 29eac288a..ce104cc02 100644 --- a/tectonic/dpx-subfont.h +++ b/tectonic/dpx-subfont.h @@ -21,6 +21,8 @@ #ifndef _SUBFONT_H_ #define _SUBFONT_H_ +#include "dpx-core.h" + void subfont_set_verbose (int level); void release_sfd_record (void); diff --git a/tectonic/dpx-system.h b/tectonic/dpx-system.h index 43019cc7f..2a36d91e2 100644 --- a/tectonic/dpx-system.h +++ b/tectonic/dpx-system.h @@ -23,6 +23,8 @@ #ifndef _SYSTEM_H_ #define _SYSTEM_H_ +#include "dpx-core.h" + #define FOPEN_R_MODE "r" #define FOPEN_RBIN_MODE "rb" #define FOPEN_WBIN_MODE "wb" diff --git a/tectonic/dpx-t1_char.h b/tectonic/dpx-t1_char.h index f56206194..ae32b7123 100644 --- a/tectonic/dpx-t1_char.h +++ b/tectonic/dpx-t1_char.h @@ -1,6 +1,8 @@ #ifndef _T1_CSTR_H_ #define _T1_CSTR_H_ +#include "dpx-core.h" + #include "dpx-cff_types.h" typedef struct { diff --git a/tectonic/dpx-t1_load.h b/tectonic/dpx-t1_load.h index 075ab13a3..a143cfae3 100644 --- a/tectonic/dpx-t1_load.h +++ b/tectonic/dpx-t1_load.h @@ -25,6 +25,8 @@ #ifndef _T1_LOAD_H_ #define _T1_LOAD_H_ +#include "dpx-core.h" + #include #include diff --git a/tectonic/dpx-tfm.h b/tectonic/dpx-tfm.h index c79a6dd73..217a50a2a 100644 --- a/tectonic/dpx-tfm.h +++ b/tectonic/dpx-tfm.h @@ -23,6 +23,8 @@ #ifndef _TFM_H_ #define _TFM_H_ +#include "dpx-core.h" + #include #include diff --git a/tectonic/dpx-truetype.h b/tectonic/dpx-truetype.h index 1b3898c84..96ec8bf16 100644 --- a/tectonic/dpx-truetype.h +++ b/tectonic/dpx-truetype.h @@ -23,6 +23,8 @@ #ifndef _TRUETYPE_H_ #define _TRUETYPE_H_ +#include "dpx-core.h" + #include "dpx-pdffont.h" int pdf_font_open_truetype (pdf_font *font); diff --git a/tectonic/dpx-tt_aux.h b/tectonic/dpx-tt_aux.h index 85c5b2af6..e5557cc7c 100644 --- a/tectonic/dpx-tt_aux.h +++ b/tectonic/dpx-tt_aux.h @@ -21,6 +21,8 @@ #ifndef _TT_AUX_H_ #define _TT_AUX_H_ +#include "dpx-core.h" + #include "dpx-pdfobj.h" #include "dpx-sfnt.h" diff --git a/tectonic/dpx-tt_cmap.h b/tectonic/dpx-tt_cmap.h index 7b231c838..bd04a0d25 100644 --- a/tectonic/dpx-tt_cmap.h +++ b/tectonic/dpx-tt_cmap.h @@ -21,6 +21,8 @@ #ifndef _TT_CMAP_H_ #define _TT_CMAP_H_ +#include "dpx-core.h" + #include "dpx-sfnt.h" void otf_cmap_set_verbose (int level); diff --git a/tectonic/dpx-tt_glyf.h b/tectonic/dpx-tt_glyf.h index 8646cdab8..b1375f5cc 100644 --- a/tectonic/dpx-tt_glyf.h +++ b/tectonic/dpx-tt_glyf.h @@ -21,6 +21,8 @@ #ifndef _TT_GLYF_H_ #define _TT_GLYF_H_ +#include "dpx-core.h" + #include "dpx-sfnt.h" struct tt_glyph_desc diff --git a/tectonic/dpx-tt_gsub.h b/tectonic/dpx-tt_gsub.h index 620f71dd5..4ebbd00c5 100644 --- a/tectonic/dpx-tt_gsub.h +++ b/tectonic/dpx-tt_gsub.h @@ -21,6 +21,8 @@ #ifndef _TT_GSUB_H_ #define _TT_GSUB_H_ +#include "dpx-core.h" + #include "dpx-otl_opt.h" #include "dpx-sfnt.h" diff --git a/tectonic/dpx-tt_post.h b/tectonic/dpx-tt_post.h index 2a8957e40..0b5927d79 100644 --- a/tectonic/dpx-tt_post.h +++ b/tectonic/dpx-tt_post.h @@ -21,6 +21,8 @@ #ifndef _TT_POST_H_ #define _TT_POST_H_ +#include "dpx-core.h" + #include "dpx-sfnt.h" struct tt_post_table diff --git a/tectonic/dpx-tt_table.h b/tectonic/dpx-tt_table.h index 18f7459a6..e4e5be64d 100644 --- a/tectonic/dpx-tt_table.h +++ b/tectonic/dpx-tt_table.h @@ -21,6 +21,8 @@ #ifndef _TT_TABLE_H_ #define _TT_TABLE_H_ +#include "dpx-core.h" + #include "dpx-sfnt.h" #define TT_HEAD_TABLE_SIZE 54UL diff --git a/tectonic/dpx-type0.h b/tectonic/dpx-type0.h index 499c018ab..5fe19841c 100644 --- a/tectonic/dpx-type0.h +++ b/tectonic/dpx-type0.h @@ -21,6 +21,8 @@ #ifndef _TYPE0_H_ #define _TYPE0_H_ +#include "dpx-core.h" + #include "dpx-pdfobj.h" #define add_to_used_chars2(b,c) {(b)[(c)/8] |= (1 << (7-((c)%8)));} diff --git a/tectonic/dpx-type1.h b/tectonic/dpx-type1.h index 1fa15fc65..c47a60794 100644 --- a/tectonic/dpx-type1.h +++ b/tectonic/dpx-type1.h @@ -23,6 +23,8 @@ #ifndef _TYPE1_H_ #define _TYPE1_H_ +#include "dpx-core.h" + #include "dpx-pdffont.h" int pdf_font_open_type1 (pdf_font *font); diff --git a/tectonic/dpx-type1c.h b/tectonic/dpx-type1c.h index 1cbd23f72..213702403 100644 --- a/tectonic/dpx-type1c.h +++ b/tectonic/dpx-type1c.h @@ -23,6 +23,8 @@ #ifndef _TYPE1C_H_ #define _TYPE1C_H_ +#include "dpx-core.h" + #include "dpx-pdffont.h" int pdf_font_open_type1c (pdf_font *font); diff --git a/tectonic/dpx-unicode.h b/tectonic/dpx-unicode.h index 2a437224f..b4eb98143 100644 --- a/tectonic/dpx-unicode.h +++ b/tectonic/dpx-unicode.h @@ -23,6 +23,8 @@ #ifndef _UNICODE_H_ #define _UNICODE_H_ +#include "dpx-core.h" + #include #include #include diff --git a/tectonic/dpx-vf.h b/tectonic/dpx-vf.h index f7be241c3..e62e88541 100644 --- a/tectonic/dpx-vf.h +++ b/tectonic/dpx-vf.h @@ -23,6 +23,8 @@ #ifndef _VF_H_ #define _VF_H_ +#include "dpx-core.h" + #include #include "dpx-pdfdev.h" From 7134962fac405a34f6c56d38d210682b86e4c851 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 12:30:40 -0400 Subject: [PATCH 19/36] tectonic/dpx-*.c: remove all references to "internals.h" By adding the core #includes to "dpx-core.h", it is no longer needed. --- tectonic/dpx-agl.c | 1 - tectonic/dpx-cff.c | 1 - tectonic/dpx-cff_dict.c | 1 - tectonic/dpx-cid.c | 1 - tectonic/dpx-cidtype2.c | 1 - tectonic/dpx-cmap.c | 1 - tectonic/dpx-cmap_read.c | 1 - tectonic/dpx-core.h | 3 +++ tectonic/dpx-dpxconf.c | 1 - tectonic/dpx-dpxfile.c | 1 - tectonic/dpx-dpxutil.c | 1 - tectonic/dpx-dvi.c | 1 - tectonic/dpx-epdf.c | 1 - tectonic/dpx-fontmap.c | 1 - tectonic/dpx-jpegimage.c | 1 - tectonic/dpx-mpost.c | 1 - tectonic/dpx-otl_conf.c | 1 - tectonic/dpx-pdfcolor.c | 1 - tectonic/dpx-pdfdev.c | 1 - tectonic/dpx-pdfdoc.c | 1 - tectonic/dpx-pdfdraw.c | 1 - tectonic/dpx-pdfencoding.c | 1 - tectonic/dpx-pdffont.c | 1 - tectonic/dpx-pdfnames.c | 1 - tectonic/dpx-pdfobj.c | 1 - tectonic/dpx-pdfparse.c | 1 - tectonic/dpx-pdfresource.c | 1 - tectonic/dpx-pdfximage.c | 1 - tectonic/dpx-sfnt.c | 1 - tectonic/dpx-spc_color.c | 1 - tectonic/dpx-spc_dvipdfmx.c | 1 - tectonic/dpx-spc_dvips.c | 1 - tectonic/dpx-spc_html.c | 1 - tectonic/dpx-spc_pdfm.c | 1 - tectonic/dpx-spc_tpic.c | 1 - tectonic/dpx-spc_util.c | 1 - tectonic/dpx-spc_xtx.c | 1 - tectonic/dpx-subfont.c | 1 - tectonic/dpx-t1_char.c | 1 - tectonic/dpx-t1_load.c | 1 - tectonic/dpx-tfm.c | 1 - tectonic/dpx-truetype.c | 1 - tectonic/dpx-tt_cmap.c | 1 - tectonic/dpx-tt_gsub.c | 1 - tectonic/dpx-tt_post.c | 1 - tectonic/dpx-type0.c | 1 - tectonic/dpx-type1.c | 1 - tectonic/dpx-type1c.c | 1 - tectonic/dpx-vf.c | 1 - 49 files changed, 3 insertions(+), 48 deletions(-) diff --git a/tectonic/dpx-agl.c b/tectonic/dpx-agl.c index bcbdeb19a..75041fb6e 100644 --- a/tectonic/dpx-agl.c +++ b/tectonic/dpx-agl.c @@ -45,7 +45,6 @@ #include "dpx-mfileio.h" #include "dpx-pdfparse.h" #include "dpx-unicode.h" -#include "internals.h" static int agl_load_listfile (const char *filename, int format); diff --git a/tectonic/dpx-cff.c b/tectonic/dpx-cff.c index ef535c287..bae85b6ed 100644 --- a/tectonic/dpx-cff.c +++ b/tectonic/dpx-cff.c @@ -30,7 +30,6 @@ #include "dpx-error.h" #include "dpx-mem.h" #include "dpx-numbers.h" -#include "internals.h" #define CFF_DEBUG 5 #define CFF_DEBUG_STR "CFF" diff --git a/tectonic/dpx-cff_dict.c b/tectonic/dpx-cff_dict.c index 913db9ece..b664f1fcb 100644 --- a/tectonic/dpx-cff_dict.c +++ b/tectonic/dpx-cff_dict.c @@ -34,7 +34,6 @@ #include "core-bridge.h" #include "dpx-error.h" #include "dpx-mem.h" -#include "internals.h" #ifndef CFF_DEBUG_STR #define CFF_DEBUG_STR "CFF" diff --git a/tectonic/dpx-cid.c b/tectonic/dpx-cid.c index 9e33e160f..7d2ac6b9c 100644 --- a/tectonic/dpx-cid.c +++ b/tectonic/dpx-cid.c @@ -42,7 +42,6 @@ #include "dpx-error.h" #include "dpx-mem.h" #include "dpx-pdfobj.h" -#include "internals.h" #define CIDFONT_DEBUG 3 #define CIDFONT_DEBUG_STR "CIDFont" diff --git a/tectonic/dpx-cidtype2.c b/tectonic/dpx-cidtype2.c index 274e7983b..07c456f17 100644 --- a/tectonic/dpx-cidtype2.c +++ b/tectonic/dpx-cidtype2.c @@ -32,7 +32,6 @@ #include "dpx-pdffont.h" #include "dpx-pdflimits.h" #include "dpx-pdfobj.h" -#include "internals.h" #ifndef PDF_NAME_LEN_MAX # define PDF_NAME_LEN_MAX 255 diff --git a/tectonic/dpx-cmap.c b/tectonic/dpx-cmap.c index 671ef5f65..651dce9ca 100644 --- a/tectonic/dpx-cmap.c +++ b/tectonic/dpx-cmap.c @@ -46,7 +46,6 @@ #include "dpx-dpxutil.h" #include "dpx-error.h" #include "dpx-mem.h" -#include "internals.h" static int __verbose = 0; static int __silent = 0; diff --git a/tectonic/dpx-cmap_read.c b/tectonic/dpx-cmap_read.c index 946e8c5c9..66ff87d63 100644 --- a/tectonic/dpx-cmap_read.c +++ b/tectonic/dpx-cmap_read.c @@ -34,7 +34,6 @@ #include "dpx-error.h" #include "dpx-mem.h" #include "dpx-pst.h" -#include "internals.h" static int __verbose = 0; diff --git a/tectonic/dpx-core.h b/tectonic/dpx-core.h index 867f23189..c9b3a7945 100644 --- a/tectonic/dpx-core.h +++ b/tectonic/dpx-core.h @@ -7,5 +7,8 @@ #define TECTONIC_DPX_CORE_H #include "core-foundation.h" +#include "core-bridge.h" +#include "core-memory.h" +#include "core-strutils.h" #endif /* TECTONIC_DPX_CORE_H */ diff --git a/tectonic/dpx-dpxconf.c b/tectonic/dpx-dpxconf.c index 555c6da5c..9c5f5495f 100644 --- a/tectonic/dpx-dpxconf.c +++ b/tectonic/dpx-dpxconf.c @@ -24,7 +24,6 @@ #include -#include "internals.h" #ifndef HAVE_LIBPAPER const struct paper paperspecs[] = { diff --git a/tectonic/dpx-dpxfile.c b/tectonic/dpx-dpxfile.c index 80b5d26a2..e4e875d43 100644 --- a/tectonic/dpx-dpxfile.c +++ b/tectonic/dpx-dpxfile.c @@ -35,7 +35,6 @@ #include "dpx-mem.h" #include "dpx-numbers.h" #include "dpx-system.h" -#include "internals.h" #define MAX_KEY_LEN 16 diff --git a/tectonic/dpx-dpxutil.c b/tectonic/dpx-dpxutil.c index efe1ae146..0ed3c2e66 100644 --- a/tectonic/dpx-dpxutil.c +++ b/tectonic/dpx-dpxutil.c @@ -30,7 +30,6 @@ #include "dpx-error.h" #include "dpx-mem.h" -#include "internals.h" int xtoi (char c) diff --git a/tectonic/dpx-dvi.c b/tectonic/dpx-dvi.c index 88cc07c6b..868f8e3c9 100644 --- a/tectonic/dpx-dvi.c +++ b/tectonic/dpx-dvi.c @@ -59,7 +59,6 @@ #include "dpx-tt_aux.h" #include "dpx-tt_table.h" #include "dpx-vf.h" -#include "internals.h" #define DVI_STACK_DEPTH_MAX 256u #define TEX_FONTS_ALLOC_SIZE 16u diff --git a/tectonic/dpx-epdf.c b/tectonic/dpx-epdf.c index 489707fce..beb581789 100644 --- a/tectonic/dpx-epdf.c +++ b/tectonic/dpx-epdf.c @@ -42,7 +42,6 @@ #include "dpx-pdfobj.h" #include "dpx-pdfparse.h" #include "dpx-pdfximage.h" -#include "internals.h" static int rect_equal (pdf_obj *rect1, pdf_obj *rect2); /* diff --git a/tectonic/dpx-fontmap.c b/tectonic/dpx-fontmap.c index 90df07d6a..c56a0e90b 100644 --- a/tectonic/dpx-fontmap.c +++ b/tectonic/dpx-fontmap.c @@ -29,7 +29,6 @@ #include "dpx-mem.h" #include "dpx-mfileio.h" #include "dpx-subfont.h" -#include "internals.h" /* CIDFont */ static char *strip_options (const char *map_name, fontmap_opt *opt); diff --git a/tectonic/dpx-jpegimage.c b/tectonic/dpx-jpegimage.c index e5f609578..1fd13e511 100644 --- a/tectonic/dpx-jpegimage.c +++ b/tectonic/dpx-jpegimage.c @@ -63,7 +63,6 @@ #include "dpx-pdfcolor.h" #include "dpx-pdfobj.h" #include "dpx-pdfximage.h" -#include "internals.h" #define JPEG_DEBUG_STR "JPEG" #define JPEG_DEBUG 3 diff --git a/tectonic/dpx-mpost.c b/tectonic/dpx-mpost.c index f7a429f88..6ba14194f 100644 --- a/tectonic/dpx-mpost.c +++ b/tectonic/dpx-mpost.c @@ -42,7 +42,6 @@ #include "dpx-pdfparse.h" #include "dpx-subfont.h" #include "dpx-tfm.h" -#include "internals.h" /* * Define the origin as (llx, lly) in order to diff --git a/tectonic/dpx-otl_conf.c b/tectonic/dpx-otl_conf.c index 520da8dd7..b3d8b0c57 100644 --- a/tectonic/dpx-otl_conf.c +++ b/tectonic/dpx-otl_conf.c @@ -36,7 +36,6 @@ #include "dpx-mfileio.h" #include "dpx-pdfobj.h" #include "dpx-pdfparse.h" -#include "internals.h" #define VERBOSE_LEVEL_MIN 0 static int verbose = 0; diff --git a/tectonic/dpx-pdfcolor.c b/tectonic/dpx-pdfcolor.c index aa08032af..673be503d 100644 --- a/tectonic/dpx-pdfcolor.c +++ b/tectonic/dpx-pdfcolor.c @@ -36,7 +36,6 @@ #include "dpx-mem.h" #include "dpx-numbers.h" #include "dpx-pdfdev.h" -#include "internals.h" static int verbose = 0; void diff --git a/tectonic/dpx-pdfdev.c b/tectonic/dpx-pdfdev.c index b63dfe797..820d04e7c 100644 --- a/tectonic/dpx-pdfdev.c +++ b/tectonic/dpx-pdfdev.c @@ -45,7 +45,6 @@ #include "dpx-pdfobj.h" #include "dpx-pdfximage.h" #include "dpx-type0.h" -#include "internals.h" static int verbose = 0; diff --git a/tectonic/dpx-pdfdoc.c b/tectonic/dpx-pdfdoc.c index 9c50bf553..3ef160744 100644 --- a/tectonic/dpx-pdfdoc.c +++ b/tectonic/dpx-pdfdoc.c @@ -53,7 +53,6 @@ #include "dpx-pdfximage.h" #include "dpx-pngimage.h" #include "dpx-system.h" -#include "internals.h" #define PDFDOC_PAGES_ALLOC_SIZE 128u #define PDFDOC_ARTICLE_ALLOC_SIZE 16 diff --git a/tectonic/dpx-pdfdraw.c b/tectonic/dpx-pdfdraw.c index 0d553abb5..87d025d33 100644 --- a/tectonic/dpx-pdfdraw.c +++ b/tectonic/dpx-pdfdraw.c @@ -34,7 +34,6 @@ #include "dpx-pdfcolor.h" #include "dpx-pdfdev.h" #include "dpx-pdfdoc.h" -#include "internals.h" #define OUR_EPSILON 2.5e-16 diff --git a/tectonic/dpx-pdfencoding.c b/tectonic/dpx-pdfencoding.c index 0ef710a91..b0ee6c247 100644 --- a/tectonic/dpx-pdfencoding.c +++ b/tectonic/dpx-pdfencoding.c @@ -35,7 +35,6 @@ #include "dpx-mem.h" #include "dpx-pdfobj.h" #include "dpx-pdfparse.h" -#include "internals.h" static bool is_similar_charset (char **encoding, const char **encoding2); static pdf_obj *make_encoding_differences (char **encoding, char **baseenc, diff --git a/tectonic/dpx-pdffont.c b/tectonic/dpx-pdffont.c index 69d82b1e8..808fa9b23 100644 --- a/tectonic/dpx-pdffont.c +++ b/tectonic/dpx-pdffont.c @@ -51,7 +51,6 @@ #include "dpx-type0.h" #include "dpx-type1.h" #include "dpx-type1c.h" -#include "internals.h" static int __verbose = 0; diff --git a/tectonic/dpx-pdfnames.c b/tectonic/dpx-pdfnames.c index 65b93f536..1f9ba4248 100644 --- a/tectonic/dpx-pdfnames.c +++ b/tectonic/dpx-pdfnames.c @@ -33,7 +33,6 @@ #include "dpx-error.h" #include "dpx-mem.h" #include "dpx-pdfobj.h" -#include "internals.h" struct obj_data { diff --git a/tectonic/dpx-pdfobj.c b/tectonic/dpx-pdfobj.c index f2fb7c61f..f39d52162 100644 --- a/tectonic/dpx-pdfobj.c +++ b/tectonic/dpx-pdfobj.c @@ -35,7 +35,6 @@ #include "dpx-pdfencrypt.h" #include "dpx-pdflimits.h" #include "dpx-pdfparse.h" -#include "internals.h" #ifdef HAVE_ZLIB #include diff --git a/tectonic/dpx-pdfparse.c b/tectonic/dpx-pdfparse.c index 5490615cf..d1a602b07 100644 --- a/tectonic/dpx-pdfparse.c +++ b/tectonic/dpx-pdfparse.c @@ -33,7 +33,6 @@ #include "dpx-error.h" #include "dpx-mem.h" #include "dpx-pdfobj.h" -#include "internals.h" /* PDF */ #ifdef is_space diff --git a/tectonic/dpx-pdfresource.c b/tectonic/dpx-pdfresource.c index f9d8ba3aa..e04b9900c 100644 --- a/tectonic/dpx-pdfresource.c +++ b/tectonic/dpx-pdfresource.c @@ -34,7 +34,6 @@ #include "dpx-error.h" #include "dpx-mem.h" #include "dpx-pdfobj.h" -#include "internals.h" #define PDF_RESOURCE_DEBUG_STR "PDF" #define PDF_RESOURCE_DEBUG 3 diff --git a/tectonic/dpx-pdfximage.c b/tectonic/dpx-pdfximage.c index 10475241d..4ea807dee 100644 --- a/tectonic/dpx-pdfximage.c +++ b/tectonic/dpx-pdfximage.c @@ -41,7 +41,6 @@ #include "dpx-pdfdraw.h" #include "dpx-pdfobj.h" #include "dpx-pngimage.h" -#include "internals.h" static int check_for_ps (rust_input_handle_t handle); diff --git a/tectonic/dpx-sfnt.c b/tectonic/dpx-sfnt.c index 1576a8eee..071b8995a 100644 --- a/tectonic/dpx-sfnt.c +++ b/tectonic/dpx-sfnt.c @@ -27,7 +27,6 @@ #include #include "dpx-mem.h" -#include "internals.h" /* * type: diff --git a/tectonic/dpx-spc_color.c b/tectonic/dpx-spc_color.c index 78afa7305..e36302538 100644 --- a/tectonic/dpx-spc_color.c +++ b/tectonic/dpx-spc_color.c @@ -29,7 +29,6 @@ #include "dpx-pdfcolor.h" #include "dpx-spc_util.h" #include "dpx-specials.h" -#include "internals.h" /* Color stack is actually placed into pdfcolor.c. diff --git a/tectonic/dpx-spc_dvipdfmx.c b/tectonic/dpx-spc_dvipdfmx.c index 5b6d168ba..71de5f81d 100644 --- a/tectonic/dpx-spc_dvipdfmx.c +++ b/tectonic/dpx-spc_dvipdfmx.c @@ -28,7 +28,6 @@ #include "dpx-dpxutil.h" #include "dpx-pdfparse.h" #include "dpx-specials.h" -#include "internals.h" static int spc_handler_null (struct spc_env *spe, struct spc_arg *args) diff --git a/tectonic/dpx-spc_dvips.c b/tectonic/dpx-spc_dvips.c index d5a217da0..b5a738aeb 100644 --- a/tectonic/dpx-spc_dvips.c +++ b/tectonic/dpx-spc_dvips.c @@ -46,7 +46,6 @@ #include "dpx-spc_util.h" #include "dpx-spc_xtx.h" #include "dpx-specials.h" -#include "internals.h" static int block_pending = 0; static double pending_x = 0.0; diff --git a/tectonic/dpx-spc_html.c b/tectonic/dpx-spc_html.c index f265b0665..fde74050b 100644 --- a/tectonic/dpx-spc_html.c +++ b/tectonic/dpx-spc_html.c @@ -40,7 +40,6 @@ #include "dpx-pdfobj.h" #include "dpx-pdfximage.h" #include "dpx-specials.h" -#include "internals.h" #define ENABLE_HTML_IMG_SUPPORT 1 diff --git a/tectonic/dpx-spc_pdfm.c b/tectonic/dpx-spc_pdfm.c index 35ec51623..3ebff2b9d 100644 --- a/tectonic/dpx-spc_pdfm.c +++ b/tectonic/dpx-spc_pdfm.c @@ -46,7 +46,6 @@ #include "dpx-spc_util.h" #include "dpx-specials.h" #include "dpx-unicode.h" -#include "internals.h" /* PLEASE REMOVE THIS */ diff --git a/tectonic/dpx-spc_tpic.c b/tectonic/dpx-spc_tpic.c index 0f3a7b0fa..5a4961bac 100644 --- a/tectonic/dpx-spc_tpic.c +++ b/tectonic/dpx-spc_tpic.c @@ -39,7 +39,6 @@ #include "dpx-pdfdraw.h" #include "dpx-pdfobj.h" #include "dpx-specials.h" -#include "internals.h" #define DEBUG 1 #define ENABLE_SPC_NAMESPACE 1 diff --git a/tectonic/dpx-spc_util.c b/tectonic/dpx-spc_util.c index e7757155b..61c44c269 100644 --- a/tectonic/dpx-spc_util.c +++ b/tectonic/dpx-spc_util.c @@ -33,7 +33,6 @@ #include "dpx-pdfdraw.h" #include "dpx-pdfparse.h" #include "dpx-specials.h" -#include "internals.h" #ifndef ISBLANK diff --git a/tectonic/dpx-spc_xtx.c b/tectonic/dpx-spc_xtx.c index 9132bfefd..867d185d5 100644 --- a/tectonic/dpx-spc_xtx.c +++ b/tectonic/dpx-spc_xtx.c @@ -47,7 +47,6 @@ #include "dpx-pdfparse.h" #include "dpx-spc_util.h" #include "dpx-specials.h" -#include "internals.h" int diff --git a/tectonic/dpx-subfont.c b/tectonic/dpx-subfont.c index 5360b4a4e..c167f75cc 100644 --- a/tectonic/dpx-subfont.c +++ b/tectonic/dpx-subfont.c @@ -31,7 +31,6 @@ #include "dpx-error.h" #include "dpx-mem.h" #include "dpx-mfileio.h" -#include "internals.h" static int verbose = 0; void diff --git a/tectonic/dpx-t1_char.c b/tectonic/dpx-t1_char.c index 3133f02bd..dbf493b37 100644 --- a/tectonic/dpx-t1_char.c +++ b/tectonic/dpx-t1_char.c @@ -33,7 +33,6 @@ #include "dpx-dpxutil.h" #include "dpx-error.h" #include "dpx-mem.h" -#include "internals.h" /* * Type 1 -> Type 1C diff --git a/tectonic/dpx-t1_load.c b/tectonic/dpx-t1_load.c index 3eac8e651..02f74f6f4 100644 --- a/tectonic/dpx-t1_load.c +++ b/tectonic/dpx-t1_load.c @@ -36,7 +36,6 @@ #include "dpx-mem.h" #include "dpx-mfileio.h" #include "dpx-pst.h" -#include "internals.h" /* Migrated from t1crypt */ #define T1_EEKEY 55665u diff --git a/tectonic/dpx-tfm.c b/tectonic/dpx-tfm.c index 7a0174aba..29cec97eb 100644 --- a/tectonic/dpx-tfm.c +++ b/tectonic/dpx-tfm.c @@ -34,7 +34,6 @@ #include "dpx-error.h" #include "dpx-mem.h" #include "dpx-numbers.h" -#include "internals.h" #define TFM_FORMAT 1 #define OFM_FORMAT 2 diff --git a/tectonic/dpx-truetype.c b/tectonic/dpx-truetype.c index 10709e223..03e79b421 100644 --- a/tectonic/dpx-truetype.c +++ b/tectonic/dpx-truetype.c @@ -45,7 +45,6 @@ #include "dpx-tt_gsub.h" #include "dpx-tt_post.h" #include "dpx-tt_table.h" -#include "internals.h" /* Modifying this has no effect :P */ #ifdef ENABLE_NOEMBED diff --git a/tectonic/dpx-tt_cmap.c b/tectonic/dpx-tt_cmap.c index 23743bd0c..9cce18f05 100644 --- a/tectonic/dpx-tt_cmap.c +++ b/tectonic/dpx-tt_cmap.c @@ -50,7 +50,6 @@ #include "dpx-tt_post.h" #include "dpx-type0.h" #include "dpx-unicode.h" -#include "internals.h" #define VERBOSE_LEVEL_MIN 0 static int verbose = 0; diff --git a/tectonic/dpx-tt_gsub.c b/tectonic/dpx-tt_gsub.c index 187694845..55cb0d378 100644 --- a/tectonic/dpx-tt_gsub.c +++ b/tectonic/dpx-tt_gsub.c @@ -34,7 +34,6 @@ #include "dpx-mem.h" #include "dpx-otl_opt.h" #include "dpx-sfnt.h" -#include "internals.h" #define VERBOSE_LEVEL_MIN 0 static int verbose = 0; diff --git a/tectonic/dpx-tt_post.c b/tectonic/dpx-tt_post.c index a5955cce2..12f7de395 100644 --- a/tectonic/dpx-tt_post.c +++ b/tectonic/dpx-tt_post.c @@ -26,7 +26,6 @@ #include "dpx-error.h" #include "dpx-mem.h" #include "dpx-sfnt.h" -#include "internals.h" static const char *macglyphorder[258]; diff --git a/tectonic/dpx-type0.c b/tectonic/dpx-type0.c index c8c39a2b1..997ff27ba 100644 --- a/tectonic/dpx-type0.c +++ b/tectonic/dpx-type0.c @@ -40,7 +40,6 @@ #include "dpx-fontmap.h" #include "dpx-mem.h" #include "dpx-pdfobj.h" -#include "internals.h" #define TYPE0FONT_DEBUG_STR "Type0" diff --git a/tectonic/dpx-type1.c b/tectonic/dpx-type1.c index 050c93df4..c9df9a430 100644 --- a/tectonic/dpx-type1.c +++ b/tectonic/dpx-type1.c @@ -44,7 +44,6 @@ #include "dpx-t1_char.h" #include "dpx-t1_load.h" #include "dpx-tfm.h" -#include "internals.h" #define FONT_FLAG_FIXEDPITCH (1 << 0) /* Fixed-width font */ #define FONT_FLAG_SERIF (1 << 1) /* Serif font */ diff --git a/tectonic/dpx-type1c.c b/tectonic/dpx-type1c.c index a1040646d..774d8c667 100644 --- a/tectonic/dpx-type1c.c +++ b/tectonic/dpx-type1c.c @@ -58,7 +58,6 @@ #include "dpx-sfnt.h" #include "dpx-tfm.h" #include "dpx-tt_aux.h" -#include "internals.h" int pdf_font_open_type1c (pdf_font *font) diff --git a/tectonic/dpx-vf.c b/tectonic/dpx-vf.c index 02f193907..1b7350086 100644 --- a/tectonic/dpx-vf.c +++ b/tectonic/dpx-vf.c @@ -35,7 +35,6 @@ /* pdfdev... */ #include "dpx-pdfdev.h" #include "dpx-tfm.h" -#include "internals.h" #define VF_ALLOC_SIZE 16u From e382dc26ac7f3759b23e5fa08ea2ddab440df778 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 12:35:07 -0400 Subject: [PATCH 20/36] tectonic/xetex-*.h: remove references to internals.h As in xdvipdfmx, the build is preserved if we add a few core includes to xetex-core.h --- tectonic/xetex-core.h | 6 +++++- tectonic/xetexd.h | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tectonic/xetex-core.h b/tectonic/xetex-core.h index 87ef6f4e6..2411616c0 100644 --- a/tectonic/xetex-core.h +++ b/tectonic/xetex-core.h @@ -6,8 +6,12 @@ #ifndef TECTONIC_XETEX_CORE_H #define TECTONIC_XETEX_CORE_H +#include "core-foundation.h" +#include "core-bridge.h" +#include "core-memory.h" +#include "core-strutils.h" + #include "tectonic.h" -#include "internals.h" #include #include // defines U_IS_BIG_ENDIAN for us diff --git a/tectonic/xetexd.h b/tectonic/xetexd.h index e10d18048..4379aa00c 100644 --- a/tectonic/xetexd.h +++ b/tectonic/xetexd.h @@ -7,7 +7,6 @@ #define TECTONIC_XETEXD_H #include "tectonic.h" -#include "internals.h" #include "XeTeXOTMath.h" #include "TECkit_Common.h" #include "XeTeX_ext.h" From 54850eb31a77ed036d1b3e7892cc04bca272bc91 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 12:40:00 -0400 Subject: [PATCH 21/36] tectonic/internals.h: sayonara Removed the last of the references to this poorly-conceived header. --- tectonic/internals.h | 19 ------------------- tectonic/output.c | 2 +- tectonic/synctex.c | 2 +- tectonic/texmfmp.c | 2 +- tectonic/xetex-engine-interface.c | 2 +- tectonic/xetex-errors.c | 2 +- tectonic/xetex-io.c | 2 +- tectonic/xetex-linebreak.c | 2 +- tectonic/xetex-math.c | 2 +- tectonic/xetex-scaledmath.c | 4 ++-- tectonic/xetex-shipout.c | 2 +- tectonic/xetex0.c | 2 +- tectonic/xetexini.c | 2 +- 13 files changed, 13 insertions(+), 32 deletions(-) delete mode 100644 tectonic/internals.h diff --git a/tectonic/internals.h b/tectonic/internals.h deleted file mode 100644 index 07913a45e..000000000 --- a/tectonic/internals.h +++ /dev/null @@ -1,19 +0,0 @@ -/* tectonic/internals.h: global, private header for Tectonic - Copyright 2016-2018 the Tectonic Project - Licensed under the MIT License. -*/ - -#ifndef TECTONIC_INTERNALS_H -#define TECTONIC_INTERNALS_H - -#include "tectonic.h" -#include "core-bridge.h" -#include "core-memory.h" -#include "core-strutils.h" - -#include -#include -#include -#include - -#endif /* not TECTONIC_INTERNALS_H */ diff --git a/tectonic/output.c b/tectonic/output.c index 0c5e73bae..818cb5fd6 100644 --- a/tectonic/output.c +++ b/tectonic/output.c @@ -3,8 +3,8 @@ * Licensed under the MIT License. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "xetexd.h" #include "synctex.h" #include "core-bridge.h" diff --git a/tectonic/synctex.c b/tectonic/synctex.c index 2bc95116f..2fa9baf83 100644 --- a/tectonic/synctex.c +++ b/tectonic/synctex.c @@ -3,8 +3,8 @@ * MIT License. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "xetexd.h" #include "synctex.h" #include "core-bridge.h" diff --git a/tectonic/texmfmp.c b/tectonic/texmfmp.c index 77d5f0246..f0653f18d 100644 --- a/tectonic/texmfmp.c +++ b/tectonic/texmfmp.c @@ -5,8 +5,8 @@ This file is public domain. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "core-bridge.h" #include "xetexd.h" #include "XeTeX_ext.h" diff --git a/tectonic/xetex-engine-interface.c b/tectonic/xetex-engine-interface.c index 01735c3c3..3bf1419ce 100644 --- a/tectonic/xetex-engine-interface.c +++ b/tectonic/xetex-engine-interface.c @@ -3,8 +3,8 @@ Licensed under the MIT License. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "xetexd.h" #include "XeTeX_ext.h" diff --git a/tectonic/xetex-errors.c b/tectonic/xetex-errors.c index 7e2298299..30e83de13 100644 --- a/tectonic/xetex-errors.c +++ b/tectonic/xetex-errors.c @@ -3,8 +3,8 @@ * Licensed under the MIT License. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "xetexd.h" #include diff --git a/tectonic/xetex-io.c b/tectonic/xetex-io.c index 55b34299e..ff7ddfdc7 100644 --- a/tectonic/xetex-io.c +++ b/tectonic/xetex-io.c @@ -3,8 +3,8 @@ Licensed under the MIT License. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "TECkit_Engine.h" #include "XeTeXLayoutInterface.h" #include "XeTeXswap.h" diff --git a/tectonic/xetex-linebreak.c b/tectonic/xetex-linebreak.c index 98fb64495..ab65d9762 100644 --- a/tectonic/xetex-linebreak.c +++ b/tectonic/xetex-linebreak.c @@ -2,8 +2,8 @@ * Licensed under the MIT License. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "xetexd.h" #include "core-bridge.h" diff --git a/tectonic/xetex-math.c b/tectonic/xetex-math.c index 9d0e0cb65..f35b9c225 100644 --- a/tectonic/xetex-math.c +++ b/tectonic/xetex-math.c @@ -2,8 +2,8 @@ * Licensed under the MIT License. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "xetexd.h" #include "synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex-scaledmath.c b/tectonic/xetex-scaledmath.c index ea50c56b5..864025e04 100644 --- a/tectonic/xetex-scaledmath.c +++ b/tectonic/xetex-scaledmath.c @@ -1,10 +1,10 @@ -/* tectonic/mathutil.c: low-level math functions +/* tectonic/xetex-scaledmath.c: low-level math functions Copyright 2017 The Tectonic Project Licensed under the MIT License. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "xetexd.h" diff --git a/tectonic/xetex-shipout.c b/tectonic/xetex-shipout.c index 2145b9d2c..2a640280f 100644 --- a/tectonic/xetex-shipout.c +++ b/tectonic/xetex-shipout.c @@ -2,8 +2,8 @@ * Licensed under the MIT License. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "xetexd.h" #include "synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex0.c b/tectonic/xetex0.c index f970360af..4b4e3d6c1 100644 --- a/tectonic/xetex0.c +++ b/tectonic/xetex0.c @@ -3,8 +3,8 @@ Licensed under the MIT License. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "xetexd.h" #include "XeTeXLayoutInterface.h" #include "synctex.h" diff --git a/tectonic/xetexini.c b/tectonic/xetexini.c index 430cbbadd..fd9a02d3b 100644 --- a/tectonic/xetexini.c +++ b/tectonic/xetexini.c @@ -3,8 +3,8 @@ Licensed under the MIT License. */ +#include "xetex-core.h" #include "tectonic.h" -#include "internals.h" #include "xetexd.h" #include "synctex.h" #include "core-bridge.h" From 11f23d514e837245ea77033bed600a954a2d73e7 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 12:49:43 -0400 Subject: [PATCH 22/36] tectonic: rename all TECKit files to a common format At first I wasn't sure whether to fold these files into the `xetex-` prefix or not, but they really do form an isolated subsystem. There was also some confusion because there are essentially two Engine.h files -- one pure C, one C++. --- build.rs | 2 +- tectonic/XeTeX_ext.c | 2 +- tectonic/XeTeX_mac.c | 2 +- tectonic/{TECkit_Common.h => teckit-Common.h} | 2 ++ tectonic/{TECkit_Compiler.h => teckit-Compiler.h} | 2 +- tectonic/{xetex-Engine.cpp => teckit-Engine.cpp} | 4 ++-- tectonic/{TECkit_Format.h => teckit-Format.h} | 2 +- tectonic/{NormalizationData.c => teckit-NormalizationData.c} | 0 tectonic/{TECkit_Engine.h => teckit-c-Engine.h} | 2 +- tectonic/{xetex-Engine.h => teckit-cxx-Engine.h} | 4 ++-- tectonic/xetex-io.c | 2 +- tectonic/xetexd.h | 2 +- 12 files changed, 14 insertions(+), 12 deletions(-) rename tectonic/{TECkit_Common.h => teckit-Common.h} (99%) rename tectonic/{TECkit_Compiler.h => teckit-Compiler.h} (99%) rename tectonic/{xetex-Engine.cpp => teckit-Engine.cpp} (99%) rename tectonic/{TECkit_Format.h => teckit-Format.h} (99%) rename tectonic/{NormalizationData.c => teckit-NormalizationData.c} (100%) rename tectonic/{TECkit_Engine.h => teckit-c-Engine.h} (99%) rename tectonic/{xetex-Engine.h => teckit-cxx-Engine.h} (98%) diff --git a/build.rs b/build.rs index b6349a446..0fd3002d1 100644 --- a/build.rs +++ b/build.rs @@ -209,7 +209,7 @@ fn main() { cppcfg .cpp(true) .flag("-Wall") - .file("tectonic/xetex-Engine.cpp") + .file("tectonic/teckit-Engine.cpp") .file("tectonic/XeTeXFontInst.cpp") .file("tectonic/XeTeXFontMgr.cpp") .file("tectonic/XeTeXLayoutInterface.cpp") diff --git a/tectonic/XeTeX_ext.c b/tectonic/XeTeX_ext.c index debe48e93..6ab186632 100644 --- a/tectonic/XeTeX_ext.c +++ b/tectonic/XeTeX_ext.c @@ -38,7 +38,7 @@ authorization from the copyright holders. #include "xetex-core.h" #include "XeTeX_ext.h" -#include "TECkit_Engine.h" +#include "teckit-c-Engine.h" #include "XeTeXLayoutInterface.h" #include "XeTeXswap.h" #include "core-bridge.h" diff --git a/tectonic/XeTeX_mac.c b/tectonic/XeTeX_mac.c index c09c1b599..fcee0d293 100644 --- a/tectonic/XeTeX_mac.c +++ b/tectonic/XeTeX_mac.c @@ -38,7 +38,7 @@ authorization from the copyright holders. #include "tectonic.h" #include "xetexd.h" -#include "TECkit_Engine.h" +#include "teckit-c-Engine.h" #include "XeTeX_ext.h" #include "XeTeXLayoutInterface.h" diff --git a/tectonic/TECkit_Common.h b/tectonic/teckit-Common.h similarity index 99% rename from tectonic/TECkit_Common.h rename to tectonic/teckit-Common.h index 84cdd531b..0504f14d8 100644 --- a/tectonic/TECkit_Common.h +++ b/tectonic/teckit-Common.h @@ -26,6 +26,8 @@ Last reviewed: Not yet. #ifndef __TECkit_Common_H__ #define __TECkit_Common_H__ +#include "core-foundation.h" + #define kCurrentTECkitVersion 0x00020004 /* 16.16 version number */ #ifndef __MACTYPES__ diff --git a/tectonic/TECkit_Compiler.h b/tectonic/teckit-Compiler.h similarity index 99% rename from tectonic/TECkit_Compiler.h rename to tectonic/teckit-Compiler.h index 68d5b130b..caf577625 100644 --- a/tectonic/TECkit_Compiler.h +++ b/tectonic/teckit-Compiler.h @@ -21,7 +21,7 @@ #ifndef __TECkit_Compiler_H__ #define __TECkit_Compiler_H__ -#include "TECkit_Common.h" +#include "teckit-Common.h" #ifdef __cplusplus extern "C" { diff --git a/tectonic/xetex-Engine.cpp b/tectonic/teckit-Engine.cpp similarity index 99% rename from tectonic/xetex-Engine.cpp rename to tectonic/teckit-Engine.cpp index 866fd1983..22f42a9e4 100644 --- a/tectonic/xetex-Engine.cpp +++ b/tectonic/teckit-Engine.cpp @@ -52,7 +52,7 @@ Last reviewed: Not yet. # include #endif -#include "xetex-Engine.h" +#include "teckit-cxx-Engine.h" #ifdef TRACING #include @@ -120,7 +120,7 @@ Stage::lookaheadCount() const return 0; } -#include "NormalizationData.c" +#include "teckit-NormalizationData.c" Normalizer::Normalizer(bool compose) : prevCombClass(0) diff --git a/tectonic/TECkit_Format.h b/tectonic/teckit-Format.h similarity index 99% rename from tectonic/TECkit_Format.h rename to tectonic/teckit-Format.h index 1ac7d0c19..eeb762040 100644 --- a/tectonic/TECkit_Format.h +++ b/tectonic/teckit-Format.h @@ -17,7 +17,7 @@ Last reviewed: Not yet. #ifndef __TECkit_Format_H__ #define __TECkit_Format_H__ -#include "TECkit_Common.h" +#include "teckit-Common.h" #define kMagicNumber 0x714d6170 /* 'qMap' */ #define kMagicNumberCmp 0x7a516d70 /* 'zQmp' */ diff --git a/tectonic/NormalizationData.c b/tectonic/teckit-NormalizationData.c similarity index 100% rename from tectonic/NormalizationData.c rename to tectonic/teckit-NormalizationData.c diff --git a/tectonic/TECkit_Engine.h b/tectonic/teckit-c-Engine.h similarity index 99% rename from tectonic/TECkit_Engine.h rename to tectonic/teckit-c-Engine.h index 4ab54243a..e7f0484cd 100644 --- a/tectonic/TECkit_Engine.h +++ b/tectonic/teckit-c-Engine.h @@ -29,7 +29,7 @@ Last reviewed: Not yet. #ifndef __TECkit_Engine_H__ #define __TECkit_Engine_H__ -#include "TECkit_Common.h" +#include "teckit-Common.h" /* formFlags bits for normalization; if none are set, then this side of the mapping is normalization-form-agnostic on input, and may generate an unspecified mixture */ #define kFlags_ExpectsNFC 0x00000001 /* expects fully composed text (NC) */ diff --git a/tectonic/xetex-Engine.h b/tectonic/teckit-cxx-Engine.h similarity index 98% rename from tectonic/xetex-Engine.h rename to tectonic/teckit-cxx-Engine.h index 586151ecf..576e328dd 100644 --- a/tectonic/xetex-Engine.h +++ b/tectonic/teckit-cxx-Engine.h @@ -20,8 +20,8 @@ Last reviewed: Not yet. #ifndef __Engine_H__ #define __Engine_H__ -#include "TECkit_Engine.h" -#include "TECkit_Format.h" +#include "teckit-c-Engine.h" +#include "teckit-Format.h" class Converter; diff --git a/tectonic/xetex-io.c b/tectonic/xetex-io.c index ff7ddfdc7..0137f6dc5 100644 --- a/tectonic/xetex-io.c +++ b/tectonic/xetex-io.c @@ -5,7 +5,7 @@ #include "xetex-core.h" #include "tectonic.h" -#include "TECkit_Engine.h" +#include "teckit-c-Engine.h" #include "XeTeXLayoutInterface.h" #include "XeTeXswap.h" #include "xetexd.h" diff --git a/tectonic/xetexd.h b/tectonic/xetexd.h index 4379aa00c..c0d50d1d6 100644 --- a/tectonic/xetexd.h +++ b/tectonic/xetexd.h @@ -8,7 +8,7 @@ #include "tectonic.h" #include "XeTeXOTMath.h" -#include "TECkit_Common.h" +#include "teckit-Common.h" #include "XeTeX_ext.h" #include "core-bridge.h" #include "xetex-constants.h" From 2a3e6a99aa38f1d2db0bbfb9e2072604d7b60bbe Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 12:54:18 -0400 Subject: [PATCH 23/36] tectonic/xetex-output.c: rename from output.c --- build.rs | 2 +- tectonic/{output.c => xetex-output.c} | 0 tectonic/xetexd.h | 50 ++++++++++++++------------- 3 files changed, 27 insertions(+), 25 deletions(-) rename tectonic/{output.c => xetex-output.c} (100%) diff --git a/build.rs b/build.rs index 0fd3002d1..6f17b96bd 100644 --- a/build.rs +++ b/build.rs @@ -150,7 +150,6 @@ fn main() { .file("tectonic/dpx-type1c.c") .file("tectonic/dpx-unicode.c") .file("tectonic/dpx-vf.c") - .file("tectonic/output.c") .file("tectonic/synctex.c") .file("tectonic/texmfmp.c") .file("tectonic/xetex0.c") @@ -162,6 +161,7 @@ fn main() { .file("tectonic/xetex-io.c") .file("tectonic/xetex-linebreak.c") .file("tectonic/xetex-math.c") + .file("tectonic/xetex-output.c") .file("tectonic/xetex-scaledmath.c") .file("tectonic/xetex-shipout.c") .file("tectonic/xetex-stringpool.c") diff --git a/tectonic/output.c b/tectonic/xetex-output.c similarity index 100% rename from tectonic/output.c rename to tectonic/xetex-output.c diff --git a/tectonic/xetexd.h b/tectonic/xetexd.h index c0d50d1d6..5c5b5b586 100644 --- a/tectonic/xetexd.h +++ b/tectonic/xetexd.h @@ -676,30 +676,6 @@ extern uint16_t _xeq_level_array[EQTB_SIZE - INT_BASE + 1]; /* the former xetexcoerce.h: */ -void print_ln(void); -void print_raw_char(UTF16_code s, bool incr_offset); -void print_char(int32_t s); -void print(int32_t s); -void print_cstr(const char* s); -void print_nl(str_number s); -void print_nl_cstr(const char* s); -void print_esc(str_number s); -void print_esc_cstr(const char* s); -void print_int(int32_t n); -void print_cs(int32_t p); -void sprint_cs(int32_t p); -void print_file_name(int32_t n, int32_t a, int32_t e); -void print_size(int32_t s); -void print_write_whatsit(const char* s, int32_t p); -void print_native_word(int32_t p); -void print_sa_num(int32_t q); -void print_file_line(void); -void print_two(int32_t n); -void print_hex(int32_t n); -void print_roman_int(int32_t n); -void print_scaled(scaled_t s); - -void print_current_string(void); int32_t badness(scaled_t t, scaled_t s); void print_word(memory_word w); void show_token_list(int32_t p, int32_t q, int32_t l); @@ -1026,6 +1002,32 @@ void math_fraction(void); void math_left_right(void); void flush_math(void); +/* xetex-output */ + +void print_ln(void); +void print_raw_char(UTF16_code s, bool incr_offset); +void print_char(int32_t s); +void print(int32_t s); +void print_cstr(const char* s); +void print_nl(str_number s); +void print_nl_cstr(const char* s); +void print_esc(str_number s); +void print_esc_cstr(const char* s); +void print_int(int32_t n); +void print_cs(int32_t p); +void sprint_cs(int32_t p); +void print_file_name(int32_t n, int32_t a, int32_t e); +void print_size(int32_t s); +void print_write_whatsit(const char* s, int32_t p); +void print_native_word(int32_t p); +void print_sa_num(int32_t q); +void print_file_line(void); +void print_two(int32_t n); +void print_hex(int32_t n); +void print_roman_int(int32_t n); +void print_current_string(void); +void print_scaled(scaled_t s); + /* xetex-scaledmath */ int32_t tex_round(double); From 51ab79700d94ede17391e3465055e4e20ecb0d95 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 12:56:43 -0400 Subject: [PATCH 24/36] tectonic/xetex-synctex.[ch]: rename from synctex.[ch] --- build.rs | 2 +- tectonic/xetex-math.c | 2 +- tectonic/xetex-output.c | 2 +- tectonic/xetex-shipout.c | 2 +- tectonic/{synctex.c => xetex-synctex.c} | 2 +- tectonic/{synctex.h => xetex-synctex.h} | 0 tectonic/xetex0.c | 2 +- tectonic/xetexini.c | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename tectonic/{synctex.c => xetex-synctex.c} (99%) rename tectonic/{synctex.h => xetex-synctex.h} (100%) diff --git a/build.rs b/build.rs index 6f17b96bd..6216e28ec 100644 --- a/build.rs +++ b/build.rs @@ -150,7 +150,6 @@ fn main() { .file("tectonic/dpx-type1c.c") .file("tectonic/dpx-unicode.c") .file("tectonic/dpx-vf.c") - .file("tectonic/synctex.c") .file("tectonic/texmfmp.c") .file("tectonic/xetex0.c") .file("tectonic/XeTeX_ext.c") @@ -165,6 +164,7 @@ fn main() { .file("tectonic/xetex-scaledmath.c") .file("tectonic/xetex-shipout.c") .file("tectonic/xetex-stringpool.c") + .file("tectonic/xetex-synctex.c") .define("HAVE_ZLIB", "1") .define("HAVE_ZLIB_COMPRESS2", "1") .define("ZLIB_CONST", "1") diff --git a/tectonic/xetex-math.c b/tectonic/xetex-math.c index f35b9c225..90dd1b5d4 100644 --- a/tectonic/xetex-math.c +++ b/tectonic/xetex-math.c @@ -5,7 +5,7 @@ #include "xetex-core.h" #include "tectonic.h" #include "xetexd.h" -#include "synctex.h" +#include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex-output.c b/tectonic/xetex-output.c index 818cb5fd6..1845b0aca 100644 --- a/tectonic/xetex-output.c +++ b/tectonic/xetex-output.c @@ -6,7 +6,7 @@ #include "xetex-core.h" #include "tectonic.h" #include "xetexd.h" -#include "synctex.h" +#include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex-shipout.c b/tectonic/xetex-shipout.c index 2a640280f..3cea0616b 100644 --- a/tectonic/xetex-shipout.c +++ b/tectonic/xetex-shipout.c @@ -5,7 +5,7 @@ #include "xetex-core.h" #include "tectonic.h" #include "xetexd.h" -#include "synctex.h" +#include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/synctex.c b/tectonic/xetex-synctex.c similarity index 99% rename from tectonic/synctex.c rename to tectonic/xetex-synctex.c index 2fa9baf83..1a9dc5860 100644 --- a/tectonic/synctex.c +++ b/tectonic/xetex-synctex.c @@ -6,7 +6,7 @@ #include "xetex-core.h" #include "tectonic.h" #include "xetexd.h" -#include "synctex.h" +#include "xetex-synctex.h" #include "core-bridge.h" #include diff --git a/tectonic/synctex.h b/tectonic/xetex-synctex.h similarity index 100% rename from tectonic/synctex.h rename to tectonic/xetex-synctex.h diff --git a/tectonic/xetex0.c b/tectonic/xetex0.c index 4b4e3d6c1..2a956bf1d 100644 --- a/tectonic/xetex0.c +++ b/tectonic/xetex0.c @@ -7,7 +7,7 @@ #include "tectonic.h" #include "xetexd.h" #include "XeTeXLayoutInterface.h" -#include "synctex.h" +#include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetexini.c b/tectonic/xetexini.c index fd9a02d3b..355595374 100644 --- a/tectonic/xetexini.c +++ b/tectonic/xetexini.c @@ -6,7 +6,7 @@ #include "xetex-core.h" #include "tectonic.h" #include "xetexd.h" -#include "synctex.h" +#include "xetex-synctex.h" #include "core-bridge.h" #include "dpx-pdfobj.h" /* pdf_files_{init,close} */ From 6e9c862a159d1a0bb144f84a260e495e2b818c50 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 13:04:47 -0400 Subject: [PATCH 25/36] tectonic/tectonic.h: remove this as well This ended up not containing anything useful. --- tectonic/XeTeXFontInst_Mac.cpp | 2 +- tectonic/XeTeXFontMgr_FC.cpp | 2 +- tectonic/XeTeXFontMgr_Mac.mm | 2 +- tectonic/XeTeXOTMath.cpp | 8 +------- tectonic/XeTeX_mac.c | 2 +- tectonic/bibtex.h | 2 +- tectonic/core-bridge.h | 10 +++++++++- tectonic/dpx-error.h | 1 - tectonic/dpx-specials.h | 2 -- tectonic/teckit-Engine.cpp | 2 +- tectonic/tectonic.h | 20 -------------------- tectonic/texmfmp.c | 2 -- tectonic/xetex-core.h | 2 -- tectonic/xetex-engine-interface.c | 1 - tectonic/xetex-errors.c | 1 - tectonic/xetex-io.c | 1 - tectonic/xetex-linebreak.c | 1 - tectonic/xetex-math.c | 1 - tectonic/xetex-output.c | 1 - tectonic/xetex-scaledmath.c | 1 - tectonic/xetex-shipout.c | 1 - tectonic/xetex-stringpool.c | 2 +- tectonic/xetex-stringpool.h | 2 +- tectonic/xetex-synctex.c | 1 - tectonic/xetex0.c | 1 - tectonic/xetexd.h | 2 +- tectonic/xetexini.c | 1 - 27 files changed, 19 insertions(+), 55 deletions(-) delete mode 100644 tectonic/tectonic.h diff --git a/tectonic/XeTeXFontInst_Mac.cpp b/tectonic/XeTeXFontInst_Mac.cpp index e5b28762b..741ee69e5 100644 --- a/tectonic/XeTeXFontInst_Mac.cpp +++ b/tectonic/XeTeXFontInst_Mac.cpp @@ -39,7 +39,7 @@ authorization from the copyright holders. * created by: Jonathan Kew */ -#include "tectonic.h" +#include "xetex-core.h" #include "XeTeXFontInst_Mac.h" #include "XeTeX_ext.h" diff --git a/tectonic/XeTeXFontMgr_FC.cpp b/tectonic/XeTeXFontMgr_FC.cpp index f95c82192..af7a97a14 100644 --- a/tectonic/XeTeXFontMgr_FC.cpp +++ b/tectonic/XeTeXFontMgr_FC.cpp @@ -30,7 +30,7 @@ use or other dealings in this Software without prior written authorization from the copyright holders. \****************************************************************************/ -#include "tectonic.h" +#include "xetex-core.h" #include "XeTeXFontMgr_FC.h" diff --git a/tectonic/XeTeXFontMgr_Mac.mm b/tectonic/XeTeXFontMgr_Mac.mm index 4cfbd8d1a..38b75bee4 100644 --- a/tectonic/XeTeXFontMgr_Mac.mm +++ b/tectonic/XeTeXFontMgr_Mac.mm @@ -31,7 +31,7 @@ a copy of this software and associated documentation files (the authorization from the copyright holders. \****************************************************************************/ -#include "tectonic.h" +#include "xetex-core.h" #include "XeTeXFontMgr_Mac.h" #include diff --git a/tectonic/XeTeXOTMath.cpp b/tectonic/XeTeXOTMath.cpp index 3f5775521..fb0e31526 100644 --- a/tectonic/XeTeXOTMath.cpp +++ b/tectonic/XeTeXOTMath.cpp @@ -31,14 +31,8 @@ use or other dealings in this Software without prior written authorization from the copyright holders. \****************************************************************************/ -#include "core-foundation.h" -#include "core-memory.h" +#include "xetex-core.h" -#include - -#include "tectonic.h" - -#include #include #include "XeTeXOTMath.h" diff --git a/tectonic/XeTeX_mac.c b/tectonic/XeTeX_mac.c index fcee0d293..b6b9c0e40 100644 --- a/tectonic/XeTeX_mac.c +++ b/tectonic/XeTeX_mac.c @@ -36,7 +36,7 @@ authorization from the copyright holders. * additional plain C extensions for XeTeX - MacOS-specific routines */ -#include "tectonic.h" +#include "xetex-core.h" #include "xetexd.h" #include "teckit-c-Engine.h" #include "XeTeX_ext.h" diff --git a/tectonic/bibtex.h b/tectonic/bibtex.h index 5d0c05eec..2a8851b4e 100644 --- a/tectonic/bibtex.h +++ b/tectonic/bibtex.h @@ -6,7 +6,7 @@ #ifndef BIBTEX_H #define BIBTEX_H -#include "tectonic.h" +#include "core-bridge.h" tt_history_t bibtex_main(const char *aux_file_name); diff --git a/tectonic/core-bridge.h b/tectonic/core-bridge.h index c0f5f42ba..eab42d2c8 100644 --- a/tectonic/core-bridge.h +++ b/tectonic/core-bridge.h @@ -7,7 +7,15 @@ #define TECTONIC_CORE_BRIDGE_H #include "core-foundation.h" -#include "tectonic.h" + +/* Both XeTeX and bibtex use this enum: */ + +typedef enum { + HISTORY_SPOTLESS = 0, + HISTORY_WARNING_ISSUED = 1, + HISTORY_ERROR_ISSUED = 2, + HISTORY_FATAL_ERROR = 3 +} tt_history_t; /* The weird enum values are historical and could be rationalized. But it is * good to write them explicitly since they must be kept in sync with diff --git a/tectonic/dpx-error.h b/tectonic/dpx-error.h index 8967f34cb..e12d91b41 100644 --- a/tectonic/dpx-error.h +++ b/tectonic/dpx-error.h @@ -29,7 +29,6 @@ #include #include "dpx-system.h" -#include "tectonic.h" void shut_up (int quietness); diff --git a/tectonic/dpx-specials.h b/tectonic/dpx-specials.h index 5b65fe9ab..608c4a732 100644 --- a/tectonic/dpx-specials.h +++ b/tectonic/dpx-specials.h @@ -25,8 +25,6 @@ #include "dpx-core.h" -#include "tectonic.h" - struct spc_env { double x_user, y_user; double mag; diff --git a/tectonic/teckit-Engine.cpp b/tectonic/teckit-Engine.cpp index 22f42a9e4..53b9f08ec 100644 --- a/tectonic/teckit-Engine.cpp +++ b/tectonic/teckit-Engine.cpp @@ -23,7 +23,7 @@ Last reviewed: Not yet. 2004-03-12 jk finished updating for version 2.1 with ...Opt APIs */ -#include "tectonic.h" +#include "core-foundation.h" //#define TRACING 1 #define VERSION "2.5.4" diff --git a/tectonic/tectonic.h b/tectonic/tectonic.h deleted file mode 100644 index 1cf8197ff..000000000 --- a/tectonic/tectonic.h +++ /dev/null @@ -1,20 +0,0 @@ -/* tectonic/tectonic.h: global, public header for Tectonic - Copyright 2016 the Tectonic Project - Licensed under the MIT License. -*/ - -#ifndef TECTONIC_TECTONIC_H -#define TECTONIC_TECTONIC_H - -#include "core-foundation.h" - -/* TeX-specific enums */ - -typedef enum { - HISTORY_SPOTLESS = 0, - HISTORY_WARNING_ISSUED = 1, - HISTORY_ERROR_ISSUED = 2, - HISTORY_FATAL_ERROR = 3 -} tt_history_t; - -#endif /* not TECTONIC_TECTONIC_H */ diff --git a/tectonic/texmfmp.c b/tectonic/texmfmp.c index f0653f18d..d3dbbb2cb 100644 --- a/tectonic/texmfmp.c +++ b/tectonic/texmfmp.c @@ -6,8 +6,6 @@ This file is public domain. */ #include "xetex-core.h" -#include "tectonic.h" -#include "core-bridge.h" #include "xetexd.h" #include "XeTeX_ext.h" diff --git a/tectonic/xetex-core.h b/tectonic/xetex-core.h index 2411616c0..aa0a21d62 100644 --- a/tectonic/xetex-core.h +++ b/tectonic/xetex-core.h @@ -11,8 +11,6 @@ #include "core-memory.h" #include "core-strutils.h" -#include "tectonic.h" - #include #include // defines U_IS_BIG_ENDIAN for us diff --git a/tectonic/xetex-engine-interface.c b/tectonic/xetex-engine-interface.c index 3bf1419ce..f7913aab6 100644 --- a/tectonic/xetex-engine-interface.c +++ b/tectonic/xetex-engine-interface.c @@ -4,7 +4,6 @@ */ #include "xetex-core.h" -#include "tectonic.h" #include "xetexd.h" #include "XeTeX_ext.h" diff --git a/tectonic/xetex-errors.c b/tectonic/xetex-errors.c index 30e83de13..523928a58 100644 --- a/tectonic/xetex-errors.c +++ b/tectonic/xetex-errors.c @@ -4,7 +4,6 @@ */ #include "xetex-core.h" -#include "tectonic.h" #include "xetexd.h" #include diff --git a/tectonic/xetex-io.c b/tectonic/xetex-io.c index 0137f6dc5..a0ea94f27 100644 --- a/tectonic/xetex-io.c +++ b/tectonic/xetex-io.c @@ -4,7 +4,6 @@ */ #include "xetex-core.h" -#include "tectonic.h" #include "teckit-c-Engine.h" #include "XeTeXLayoutInterface.h" #include "XeTeXswap.h" diff --git a/tectonic/xetex-linebreak.c b/tectonic/xetex-linebreak.c index ab65d9762..bc3c268fe 100644 --- a/tectonic/xetex-linebreak.c +++ b/tectonic/xetex-linebreak.c @@ -3,7 +3,6 @@ */ #include "xetex-core.h" -#include "tectonic.h" #include "xetexd.h" #include "core-bridge.h" diff --git a/tectonic/xetex-math.c b/tectonic/xetex-math.c index 90dd1b5d4..8e1990679 100644 --- a/tectonic/xetex-math.c +++ b/tectonic/xetex-math.c @@ -3,7 +3,6 @@ */ #include "xetex-core.h" -#include "tectonic.h" #include "xetexd.h" #include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex-output.c b/tectonic/xetex-output.c index 1845b0aca..590094f3d 100644 --- a/tectonic/xetex-output.c +++ b/tectonic/xetex-output.c @@ -4,7 +4,6 @@ */ #include "xetex-core.h" -#include "tectonic.h" #include "xetexd.h" #include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex-scaledmath.c b/tectonic/xetex-scaledmath.c index 864025e04..5fcf91908 100644 --- a/tectonic/xetex-scaledmath.c +++ b/tectonic/xetex-scaledmath.c @@ -4,7 +4,6 @@ */ #include "xetex-core.h" -#include "tectonic.h" #include "xetexd.h" diff --git a/tectonic/xetex-shipout.c b/tectonic/xetex-shipout.c index 3cea0616b..8440d6fc1 100644 --- a/tectonic/xetex-shipout.c +++ b/tectonic/xetex-shipout.c @@ -3,7 +3,6 @@ */ #include "xetex-core.h" -#include "tectonic.h" #include "xetexd.h" #include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex-stringpool.c b/tectonic/xetex-stringpool.c index 7b518cbbb..77b880feb 100644 --- a/tectonic/xetex-stringpool.c +++ b/tectonic/xetex-stringpool.c @@ -3,7 +3,7 @@ Licensed under the MIT License. */ -#include "tectonic.h" +#include "xetex-core.h" #include "xetexd.h" #include diff --git a/tectonic/xetex-stringpool.h b/tectonic/xetex-stringpool.h index d9476a3b5..ef258b380 100644 --- a/tectonic/xetex-stringpool.h +++ b/tectonic/xetex-stringpool.h @@ -6,7 +6,7 @@ #ifndef TECTONIC_STRINGPOOL_H #define TECTONIC_STRINGPOOL_H -#include "tectonic.h" +#include "xetex-core.h" #include "xetexd.h" #define EMPTY_STRING (65536L + 1) diff --git a/tectonic/xetex-synctex.c b/tectonic/xetex-synctex.c index 1a9dc5860..7ecf300c7 100644 --- a/tectonic/xetex-synctex.c +++ b/tectonic/xetex-synctex.c @@ -4,7 +4,6 @@ */ #include "xetex-core.h" -#include "tectonic.h" #include "xetexd.h" #include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex0.c b/tectonic/xetex0.c index 2a956bf1d..e5c309ce4 100644 --- a/tectonic/xetex0.c +++ b/tectonic/xetex0.c @@ -4,7 +4,6 @@ */ #include "xetex-core.h" -#include "tectonic.h" #include "xetexd.h" #include "XeTeXLayoutInterface.h" #include "xetex-synctex.h" diff --git a/tectonic/xetexd.h b/tectonic/xetexd.h index 5c5b5b586..a8c2fce75 100644 --- a/tectonic/xetexd.h +++ b/tectonic/xetexd.h @@ -6,7 +6,7 @@ #ifndef TECTONIC_XETEXD_H #define TECTONIC_XETEXD_H -#include "tectonic.h" +#include "xetex-core.h" #include "XeTeXOTMath.h" #include "teckit-Common.h" #include "XeTeX_ext.h" diff --git a/tectonic/xetexini.c b/tectonic/xetexini.c index 355595374..2e6f3c32e 100644 --- a/tectonic/xetexini.c +++ b/tectonic/xetexini.c @@ -4,7 +4,6 @@ */ #include "xetex-core.h" -#include "tectonic.h" #include "xetexd.h" #include "xetex-synctex.h" #include "core-bridge.h" From 0c2feade2d493cb9a4f8923f6fa901dcb2e1c6df Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 13:07:41 -0400 Subject: [PATCH 26/36] tectonic/xetex-texmfmp.c: rename from texmfmp.c --- build.rs | 2 +- tectonic/{texmfmp.c => xetex-texmfmp.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tectonic/{texmfmp.c => xetex-texmfmp.c} (100%) diff --git a/build.rs b/build.rs index 6216e28ec..8472a78ac 100644 --- a/build.rs +++ b/build.rs @@ -150,7 +150,6 @@ fn main() { .file("tectonic/dpx-type1c.c") .file("tectonic/dpx-unicode.c") .file("tectonic/dpx-vf.c") - .file("tectonic/texmfmp.c") .file("tectonic/xetex0.c") .file("tectonic/XeTeX_ext.c") .file("tectonic/xetexini.c") @@ -165,6 +164,7 @@ fn main() { .file("tectonic/xetex-shipout.c") .file("tectonic/xetex-stringpool.c") .file("tectonic/xetex-synctex.c") + .file("tectonic/xetex-texmfmp.c") .define("HAVE_ZLIB", "1") .define("HAVE_ZLIB_COMPRESS2", "1") .define("ZLIB_CONST", "1") diff --git a/tectonic/texmfmp.c b/tectonic/xetex-texmfmp.c similarity index 100% rename from tectonic/texmfmp.c rename to tectonic/xetex-texmfmp.c From 283e920efc433dd45979d169910a0fc308e8c6d7 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 13:10:00 -0400 Subject: [PATCH 27/36] tectonic/xetex-xetex0.c: rename from xetex0.c --- build.rs | 2 +- tectonic/{xetex0.c => xetex-xetex0.c} | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) rename tectonic/{xetex0.c => xetex-xetex0.c} (99%) diff --git a/build.rs b/build.rs index 8472a78ac..6ae542cea 100644 --- a/build.rs +++ b/build.rs @@ -150,7 +150,6 @@ fn main() { .file("tectonic/dpx-type1c.c") .file("tectonic/dpx-unicode.c") .file("tectonic/dpx-vf.c") - .file("tectonic/xetex0.c") .file("tectonic/XeTeX_ext.c") .file("tectonic/xetexini.c") .file("tectonic/XeTeX_pic.c") @@ -165,6 +164,7 @@ fn main() { .file("tectonic/xetex-stringpool.c") .file("tectonic/xetex-synctex.c") .file("tectonic/xetex-texmfmp.c") + .file("tectonic/xetex-xetex0.c") .define("HAVE_ZLIB", "1") .define("HAVE_ZLIB_COMPRESS2", "1") .define("ZLIB_CONST", "1") diff --git a/tectonic/xetex0.c b/tectonic/xetex-xetex0.c similarity index 99% rename from tectonic/xetex0.c rename to tectonic/xetex-xetex0.c index e5c309ce4..755efd812 100644 --- a/tectonic/xetex0.c +++ b/tectonic/xetex-xetex0.c @@ -1,4 +1,4 @@ -/* xetex0.c: bulk of the WEB code translated to C +/* xetex-xetex0.c: bulk of the WEB code translated to C Copyright 2016-2018 The Tectonic Project Licensed under the MIT License. */ @@ -7,8 +7,6 @@ #include "xetexd.h" #include "XeTeXLayoutInterface.h" #include "xetex-synctex.h" -#include "core-bridge.h" - #define IS_LC_HEX(c) (((c) >= '0' && (c) <= '9' ) || ((c) >= 'a' && (c) <= 'f' )) From 700e3815463e933e7f4770a5917e670dbb78cba8 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 13:15:31 -0400 Subject: [PATCH 28/36] tectonic/xetex-xetexd.h: rename from xetexd.h --- tectonic/XeTeX_ext.c | 2 +- tectonic/XeTeX_mac.c | 2 +- tectonic/XeTeX_pic.c | 2 +- tectonic/core-bridge.c | 4 +++- tectonic/xetex-engine-interface.c | 2 +- tectonic/xetex-errors.c | 2 +- tectonic/xetex-io.c | 2 +- tectonic/xetex-linebreak.c | 2 +- tectonic/xetex-math.c | 2 +- tectonic/xetex-output.c | 2 +- tectonic/xetex-scaledmath.c | 2 +- tectonic/xetex-shipout.c | 2 +- tectonic/xetex-stringpool.c | 2 +- tectonic/xetex-stringpool.h | 2 +- tectonic/xetex-synctex.c | 2 +- tectonic/xetex-texmfmp.c | 2 +- tectonic/xetex-xetex0.c | 2 +- tectonic/{xetexd.h => xetex-xetexd.h} | 8 ++++---- tectonic/xetexini.c | 4 ++-- 19 files changed, 25 insertions(+), 23 deletions(-) rename tectonic/{xetexd.h => xetex-xetexd.h} (99%) diff --git a/tectonic/XeTeX_ext.c b/tectonic/XeTeX_ext.c index 6ab186632..a2983dfd8 100644 --- a/tectonic/XeTeX_ext.c +++ b/tectonic/XeTeX_ext.c @@ -59,7 +59,7 @@ authorization from the copyright holders. #include -#include "xetexd.h" +#include "xetex-xetexd.h" /* OT-related constants we need */ diff --git a/tectonic/XeTeX_mac.c b/tectonic/XeTeX_mac.c index b6b9c0e40..fece36479 100644 --- a/tectonic/XeTeX_mac.c +++ b/tectonic/XeTeX_mac.c @@ -37,7 +37,7 @@ authorization from the copyright holders. */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "teckit-c-Engine.h" #include "XeTeX_ext.h" #include "XeTeXLayoutInterface.h" diff --git a/tectonic/XeTeX_pic.c b/tectonic/XeTeX_pic.c index fc9860956..e3153edc2 100644 --- a/tectonic/XeTeX_pic.c +++ b/tectonic/XeTeX_pic.c @@ -37,7 +37,7 @@ XeTeX_pic.c */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "XeTeX_ext.h" #include "core-bridge.h" #include "dpx-dpxutil.h" diff --git a/tectonic/core-bridge.c b/tectonic/core-bridge.c index 5511a56b6..b710a6e97 100644 --- a/tectonic/core-bridge.c +++ b/tectonic/core-bridge.c @@ -10,9 +10,11 @@ #include #include /*vsnprintf*/ +/* TODO: these are needed for the various *_main routines which should + * probably be moved out into other files. */ #include "bibtex.h" #include "dpx-dvipdfmx.h" -#include "xetexd.h" +#include "xetex-xetexd.h" /* The global variable that represents the Rust API. Some fine day we'll get diff --git a/tectonic/xetex-engine-interface.c b/tectonic/xetex-engine-interface.c index f7913aab6..9935c0b16 100644 --- a/tectonic/xetex-engine-interface.c +++ b/tectonic/xetex-engine-interface.c @@ -4,7 +4,7 @@ */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "XeTeX_ext.h" #include diff --git a/tectonic/xetex-errors.c b/tectonic/xetex-errors.c index 523928a58..a8cf9104c 100644 --- a/tectonic/xetex-errors.c +++ b/tectonic/xetex-errors.c @@ -4,7 +4,7 @@ */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include diff --git a/tectonic/xetex-io.c b/tectonic/xetex-io.c index a0ea94f27..bd40f55f1 100644 --- a/tectonic/xetex-io.c +++ b/tectonic/xetex-io.c @@ -7,7 +7,7 @@ #include "teckit-c-Engine.h" #include "XeTeXLayoutInterface.h" #include "XeTeXswap.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "core-bridge.h" #include diff --git a/tectonic/xetex-linebreak.c b/tectonic/xetex-linebreak.c index bc3c268fe..1fdfc66dc 100644 --- a/tectonic/xetex-linebreak.c +++ b/tectonic/xetex-linebreak.c @@ -3,7 +3,7 @@ */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "core-bridge.h" static int32_t passive; diff --git a/tectonic/xetex-math.c b/tectonic/xetex-math.c index 8e1990679..6a538e494 100644 --- a/tectonic/xetex-math.c +++ b/tectonic/xetex-math.c @@ -3,7 +3,7 @@ */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex-output.c b/tectonic/xetex-output.c index 590094f3d..354b58c97 100644 --- a/tectonic/xetex-output.c +++ b/tectonic/xetex-output.c @@ -4,7 +4,7 @@ */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex-scaledmath.c b/tectonic/xetex-scaledmath.c index 5fcf91908..829413bed 100644 --- a/tectonic/xetex-scaledmath.c +++ b/tectonic/xetex-scaledmath.c @@ -4,7 +4,7 @@ */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" int32_t diff --git a/tectonic/xetex-shipout.c b/tectonic/xetex-shipout.c index 8440d6fc1..de7012ebf 100644 --- a/tectonic/xetex-shipout.c +++ b/tectonic/xetex-shipout.c @@ -3,7 +3,7 @@ */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex-stringpool.c b/tectonic/xetex-stringpool.c index 77b880feb..abc5edbca 100644 --- a/tectonic/xetex-stringpool.c +++ b/tectonic/xetex-stringpool.c @@ -4,7 +4,7 @@ */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include static const char *string_constants[] = { diff --git a/tectonic/xetex-stringpool.h b/tectonic/xetex-stringpool.h index ef258b380..bd868048c 100644 --- a/tectonic/xetex-stringpool.h +++ b/tectonic/xetex-stringpool.h @@ -7,7 +7,7 @@ #define TECTONIC_STRINGPOOL_H #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #define EMPTY_STRING (65536L + 1) diff --git a/tectonic/xetex-synctex.c b/tectonic/xetex-synctex.c index 7ecf300c7..b3b4b074f 100644 --- a/tectonic/xetex-synctex.c +++ b/tectonic/xetex-synctex.c @@ -4,7 +4,7 @@ */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "xetex-synctex.h" #include "core-bridge.h" diff --git a/tectonic/xetex-texmfmp.c b/tectonic/xetex-texmfmp.c index d3dbbb2cb..6fa53c76c 100644 --- a/tectonic/xetex-texmfmp.c +++ b/tectonic/xetex-texmfmp.c @@ -6,7 +6,7 @@ This file is public domain. */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "XeTeX_ext.h" #include /* For `struct tm'. Moved here for Visual Studio 2005. */ diff --git a/tectonic/xetex-xetex0.c b/tectonic/xetex-xetex0.c index 755efd812..281e84bdb 100644 --- a/tectonic/xetex-xetex0.c +++ b/tectonic/xetex-xetex0.c @@ -4,7 +4,7 @@ */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "XeTeXLayoutInterface.h" #include "xetex-synctex.h" diff --git a/tectonic/xetexd.h b/tectonic/xetex-xetexd.h similarity index 99% rename from tectonic/xetexd.h rename to tectonic/xetex-xetexd.h index a8c2fce75..11e41d6cb 100644 --- a/tectonic/xetexd.h +++ b/tectonic/xetex-xetexd.h @@ -1,10 +1,10 @@ -/* tectonic/xetexd.h -- many, many XeTeX symbol definitions +/* tectonic/xetex-xetexd.h -- many, many XeTeX symbol definitions Copyright 2016-2018 The Tectonic Project Licensed under the MIT License. */ -#ifndef TECTONIC_XETEXD_H -#define TECTONIC_XETEXD_H +#ifndef TECTONIC_XETEX_XETEXD_H +#define TECTONIC_XETEX_XETEXD_H #include "xetex-core.h" #include "XeTeXOTMath.h" @@ -1097,4 +1097,4 @@ tt_history_t tt_run_engine(char *dump_name, char *input_file_name); #include "xetex-stringpool.h" -#endif /* TECTONIC_XETEXD_H */ +#endif /* TECTONIC_XETEX_XETEXD_H */ diff --git a/tectonic/xetexini.c b/tectonic/xetexini.c index 2e6f3c32e..e3df1ea2f 100644 --- a/tectonic/xetexini.c +++ b/tectonic/xetexini.c @@ -4,12 +4,12 @@ */ #include "xetex-core.h" -#include "xetexd.h" +#include "xetex-xetexd.h" #include "xetex-synctex.h" #include "core-bridge.h" #include "dpx-pdfobj.h" /* pdf_files_{init,close} */ -/* All the following variables are declared in xetexd.h */ +/* All the following variables are declared in xetex-xetexd.h */ memory_word *eqtb; int32_t bad; char *name_of_file; From fa97ed816dd020e68ec32f9872b18654927bddee Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 13:19:29 -0400 Subject: [PATCH 29/36] tectonic/xetex-ext.[ch]: rename from XeTeX_ext.[ch] --- build.rs | 2 +- tectonic/XeTeXFontInst.cpp | 2 +- tectonic/XeTeXFontInst_Mac.cpp | 2 +- tectonic/XeTeXOTMath.h | 2 +- tectonic/XeTeX_mac.c | 2 +- tectonic/XeTeX_pic.c | 4 ++-- tectonic/XeTeX_web.h | 2 +- tectonic/xetex-engine-interface.c | 2 +- tectonic/{XeTeX_ext.c => xetex-ext.c} | 2 +- tectonic/{XeTeX_ext.h => xetex-ext.h} | 0 tectonic/xetex-texmfmp.c | 2 +- tectonic/xetex-xetexd.h | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) rename tectonic/{XeTeX_ext.c => xetex-ext.c} (99%) rename tectonic/{XeTeX_ext.h => xetex-ext.h} (100%) diff --git a/build.rs b/build.rs index 6ae542cea..11791a37c 100644 --- a/build.rs +++ b/build.rs @@ -150,11 +150,11 @@ fn main() { .file("tectonic/dpx-type1c.c") .file("tectonic/dpx-unicode.c") .file("tectonic/dpx-vf.c") - .file("tectonic/XeTeX_ext.c") .file("tectonic/xetexini.c") .file("tectonic/XeTeX_pic.c") .file("tectonic/xetex-engine-interface.c") .file("tectonic/xetex-errors.c") + .file("tectonic/xetex-ext.c") .file("tectonic/xetex-io.c") .file("tectonic/xetex-linebreak.c") .file("tectonic/xetex-math.c") diff --git a/tectonic/XeTeXFontInst.cpp b/tectonic/XeTeXFontInst.cpp index ea71fb141..58b2e2fd7 100644 --- a/tectonic/XeTeXFontInst.cpp +++ b/tectonic/XeTeXFontInst.cpp @@ -43,7 +43,7 @@ authorization from the copyright holders. #include "XeTeXFontInst.h" #include "XeTeXLayoutInterface.h" -#include "XeTeX_ext.h" +#include "xetex-ext.h" #include #include FT_GLYPH_H diff --git a/tectonic/XeTeXFontInst_Mac.cpp b/tectonic/XeTeXFontInst_Mac.cpp index 741ee69e5..e71b8032a 100644 --- a/tectonic/XeTeXFontInst_Mac.cpp +++ b/tectonic/XeTeXFontInst_Mac.cpp @@ -41,7 +41,7 @@ authorization from the copyright holders. #include "xetex-core.h" #include "XeTeXFontInst_Mac.h" -#include "XeTeX_ext.h" +#include "xetex-ext.h" XeTeXFontInst_Mac::XeTeXFontInst_Mac(CTFontDescriptorRef descriptor, float pointSize, int &status) : XeTeXFontInst(NULL, 0, pointSize, status) diff --git a/tectonic/XeTeXOTMath.h b/tectonic/XeTeXOTMath.h index 3d17655b3..581f878d3 100644 --- a/tectonic/XeTeXOTMath.h +++ b/tectonic/XeTeXOTMath.h @@ -36,7 +36,7 @@ authorization from the copyright holders. #include #include "xetex-core.h" -#include "XeTeX_ext.h" +#include "xetex-ext.h" typedef struct { unsigned int count; diff --git a/tectonic/XeTeX_mac.c b/tectonic/XeTeX_mac.c index fece36479..3cfa143c2 100644 --- a/tectonic/XeTeX_mac.c +++ b/tectonic/XeTeX_mac.c @@ -39,7 +39,7 @@ authorization from the copyright holders. #include "xetex-core.h" #include "xetex-xetexd.h" #include "teckit-c-Engine.h" -#include "XeTeX_ext.h" +#include "xetex-ext.h" #include "XeTeXLayoutInterface.h" #include diff --git a/tectonic/XeTeX_pic.c b/tectonic/XeTeX_pic.c index e3153edc2..a80b826ce 100644 --- a/tectonic/XeTeX_pic.c +++ b/tectonic/XeTeX_pic.c @@ -38,7 +38,7 @@ XeTeX_pic.c #include "xetex-core.h" #include "xetex-xetexd.h" -#include "XeTeX_ext.h" +#include "xetex-ext.h" #include "core-bridge.h" #include "dpx-dpxutil.h" #include "dpx-pdfdoc.h" @@ -123,7 +123,7 @@ pdf_get_rect (char *filename, rust_input_handle_t handle, int page_num, int pdf_ /* OMG, magic numbers specifying page bound types do not agree between * xdvipdfmx code (dpx-pdfdoc.c:pdf_doc_get_page) and XeTeX/Apple's - * pdfbox_* definitions (XeTeX_ext.h). */ + * pdfbox_* definitions (xetex-ext.h). */ switch (pdf_box) { case pdfbox_media: diff --git a/tectonic/XeTeX_web.h b/tectonic/XeTeX_web.h index d274be242..973ff4dc6 100644 --- a/tectonic/XeTeX_web.h +++ b/tectonic/XeTeX_web.h @@ -37,7 +37,7 @@ authorization from the copyright holders. #define __XETEX_WEB_H #include "xetex-core.h" -#include "XeTeX_ext.h" +#include "xetex-ext.h" #ifndef M_PI #define M_PI 3.14159265358979323846264338327950288 diff --git a/tectonic/xetex-engine-interface.c b/tectonic/xetex-engine-interface.c index 9935c0b16..903749c3b 100644 --- a/tectonic/xetex-engine-interface.c +++ b/tectonic/xetex-engine-interface.c @@ -5,7 +5,7 @@ #include "xetex-core.h" #include "xetex-xetexd.h" -#include "XeTeX_ext.h" +#include "xetex-ext.h" #include diff --git a/tectonic/XeTeX_ext.c b/tectonic/xetex-ext.c similarity index 99% rename from tectonic/XeTeX_ext.c rename to tectonic/xetex-ext.c index a2983dfd8..939cc2fc7 100644 --- a/tectonic/XeTeX_ext.c +++ b/tectonic/xetex-ext.c @@ -37,7 +37,7 @@ authorization from the copyright holders. */ #include "xetex-core.h" -#include "XeTeX_ext.h" +#include "xetex-ext.h" #include "teckit-c-Engine.h" #include "XeTeXLayoutInterface.h" #include "XeTeXswap.h" diff --git a/tectonic/XeTeX_ext.h b/tectonic/xetex-ext.h similarity index 100% rename from tectonic/XeTeX_ext.h rename to tectonic/xetex-ext.h diff --git a/tectonic/xetex-texmfmp.c b/tectonic/xetex-texmfmp.c index 6fa53c76c..6479c81ad 100644 --- a/tectonic/xetex-texmfmp.c +++ b/tectonic/xetex-texmfmp.c @@ -7,7 +7,7 @@ #include "xetex-core.h" #include "xetex-xetexd.h" -#include "XeTeX_ext.h" +#include "xetex-ext.h" #include /* For `struct tm'. Moved here for Visual Studio 2005. */ diff --git a/tectonic/xetex-xetexd.h b/tectonic/xetex-xetexd.h index 11e41d6cb..efdbec325 100644 --- a/tectonic/xetex-xetexd.h +++ b/tectonic/xetex-xetexd.h @@ -9,7 +9,7 @@ #include "xetex-core.h" #include "XeTeXOTMath.h" #include "teckit-Common.h" -#include "XeTeX_ext.h" +#include "xetex-ext.h" #include "core-bridge.h" #include "xetex-constants.h" From 6bed3b512ba78bb5387ec5f390073e0eafbcedfe Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 13:27:40 -0400 Subject: [PATCH 30/36] tecteonic: rename the C++ files with a "xetex-" prefix Final file names are along the lines of "xetex-XeTeXFontMgr.h" Note that the classes that these files define have names such as `XeTeXFontMgr`, so it seems best to keep the "XeTeX" in the filename. --- build.rs | 14 +++++++------- tectonic/XeTeX_mac.c | 2 +- .../{XeTeXFontInst.cpp => xetex-XeTeXFontInst.cpp} | 4 ++-- .../{XeTeXFontInst.h => xetex-XeTeXFontInst.h} | 2 +- ...ontInst_Mac.cpp => xetex-XeTeXFontInst_Mac.cpp} | 2 +- ...TeXFontInst_Mac.h => xetex-XeTeXFontInst_Mac.h} | 2 +- .../{XeTeXFontMgr.cpp => xetex-XeTeXFontMgr.cpp} | 6 +++--- tectonic/{XeTeXFontMgr.h => xetex-XeTeXFontMgr.h} | 0 ...TeXFontMgr_FC.cpp => xetex-XeTeXFontMgr_FC.cpp} | 2 +- .../{XeTeXFontMgr_FC.h => xetex-XeTeXFontMgr_FC.h} | 2 +- ...XeTeXFontMgr_Mac.h => xetex-XeTeXFontMgr_Mac.h} | 2 +- ...TeXFontMgr_Mac.mm => xetex-XeTeXFontMgr_Mac.mm} | 0 ...nterface.cpp => xetex-XeTeXLayoutInterface.cpp} | 8 ++++---- ...outInterface.h => xetex-XeTeXLayoutInterface.h} | 0 .../{XeTeXOTMath.cpp => xetex-XeTeXOTMath.cpp} | 6 +++--- tectonic/{XeTeXOTMath.h => xetex-XeTeXOTMath.h} | 0 tectonic/xetex-core.h | 4 ++-- tectonic/xetex-ext.c | 2 +- tectonic/xetex-ext.h | 2 +- tectonic/xetex-io.c | 2 +- tectonic/xetex-xetex0.c | 2 +- tectonic/xetex-xetexd.h | 2 +- 22 files changed, 33 insertions(+), 33 deletions(-) rename tectonic/{XeTeXFontInst.cpp => xetex-XeTeXFontInst.cpp} (99%) rename tectonic/{XeTeXFontInst.h => xetex-XeTeXFontInst.h} (99%) rename tectonic/{XeTeXFontInst_Mac.cpp => xetex-XeTeXFontInst_Mac.cpp} (98%) rename tectonic/{XeTeXFontInst_Mac.h => xetex-XeTeXFontInst_Mac.h} (98%) rename tectonic/{XeTeXFontMgr.cpp => xetex-XeTeXFontMgr.cpp} (99%) rename tectonic/{XeTeXFontMgr.h => xetex-XeTeXFontMgr.h} (100%) rename tectonic/{XeTeXFontMgr_FC.cpp => xetex-XeTeXFontMgr_FC.cpp} (99%) rename tectonic/{XeTeXFontMgr_FC.h => xetex-XeTeXFontMgr_FC.h} (98%) rename tectonic/{XeTeXFontMgr_Mac.h => xetex-XeTeXFontMgr_Mac.h} (98%) rename tectonic/{XeTeXFontMgr_Mac.mm => xetex-XeTeXFontMgr_Mac.mm} (100%) rename tectonic/{XeTeXLayoutInterface.cpp => xetex-XeTeXLayoutInterface.cpp} (99%) rename tectonic/{XeTeXLayoutInterface.h => xetex-XeTeXLayoutInterface.h} (100%) rename tectonic/{XeTeXOTMath.cpp => xetex-XeTeXOTMath.cpp} (99%) rename tectonic/{XeTeXOTMath.h => xetex-XeTeXOTMath.h} (100%) diff --git a/build.rs b/build.rs index 11791a37c..6e37b3a0a 100644 --- a/build.rs +++ b/build.rs @@ -210,10 +210,10 @@ fn main() { .cpp(true) .flag("-Wall") .file("tectonic/teckit-Engine.cpp") - .file("tectonic/XeTeXFontInst.cpp") - .file("tectonic/XeTeXFontMgr.cpp") - .file("tectonic/XeTeXLayoutInterface.cpp") - .file("tectonic/XeTeXOTMath.cpp") + .file("tectonic/xetex-XeTeXFontInst.cpp") + .file("tectonic/xetex-XeTeXFontMgr.cpp") + .file("tectonic/xetex-XeTeXLayoutInterface.cpp") + .file("tectonic/xetex-XeTeXOTMath.cpp") .include("."); for p in deps.include_paths { @@ -228,8 +228,8 @@ fn main() { ccfg.file("tectonic/XeTeX_mac.c"); cppcfg.define("XETEX_MAC", Some("1")); - cppcfg.file("tectonic/XeTeXFontInst_Mac.cpp"); - cppcfg.file("tectonic/XeTeXFontMgr_Mac.mm"); + cppcfg.file("tectonic/xetex-XeTeXFontInst_Mac.cpp"); + cppcfg.file("tectonic/xetex-XeTeXFontMgr_Mac.mm"); println!("cargo:rustc-link-lib=framework=Foundation"); println!("cargo:rustc-link-lib=framework=CoreFoundation"); @@ -240,7 +240,7 @@ fn main() { if cfg!(not(target_os = "macos")) { // At the moment we use Fontconfig on both Linux and Windows. - cppcfg.file("tectonic/XeTeXFontMgr_FC.cpp"); + cppcfg.file("tectonic/xetex-XeTeXFontMgr_FC.cpp"); } if cfg!(target_endian = "big") { diff --git a/tectonic/XeTeX_mac.c b/tectonic/XeTeX_mac.c index 3cfa143c2..3578a7e58 100644 --- a/tectonic/XeTeX_mac.c +++ b/tectonic/XeTeX_mac.c @@ -40,7 +40,7 @@ authorization from the copyright holders. #include "xetex-xetexd.h" #include "teckit-c-Engine.h" #include "xetex-ext.h" -#include "XeTeXLayoutInterface.h" +#include "xetex-XeTeXLayoutInterface.h" #include diff --git a/tectonic/XeTeXFontInst.cpp b/tectonic/xetex-XeTeXFontInst.cpp similarity index 99% rename from tectonic/XeTeXFontInst.cpp rename to tectonic/xetex-XeTeXFontInst.cpp index 58b2e2fd7..7c3a3653b 100644 --- a/tectonic/XeTeXFontInst.cpp +++ b/tectonic/xetex-XeTeXFontInst.cpp @@ -41,8 +41,8 @@ authorization from the copyright holders. #include "xetex-core.h" -#include "XeTeXFontInst.h" -#include "XeTeXLayoutInterface.h" +#include "xetex-XeTeXFontInst.h" +#include "xetex-XeTeXLayoutInterface.h" #include "xetex-ext.h" #include diff --git a/tectonic/XeTeXFontInst.h b/tectonic/xetex-XeTeXFontInst.h similarity index 99% rename from tectonic/XeTeXFontInst.h rename to tectonic/xetex-XeTeXFontInst.h index a18a043b1..2341e840e 100644 --- a/tectonic/XeTeXFontInst.h +++ b/tectonic/xetex-XeTeXFontInst.h @@ -43,7 +43,7 @@ authorization from the copyright holders. #define __XeTeXFontInst_H #include "xetex-core.h" -#include "XeTeXFontMgr.h" +#include "xetex-XeTeXFontMgr.h" // create specific subclasses for each supported platform diff --git a/tectonic/XeTeXFontInst_Mac.cpp b/tectonic/xetex-XeTeXFontInst_Mac.cpp similarity index 98% rename from tectonic/XeTeXFontInst_Mac.cpp rename to tectonic/xetex-XeTeXFontInst_Mac.cpp index e71b8032a..50cade6cf 100644 --- a/tectonic/XeTeXFontInst_Mac.cpp +++ b/tectonic/xetex-XeTeXFontInst_Mac.cpp @@ -40,7 +40,7 @@ authorization from the copyright holders. */ #include "xetex-core.h" -#include "XeTeXFontInst_Mac.h" +#include "xetex-XeTeXFontInst_Mac.h" #include "xetex-ext.h" XeTeXFontInst_Mac::XeTeXFontInst_Mac(CTFontDescriptorRef descriptor, float pointSize, int &status) diff --git a/tectonic/XeTeXFontInst_Mac.h b/tectonic/xetex-XeTeXFontInst_Mac.h similarity index 98% rename from tectonic/XeTeXFontInst_Mac.h rename to tectonic/xetex-XeTeXFontInst_Mac.h index c7b142b25..1df19f6da 100644 --- a/tectonic/XeTeXFontInst_Mac.h +++ b/tectonic/xetex-XeTeXFontInst_Mac.h @@ -44,7 +44,7 @@ authorization from the copyright holders. #include "xetex-core.h" -#include "XeTeXFontInst.h" +#include "xetex-XeTeXFontInst.h" #include diff --git a/tectonic/XeTeXFontMgr.cpp b/tectonic/xetex-XeTeXFontMgr.cpp similarity index 99% rename from tectonic/XeTeXFontMgr.cpp rename to tectonic/xetex-XeTeXFontMgr.cpp index ce14d8115..4b9516fd1 100644 --- a/tectonic/XeTeXFontMgr.cpp +++ b/tectonic/xetex-XeTeXFontMgr.cpp @@ -35,11 +35,11 @@ authorization from the copyright holders. #include "XeTeX_web.h" #ifdef XETEX_MAC -#include "XeTeXFontMgr_Mac.h" +#include "xetex-XeTeXFontMgr_Mac.h" #else -#include "XeTeXFontMgr_FC.h" +#include "xetex-XeTeXFontMgr_FC.h" #endif -#include "XeTeXFontInst.h" +#include "xetex-XeTeXFontInst.h" #include diff --git a/tectonic/XeTeXFontMgr.h b/tectonic/xetex-XeTeXFontMgr.h similarity index 100% rename from tectonic/XeTeXFontMgr.h rename to tectonic/xetex-XeTeXFontMgr.h diff --git a/tectonic/XeTeXFontMgr_FC.cpp b/tectonic/xetex-XeTeXFontMgr_FC.cpp similarity index 99% rename from tectonic/XeTeXFontMgr_FC.cpp rename to tectonic/xetex-XeTeXFontMgr_FC.cpp index af7a97a14..ce6e245eb 100644 --- a/tectonic/XeTeXFontMgr_FC.cpp +++ b/tectonic/xetex-XeTeXFontMgr_FC.cpp @@ -32,7 +32,7 @@ authorization from the copyright holders. #include "xetex-core.h" -#include "XeTeXFontMgr_FC.h" +#include "xetex-XeTeXFontMgr_FC.h" /* allow compilation with old Fontconfig header */ #ifndef FC_FULLNAME diff --git a/tectonic/XeTeXFontMgr_FC.h b/tectonic/xetex-XeTeXFontMgr_FC.h similarity index 98% rename from tectonic/XeTeXFontMgr_FC.h rename to tectonic/xetex-XeTeXFontMgr_FC.h index 35ac1afe5..8d5c522b3 100644 --- a/tectonic/XeTeXFontMgr_FC.h +++ b/tectonic/xetex-XeTeXFontMgr_FC.h @@ -34,7 +34,7 @@ authorization from the copyright holders. #define __XETEX_FONT_MGR_FC_H #include "xetex-core.h" -#include "XeTeXFontMgr.h" +#include "xetex-XeTeXFontMgr.h" class XeTeXFontMgr_FC : public XeTeXFontMgr diff --git a/tectonic/XeTeXFontMgr_Mac.h b/tectonic/xetex-XeTeXFontMgr_Mac.h similarity index 98% rename from tectonic/XeTeXFontMgr_Mac.h rename to tectonic/xetex-XeTeXFontMgr_Mac.h index bf35e8955..33e9a6271 100644 --- a/tectonic/XeTeXFontMgr_Mac.h +++ b/tectonic/xetex-XeTeXFontMgr_Mac.h @@ -36,7 +36,7 @@ authorization from the copyright holders. #include "xetex-core.h" -#include "XeTeXFontMgr.h" +#include "xetex-XeTeXFontMgr.h" #include diff --git a/tectonic/XeTeXFontMgr_Mac.mm b/tectonic/xetex-XeTeXFontMgr_Mac.mm similarity index 100% rename from tectonic/XeTeXFontMgr_Mac.mm rename to tectonic/xetex-XeTeXFontMgr_Mac.mm diff --git a/tectonic/XeTeXLayoutInterface.cpp b/tectonic/xetex-XeTeXLayoutInterface.cpp similarity index 99% rename from tectonic/XeTeXLayoutInterface.cpp rename to tectonic/xetex-XeTeXLayoutInterface.cpp index ccd2c76bd..6a83dd15e 100644 --- a/tectonic/XeTeXLayoutInterface.cpp +++ b/tectonic/xetex-XeTeXLayoutInterface.cpp @@ -45,12 +45,12 @@ authorization from the copyright holders. #include "XeTeX_web.h" -#include "XeTeXLayoutInterface.h" -#include "XeTeXFontInst.h" +#include "xetex-XeTeXLayoutInterface.h" +#include "xetex-XeTeXFontInst.h" #ifdef XETEX_MAC -#include "XeTeXFontInst_Mac.h" +#include "xetex-XeTeXFontInst_Mac.h" #endif -#include "XeTeXFontMgr.h" +#include "xetex-XeTeXFontMgr.h" struct XeTeXLayoutEngine_rec { diff --git a/tectonic/XeTeXLayoutInterface.h b/tectonic/xetex-XeTeXLayoutInterface.h similarity index 100% rename from tectonic/XeTeXLayoutInterface.h rename to tectonic/xetex-XeTeXLayoutInterface.h diff --git a/tectonic/XeTeXOTMath.cpp b/tectonic/xetex-XeTeXOTMath.cpp similarity index 99% rename from tectonic/XeTeXOTMath.cpp rename to tectonic/xetex-XeTeXOTMath.cpp index fb0e31526..985074f3b 100644 --- a/tectonic/XeTeXOTMath.cpp +++ b/tectonic/xetex-XeTeXOTMath.cpp @@ -35,11 +35,11 @@ authorization from the copyright holders. #include -#include "XeTeXOTMath.h" +#include "xetex-XeTeXOTMath.h" #include "XeTeX_web.h" -#include "XeTeXLayoutInterface.h" -#include "XeTeXFontInst.h" +#include "xetex-XeTeXLayoutInterface.h" +#include "xetex-XeTeXFontInst.h" int get_ot_math_constant(int f, int n) diff --git a/tectonic/XeTeXOTMath.h b/tectonic/xetex-XeTeXOTMath.h similarity index 100% rename from tectonic/XeTeXOTMath.h rename to tectonic/xetex-XeTeXOTMath.h diff --git a/tectonic/xetex-core.h b/tectonic/xetex-core.h index aa0a21d62..80002a5dd 100644 --- a/tectonic/xetex-core.h +++ b/tectonic/xetex-core.h @@ -103,8 +103,8 @@ typedef struct XeTeXLayoutEngine_rec* XeTeXLayoutEngine; #define FONT_FLAGS_COLORED 0x01 #define FONT_FLAGS_VERTICAL 0x02 -/* gFreeTypeLibrary is defined in XeTeXFontInst_FT2.cpp, - * also used in XeTeXFontMgr_FC.cpp and XeTeX_ext.c. */ +/* gFreeTypeLibrary is defined in xetex-XeTeXFontInst_FT2.cpp, + * also used in xetex-XeTeXFontMgr_FC.cpp and xetex-ext.c. */ BEGIN_EXTERN_C extern FT_Library gFreeTypeLibrary; diff --git a/tectonic/xetex-ext.c b/tectonic/xetex-ext.c index 939cc2fc7..ceea533f3 100644 --- a/tectonic/xetex-ext.c +++ b/tectonic/xetex-ext.c @@ -39,7 +39,7 @@ authorization from the copyright holders. #include "xetex-core.h" #include "xetex-ext.h" #include "teckit-c-Engine.h" -#include "XeTeXLayoutInterface.h" +#include "xetex-XeTeXLayoutInterface.h" #include "XeTeXswap.h" #include "core-bridge.h" diff --git a/tectonic/xetex-ext.h b/tectonic/xetex-ext.h index 02eb86273..349521820 100644 --- a/tectonic/xetex-ext.h +++ b/tectonic/xetex-ext.h @@ -36,7 +36,7 @@ authorization from the copyright holders. #define __XETEXEXT_H #include "xetex-core.h" -#include "XeTeXLayoutInterface.h" +#include "xetex-XeTeXLayoutInterface.h" #define AAT_FONT_FLAG 0xFFFFu #define OTGR_FONT_FLAG 0xFFFEu diff --git a/tectonic/xetex-io.c b/tectonic/xetex-io.c index bd40f55f1..47c732b09 100644 --- a/tectonic/xetex-io.c +++ b/tectonic/xetex-io.c @@ -5,7 +5,7 @@ #include "xetex-core.h" #include "teckit-c-Engine.h" -#include "XeTeXLayoutInterface.h" +#include "xetex-XeTeXLayoutInterface.h" #include "XeTeXswap.h" #include "xetex-xetexd.h" #include "core-bridge.h" diff --git a/tectonic/xetex-xetex0.c b/tectonic/xetex-xetex0.c index 281e84bdb..13d87e626 100644 --- a/tectonic/xetex-xetex0.c +++ b/tectonic/xetex-xetex0.c @@ -5,7 +5,7 @@ #include "xetex-core.h" #include "xetex-xetexd.h" -#include "XeTeXLayoutInterface.h" +#include "xetex-XeTeXLayoutInterface.h" #include "xetex-synctex.h" #define IS_LC_HEX(c) (((c) >= '0' && (c) <= '9' ) || ((c) >= 'a' && (c) <= 'f' )) diff --git a/tectonic/xetex-xetexd.h b/tectonic/xetex-xetexd.h index efdbec325..0cca8d70d 100644 --- a/tectonic/xetex-xetexd.h +++ b/tectonic/xetex-xetexd.h @@ -7,7 +7,7 @@ #define TECTONIC_XETEX_XETEXD_H #include "xetex-core.h" -#include "XeTeXOTMath.h" +#include "xetex-XeTeXOTMath.h" #include "teckit-Common.h" #include "xetex-ext.h" #include "core-bridge.h" From 695add133ddaa20708be25cce127e4a658a5ed53 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 13:30:24 -0400 Subject: [PATCH 31/36] tectonic/xetex-ini.c: rename from xetexini.c --- build.rs | 2 +- tectonic/{xetexini.c => xetex-ini.c} | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) rename tectonic/{xetexini.c => xetex-ini.c} (99%) diff --git a/build.rs b/build.rs index 6e37b3a0a..27f35ce13 100644 --- a/build.rs +++ b/build.rs @@ -150,11 +150,11 @@ fn main() { .file("tectonic/dpx-type1c.c") .file("tectonic/dpx-unicode.c") .file("tectonic/dpx-vf.c") - .file("tectonic/xetexini.c") .file("tectonic/XeTeX_pic.c") .file("tectonic/xetex-engine-interface.c") .file("tectonic/xetex-errors.c") .file("tectonic/xetex-ext.c") + .file("tectonic/xetex-ini.c") .file("tectonic/xetex-io.c") .file("tectonic/xetex-linebreak.c") .file("tectonic/xetex-math.c") diff --git a/tectonic/xetexini.c b/tectonic/xetex-ini.c similarity index 99% rename from tectonic/xetexini.c rename to tectonic/xetex-ini.c index e3df1ea2f..db770df9e 100644 --- a/tectonic/xetexini.c +++ b/tectonic/xetex-ini.c @@ -1,4 +1,4 @@ -/* xetexini.c: WEB initialization code translated to C +/* xetex-ini.c: WEB initialization code translated to C Copyright 2016-2018 The Tectonic Project Licensed under the MIT License. */ @@ -6,7 +6,6 @@ #include "xetex-core.h" #include "xetex-xetexd.h" #include "xetex-synctex.h" -#include "core-bridge.h" #include "dpx-pdfobj.h" /* pdf_files_{init,close} */ /* All the following variables are declared in xetex-xetexd.h */ From c85c0436d332b86aed085e913d9f91b36ec2c319 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 13:32:10 -0400 Subject: [PATCH 32/36] tectonic/xetex-macos.c: rename from XeTeX_mac.c --- build.rs | 2 +- tectonic/{XeTeX_mac.c => xetex-macos.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tectonic/{XeTeX_mac.c => xetex-macos.c} (100%) diff --git a/build.rs b/build.rs index 27f35ce13..405f39893 100644 --- a/build.rs +++ b/build.rs @@ -225,7 +225,7 @@ fn main() { if cfg!(target_os = "macos") { ccfg.define("XETEX_MAC", Some("1")); - ccfg.file("tectonic/XeTeX_mac.c"); + ccfg.file("tectonic/xetex-macos.c"); cppcfg.define("XETEX_MAC", Some("1")); cppcfg.file("tectonic/xetex-XeTeXFontInst_Mac.cpp"); diff --git a/tectonic/XeTeX_mac.c b/tectonic/xetex-macos.c similarity index 100% rename from tectonic/XeTeX_mac.c rename to tectonic/xetex-macos.c From f952de790a6b38bddd794396073e2b433c7c7093 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 13:34:11 -0400 Subject: [PATCH 33/36] tectonic/xetex-pic.c: rename from XeTeX_pic.c --- build.rs | 2 +- tectonic/{XeTeX_pic.c => xetex-pic.c} | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) rename tectonic/{XeTeX_pic.c => xetex-pic.c} (99%) diff --git a/build.rs b/build.rs index 405f39893..c3a273a2e 100644 --- a/build.rs +++ b/build.rs @@ -150,7 +150,6 @@ fn main() { .file("tectonic/dpx-type1c.c") .file("tectonic/dpx-unicode.c") .file("tectonic/dpx-vf.c") - .file("tectonic/XeTeX_pic.c") .file("tectonic/xetex-engine-interface.c") .file("tectonic/xetex-errors.c") .file("tectonic/xetex-ext.c") @@ -159,6 +158,7 @@ fn main() { .file("tectonic/xetex-linebreak.c") .file("tectonic/xetex-math.c") .file("tectonic/xetex-output.c") + .file("tectonic/xetex-pic.c") .file("tectonic/xetex-scaledmath.c") .file("tectonic/xetex-shipout.c") .file("tectonic/xetex-stringpool.c") diff --git a/tectonic/XeTeX_pic.c b/tectonic/xetex-pic.c similarity index 99% rename from tectonic/XeTeX_pic.c rename to tectonic/xetex-pic.c index a80b826ce..0b70d5466 100644 --- a/tectonic/XeTeX_pic.c +++ b/tectonic/xetex-pic.c @@ -39,7 +39,6 @@ XeTeX_pic.c #include "xetex-core.h" #include "xetex-xetexd.h" #include "xetex-ext.h" -#include "core-bridge.h" #include "dpx-dpxutil.h" #include "dpx-pdfdoc.h" #include "dpx-pdfdraw.h" From f3e6d8be6670cfe8868dfb50ec1237a86f270dd5 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 13:36:37 -0400 Subject: [PATCH 34/36] tectonic/xetex-swap.h: rename from XeTeXswap.h --- tectonic/xetex-ext.c | 3 +-- tectonic/xetex-io.c | 3 +-- tectonic/{XeTeXswap.h => xetex-swap.h} | 0 3 files changed, 2 insertions(+), 4 deletions(-) rename tectonic/{XeTeXswap.h => xetex-swap.h} (100%) diff --git a/tectonic/xetex-ext.c b/tectonic/xetex-ext.c index ceea533f3..45f5f0ab9 100644 --- a/tectonic/xetex-ext.c +++ b/tectonic/xetex-ext.c @@ -40,8 +40,7 @@ authorization from the copyright holders. #include "xetex-ext.h" #include "teckit-c-Engine.h" #include "xetex-XeTeXLayoutInterface.h" -#include "XeTeXswap.h" -#include "core-bridge.h" +#include "xetex-swap.h" #include #include diff --git a/tectonic/xetex-io.c b/tectonic/xetex-io.c index 47c732b09..5e0b1a4a8 100644 --- a/tectonic/xetex-io.c +++ b/tectonic/xetex-io.c @@ -6,9 +6,8 @@ #include "xetex-core.h" #include "teckit-c-Engine.h" #include "xetex-XeTeXLayoutInterface.h" -#include "XeTeXswap.h" +#include "xetex-swap.h" #include "xetex-xetexd.h" -#include "core-bridge.h" #include #include diff --git a/tectonic/XeTeXswap.h b/tectonic/xetex-swap.h similarity index 100% rename from tectonic/XeTeXswap.h rename to tectonic/xetex-swap.h From aebd896b707735d9f7ffa168ccf524a1e83f6d3c Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 13:40:20 -0400 Subject: [PATCH 35/36] tectonic/xetex-web.h: rename from XeTeX_web.h --- tectonic/xetex-XeTeXFontMgr.cpp | 3 +-- tectonic/xetex-XeTeXLayoutInterface.cpp | 2 +- tectonic/xetex-XeTeXOTMath.cpp | 3 +-- tectonic/{XeTeX_web.h => xetex-web.h} | 0 4 files changed, 3 insertions(+), 5 deletions(-) rename tectonic/{XeTeX_web.h => xetex-web.h} (100%) diff --git a/tectonic/xetex-XeTeXFontMgr.cpp b/tectonic/xetex-XeTeXFontMgr.cpp index 4b9516fd1..922c45992 100644 --- a/tectonic/xetex-XeTeXFontMgr.cpp +++ b/tectonic/xetex-XeTeXFontMgr.cpp @@ -31,8 +31,7 @@ authorization from the copyright holders. \****************************************************************************/ #include "xetex-core.h" - -#include "XeTeX_web.h" +#include "xetex-web.h" #ifdef XETEX_MAC #include "xetex-XeTeXFontMgr_Mac.h" diff --git a/tectonic/xetex-XeTeXLayoutInterface.cpp b/tectonic/xetex-XeTeXLayoutInterface.cpp index 6a83dd15e..b9db684d6 100644 --- a/tectonic/xetex-XeTeXLayoutInterface.cpp +++ b/tectonic/xetex-XeTeXLayoutInterface.cpp @@ -43,7 +43,7 @@ authorization from the copyright holders. #include #include -#include "XeTeX_web.h" +#include "xetex-web.h" #include "xetex-XeTeXLayoutInterface.h" #include "xetex-XeTeXFontInst.h" diff --git a/tectonic/xetex-XeTeXOTMath.cpp b/tectonic/xetex-XeTeXOTMath.cpp index 985074f3b..319809202 100644 --- a/tectonic/xetex-XeTeXOTMath.cpp +++ b/tectonic/xetex-XeTeXOTMath.cpp @@ -36,8 +36,7 @@ authorization from the copyright holders. #include #include "xetex-XeTeXOTMath.h" - -#include "XeTeX_web.h" +#include "xetex-web.h" #include "xetex-XeTeXLayoutInterface.h" #include "xetex-XeTeXFontInst.h" diff --git a/tectonic/XeTeX_web.h b/tectonic/xetex-web.h similarity index 100% rename from tectonic/XeTeX_web.h rename to tectonic/xetex-web.h From 963bca3b20f879362ff4690ff259c74db088d69d Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 30 Sep 2018 14:06:29 -0400 Subject: [PATCH 36/36] tectonic: fixups to build on macOS --- tectonic/xetex-XeTeXFontMgr_Mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tectonic/xetex-XeTeXFontMgr_Mac.mm b/tectonic/xetex-XeTeXFontMgr_Mac.mm index 38b75bee4..be7dd0854 100644 --- a/tectonic/xetex-XeTeXFontMgr_Mac.mm +++ b/tectonic/xetex-XeTeXFontMgr_Mac.mm @@ -32,7 +32,7 @@ a copy of this software and associated documentation files (the \****************************************************************************/ #include "xetex-core.h" -#include "XeTeXFontMgr_Mac.h" +#include "xetex-XeTeXFontMgr_Mac.h" #include