summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Laurens <jerome.laurens@u-bourgogne.fr>2015-06-25 11:46:28 +0000
committerJérôme Laurens <jerome.laurens@u-bourgogne.fr>2015-06-25 11:46:28 +0000
commite3191d237c77eb4ac2cd6e591e6f38e61e4596d3 (patch)
tree0cedacfa3de183e9083b59f6cee98a88b006a5c3
parent1b7704686ccfb0748886fdbf3f462db99cdff471 (diff)
SyncTeX (no engine concerned): parser version -> 1.18, CLI version 1.3, see readme.
git-svn-id: svn://tug.org/texlive/trunk@37669 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_main.c38
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser.c23
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser.h9
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser_c-auto.h44
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser_local.h2
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser_readme.txt6
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser_utils.c2
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser_utils.h2
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser_version.txt2
9 files changed, 89 insertions, 39 deletions
diff --git a/Build/source/texk/web2c/synctexdir/synctex_main.c b/Build/source/texk/web2c/synctexdir/synctex_main.c
index cf07d4cdfca..17753e1f0ef 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_main.c
+++ b/Build/source/texk/web2c/synctexdir/synctex_main.c
@@ -5,7 +5,7 @@ This file is part of the SyncTeX package.
Latest Revision: Tue Jan 14 09:55:00 UTC 2014
-Version: 1.17
+Version: 1.18
License:
--------
@@ -59,11 +59,17 @@ This file is named "synctex_main.c".
This is the command line interface to the synctex_parser.c.
*/
-#ifdef __linux__
-#define _ISOC99_SOURCE /* to get the fmax() prototype */
-#endif
+# define SYNCTEX_CLI_VERSION_STRING "1.3"
+
+# ifdef __linux__
+# define _ISOC99_SOURCE /* to get the fmax() prototype */
+# endif
-# include <w2c/c-auto.h> /* for inline && HAVE_xxx */
+# ifdef __SYNCTEX_WORK__
+# include <synctex_parser_c-auto.h> /* for inline && HAVE_xxx */
+# else
+# include <w2c/c-auto.h> /* for inline && HAVE_xxx */
+# endif
# include <stdlib.h>
# include <stdio.h>
@@ -116,7 +122,7 @@ int synctex_test(int argc, char *argv[]);
int main(int argc, char *argv[])
{
int arg_index = 1;
- printf("This is SyncTeX command line utility, version 1.2\n");
+ printf("This is SyncTeX command line utility, version " SYNCTEX_CLI_VERSION_STRING "\n");
if(arg_index<argc) {
if(0==strcmp("help",argv[arg_index])) {
if(++arg_index<argc) {
@@ -155,8 +161,8 @@ static void synctex_usage(const char * error,va_list ap) {
}
fprintf((error?stderr:stdout),
"usage: synctex <subcommand> [options] [args]\n"
- "Synchronize TeXnology command-line client, version 1.17\n\n"
- "The Synchronization TeXnology by Jérôme Laurens is a new feature of recent TeX engines.\n"
+ "Synchronize TeXnology command-line client, version " SYNCTEX_VERSION_STRING "\n\n"
+ "The Synchronization TeXnology by Jérôme Laurens is a rather new feature of recent TeX engines.\n"
"It allows to synchronize between input and output, which means to\n"
"navigate from the source document to the typeset material and vice versa.\n\n"
);
@@ -276,10 +282,10 @@ int synctex_view(int argc, char *argv[]) {
return -1;
}
start = argv[arg_index];
- Ps.line = strtol(start,&end,10);
+ Ps.line = (int)strtol(start,&end,10);
if(end>start && strlen(end)>0 && *end==':') {
start = end+1;
- Ps.column = strtol(start,&end,10);
+ Ps.column = (int)strtol(start,&end,10);
if(end == start || Ps.column < 0) {
Ps.column = 0;
}
@@ -340,7 +346,7 @@ option_hint:
Ps.before = argv[arg_index];
*Ps.after = '\0';
++Ps.after;
- Ps.offset = strtoul(Ps.after,&Ps.middle,10);
+ Ps.offset = (int)strtoul(Ps.after,&Ps.middle,10);
if(Ps.middle>Ps.after && strlen(Ps.middle)>2) {
Ps.after = strstr(++Ps.middle,"/");
if(NULL != Ps.after) {
@@ -390,7 +396,6 @@ int synctex_view_proceed(synctex_view_params_t * Ps) {
char * where = NULL;
char * buffer = NULL;
char * buffer_cur = NULL;
- int printed = 0;
int status = 0;
/* Preparing the buffer where everything will be printed */
size = strlen(viewer)+3*sizeof(int)+6*sizeof(float)+4*(SYNCTEX_STR_SIZE);
@@ -425,7 +430,7 @@ int synctex_view_proceed(synctex_view_params_t * Ps) {
while(viewer && (where = strstr(viewer,"&{"))) {
#define TEST(KEY,FORMAT,WHAT)\
if(!strncmp(where,KEY,strlen(KEY))) {\
- printed = where-viewer;\
+ size_t printed = where-viewer;\
if(buffer_cur != memcpy(buffer_cur,viewer,(size_t)printed)) {\
synctex_help_view("Memory copy problem");\
free(buffer);\
@@ -583,7 +588,7 @@ int synctex_edit(int argc, char *argv[]) {
return -1;
}
start = argv[arg_index];
- Ps.page = strtol(start,&end,10);
+ Ps.page = (int)strtol(start,&end,10);
if(end>start && strlen(end)>1 && *end==':') {
start = end+1;
Ps.x = strtod(start,&end);
@@ -640,7 +645,7 @@ option_hint:
start = argv[arg_index];
end = NULL;
- Ps.offset = strtol(start,&end,10);
+ Ps.offset = (int)strtol(start,&end,10);
if(end>start && strlen(end)>1 && *end==':') {
Ps.context = end+1;
return synctex_edit_proceed(&Ps);
@@ -680,7 +685,6 @@ int synctex_edit_proceed(synctex_edit_params_t * Ps) {
char * where = NULL;
char * buffer = NULL;
char * buffer_cur = NULL;
- int printed;
int status;
size = strlen(Ps->editor)+3*sizeof(int)+3*SYNCTEX_STR_SIZE;
buffer = malloc(size+1);
@@ -709,7 +713,7 @@ int synctex_edit_proceed(synctex_edit_params_t * Ps) {
while(Ps->editor && (where = strstr(Ps->editor,"&{"))) {
#define TEST(KEY,FORMAT,WHAT)\
if(!strncmp(where,KEY,strlen(KEY))) {\
- printed = where-Ps->editor;\
+ size_t printed = where-Ps->editor;\
if(buffer_cur != memcpy(buffer_cur,Ps->editor,(size_t)printed)) {\
synctex_help_edit("Memory copy problem");\
free(buffer);\
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser.c b/Build/source/texk/web2c/synctexdir/synctex_parser.c
index 3175495ffdb..5b28ace6414 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser.c
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser.c
@@ -5,7 +5,7 @@ This file is part of the SyncTeX package.
Latest Revision: Tue Jun 14 08:23:30 UTC 2011
-Version: 1.17
+Version: 1.18
See synctex_parser_readme.txt for more details
@@ -1075,7 +1075,7 @@ static void _synctex_display_boundary(synctex_node_t node) {
* status == SYNCTEX_STATUS_EOF means the function did not work as expected and there is no more material.
* status<SYNCTEX_STATUS_EOF means an error
*/
-typedef int synctex_status_t;
+
/* When the end of the synctex file has been reached: */
# define SYNCTEX_STATUS_EOF 0
/* When the function could not return the value it was asked for: */
@@ -1108,7 +1108,7 @@ synctex_status_t _synctex_scan_input(synctex_scanner_t scanner);
synctex_status_t _synctex_scan_preamble(synctex_scanner_t scanner);
synctex_status_t _synctex_scan_float_and_dimension(synctex_scanner_t scanner, float * value_ref);
synctex_status_t _synctex_scan_post_scriptum(synctex_scanner_t scanner);
-int _synctex_scan_postamble(synctex_scanner_t scanner);
+synctex_status_t _synctex_scan_postamble(synctex_scanner_t scanner);
synctex_status_t _synctex_setup_visible_box(synctex_node_t box);
synctex_status_t _synctex_hbox_setup_visible(synctex_node_t node,int h, int v);
synctex_status_t _synctex_scan_sheet(synctex_scanner_t scanner, synctex_node_t parent);
@@ -1118,7 +1118,6 @@ int synctex_scanner_pre_x_offset(synctex_scanner_t scanner);
int synctex_scanner_pre_y_offset(synctex_scanner_t scanner);
const char * synctex_scanner_get_output_fmt(synctex_scanner_t scanner);
int _synctex_node_is_box(synctex_node_t node);
-int _synctex_bail(void);
/* Try to ensure that the buffer contains at least size bytes.
* Passing a huge size argument means the whole buffer length.
@@ -1157,7 +1156,7 @@ synctex_status_t _synctex_buffer_get_available_size(synctex_scanner_t scanner, s
}
SYNCTEX_CUR = SYNCTEX_START + available; /* the next character after the move, will change. */
/* Fill the buffer up to its end */
- already_read = gzread(SYNCTEX_FILE,(void *)SYNCTEX_CUR,SYNCTEX_BUFFER_SIZE - available);
+ already_read = gzread(SYNCTEX_FILE,(void *)SYNCTEX_CUR,(int)(SYNCTEX_BUFFER_SIZE - available));
if (already_read>0) {
/* We assume that 0<already_read<=SYNCTEX_BUFFER_SIZE - available, such that
* SYNCTEX_CUR + already_read = SYNCTEX_START + available + already_read <= SYNCTEX_START + SYNCTEX_BUFFER_SIZE */
@@ -1824,8 +1823,8 @@ report_record_problem:
* a negative error otherwise
* The postamble comprises the post scriptum section.
*/
-int _synctex_scan_postamble(synctex_scanner_t scanner) {
- int status = 0;
+synctex_status_t _synctex_scan_postamble(synctex_scanner_t scanner) {
+ synctex_status_t status = 0;
if (NULL == scanner) {
return SYNCTEX_STATUS_BAD_ARGUMENT;
}
@@ -2081,7 +2080,6 @@ scan_anchor:
}
goto prepare_loop;
}
- _synctex_bail();
/* The child loop means that we go down one level, when we just created a box node,
* the next node created is a child of this box. */
child_loop:
@@ -2340,7 +2338,6 @@ scan_xobh:
goto child_loop;
}
}
- _synctex_bail();
/* The vertical loop means that we are on the same level, for example when we just ended a box.
* If a node is created now, it will be a sibling of the current node, sharing the same parent. */
sibling_loop:
@@ -3428,7 +3425,7 @@ synctex_node_t synctex_sheet_content(synctex_scanner_t scanner,int page) {
# pragma mark Query
# endif
-int synctex_display_query(synctex_scanner_t scanner,const char * name,int line,int column) {
+synctex_status_t synctex_display_query(synctex_scanner_t scanner,const char * name,int line,int column) {
# ifdef __DARWIN_UNIX03
# pragma unused(column)
# endif
@@ -3644,7 +3641,7 @@ SYNCTEX_INLINE static synctex_node_t _synctex_eq_closest_child(synctex_point_t h
#define SYNCTEX_MASK_LEFT 1
#define SYNCTEX_MASK_RIGHT 2
-int synctex_edit_query(synctex_scanner_t scanner,int page,float h,float v) {
+synctex_status_t synctex_edit_query(synctex_scanner_t scanner,int page,float h,float v) {
synctex_node_t sheet = NULL;
synctex_node_t node = NULL; /* placeholder */
synctex_node_t other_node = NULL; /* placeholder */
@@ -3747,10 +3744,6 @@ end:
# pragma mark Utilities
# endif
-int _synctex_bail(void) {
- _synctex_error("SyncTeX ERROR\n");
- return -1;
-}
/* Rougly speaking, this is:
* node's h coordinate - hitPoint's h coordinate.
* If node is to the right of the hit point, then this distance is positive,
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser.h b/Build/source/texk/web2c/synctexdir/synctex_parser.h
index 3151707623d..2c1911e0eea 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser.h
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser.h
@@ -5,7 +5,7 @@ This file is part of the SyncTeX package.
Latest Revision: Tue Jun 14 08:23:30 UTC 2011
-Version: 1.17
+Version: 1.18
See synctex_parser_readme.txt for more details
@@ -59,6 +59,8 @@ Thu Jun 19 09:39:21 UTC 2008
extern "C" {
#endif
+# define SYNCTEX_VERSION_STRING "1.18"
+
/* synctex_node_t is the type for all synctex nodes.
* The synctex file is parsed into a tree of nodes, either sheet, boxes, math nodes... */
typedef struct _synctex_node * synctex_node_t;
@@ -162,8 +164,9 @@ synctex_scanner_t synctex_scanner_parse(synctex_scanner_t scanner);
* Sumatra-PDF, Skim, iTeXMac2 and Texworks are examples of open source software that use this library.
* You can browse their code for a concrete implementation.
*/
-int synctex_display_query(synctex_scanner_t scanner,const char * name,int line,int column);
-int synctex_edit_query(synctex_scanner_t scanner,int page,float h,float v);
+typedef long synctex_status_t;
+synctex_status_t synctex_display_query(synctex_scanner_t scanner,const char * name,int line,int column);
+synctex_status_t synctex_edit_query(synctex_scanner_t scanner,int page,float h,float v);
synctex_node_t synctex_next_result(synctex_scanner_t scanner);
/* Display all the information contained in the scanner object.
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser_c-auto.h b/Build/source/texk/web2c/synctexdir/synctex_parser_c-auto.h
new file mode 100644
index 00000000000..872bef76a0c
--- /dev/null
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser_c-auto.h
@@ -0,0 +1,44 @@
+/*
+Copyright (c) 2005 jerome DOT laurens AT u-bourgogne DOT fr
+
+This file is part of the SyncTeX package.
+
+Latest Revision: Jeu 25 jui 2015 10:10:58 UTC
+
+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 OS X, use your own header to fit your system */
+#define HAVE_STRLCAT
+#define HAVE_STRLCPY
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser_local.h b/Build/source/texk/web2c/synctexdir/synctex_parser_local.h
index fd0e76a2af9..89fd1369659 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser_local.h
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser_local.h
@@ -5,7 +5,7 @@ This file is part of the SyncTeX package.
Latest Revision: Tue Jun 14 08:23:30 UTC 2011
-Version: 1.17
+Version: 1.18
See synctex_parser_readme.txt for more details
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser_readme.txt b/Build/source/texk/web2c/synctexdir/synctex_parser_readme.txt
index 4265cf423e9..0243f5353b4 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser_readme.txt
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser_readme.txt
@@ -162,6 +162,12 @@ TeX and friends are not concerned by these changes.
- fixed a segfault, from Sebastian Ramacher
1.17: Mon Aug 04
- fixed a memory leak
+1.18: Thu Jun 25 11:36:05 UTC 2015
+- nested sheets now fully supported (does it make sense in TeX)
+- cosmetic changes: uniform indentation
+- suppression of warnings, mainly long/int ones. In short, zlib likes ints when size_t likes longs.
+- CLI synctex tool can build out of TeXLive (modulo appropriate options passed to the compiler)
+
Acknowledgments:
----------------
The author received useful remarks from the pdfTeX developers, especially Hahn The Thanh,
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
index 2fef636d59b..0e9fd0e5be6 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
@@ -5,7 +5,7 @@ This file is part of the SyncTeX package.
Latest Revision: Tue Jun 14 08:23:30 UTC 2011
-Version: 1.17
+Version: 1.18
See synctex_parser_readme.txt for more details
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.h b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.h
index db19b2dadcc..9c76ac528d2 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.h
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.h
@@ -5,7 +5,7 @@ This file is part of the SyncTeX package.
Latest Revision: Tue Jun 14 08:23:30 UTC 2011
-Version: 1.17
+Version: 1.18
See synctex_parser_readme.txt for more details
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser_version.txt b/Build/source/texk/web2c/synctexdir/synctex_parser_version.txt
index 68209c0009f..d907c153cf6 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser_version.txt
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser_version.txt
@@ -1 +1 @@
-1.17 \ No newline at end of file
+1.18 \ No newline at end of file