diff options
| author | Andreas Politz <politza@hochschule-trier.de> | 2019-12-08 18:11:48 +0100 |
|---|---|---|
| committer | Andreas Politz <politza@hochschule-trier.de> | 2019-12-28 11:05:12 +0100 |
| commit | 69853ffc9b320136aa3ff2b027af843bffa8aa94 (patch) | |
| tree | eb40b0d94de64d20036d40e51b4a4c2e5f6b084f | |
| parent | 1116b3342cf6d50c2bec5710bbe5be7aec2db24b (diff) | |
Prepare for update of synctex
| -rw-r--r-- | server/Makefile.am | 9 | ||||
| -rw-r--r-- | server/synctex_parser.c | 50 | ||||
| -rw-r--r-- | 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)<SYNCTEX_STATUS_OK) { _synctex_error("Unexpected end of nested sheet (3)."); SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR); @@ -2747,7 +2745,7 @@ return_on_error: /* remove the last path extension if any */ _synctex_strip_last_path_extension(synctex_name); if (!strlen(synctex_name)) { - goto return_on_error; + goto return_on_error; } /* now insert quotes. */ if (add_quotes) { @@ -3457,7 +3455,7 @@ synctex_status_t synctex_display_query(synctex_scanner_t scanner,const char * na SYNCTEX_CUR += SYNCTEX_END - SYNCTEX_START; SYNCTEX_START = SYNCTEX_END; SYNCTEX_END = SYNCTEX_START + size*sizeof(synctex_node_t *); - } + } *(synctex_node_t *)SYNCTEX_CUR = node; SYNCTEX_CUR += sizeof(synctex_node_t); } @@ -3475,7 +3473,7 @@ synctex_status_t synctex_display_query(synctex_scanner_t scanner,const char * na SYNCTEX_CUR += SYNCTEX_END - SYNCTEX_START; SYNCTEX_START = SYNCTEX_END; SYNCTEX_END = SYNCTEX_START + size*sizeof(synctex_node_t *); - } + } *(synctex_node_t *)SYNCTEX_CUR = node; SYNCTEX_CUR += sizeof(synctex_node_t); } @@ -3492,7 +3490,7 @@ synctex_status_t synctex_display_query(synctex_scanner_t scanner,const char * na SYNCTEX_CUR += SYNCTEX_END - SYNCTEX_START; SYNCTEX_START = SYNCTEX_END; SYNCTEX_END = SYNCTEX_START + size*sizeof(synctex_node_t *); - } + } *(synctex_node_t *)SYNCTEX_CUR = node; SYNCTEX_CUR += sizeof(synctex_node_t); } @@ -3683,7 +3681,7 @@ end: if ((other_node = SYNCTEX_NEXT_hbox(node))) { do { if (_synctex_point_in_box(hitPoint,other_node,synctex_YES)) { - node = _synctex_smallest_container(other_node,node); + node = _synctex_smallest_container(other_node,node); } } while((other_node = SYNCTEX_NEXT_hbox(other_node))); } @@ -3938,7 +3936,7 @@ synctex_bool_t _synctex_point_in_box(synctex_point_t hitPoint, synctex_node_t no return synctex_YES; } } - return synctex_NO; + return synctex_NO; } int _synctex_node_distance_to_point(synctex_point_t hitPoint, synctex_node_t node, synctex_bool_t visible) { @@ -4127,7 +4125,7 @@ SYNCTEX_INLINE static int __synctex_eq_get_closest_children_in_hbox(synctex_poin } } } else if (off7 == 0) { - /* hitPoint is inside node. */ + /* hitPoint is inside node. */ bestDistancesRef->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 <w2c/c-auto.h> /* for inline && HAVE_xxx */ -/* No inlining for synctex tool in texlive. */ -# define SYNCTEX_INLINE +#include <stdio.h> +#define printf(fmt, args...) (fprintf (stderr, (fmt), ## args)) +#define SYNCTEX_INLINE |
