From 82f46b64283b299b045a0295a09aadc11c644e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LAURENS=20J=C3=A9r=C3=B4me?= Date: Fri, 20 Mar 2026 16:42:02 +0100 Subject: [PATCH 1/3] Parser version 1.31 --- synctex_parser_version.txt | 2 +- synctex_version.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/synctex_parser_version.txt b/synctex_parser_version.txt index 57432cb..d0911c8 100644 --- a/synctex_parser_version.txt +++ b/synctex_parser_version.txt @@ -1 +1 @@ -1.30 +1.31 diff --git a/synctex_version.h b/synctex_version.h index 908ea7b..78ce3d9 100644 --- a/synctex_version.h +++ b/synctex_version.h @@ -56,10 +56,10 @@ I would appreciate to be listed as contributor and see "__SyncTeX__" highlighted /* The version of the synctex parser library */ # define SYNCTEX_VERSION_MAJOR 1 -# define SYNCTEX_VERSION_MINOR 30 +# define SYNCTEX_VERSION_MINOR 31 /* Keep next value in synch with `synctex_parser_version.txt` contents. */ -# define SYNCTEX_VERSION_STRING "1.30" +# define SYNCTEX_VERSION_STRING "1.31" /* The version of the synctex CLI tool */ # define SYNCTEX_CLI_VERSION_MAJOR 1 From 9bd207fa7061adeb854decfeeb5d8dbbf3491c97 Mon Sep 17 00:00:00 2001 From: unbadfish <3066893506@qq.com> Date: Mon, 20 Apr 2026 20:03:38 +0800 Subject: [PATCH 2/3] chore: change some windows API form W(default) to A --- synctex_parser_utils.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/synctex_parser_utils.c b/synctex_parser_utils.c index e82d1e3..86139c3 100644 --- a/synctex_parser_utils.c +++ b/synctex_parser_utils.c @@ -1,15 +1,15 @@ -/* +/* Copyright (c) 2008-2024 jerome DOT laurens AT u-bourgogne DOT fr - + This file is part of the __SyncTeX__ package. - + Version: see synctex_version.h Latest Revision: Thu Mar 21 14:12:58 UTC 2024 See `synctex_parser_readme.md` 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 @@ -18,10 +18,10 @@ 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 @@ -30,7 +30,7 @@ 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 @@ -165,8 +165,8 @@ void _synctex_strip_last_path_extension(char * string) { char * last_component = NULL; char * last_extension = NULL; # if defined(SYNCTEX_WINDOWS) - last_component = PathFindFileName(string); - last_extension = PathFindExtension(string); + last_component = PathFindFileNameA(string); + last_extension = PathFindExtensionA(string); if(last_extension == NULL)return; if(last_component == NULL)last_component = string; if(last_extension>last_component){/* filter out paths like "my/dir/.hidden" */ @@ -371,7 +371,7 @@ char * _synctex_merge_strings(const char * first,...) { _synctex_error("! _synctex_merge_strings: Memory problem"); return NULL; } - return NULL; + return NULL; } /* The purpose of _synctex_get_name is to find the name of the synctex file. @@ -552,7 +552,7 @@ int _synctex_get_name(const char * output, const char * build_directory, char ** } const char * _synctex_get_io_mode_name(synctex_io_mode_t io_mode) { - static const char * synctex_io_modes[4] = {"r","rb","a","ab"}; + static const char * synctex_io_modes[4] = {"r","rb","a","ab"}; unsigned index = ((io_mode & synctex_io_gz_mask)?1:0) + ((io_mode & synctex_io_append_mask)?2:0);// bug pointed out by Jose Alliste return synctex_io_modes[index]; } @@ -564,7 +564,7 @@ static int _synctex_parse_int_C(char * ptr, char ** endptr) { } /** * This was initially suggested by user202729. - * + * */ static int _synctex_parse_int_raw1(char * ptr, char ** endptr) { int result = 0; From bbb6015466c76ad252db968a5c3a1601cce86664 Mon Sep 17 00:00:00 2001 From: unbadfish <3066893506@qq.com> Date: Mon, 20 Apr 2026 20:36:23 +0800 Subject: [PATCH 3/3] set ATTRIBUTE-related marco to dummy in windows --- synctex_parser_utils.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/synctex_parser_utils.h b/synctex_parser_utils.h index 54a0557..def942d 100644 --- a/synctex_parser_utils.h +++ b/synctex_parser_utils.h @@ -1,13 +1,13 @@ -/* +/* Copyright (c) 2008-2024 jerome DOT laurens AT u-bourgogne DOT fr - + This file is part of the __SyncTeX__ package. - + Version: see synctex_version.h Latest Revision: Thu Mar 21 14:12:58 UTC 2024 See `synctex_parser_readme.md` for more details - + ## License Permission is hereby granted, free of charge, to any person @@ -31,9 +31,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. */ @@ -73,13 +73,13 @@ extern "C" { # define SYNCTEX_CASE_SENSITIVE_PATH 1 # define SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c) # endif - + # if defined(_WIN32) || defined(__OS2__) # define SYNCTEX_IS_DOT(c) ('.' == c) # else # define SYNCTEX_IS_DOT(c) ('.' == c) # endif - + # if SYNCTEX_CASE_SENSITIVE_PATH # define SYNCTEX_ARE_PATH_CHARACTERS_EQUAL(left,right) (left != right) # else @@ -87,11 +87,11 @@ extern "C" { # endif # if defined(_MSC_VER) -# define SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK) ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK) +# define SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK) # else # define SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK) __attribute__((__format__ (__printf__, (STRING_INDEX), (FIRST_TO_CHECK)))) # endif - + /* This custom malloc functions initializes to 0 the newly allocated memory. * There is no bzero function on windows. */ void *_synctex_malloc(size_t size); @@ -165,7 +165,7 @@ int _synctex_get_name(const char * output, const char * build_directory, char ** const char * _synctex_get_io_mode_name(synctex_io_mode_t io_mode); synctex_bool_t synctex_ignore_leading_dot_slash_in_path(const char ** name); - + synctex_bool_t synctex_ignore_leading_dot_slash_in_path(const char ** name); int synctex_parse_int(char * ptr, char ** endptr);