summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorJérôme Laurens <jerome.laurens@u-bourgogne.fr>2020-05-11 15:56:48 +0000
committerJérôme Laurens <jerome.laurens@u-bourgogne.fr>2020-05-11 15:56:48 +0000
commit996969c22f3cbfdc0a0aabe6e530a37f0e4b21b1 (patch)
tree51190360dd21976190cf3e41490392763d490a9c /Build/source
parent61ab31af1fb910f473beb20b02bfb09411755be7 (diff)
Synctex parser tool: Typos fixed, keyword added, added...
git-svn-id: svn://tug.org/texlive/trunk@55094 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/web2c/synctexdir/README.txt177
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_main.c8
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser.c82
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser.h10
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser_advanced.h2
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser_utils.c9
6 files changed, 57 insertions, 231 deletions
diff --git a/Build/source/texk/web2c/synctexdir/README.txt b/Build/source/texk/web2c/synctexdir/README.txt
index f8008e3cd75..6c7df4a7544 100644
--- a/Build/source/texk/web2c/synctexdir/README.txt
+++ b/Build/source/texk/web2c/synctexdir/README.txt
@@ -1,176 +1 @@
-# Copyright (c) 2008, 2009, 2010, 2011 jerome DOT laurens AT u-bourgogne DOT fr
-#
-# This file is part of the SyncTeX package.
-#
-# 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.
-#
-# Acknowledgments:
-# ----------------
-# The author received useful remarks from the pdfTeX developers, especially Hahn The Thanh,
-# and significant help from XeTeX developer Jonathan Kew
-#
-# Nota Bene:
-# ----------
-# If you include or use a significant part of the synctex package into a software,
-# I would appreciate to be listed as contributor and see "SyncTeX" highlighted.
-#
-# Version 1
-# Thu Jun 19 09:39:21 UTC 2008
-
-
-This file gives the .synctex file specifications.
-
-SyncTeX output file specifications, Version 2, Lun 31 mar 2008 13:50:31 UTC
-===========================================================================
-This is an EBNF file specification extended by ICU regex patterns
-(enclosed between 2 '/'s)
-
-The whole synctex file is made of various records gathered into four different sections:
-
-<synctex file> ::= <preamble> <contents> <postamble> <post scriptum>
-
-Each record is a sequence of text characters following an end of record mark or starting the file,
-and ending with an end of record mark.
-The first characters of a record will determine the type of the record.
-
-<end of record mark> ::= /\n/
-<end of record> ::= /[^\n]*/<end of record mark>
-
-The preamble:
--------------
-
-<preamble> ::= <control record> <input record>* <informations> <forthcoming records>
-
-<control record> ::= /SyncTeX Version:/<version><end of record mark>
-<SyncTeX> ::=
-<version> ::= /1/
-
-<input record> ::= /Input:/<tag information><end of record mark>
-<tag information> ::= <tag>/:/<file name><end of record mark>
-<tag> ::= <integer>
-<file name> ::= /[^<end of record mark>]*/
-This is used to give a shortcut to filenames.
-
-<informations> ::= <output record>? <magnification record>? <unit record>? <x offset record>? <y offset record>?
-
-<output record> ::= /Output:/<output><end of record mark>
-<output> ::= /dvi|pdf|xdv|[0-9a-zA-Z]*/
-
-<magnification record> ::= /Magnification:/<magnification><end of record>
-<magnification> ::= <integer>
-This is the TeX magnification.
-
-<unit record> ::= /Unit:<unit><end of record>/
-<unit> ::= <integer>
-The SyncTeX unit is <unit> scaled point, 1 in general, 8192 when not given.
-
-<x offset record> ::= /X Offset:/<x offset><end of record>
-<x offset> ::= <integer>
-<y offset record> ::= /Y Offset:/<y offset><end of record>
-<y offset> ::= <integer>
-The offset or the origin of the system of coordinates from the top left point of the page.
-This defaults to 1in for both the vertical and horizontal offsets.
-Both offsets are given in this section in scaled point unit.
-
-<forthcoming records>: The preamble, like any other section may contain in the future any other kind of record,
-except the one starting the next section. In order to ensure some forwards compatibility,
-parsers should anticipate and parse unknown records: an unexpected record should be silently ignored by the parser.
-This means that this format is somehow open an more types of records can be added without breaking existing software.
-
-The preamble ends when a record is found that fits the following section.
-
-The contents:
--------------
-<contents> ::= <contents record><sheet(1)><i line>*<sheet(2)><i line>*...<sheet(N)><i line>*
-
-<contents record>::=/Contents:/<byte offset><end of record>/
-<offset> ::= <byte offset>
-<sheet(n)> ::= <sheet(n) start><v content>*<sheet end>
-<sheet(n) start> ::= /{/<byte offset>/:/<the integer n><end of record>/
-<sheet end> ::= /}/<byte offset><end of record>
-
-<box content> ::= <vbox section>|<hbox section>|<void vbox record>|<void hbox record>
-<vbox section> ::= (<vbox start record><vbox content>*<vbox stop record>)|<box content>*
-<hbox content> ::= <glue record>|<kern record>|<math record>|<box content>
-<hbox section> ::= <hbox start record><box content>*<hbox stop record>
-
-<void vbox record> ::= /v/<link>/:/<point>/:/<size><end of record>
-<void hbox record> ::= /h/<link>/:/<point>/:/<size><end of record>
-<size> ::= <W>/,/<H>/,/<D>
-<W> ::= <integer>
-<H> ::= <integer>
-<D> ::= <integer>
-<link> ::= <tag>/,/<line>(/,/<column>)?
-<line> ::= <integer>
-<column> ::= <integer>
-
-<current record> ::= /x/<link>/:/<point><end of record>
-<kern record> ::= /k/<link>/:/<point>/:/<W><end of record>
-<glue record> ::= /g/<link>/:/<point><end of record>
-<math record> ::= /$/<link>/:/<point><end of record>
-
-The byte offset is an implicit anchor to navigate the synctex file from sheet to sheet.
-
-The postamble:
---------------
-The postamble closes the file
-If there is no postamble, it means that the typesetting process did not end correctly.
-<postamble> ::= <postamble record><number of objects record>
-
-<postamble record> ::= /Postamble:/<byte offset><end of record>
-<number of objects record> ::= /Count:/<integer><end of record>
-
-The post scriptum:
-------------------
-The post scriptum contains material possibly added by 3rd parties.
-It allows to append some transformation (shift and magnify).
-Typically, one applies a dvi to pdf filter with offset options and magnification,
-then he appends the same options to the synctex file, for example
-
- dvipdfmx -m 0.486 -x 9472573sp -y 13.3dd source.dvi
- echo "X Offset:9472573" >> source.synctex
- echo "Y Offset:13.3dd" >> source.synctex
- echo "Magnification:0.486" >> source.synctex
-
-
-<post scriptum> ::= (<magnification line>|<x offset line>|<y offset line>)*
-<magnification line> ::= /Magnification:/<post magnification><end of line mark>
-<post magnification> ::= <unsigned decimal float>
-<x offset line> ::= /X Offset:/<post x offset><end of line mark>
-<post x offset> ::= <sign><unsigned decimal float><offset unit>
-<y offset> ::= <x offset>
-<sign> ::= /(+|-)?/
-<offset unit> ::= /(in|cm|mm|pt|bp|pc|sp|dd|cc|nd|nc)?/
-<end of line mark> ::= /[\n\r]*/
-<y offset line> ::= /Y Offset:/<post y offset><end of line mark>
-<post y offset> ::= <sign><unsigned decimal float><offset unit>
-
-This second information will override the offset and magnification previously available in the preamble section.
-All the numbers are encoded using the decimal representation with "C" locale.
-
+The .synctex file specifications is now available as a man page with `man 5 synctex`.
diff --git a/Build/source/texk/web2c/synctexdir/synctex_main.c b/Build/source/texk/web2c/synctexdir/synctex_main.c
index 01f269673f5..ea676eacc1a 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_main.c
+++ b/Build/source/texk/web2c/synctexdir/synctex_main.c
@@ -382,7 +382,7 @@ int synctex_view_proceed(synctex_view_params_t * Ps) {
printf("input:%s\n",Ps->input);
printf("viewer:%s\n",Ps->viewer);
printf("before:%s\n",Ps->before);
- printf("offset:%i\n",Ps->offset);
+ printf("offset:%u\n",Ps->offset);
printf("middle:%s\n",Ps->middle);
printf("after:%s\n",Ps->after);
printf("output:%s\n",Ps->output);
@@ -466,7 +466,7 @@ int synctex_view_proceed(synctex_view_params_t * Ps) {
TEST("&{width}", "%f",fabs(synctex_node_box_visible_width(node)));
TEST("&{height}","%f",fmax(synctex_node_box_visible_height(node)+synctex_node_box_visible_depth(node),1));
TEST("&{before}","%s",(Ps->before && strlen(Ps->before)<SYNCTEX_STR_SIZE?Ps->before:""));
- TEST("&{offset}","%i",Ps->offset);
+ TEST("&{offset}","%u",Ps->offset);
TEST("&{middle}","%s",(Ps->middle && strlen(Ps->middle)<SYNCTEX_STR_SIZE?Ps->middle:""));
TEST("&{after}", "%s",(Ps->after && strlen(Ps->after)<SYNCTEX_STR_SIZE?Ps->after:""));
# undef TEST
@@ -673,7 +673,7 @@ int synctex_edit_proceed(synctex_edit_params_t * Ps) {
printf("y:%f\n",Ps->y);
printf("almost output:%s\n",Ps->output);
printf("editor:%s\n",Ps->editor);
- printf("offset:%i\n",Ps->offset);
+ printf("offset:%u\n",Ps->offset);
printf("context:%s\n",Ps->context);
printf("cwd:%s\n",getcwd(NULL,0));
#endif
@@ -743,7 +743,7 @@ int synctex_edit_proceed(synctex_edit_params_t * Ps) {
TEST("&{input}", "%s",input);
TEST("&{line}", "%i",synctex_node_line(node));
TEST("&{column}", "%i",-1);
- TEST("&{offset}", "%i",Ps->offset);
+ TEST("&{offset}", "%u",Ps->offset);
TEST("&{context}","%s",Ps->context);
# undef TEST
break;
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser.c b/Build/source/texk/web2c/synctexdir/synctex_parser.c
index f4f7d848e43..7fcbe0ce3a9 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser.c
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser.c
@@ -279,7 +279,7 @@ typedef synctex_node_p synctex_noxy_p;
* Free the given node by sending the free message.
* - parameter NODE: of type synctex_node_p
*/
-void synctex_node_free(synctex_node_p node) {
+static void synctex_node_free(synctex_node_p node) {
SYNCTEX_MSG_SEND(node,free);
}
# if defined(SYNCTEX_TESTING)
@@ -436,7 +436,7 @@ DEFINE_SYNCTEX_TREE_RESET(WHAT)
/*
* _synctex_tree_set_... methods return the old value.
* The return value of _synctex_tree_set_child and
- * _synctex_tree_set_sibling must be released somehown.
+ * _synctex_tree_set_sibling must be released somehow.
*/
DEFINE_SYNCTEX_TREE__GETSETRESET(sibling)
DEFINE_SYNCTEX_TREE_GETSETRESET(parent)
@@ -648,12 +648,12 @@ static synctex_open_s __synctex_open_v2(const char * output, synctex_io_mode_t i
quoteless_synctex_name = NULL;
}
}
- /* The operation is successfull, return the arguments by value. */
+ /* The operation is successful, return the arguments by value. */
open.status = SYNCTEX_STATUS_OK;
return open;
}
-/* Opens the ouput file, taking into account the eventual build_directory.
+/* Opens the output file, taking into account the eventual build_directory.
* - returns: an open structure which status is
* SYNCTEX_STATUS_OK on success,
* SYNCTEX_STATUS_ERROR on failure.
@@ -707,7 +707,7 @@ static synctex_open_s _synctex_open_v2(const char * output, const char * build_d
} /* if (build_directory...) */
return open;
}
-void synctex_reader_free(synctex_reader_p reader) {
+static void synctex_reader_free(synctex_reader_p reader) {
if (reader) {
_synctex_free(reader->output);
_synctex_free(reader->synctex);
@@ -720,7 +720,7 @@ void synctex_reader_free(synctex_reader_p reader) {
* Return reader on success.
* Deallocate reader and return NULL on failure.
*/
-synctex_reader_p synctex_reader_init_with_output_file(synctex_reader_p reader, const char * output, const char * build_directory) {
+static synctex_reader_p synctex_reader_init_with_output_file(synctex_reader_p reader, const char * output, const char * build_directory) {
if (reader) {
/* now open the synctex file */
synctex_open_s open = _synctex_open_v2(output,build_directory,0,synctex_ADD_QUOTES);
@@ -2828,20 +2828,6 @@ synctex_node_p synctex_node_next(synctex_node_p node) {
return _synctex_node_sibling_or_parents(node);
}
/**
- * The next nodes corresponds to a deep first tree traversal.
- * Does not create child proxies as side effect contrary to
- * the synctex_node_next method above.
- * May loop infinitely many times if the tree
- * is not properly built (contains loops).
- */
-synctex_node_p _synctex_node_next(synctex_node_p node) {
- synctex_node_p N = _synctex_tree_child(node);
- if (N) {
- return N;
- }
- return _synctex_node_sibling_or_parents(node);
-}
-/**
* The node which argument is the sibling.
* - return: NULL if the argument has no parent or
* is the first child of its parent.
@@ -5165,7 +5151,7 @@ main_loop:
/* At least 1 more character */
zs = _synctex_buffer_get_available_size(scanner,1);
if (zs.size == 0){
- _synctex_error("Uncomplete synctex file, postamble missing.");
+ _synctex_error("Incomplete synctex file, postamble missing.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
goto main_loop;
@@ -5182,13 +5168,13 @@ ignore_loop:
--ignored_form_depth;
}
if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {
- _synctex_error("Uncomplete container.");
+ _synctex_error("Incomplete container.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
} else {
zs = _synctex_buffer_get_available_size(scanner,1);
if (zs.size == 0){
- _synctex_error("Uncomplete synctex file, postamble missing.");
+ _synctex_error("Incomplete synctex file, postamble missing.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
}
@@ -5264,7 +5250,7 @@ content_loop:
synctex_node_log(child);
# endif
if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {
- _synctex_error("Uncomplete container.");
+ _synctex_error("Incomplete container.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
last_k = last_g = NULL;
@@ -5373,7 +5359,7 @@ content_loop:
sibling = _synctex_tree_child(parent);
_synctex_data_set_point(sibling,_synctex_data_point_V(parent));
if (last_k && last_g && (child = synctex_node_child(parent))) {
- /* Find the node preceeding last_k */
+ /* Find the node preceding last_k */
synctex_node_p next;
while ((next = __synctex_tree_sibling(child))) {
if (next == last_k) {
@@ -5397,7 +5383,7 @@ content_loop:
# endif
}
if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {
- _synctex_error("Uncomplete container.");
+ _synctex_error("Incomplete container.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
last_k = last_g = NULL;
@@ -5678,7 +5664,7 @@ _synctex_make_hbox_contain_box(parent,_synctex_data_box(child));
}
zs = _synctex_buffer_get_available_size(scanner,1);
if (zs.size == 0){
- _synctex_error("Uncomplete synctex file, postamble missing.");
+ _synctex_error("Incomplete synctex file, postamble missing.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
last_k = last_g = NULL;
@@ -5944,11 +5930,11 @@ SYNCTEX_INLINE static synctex_status_t _synctex_post_process(synctex_scanner_p s
/* Used when parsing the synctex file
*/
static synctex_status_t _synctex_scan_content(synctex_scanner_p scanner) {
- scanner->reader->lastv = -1;
- synctex_status_t status = 0;
if (NULL == scanner) {
return SYNCTEX_STATUS_BAD_ARGUMENT;
}
+ scanner->reader->lastv = -1;
+ synctex_status_t status = 0;
/* Find where this section starts */
content_not_found:
status = _synctex_match_string(scanner,"Content:");
@@ -5956,7 +5942,7 @@ content_not_found:
return status;
}
if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {
- _synctex_error("Uncomplete Content.");
+ _synctex_error("Incomplete Content.");
return SYNCTEX_STATUS_ERROR;
}
if (status == SYNCTEX_STATUS_NOT_OK) {
@@ -6062,8 +6048,8 @@ synctex_scanner_p synctex_scanner_parse(synctex_scanner_p scanner) {
scanner->pre_magnification = 1000;
scanner->pre_unit = 8192;
scanner->pre_x_offset = scanner->pre_y_offset = 578;
- /* initialize the offset with a fake unprobable value,
- * If there is a post scriptum section, this value will be overriden by the real life value */
+ /* initialize the offset with a fake improbable value,
+ * If there is a post scriptum section, this value will be overridden by the real life value */
scanner->x_offset = scanner->y_offset = 6.027e23f;
scanner->reader->line_number = 1;
@@ -7613,7 +7599,7 @@ static synctex_nd_s _synctex_point_h_ordered_distance_v2
width = _synctex_data_width(node);
min = _synctex_data_h(node);
max = min + (width>0?width:-width);
- /* We allways have min <= max */
+ /* We always have min <= max */
if (hit->h<min) {
nd.distance = min - hit->h; /* regions 1+4+7, result is > 0 */
} else if (hit->h>max) {
@@ -7627,7 +7613,7 @@ static synctex_nd_s _synctex_point_h_ordered_distance_v2
width = synctex_node_width(node);
min = synctex_node_h(node);
max = min + (width>0?width:-width);
- /* We allways have min <= max */
+ /* We always have min <= max */
if (hit->h<min) {
nd.distance = min - hit->h; /* regions 1+4+7, result is > 0 */
} else if (hit->h>max) {
@@ -7642,7 +7628,7 @@ static synctex_nd_s _synctex_point_h_ordered_distance_v2
width = synctex_node_hbox_width(node);
min = synctex_node_hbox_h(node);
max = min + (width>0?width:-width);
- /* We allways have min <= max */
+ /* We always have min <= max */
if (hit->h<min) {
nd.distance = min - hit->h; /* regions 1+4+7, result is > 0 */
} else if (hit->h>max) {
@@ -7754,7 +7740,7 @@ static synctex_nd_s _synctex_point_v_ordered_distance_v2
min = synctex_node_v(node);
max = min + _synctex_abs(_synctex_data_depth(node));
min -= _synctex_abs(_synctex_data_height(node));
- /* We allways have min <= max */
+ /* We always have min <= max */
if (hit->v<min) {
nd.distance = min - hit->v; /* regions 1+2+3, result is > 0 */
} else if (hit->v>max) {
@@ -7768,7 +7754,7 @@ static synctex_nd_s _synctex_point_v_ordered_distance_v2
min = synctex_node_v(node);
max = min + _synctex_abs(synctex_node_depth(node));
min -= _synctex_abs(synctex_node_height(node));
- /* We allways have min <= max */
+ /* We always have min <= max */
if (hit->v<min) {
nd.distance = min - hit->v; /* regions 1+2+3, result is > 0 */
} else if (hit->v>max) {
@@ -7785,7 +7771,7 @@ static synctex_nd_s _synctex_point_v_ordered_distance_v2
max = min + (depth>0?depth:-depth);
height = synctex_node_hbox_height(node);
min -= (height>0?height:-height);
- /* We allways have min <= max */
+ /* We always have min <= max */
if (hit->v<min) {
nd.distance = min - hit->v; /* regions 1+2+3, result is > 0 */
} else if (hit->v>max) {
@@ -7801,7 +7787,7 @@ static synctex_nd_s _synctex_point_v_ordered_distance_v2
min = _synctex_data_v(node);
max = min + _synctex_abs(_synctex_data_depth(_synctex_tree_parent(node)));
min -= _synctex_abs(_synctex_data_height(_synctex_tree_parent(node)));
- /* We allways have min <= max */
+ /* We always have min <= max */
if (hit->v<min) {
nd.distance = min - hit->v; /* regions 1+2+3, result is > 0 */
} else if (hit->v>max) {
@@ -8394,10 +8380,10 @@ typedef union {
gzFile as_gzFile;
FILE * as_FILE_p;
void * as_ptr;
-} syncex_file_u;
+} synctex_file_u;
struct synctex_updater_t {
- syncex_file_u file;
+ synctex_file_u file;
synctex_print_f print;
synctex_close_f close;
int length; /* the number of chars appended */
@@ -8560,6 +8546,20 @@ void synctex_updater_free(synctex_updater_p updater){
# pragma mark -
# pragma mark Testers
# endif
+/**
+ * The next nodes corresponds to a deep first tree traversal.
+ * Does not create child proxies as side effect contrary to
+ * the synctex_node_next method above.
+ * May loop infinitely many times if the tree
+ * is not properly built (contains loops).
+ */
+static synctex_node_p _synctex_node_next(synctex_node_p node) {
+ synctex_node_p N = _synctex_tree_child(node);
+ if (N) {
+ return N;
+ }
+ return _synctex_node_sibling_or_parents(node);
+}
static int _synctex_input_copy_name(synctex_node_p input, char * name) {
char * copy = _synctex_malloc(strlen(name)+1);
memcpy(copy,name,strlen(name)+1);
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser.h b/Build/source/texk/web2c/synctexdir/synctex_parser.h
index e54a0176a15..3a6a9018295 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser.h
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser.h
@@ -146,7 +146,7 @@ extern "C" {
/* The main entry points.
* Given the file name, a line and a column number, synctex_display_query returns the number of nodes
- * satisfying the contrain. Use code like
+ * satisfying the constrain. Use code like
*
* if(synctex_display_query(scanner,name,line,column,page_hint)>0) {
* synctex_node_p node;
@@ -165,7 +165,7 @@ extern "C" {
* - highlight just the character using that information
*
* Given the page and the position in the page, synctex_edit_query returns the number of nodes
- * satisfying the contrain. Use code like
+ * satisfying the constrain. Use code like
*
* if(synctex_edit_query(scanner,page,h,v)>0) {
* synctex_node_p node;
@@ -230,7 +230,7 @@ extern "C" {
* synctex_node_box_visible_depth(node)
* );
* The visible dimensions are bigger than real ones
- * to compensate 0 width boxes or nodes intentionnaly
+ * to compensate 0 width boxes or nodes intentionally
* put outside the box (using \kern for example).
* - parameter node: a node.
* - returns: a float.
@@ -248,7 +248,7 @@ extern "C" {
* as opposite to TeX coordinates.
* The origin is at the top left corner of the page.
* The visible dimensions are bigger than real ones
- * to compensate 0 width boxes or nodes intentionnaly
+ * to compensate 0 width boxes or nodes intentionally
* put outside the box (using \kern for example).
* All nodes have coordinates, but all nodes don't
* have non null size. For example, math nodes
@@ -389,7 +389,7 @@ extern "C" {
* The scanner owns a list of sheet siblings and
* a list of form siblings.
* Sheets or forms have one child which is a box:
- * theie contents.
+ * their contents.
* - argument page: 1 based sheet page number.
* - argument tag: 1 based form tag number.
*/
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser_advanced.h b/Build/source/texk/web2c/synctexdir/synctex_parser_advanced.h
index 867fbf7ed00..a7f04d80dab 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser_advanced.h
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser_advanced.h
@@ -449,7 +449,7 @@ extern "C" {
*/
void synctex_iterator_free(synctex_iterator_p iterator);
/**
- * Wether the iterator actually points to an object.
+ * Whether the iterator actually points to an object.
* - argument iterator: the object to iterate on...
*/
synctex_bool_t synctex_iterator_has_next(synctex_iterator_p iterator);
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
index c4f200d8754..4b4065dab64 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
@@ -48,7 +48,6 @@
#include <limits.h>
#include <ctype.h>
-#include <string.h>
#include <sys/stat.h>
@@ -87,7 +86,7 @@ void _synctex_free(void * ptr) {
# include <syslog.h>
#endif
-int _synctex_log(int level, const char * prompt, const char * reason,va_list arg) {
+static int _synctex_log(int level, const char * prompt, const char * reason,va_list arg) {
int result;
# ifdef SYNCTEX_RECENT_WINDOWS
{/* This code is contributed by William Blum.
@@ -301,7 +300,7 @@ int _synctex_copy_with_quoting_last_path_component(const char * src, char ** des
if(src && dest_ref) {
const char * lpc;
# define dest (*dest_ref)
- dest = NULL; /* Default behavior: no change and sucess. */
+ dest = NULL; /* Default behavior: no change and success. */
lpc = _synctex_last_path_component(src);
if(strlen(lpc)) {
if(strchr(lpc,' ') && lpc[0]!='"' && lpc[strlen(lpc)-1]!='"') {
@@ -351,6 +350,7 @@ char * _synctex_merge_strings(const char * first,...) {
size_t len = strlen(temp);
if(UINT_MAX-len<size) {
_synctex_error("! _synctex_merge_strings: Capacity exceeded.");
+ va_end(arg);
return NULL;
}
size+=len;
@@ -371,6 +371,7 @@ char * _synctex_merge_strings(const char * first,...) {
_synctex_error("! _synctex_merge_strings: Copy problem");
free(result);
result = NULL;
+ va_end(arg);
return NULL;
}
dest += size;
@@ -388,7 +389,7 @@ char * _synctex_merge_strings(const char * first,...) {
/* The purpose of _synctex_get_name is to find the name of the synctex file.
* There is a list of possible filenames from which we return the most recent one and try to remove all the others.
- * With two runs of pdftex or xetex we are sure the the synctex file is really the most appropriate.
+ * With two runs of pdftex or xetex we are sure the synctex file is really the most appropriate.
*/
int _synctex_get_name(const char * output, const char * build_directory, char ** synctex_name_ref, synctex_io_mode_t * io_mode_ref)
{