From 69853ffc9b320136aa3ff2b027af843bffa8aa94 Mon Sep 17 00:00:00 2001 From: Andreas Politz Date: Sun, 8 Dec 2019 18:11:48 +0100 Subject: Prepare for update of synctex --- server/Makefile.am | 9 ++++---- server/synctex_parser.c | 50 +++++++++++++++++++++---------------------- server/synctex_parser_local.h | 48 +++-------------------------------------- 3 files changed, 32 insertions(+), 75 deletions(-) diff --git a/server/Makefile.am b/server/Makefile.am index 5a5a7a6..1662dca 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -9,20 +9,21 @@ epdfinfo_SOURCES = epdfinfo.c epdfinfo.h poppler-hack.cc noinst_LIBRARIES = libsynctex.a libsynctex_a_SOURCES = synctex_parser.c synctex_parser_utils.c synctex_parser.h \ synctex_parser_local.h synctex_parser_utils.h -libsynctex_a_CFLAGS = -w $(zlib_CFLAGS) +libsynctex_a_CFLAGS = -w $(zlib_CFLAGS) -DSYNCTEX_USE_LOCAL_HEADER if HAVE_W32 epdfinfo_LDADD += -lshlwapi endif -SYNCTEX_UPSTREAM = svn://tug.org/texlive/tags/texlive-2017.1/Build/source/texk/web2c/synctexdir +SYNCTEX_UPSTREAM = svn://tug.org/texlive/trunk/Build/source/texk/web2c/synctexdir SYNCTEX_FILES = synctex_parser.c \ synctex_parser.h \ - synctex_parser_local.h \ synctex_parser_readme.txt \ synctex_parser_utils.c \ synctex_parser_utils.h \ - synctex_parser_version.txt + synctex_parser_version.txt \ + synctex_version.h \ + synctex_parser_advanced.h check-local: diff --git a/server/synctex_parser.c b/server/synctex_parser.c index 5b7e8c5..830961a 100644 --- a/server/synctex_parser.c +++ b/server/synctex_parser.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 2008, 2009, 2010 , 2011 jerome DOT laurens AT u-bourgogne DOT fr This file is part of the SyncTeX package. @@ -32,9 +32,9 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE -Except as contained in this notice, the name of the copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in this Software without prior written +Except as contained in this notice, the name of the copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in this Software without prior written authorization from the copyright holder. Acknowledgments: @@ -64,7 +64,7 @@ Thu Jun 19 09:39:21 UTC 2008 # else # define HAVE_LOCALE_H 1 # define HAVE_SETLOCALE 1 -# if defined(_MSC_VER) +# if defined(_MSC_VER) # define SYNCTEX_INLINE __inline # else # define SYNCTEX_INLINE inline @@ -94,8 +94,6 @@ Thu Jun 19 09:39:21 UTC 2008 #include "synctex_parser.h" #include "synctex_parser_utils.h" -#define printf(fmt, args...) (fprintf (stderr, (fmt), ## args)) - /* These are the possible extensions of the synctex file */ const char * synctex_suffix = ".synctex"; const char * synctex_suffix_gz = ".gz"; @@ -574,9 +572,9 @@ typedef struct { || (NODE->class->type == synctex_node_type_void_vbox)\ || (NODE->class->type == synctex_node_type_hbox)\ || (NODE->class->type == synctex_node_type_void_hbox)) - + #define SYNCTEX_HAS_CHILDREN(NODE) (NODE && SYNCTEX_CHILD(NODE)) - + static void _synctex_log_medium_node(synctex_node_t node); typedef synctex_node_medium_t synctex_node_math_t; @@ -1396,7 +1394,7 @@ synctex_status_t _synctex_decode_int(synctex_scanner_t scanner, int* value_ref) * value_ref = result; } return SYNCTEX_STATUS_OK;/* Successfully scanned an int */ - } + } return SYNCTEX_STATUS_NOT_OK;/* Could not scan an int */ } @@ -1958,7 +1956,7 @@ scan_next_line: } else if (*SYNCTEX_CUR == SYNCTEX_CHAR_BEGIN_SHEET) { ++SYNCTEX_CUR; goto deeper; - + } else if (_synctex_next_line(scanner)left = bestDistancesRef->right = 0; bestNodesRef->left = node; bestNodesRef->right = NULL; @@ -4153,19 +4151,19 @@ SYNCTEX_INLINE static int __synctex_eq_get_closest_children_in_hbox(synctex_poin /* the left node is new, try to narrow the result */ if ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->left,visible))) { bestNodesRef->left = node; - } + } if ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->left,visible))) { bestNodesRef->left = node; - } + } } if (result & SYNCTEX_MASK_RIGHT) { /* the right node is new, try to narrow the result */ if ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->right,visible))) { bestNodesRef->right = node; - } + } if ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->right,visible))) { bestNodesRef->right = node; - } + } } } return result; @@ -4220,19 +4218,19 @@ SYNCTEX_INLINE static int __synctex_eq_get_closest_children_in_vbox(synctex_poin /* the left node is new, try to narrow the result */ if ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->left,visible))) { bestNodesRef->left = node; - } + } if ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->left,visible))) { bestNodesRef->left = node; - } + } } if (result & SYNCTEX_MASK_RIGHT) { /* the right node is new, try to narrow the result */ if ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->right,visible))) { bestNodesRef->right = node; - } + } if ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->right,visible))) { bestNodesRef->right = node; - } + } } } return result; diff --git a/server/synctex_parser_local.h b/server/synctex_parser_local.h index 89fd136..b53439f 100644 --- a/server/synctex_parser_local.h +++ b/server/synctex_parser_local.h @@ -1,45 +1,3 @@ -/* -Copyright (c) 2008, 2009, 2010 , 2011 jerome DOT laurens AT u-bourgogne DOT fr - -This file is part of the SyncTeX package. - -Latest Revision: Tue Jun 14 08:23:30 UTC 2011 - -Version: 1.18 - -See synctex_parser_readme.txt for more details - -License: --------- -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE - -Except as contained in this notice, the name of the copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in this Software without prior written -authorization from the copyright holder. - -*/ - -/* This local header file is for TEXLIVE, use your own header to fit your system */ -# include /* for inline && HAVE_xxx */ -/* No inlining for synctex tool in texlive. */ -# define SYNCTEX_INLINE +#include +#define printf(fmt, args...) (fprintf (stderr, (fmt), ## args)) +#define SYNCTEX_INLINE -- cgit v1.0