Revision: 14164
          http://sourceforge.net/p/skim-app/code/14164
Author:   hofman
Date:     2024-04-01 17:19:46 +0000 (Mon, 01 Apr 2024)
Log Message:
-----------
update synctex to latest sources (1.30)

Modified Paths:
--------------
    trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.h
    trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.m
    trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser_advanced.h
    trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser_local.h
    trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser_readme.txt
    trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser_utils.h
    trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser_utils.m
    trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser_version.txt
    trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_version.h

Modified: trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.h
===================================================================
--- trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.h       
2024-04-01 15:56:23 UTC (rev 14163)
+++ trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.h       
2024-04-01 17:19:46 UTC (rev 14164)
@@ -1,11 +1,11 @@
 /*
- Copyright (c) 2008-2017 jerome DOT laurens AT u-bourgogne DOT fr
+ Copyright (c) 2008-2024 jerome DOT laurens AT u-bourgogne DOT fr
  
  This file is part of the __SyncTeX__ package.
  
- [//]: # (Latest Revision: Fri Jul 14 16:20:41 UTC 2017)
- [//]: # (Version: 1.21)
- 
+ Version: see synctex_version.h
+ Latest Revision: Thu Mar 21 14:12:58 UTC 2024
+
  See `synctex_parser_readme.md` for more details
  
  ## License
@@ -56,26 +56,35 @@
 extern "C" {
 #endif
     
-    /*  The main synctex object is a scanner.
-     *  Its implementation is considered private.
-     *  The basic workflow is
-     *  -   create a "synctex scanner" with the contents of a file
-     *  -   perform actions on that scanner like
-        synctex_display_query or synctex_edit_query below.
-     *  -   perform actions on nodes returned by the scanner
-     *  - free the scanner when the work is done
+/** @defgroup Scanner Main scanner object.
+ *  
+ * The main synctex object is a scanner.
+ * The basic workflow is
+ * -   create a "synctex scanner" with the contents of a file
+ * -   perform actions on that scanner like
+ * `synctex_display_query` or `synctex_edit_query`.
+ * -   perform actions on nodes returned by the scanner
+ * - free the scanner when the work is done
+ * @{
+ */
+
+    typedef struct _synctex_scanner_t _synctex_scanner_s;
+    /**
+     * @brief Main synctex object.
+     * 
+     * Its implementation is considered private.
      */
-    typedef struct synctex_scanner_t synctex_scanner_s;
-    typedef synctex_scanner_s * synctex_scanner_p;
+    typedef _synctex_scanner_s * synctex_scanner_p;
     
     /**
-     *  This is the designated method to create
+     * @brief This is the designated method to create
      *  a new synctex scanner object.
-     *  - argument output: the pdf/dvi/xdv file associated
+     * 
+     * @param output the pdf/dvi/xdv file associated
      *      to the synctex file.
      *      If necessary, it can be the tex file that
      *      originated the synctex file but this might cause
-     *      problems if the \jobname has a custom value.
+     *      problems if the `\jobname` has a custom value.
      *      Despite this method can accept a relative path
      *      in practice, you should only pass full paths.
      *      The path should be encoded by the underlying
@@ -84,8 +93,8 @@
      *      not 16 bits nor 32 bits.
      *      The last file extension is removed and
      *      replaced by the proper extension,
-     *      either synctex or synctex.gz.
-     *  - argument build_directory: It is the directory where
+     *      either `synctex` or `synctex.gz`.
+     * @param build_directory It is the directory where
      *      all the auxiliary stuff is created.
      *      If no synctex file is found in the same directory
      *      as the output file, then we try to find one in
@@ -101,25 +110,34 @@
      *      Please note that this new argument is provided
      *      as a convenience but should not be used.
      *      Available since version 1.5.
-     *  - argument parse: In general, use 1.
+     * @param parse In general, use 1.
      *      Use 0 only if you do not want to parse the
      *      content but just check for existence.
      *      Available since version 1.5
-     *   - resturn: a scanner. NULL is returned in case
+     * @return synctex_scanner_p NULL is returned in case
      *      of an error or non existent file.
      */
     synctex_scanner_p synctex_scanner_new_with_output_file(const char * 
output, const char * build_directory, int parse);
     
     /**
-     *  Designated method to delete a synctex scanner object,
-     *  including all its internal resources.
-     *  Frees all the memory, you must call it when you are finished with the 
scanner.
      *  - argument scanner: a scanner.
      *  - returns: an integer used for testing purposes.
      */
+
+    /**
+     * @brief Scanner destructor
+     *
+     * Designated method to delete a synctex scanner object,
+     * including all its internal resources.
+     * Frees all the memory, you must call it when you are finished with the 
scanner.
+     * @param scanner  a scanner.
+     * @return int an integer mainly used for testing purposes.
+     */
     int synctex_scanner_free(synctex_scanner_p scanner);
     
     /**
+     * @brief Ask the scanner to parse the .synctex file.
+     * 
      *  Send this message to force the scanner to
      *  parse the contents of the synctex output file.
      *  Nothing is performed if the file was already parsed.
@@ -134,77 +152,147 @@
      *         }
      *  - returns: the argument on success.
      *      On failure, frees scanner and returns NULL.
+     * 
+     * @param scanner 
+     * @return synctex_scanner_p the argument on success.
+     *      On failure, frees scanner and returns NULL.
      */
     synctex_scanner_p synctex_scanner_parse(synctex_scanner_p scanner);
     
+    /** @} */
+
     /*  synctex_node_p is the type for all synctex nodes.
      *  Its implementation is considered private.
      *  The synctex file is parsed into a tree of nodes, either sheet, form, 
boxes, math nodes... */
     
-    typedef struct synctex_node_t synctex_node_s;
-    typedef synctex_node_s * synctex_node_p;
+    typedef struct _synctex_node_t _synctex_node_s;
+    typedef _synctex_node_s * synctex_node_p;
     
-    /*  The main entry points.
-     *  Given the file name, a line and a column number, synctex_display_query 
returns the number of nodes
-     *  satisfying the constrain. Use code like
+    /** @defgroup Query  Text and display query.
      *
-     *      if(synctex_display_query(scanner,name,line,column,page_hint)>0) {
-     *         synctex_node_p node;
-     *         while((node = synctex_scanner_next_result(scanner))) {
-     *             // do something with node
-     *             ...
-     *         }
-     *     }
+     * Both methods are conservative, in the sense that matching is weak.
+     * If the exact column number is not found, there will be an answer with 
the whole line.
      *
+     * Sumatra-PDF, Skim, iTeXMac2, TeXShop and Texworks are examples of open 
source software that use this library.
+     * You can browse their code for a concrete implementation.
+     * @{
+     */
+
+    /**
+     * @brief Type for status as return value
+     * 
+     */
+    typedef long synctex_status_t;
+    /**
+     * @brief Display query
+     * 
+     * Given an input file name, a line and a column number,
+     * `synctex_display_query` returns the number of nodes
+     * satisfying the constrain. Use code like
+     *
+     * ```
+     * if(synctex_display_query(scanner,name,line,column,page_hint)>0) {
+     *   synctex_node_p node;
+     *   while((node = synctex_scanner_next_result(scanner))) {
+     *     // do something with node
+     *     ...
+     *   }
+     * }
+     * ```
      *  Please notice that since version 1.19,
      *  there is a new argument page_hint.
      *  The results in pages closer to page_hint are given first.
      *  For example, one can
-     * - highlight each resulting node in the output, using 
synctex_node_visible_h and synctex_node_visible_v
-     * - highlight all the rectangles enclosing those nodes, using 
synctex_node_box_visible_... functions
-     * - highlight just the character using that information
+     * 
+     * - highlight each resulting node in the output,
+     *   using `synctex_node_visible_h` and `synctex_node_visible_v`
+     * - highlight all the rectangles enclosing those nodes,
+     *   using `synctex_node_box_visible_...` functions
+     * - highlight just the character that fits best to that information
      *
-     *  Given the page and the position in the page, synctex_edit_query 
returns the number of nodes
-     *  satisfying the constrain. Use code like
-     *
-     *     if(synctex_edit_query(scanner,page,h,v)>0) {
-     *         synctex_node_p node;
-     *         while(node = synctex_scanner_next_result(scanner)) {
-     *             // do something with node
-     *             ...
-     *         }
-     *     }
-     *
+     * It corresponds to the command
+     * ```
+     * synctex view -i <line>:<column>:<page_hint>:<input> ...
+     * ```
+     * 
+     * @param scanner built with the appropriate `.synctex` file.
+     * @param input the absolute path to a source input file
+     * @param line the line number in the input file
+     * @param column the column number in the input file
+     * @param page_hint a page number used to resolve ambiguities.
+     *   Whenever, different matches occur, the ones closest
+     *   to this page number will be given first.
+     *   Pass the currently displayed page number if available.
+     *   Pass 0 to have matches with lower page numbers first.
+     *   Pass 1000 to have matches with higher page numbers first.
+     *   Using pdf forms may lead to ambiguities.
+     * @return synctex_status_t, an error status when negative,
+     *   the number of results found otherwise.
+     * @see synctex_scanner_next_result
+     */
+    synctex_status_t synctex_display_query(synctex_scanner_p scanner,const 
char *  input,int line,int column, int page_hint);
+
+    /**
+     * @brief Edit query
+     * 
+     * Given the page and the position in the page, synctex_edit_query returns 
the number of nodes
+     * satisfying the constrain.
+     * 
+     * Usage:
+     * ```
+     * if(synctex_edit_query(scanner,page,h,v)>0) {
+     *   synctex_node_p node;
+     *   while(node = synctex_scanner_next_result(scanner)) {
+     *     // do something with node
+     *     ...
+     *   }
+     * }
+     * ```
+     * 
      *  For example, one can
      * - highlight each resulting line in the input,
      * - highlight just the character using that information
      *
-     *  page is 1 based
-     *  h and v are coordinates in 72 dpi unit, relative to the top left 
corner of the page.
-     *  If you make a new query, the result of the previous one is discarded. 
If you need to make more than one query
-     *  in parallel, use the iterator API exposed in
-     *  the synctex_parser_private.h header.
-     *  If one of this function returns a negative integer,
-     *  it means that an error occurred.
-     *
-     *  Both methods are conservative, in the sense that matching is weak.
-     *  If the exact column number is not found, there will be an answer with 
the whole line.
-     *
-     *  Sumatra-PDF, Skim, iTeXMac2, TeXShop and Texworks are examples of open 
source software that use this library.
-     *  You can browse their code for a concrete implementation.
+     * If you make a new query, the result of the previous one is discarded.
+     * If you need to make more than one query
+     * in parallel, use the iterator API exposed in
+     * the `synctex_parser_advanced.h` header.
+     * 
+     * It corresponds to the command
+     * ```
+     * synctex edit -o <page>:<h>:<v>:<output> ...\n"
+     * ```
+     * 
+     * @param scanner built with the appropriate `.synctex` file.
+     * @param page the page number in the output file, 1 based
+     * @param h the horizontal coordinate in 72 dpi unit from top left corner 
of the page
+     * @param v the vertical coordinate in 72 dpi unit from top left corner of 
the page
+     * @return synctex_status_t, an error status when negative,
+     *   the number of results found otherwise.
+     * @see synctex_scanner_next_result
      */
-    typedef long synctex_status_t;
-    /*  The page_hint argument is used to resolve ambiguities.
-     *  Whenever, different matches occur, the ones closest
-     *  to the page will be given first. Pass a negative number
-     *  when in doubt. Using pdf forms may lead to ambiguities.
+    synctex_status_t synctex_edit_query(synctex_scanner_p scanner,int 
page,float h,float v);
+
+    /**
+     * @brief Answer to queries
+     * 
+     * @param scanner 
+     * @return synctex_node_p The next node of the query,
+     *   NULL when there are no node left.
+     * @see `synctex_edit_query` and `synctex_view_query`.
      */
-    synctex_status_t synctex_display_query(synctex_scanner_p scanner,const 
char *  name,int line,int column, int page_hint);
-    synctex_status_t synctex_edit_query(synctex_scanner_p scanner,int 
page,float h,float v);
     synctex_node_p synctex_scanner_next_result(synctex_scanner_p scanner);
-    synctex_status_t synctex_scanner_reset_result(synctex_scanner_p scanner);
     
     /**
+     * @brief Reset to the first result
+     * 
+     * @param scanner 
+     * @return synctex_status_t 
+     */
+    synctex_status_t synctex_scanner_reset_result(synctex_scanner_p scanner);
+    /** @} */
+
+    /**
      *  The horizontal and vertical location,
      *  the width, height and depth of a box enclosing node.
      *  All dimensions are given in page coordinates
@@ -292,6 +380,10 @@
      */
     int synctex_node_page(synctex_node_p node);
 
+    /** @addtogroup Scanner
+     * @{
+     */
+
     /**
      *  Display all the information contained in the scanner.
      *  If the records are too numerous, only the first ones are displayed.
@@ -324,10 +416,80 @@
     
     int synctex_scanner_get_tag(synctex_scanner_p scanner,const char * name);
     
+    /** @defgroup Tree Node tree
+     * 
+     * parent, child and sibling are standard names for tree nodes.
+     * The parent is one level higher,
+     * the child is one level deeper,
+     * and the sibling is at the same level.
+     * A node and its sibling have the same parent.
+     * A node is the parent of its children.
+     * A node is either the child of its parent,
+     * or belongs to the sibling chain of its parent's child.
+     * The sheet or form of a node is the topmost ancestor,
+     * it is of type sheet or form.
+     * The next node is either the child, the sibling or the parent's sibling,
+     * unless the parent is a sheet, a form or NULL.
+     * This allows to navigate through all the nodes of a given sheet node:
+     *
+     * ```C
+     * synctex_node_p node = ...;
+     * while((node = synctex_node_next(node))) {
+     *   // do something with node
+     * }
+     * ```
+     * 
+     *  With `synctex_sheet_content` and `synctex_form_content`,
+     *  you can retrieve the sheet node given the page
+     *  or form tag.
+     *  The page is 1 based, according to TeX standards.
+     *  Conversely `synctex_node_parent_sheet` or
+     *  `synctex_node_parent_form` allows to retrieve
+     *  the sheet or the form containing a given node.
+     *  Notice that a node is not contained in a sheet
+     *  and a form at the same time.
+     *  Some nodes are not contained in either (handles).
+     * @{ */
+
+    /**
+     * @brief First input node.
+     * 
+     * @param scanner 
+     * @return * synctex_node_p 
+     */
     synctex_node_p synctex_scanner_input(synctex_scanner_p scanner);
+    /**
+     * @brief First input node with a given tag.
+     * 
+     * Corresponds to `Input:<tag>:<file>` entries in the `.sycntex` file.
+     * @param scanner 
+     * @param tag 
+     * @return * synctex_node_p 
+     */
     synctex_node_p synctex_scanner_input_with_tag(synctex_scanner_p 
scanner,int tag);
+    /**
+     * @brief Path to the output file
+     * 
+     * @param scanner 
+     * @return const char* 
+     */
     const char * synctex_scanner_get_output(synctex_scanner_p scanner);
+    /**
+     * @brief Path to the synctex file
+     * 
+     * @param scanner 
+     * @return const char* 
+     */
     const char * synctex_scanner_get_synctex(synctex_scanner_p scanner);
+    /**
+     * @brief Format of the output
+     * 
+     * From the content of the synctex file.
+     * @param scanner 
+     * @return const char* 
+     */
+    const char * synctex_scanner_get_output_fmt(synctex_scanner_p scanner);
+    /** @} */
     
     /*  The x and y offset of the origin in TeX coordinates. The magnification
      These are used by pdf viewers that want to display the real box size.
@@ -337,51 +499,111 @@
      synctex_node_box_width(node)*synctex_scanner_magnification(scanner)
      but direct methods are available for that below.
      */
+
+    /**
+     * @brief Horizontal offset of coordinates.
+     * 
+     * 1in default in TeX.
+     * @param scanner 
+     * @return int 
+     */
     int synctex_scanner_x_offset(synctex_scanner_p scanner);
+    /**
+     * @brief Vertical offset of coordinates.
+     * 
+     * 1in default in TeX.
+     * @param scanner 
+     * @return int 
+     */
     int synctex_scanner_y_offset(synctex_scanner_p scanner);
+    /**
+     * @brief Magnification
+     * 
+     * 1000 default in TeX.
+     * @param scanner 
+     * @return float 
+     */
     float synctex_scanner_magnification(synctex_scanner_p scanner);
     
+    /** @} */
+
+    /** @addtogroup Tree
+     * @{
+     */
+    
     /**
-     *  ## Browsing the nodes
-     *  parent, child and sibling are standard names for tree nodes.
-     *  The parent is one level higher,
-     *  the child is one level deeper,
-     *  and the sibling is at the same level.
-     *  A node and its sibling have the same parent.
-     *  A node is the parent of its children.
-     *  A node is either the child of its parent,
-     *  or belongs to the sibling chain of its parent's child.
-     *  The sheet or form of a node is the topmost ancestor,
-     *  it is of type sheet or form.
-     *  The next node is either the child, the sibling or the parent's sibling,
-     *  unless the parent is a sheet, a form or NULL.
-     *  This allows to navigate through all the nodes of a given sheet node:
-     *
-     *     synctex_node_p node = sheet;
-     *     while((node = synctex_node_next(node))) {
-     *         // do something with node
-     *     }
-     *
-     *  With synctex_sheet_content and synctex_form_content,
-     *  you can retrieve the sheet node given the page
-     *  or form tag.
-     *  The page is 1 based, according to TeX standards.
-     *  Conversely synctex_node_parent_sheet or
-     *  synctex_node_parent_form allows to retrieve
-     *  the sheet or the form containing a given node.
-     *  Notice that a node is not contained in a sheet
-     *  and a form at the same time.
-     *  Some nodes are not contained in either (handles).
+     * @brief Parent
+     * 
+     * @param node 
+     * @return synctex_node_p possibly NULL.
      */
-    
     synctex_node_p synctex_node_parent(synctex_node_p node);
+    /**
+     * @brief Parent sheet
+     * 
+     * @param node 
+     * @return synctex_node_p possibly NULL.
+     */
     synctex_node_p synctex_node_parent_sheet(synctex_node_p node);
+    /**
+     * @brief Parent sheet
+     * 
+     * @param node 
+     * @return synctex_node_p possibly NULL.
+     */
     synctex_node_p synctex_node_parent_form(synctex_node_p node);
+    /**
+     * @brief First child
+     * 
+     * @param node 
+     * @return synctex_node_p possibly NULL.
+     */
     synctex_node_p synctex_node_child(synctex_node_p node);
+    /**
+     * @brief Last child
+     * 
+     * Last sibling of the first child, if any.
+     * @param node 
+     * @return synctex_node_p possibly NULL.
+     */
     synctex_node_p synctex_node_last_child(synctex_node_p node);
+    /**
+     * @brief First sibling
+     * 
+     * @param node 
+     * @return synctex_node_p possibly NULL.
+     */
     synctex_node_p synctex_node_sibling(synctex_node_p node);
+    /**
+     * @brief Last sibling
+     * 
+     * Last sibling of the first sibling of the node, if any,
+     * the node itself otherwise.
+     * @param node 
+     * @return synctex_node_p possibly NULL.
+     * @see synctex_node_last_child
+     */
     synctex_node_p synctex_node_last_sibling(synctex_node_p node);
+    /**
+     * @brief 
+     * 
+     * @param node 
+     * @return synctex_node_p 
+     */
     synctex_node_p synctex_node_arg_sibling(synctex_node_p node);
+
+    /**
+     * @brief Next node.
+     * 
+     * Deep first traversal of the tree of nodes.
+     * First child if any,
+     * first sibling if any,
+     * parent's first sibling if any,
+     * parent's parent's first sibling if any,
+     * ...
+     * @param node 
+     * @return synctex_node_p 
+     */
     synctex_node_p synctex_node_next(synctex_node_p node);
     
     /**
@@ -394,22 +616,95 @@
      *  - argument tag: 1 based form tag number.
      */
     synctex_node_p synctex_sheet(synctex_scanner_p scanner,int page);
+    /**
+     * @brief Sheet content at a given page.
+     * 
+     * @param scanner 
+     * @param page 
+     * @return synctex_node_p 
+     */
     synctex_node_p synctex_sheet_content(synctex_scanner_p scanner,int page);
+    /**
+     * @brief Form for a given tag
+     * 
+     * @param scanner 
+     * @param tag 
+     * @return synctex_node_p 
+     */
     synctex_node_p synctex_form(synctex_scanner_p scanner,int tag);
+    /**
+     * @brief Form content for given tag.
+     * 
+     * @param scanner 
+     * @param tag 
+     * @return synctex_node_p 
+     */
     synctex_node_p synctex_form_content(synctex_scanner_p scanner,int tag);
     
+    /** @} */
+
     /*  This is primarily used for debugging purpose.
      *  The second one logs information for the node and recursively displays 
information for its next node */
+
+    /**
+     * @brief Log a node
+     * 
+     * This is primarily used for debugging purpose.
+     * @param node 
+     */
     void synctex_node_log(synctex_node_p node);
+    /**
+     * @brief Display a node
+     * 
+     * This is primarily used for debugging purpose.
+     * @param node 
+     */
     void synctex_node_display(synctex_node_p node);
     
-    /*  For quite all nodes, horizontal, vertical coordinates, and width.
-     *  These are expressed in TeX small points coordinates, with origin at 
the top left corner.
+    /**
+     * @defgroup Geometry Node geometry 
+     * 
+     * For quite all nodes, horizontal, vertical coordinates, and width.
+     * These are expressed in TeX small points coordinates,
+     * with origin at the top left corner.
+     * For nodes without depth or height, 0 is returned.
+     * @{
      */
+
+    /**
+     * @brief Horizontal coordinate
+     * 
+     * @param node 
+     * @return int in TeX sp from top left corner of the page
+     */
     int synctex_node_h(synctex_node_p node);
+    /**
+     * @brief Vertical coordinate
+     * 
+     * @param node 
+     * @return int in TeX sp from top left corner of the page
+     */
     int synctex_node_v(synctex_node_p node);
+    /**
+     * @brief Width
+     * 
+     * @param node 
+     * @return int in TeX sp
+     */
     int synctex_node_width(synctex_node_p node);
+    /**
+     * @brief Height
+     * 
+     * @param node 
+     * @return int in TeX sp, 0 when irrelevant
+     */
     int synctex_node_height(synctex_node_p node);
+    /**
+     * @brief Depth
+     * 
+     * @param node 
+     * @return int in TeX sp, 0 when irrelevant
+     */
     int synctex_node_depth(synctex_node_p node);
     
     /*  For all nodes, dimensions of the enclosing box.
@@ -421,7 +716,7 @@
     int synctex_node_box_width(synctex_node_p node);
     int synctex_node_box_height(synctex_node_p node);
     int synctex_node_box_depth(synctex_node_p node);
-
+    /** @} */
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.m
===================================================================
--- trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.m       
2024-04-01 15:56:23 UTC (rev 14163)
+++ trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.m       
2024-04-01 17:19:46 UTC (rev 14164)
@@ -1,11 +1,11 @@
 /*
- Copyright (c) 2008-2017 jerome DOT laurens AT u-bourgogne DOT fr
+ Copyright (c) 2008-2024 jerome DOT laurens AT u-bourgogne DOT fr
  
  This file is part of the __SyncTeX__ package.
  
- [//]: # (Latest Revision: Sun Oct 15 15:09:55 UTC 2017)
- [//]: # (Version: 1.21)
- 
+ Version: see synctex_version.h
+ Latest Revision: Thu Mar 21 14:12:58 UTC 2024
+
  See `synctex_parser_readme.md` for more details
  
  ## License
@@ -56,14 +56,14 @@
  *  With this design, you should not need to edit this file. */
 
 /**
- *  \file synctex_parser.c
- *  \brief SyncTeX file parser and controller.
- *  - author: Jérôme LAURENS
- *  \version 1.21
- *  \date Sun Oct 15 15:09:55 UTC 2017
+ * @file synctex_parser.c
+ * @brief SyncTeX file parser and controller.
+ * @author: Jérôme LAURENS
+ * @version 1.22
+ * @date Tue Mar  5 21:16:33 UTC 2024
  *
- *  Reads and parse *.synctex[.gz] files,
- *  performs edit and display queries.
+ * Reads and parse *.synctex[.gz] files,
+ * performs edit and display queries.
  *
  *  See
  *  - synctex_scanner_new_with_output_file
@@ -76,7 +76,7 @@
  *
  *  The data is organized in a graph with multiple entries.
  *  The root object is a scanner, it is created with the contents on a synctex 
file.
- *  Each node of the tree is a synctex_node_t object.
+ *  Each node of the tree is a private `_synctex_node_t` object.
  *  There are 3 subtrees, two of them sharing the same leaves.
  *  The first tree is the list of input records, where input file names are 
associated with tags.
  *  The second tree is the box tree as given by TeX when shipping pages out.
@@ -86,6 +86,7 @@
 /* Declare _GNU_SOURCE for accessing vasprintf. For MSC compiler, vasprintf is
  * defined in this file
  */
+/** @cond */
 #define _GNU_SOURCE
 
 #   if defined(SYNCTEX_USE_LOCAL_HEADER)
@@ -124,43 +125,58 @@
 SYNCTEX_INLINE static int _synctex_abs(int x) {
     return x>0? x: -x;
 }
+
+/** @endcond */
+
 /*  These are the possible extensions of the synctex file */
+/**
+ * @brief Extension of uncompressed synctex file
+ */
 const char * synctex_suffix = ".synctex";
+/**
+ * @brief Extension of compressed synctex file
+ */
 const char * synctex_suffix_gz = ".gz";
 
-typedef synctex_node_p(*synctex_node_new_f)(synctex_scanner_p);
-typedef void(*synctex_node_fld_f)(synctex_node_p);
-typedef char *(*synctex_node_str_f)(synctex_node_p);
+/** @cond */
 
+typedef synctex_node_p(*_synctex_node_new_f)(synctex_scanner_p);
+typedef void(*_synctex_node_fld_f)(synctex_node_p);
+typedef char *(*_synctex_node_str_f)(synctex_node_p);
+
 /**
- *  Pseudo class.
- *  - author: J. Laurens
- *
- *  Each nodes has a class, it is therefore called an object.
- *  Each class has a unique scanner.
- *  Each class has a type which is a unique identifier.
- *  The class points to various methods,
- *  each of them vary amongst objects.
- *  Each class has a data model which stores node's attributes.
- *  Each class has an tree model which stores children and parent.
- *  Inspectors give access to data and tree elements.
+ * @brief A tree model structure
+ * @author: Jérôme LAURENS
+ * 
+ * 8 fields + size: `spcflnat` referring to the first letters of each field.
  */
-
-/*  8 fields + size: spcflnat */
 typedef struct synctex_tree_model_t {
+    /** A sibling node, if any */
     int sibling;
+    /** The parent node, if any */
     int parent;
+    /** The first child node, if any */
     int child;
+    /** The first friend node, if any */
     int friend;
+    /** The last node, if any */
     int last;
+    /** The next hbox node, if any */
     int next_hbox;
+    /** Undocumented */
     int arg_sibling;
+    /** Undocumented */
     int target;
+    /** Undocumented */
     int size;
-} synctex_tree_model_s;
-typedef const synctex_tree_model_s * synctex_tree_model_p;
+} _synctex_tree_model_s;
+/**
+ * @brief A pointer to a constant tree model structure
+ * @author: Jérôme LAURENS
+ */
+typedef const _synctex_tree_model_s * _synctex_tree_model_p;
 
-typedef struct synctex_data_model_t {
+typedef struct _synctex_data_model_t {
     int tag;
     int line;
     int column;
@@ -179,36 +195,62 @@
     int name;
     int page;
     int size;
-} synctex_data_model_s;
+} _synctex_data_model_s;
 
-typedef const synctex_data_model_s * synctex_data_model_p;
+/**
+ * @brief A pointer to a constant data model structure
+ * @author: Jérôme LAURENS
+ */
+typedef const _synctex_data_model_s * _synctex_data_model_p;
 
-typedef int (*synctex_int_getter_f)(synctex_node_p);
+/**
+ * @brief node -> integer function type
+ * @author: Jérôme LAURENS
+ * 
+ */
+typedef int (*_synctex_int_getter_f)(synctex_node_p);
+
+/**
+ * @brief tlc inspector structure
+ * 
+ */
 typedef struct synctex_tlcpector_t {
-    synctex_int_getter_f tag;
-    synctex_int_getter_f line;
-    synctex_int_getter_f column;
-} synctex_tlcpector_s;
-typedef const synctex_tlcpector_s * synctex_tlcpector_p;
+    /** tag getter */
+    _synctex_int_getter_f tag;
+    /** line getter */
+    _synctex_int_getter_f line;
+    /** column getter */
+    _synctex_int_getter_f column;
+} _synctex_tlcpector_s;
+typedef const _synctex_tlcpector_s * _synctex_tlcpector_p;
 static int _synctex_int_none(synctex_node_p node) {
     SYNCTEX_UNUSED(node)
     return 0;
 }
-static const synctex_tlcpector_s synctex_tlcpector_none = {
+static const _synctex_tlcpector_s synctex_tlcpector_none = {
     &_synctex_int_none, /* tag */
     &_synctex_int_none, /* line */
     &_synctex_int_none, /* column */
 };
 
-typedef struct synctex_inspector_t {
-    synctex_int_getter_f h;
-    synctex_int_getter_f v;
-    synctex_int_getter_f width;
-    synctex_int_getter_f height;
-    synctex_int_getter_f depth;
-} synctex_inspector_s;
-typedef const synctex_inspector_s * synctex_inspector_p;
-static const synctex_inspector_s synctex_inspector_none = {
+/**
+ * @brief Geometry inspector structure
+ * 
+ */
+typedef struct _synctex_inspector_t {
+    /** h getter */
+    _synctex_int_getter_f h;
+    /** v getter */
+    _synctex_int_getter_f v;
+    /** width getter */
+    _synctex_int_getter_f width;
+    /** height getter */
+    _synctex_int_getter_f height;
+    /** depth getter */
+    _synctex_int_getter_f depth;
+} _synctex_inspector_s;
+typedef const _synctex_inspector_s * _synctex_inspector_p;
+static const _synctex_inspector_s synctex_inspector_none = {
     &_synctex_int_none, /* h */
     &_synctex_int_none, /* v */
     &_synctex_int_none, /* width */
@@ -216,19 +258,28 @@
     &_synctex_int_none, /* depth */
 };
 
-typedef float (*synctex_float_getter_f)(synctex_node_p);
-typedef struct synctex_vispector_t {
-    synctex_float_getter_f h;
-    synctex_float_getter_f v;
-    synctex_float_getter_f width;
-    synctex_float_getter_f height;
-    synctex_float_getter_f depth;
-} synctex_vispector_s;
+typedef float (*_synctex_float_getter_f)(synctex_node_p);
+/**
+ * @brief vi inspector data structure.
+ * 
+ */
+typedef struct _synctex_vispector_t {
+    /** h attribute getter */
+    _synctex_float_getter_f h;
+    /** v attribute getter */
+    _synctex_float_getter_f v;
+    /** width attribute getter */
+    _synctex_float_getter_f width;
+    /** height attribute getter */
+    _synctex_float_getter_f height;
+    /** depth attribute getter */
+    _synctex_float_getter_f depth;
+} _synctex_vispector_s;
 static float _synctex_float_none(synctex_node_p node) {
     SYNCTEX_UNUSED(node)
     return 0;
 }
-static const synctex_vispector_s synctex_vispector_none = {
+static const _synctex_vispector_s synctex_vispector_none = {
     &_synctex_float_none, /* h */
     &_synctex_float_none, /* v */
     &_synctex_float_none, /* width */
@@ -235,21 +286,21 @@
     &_synctex_float_none, /* height */
     &_synctex_float_none, /* depth */
 };
-typedef const synctex_vispector_s * synctex_vispector_p;
+typedef const _synctex_vispector_s * _synctex_vispector_p;
 
-struct synctex_class_t {
+struct _synctex_class_t {
     synctex_scanner_p scanner;
     synctex_node_type_t type;
-    synctex_node_new_f new;
-    synctex_node_fld_f free;
-    synctex_node_fld_f log;
-    synctex_node_fld_f display;
-    synctex_node_str_f abstract;
-    synctex_tree_model_p navigator;
-    synctex_data_model_p modelator;
-    synctex_tlcpector_p tlcpector;
-    synctex_inspector_p inspector;
-    synctex_vispector_p vispector;
+    _synctex_node_new_f new;
+    _synctex_node_fld_f free;
+    _synctex_node_fld_f log;
+    _synctex_node_fld_f display;
+    _synctex_node_str_f abstract;
+    _synctex_tree_model_p navigator;
+    _synctex_data_model_p modelator;
+    _synctex_tlcpector_p tlcpector;
+    _synctex_inspector_p inspector;
+    _synctex_vispector_p vispector;
 };
 
 /**
@@ -259,8 +310,8 @@
  *  When the name contains "node", well it depends...
  */
 
-typedef synctex_node_p synctex_proxy_p;
-typedef synctex_node_p synctex_noxy_p;
+typedef synctex_node_p _synctex_proxy_p;
+typedef synctex_node_p _synctex_noxy_p;
 
 #      ifdef SYNCTEX_NOTHING
 #       pragma mark -
@@ -268,8 +319,8 @@
 #   endif
 
 /**
- *  \def SYNCTEX_MSG_SEND
- *  \brief Takes care of sending the given message if possible.
+ *  @def SYNCTEX_MSG_SEND
+ *  @brief Takes care of sending the given message if possible.
  *  - parameter NODE: of type synctex_node_p
  *  - parameter SELECTOR: one of the class_ pointer properties
  */
@@ -284,7 +335,7 @@
  *  Free the given node by sending the free message.
  *  - parameter NODE: of type synctex_node_p
  */
-static 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)
@@ -473,7 +524,7 @@
 DEFINE_SYNCTEX_TREE_GETSET(arg_sibling)
 DEFINE_SYNCTEX_TREE_GETSETRESET(target)
 
-#if SYNCTEX_DEBUG>1000
+#if SYNCTEX_DEBUG > 1000
 #   undef SYNCTEX_USE_NODE_COUNT
 #   define SYNCTEX_USE_NODE_COUNT 1
 #endif
@@ -495,7 +546,7 @@
 #endif
 
 #define SYNCTEX_HAS_CHILDREN(NODE) (NODE && _synctex_tree_child(NODE))
-#      ifdef   __SYNCTEX_WORK__
+#      ifdef   SYNCTEX_STANDALONE
 #              include "/usr/local/include/node/zlib.h"
 #      else
 #              include <zlib.h>
@@ -535,29 +586,57 @@
 #if SYNCTEX_BUFFER_SIZE < SYNCTEX_BUFFER_MIN_SIZE
 #   error BAD BUFFER SIZE(2)
 #endif
+/** @endcond */
 
-typedef struct synctex_reader_t {
-    gzFile file;    /*  The (possibly compressed) file */
+/**
+ * @brief Data structure fot a file reader
+ * 
+ */
+typedef struct _synctex_reader_t {
+    /** The (possibly compressed) file */
+    gzFile file;
+    /** The output file */
     char * output;
+    /** The synctex file */
     char * synctex;
-    char * current; /*  current location in the buffer */
-    char * start;   /*  start of the buffer */
-    char * end;     /*  end of the buffer */
+    /** current location in the buffer */
+    char * current;
+    /** start of the buffer */
+    char * start;
+    /** end of the buffer */
+    char * end;
+    /** Undocumented */
     size_t min_size;
+    /** Undocumented */
     size_t size;
+    /** Undocumented */
     int lastv;
+    /** Undocumented */
     int line_number;
     SYNCTEX_DECLARE_CHAR_OFFSET
-} synctex_reader_s;
+} _synctex_reader_s;
 
-typedef synctex_reader_s * synctex_reader_p;
+/**
+ * @brief Reader structure
+ * 
+ */
+typedef _synctex_reader_s * synctex_reader_p;
 
+/**
+ * @brief Return structure
+ * 
+ * This is the return structure of the open functions.
+ */
 typedef struct {
+    /** error status */
     synctex_status_t status;
+    /** synctex file name */
     char * synctex;
+    /** synctex file */
     gzFile file;
+    /** mode */
     synctex_io_mode_t io_mode;
-} synctex_open_s;
+} _synctex_open_s;
 
 /*     This functions opens the file at the "output" given location.
  *  It manages the problem of quoted filenames that appear with pdftex and 
filenames containing the space character.
@@ -570,8 +649,8 @@
  *  - note: on success, the caller is the owner
  *      of the fields of the returned open structure.
  */
-static synctex_open_s __synctex_open_v2(const char * output, synctex_io_mode_t 
io_mode, synctex_bool_t add_quotes) {
-    synctex_open_s open = {SYNCTEX_STATUS_ERROR, NULL, NULL, io_mode};
+static _synctex_open_s __synctex_open_v2(const char * output, 
synctex_io_mode_t io_mode, synctex_bool_t add_quotes) {
+    _synctex_open_s open = {SYNCTEX_STATUS_ERROR, NULL, NULL, io_mode};
     char * quoteless_synctex_name = NULL;
     const char * mode = _synctex_get_io_mode_name(open.io_mode);
     size_t size = 
strlen(output)+strlen(synctex_suffix)+strlen(synctex_suffix_gz)+1;
@@ -686,8 +765,8 @@
  *  - note: on success, the caller is the owner
  *      of the fields of the returned open structure.
  */
-static synctex_open_s _synctex_open_v2(const char * output, const char * 
build_directory, synctex_io_mode_t io_mode, synctex_bool_t add_quotes) {
-    synctex_open_s open = __synctex_open_v2(output,io_mode,add_quotes);
+static _synctex_open_s _synctex_open_v2(const char * output, const char * 
build_directory, synctex_io_mode_t io_mode, synctex_bool_t add_quotes) {
+    _synctex_open_s open = __synctex_open_v2(output,io_mode,add_quotes);
     if (open.status == SYNCTEX_STATUS_OK) {
         return open;
     }
@@ -749,7 +828,7 @@
 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);
+        _synctex_open_s open = 
_synctex_open_v2(output,build_directory,0,synctex_ADD_QUOTES);
         if (open.status<SYNCTEX_STATUS_OK) {
             open = 
_synctex_open_v2(output,build_directory,0,synctex_DONT_ADD_QUOTES);
             if (open.status<SYNCTEX_STATUS_OK) {
@@ -773,7 +852,6 @@
             (char *)_synctex_malloc(reader->size+1); /*  one more character 
for null termination */
         if (NULL == reader->start) {
             _synctex_error("!  malloc error in 
synctex_reader_init_with_output_file.");
-        //bailey:
 #ifdef SYNCTEX_DEBUG
             return reader;
 #else
@@ -792,6 +870,8 @@
     return reader;
 }
 
+/** @cond */
+
 #   if defined(SYNCTEX_USE_HANDLE)
 #       define SYNCTEX_DECLARE_HANDLE synctex_node_p handle;
 #   else
@@ -802,48 +882,79 @@
 #       pragma mark -
 #       pragma mark SCANNER
 #   endif
+
 /**
  *  The synctex scanner is the root object.
+ * 
  *  Is is initialized with the contents of a text file or a gzipped file.
  *  The buffer_.* are first used to parse the text.
  */
-struct synctex_scanner_t {
+struct _synctex_scanner_t {
+    /** Auxiliary reader object discarded when used */
     synctex_reader_p reader;
     SYNCTEX_DECLARE_NODE_COUNT
     SYNCTEX_DECLARE_HANDLE
-    char * output_fmt;          /*  dvi or pdf, not yet used */
-    synctex_iterator_p iterator;/*  result iterator */
-    int version;                /*  1, not yet used */
+    /** "dvi" or "pdf", not yet used */
+    char * output_fmt;
+    /** result iterator */
+    synctex_iterator_p iterator;
+    /** allways 1, not yet used */
+    int version;
+    /** various flags */
     struct {
-        unsigned has_parsed:1;         /*  Whether the scanner has parsed its 
underlying synctex file. */
-        unsigned postamble:1;          /*  Whether the scanner has parsed its 
underlying synctex file. */
-        unsigned reserved:sizeof(unsigned)-2;  /*  alignment */
+        /**  Whether the scanner has parsed its underlying synctex file. */
+        unsigned has_parsed:1;
+        /*  Whether the scanner has parsed its underlying synctex file. */
+        unsigned postamble:1;
+        /*  alignment */
+        unsigned reserved:sizeof(unsigned)-2;
     } flags;
-    int pre_magnification;  /*  magnification from the synctex preamble */
-    int pre_unit;           /*  unit from the synctex preamble */
-    int pre_x_offset;       /*  X offset from the synctex preamble */
-    int pre_y_offset;       /*  Y offset from the synctex preamble */
-    int count;              /*  Number of records, from the synctex postamble 
*/
-    float unit;             /*  real unit, from synctex preamble or post 
scriptum */
-    float x_offset;         /*  X offset, from synctex preamble or post 
scriptum */
-    float y_offset;         /*  Y Offset, from synctex preamble or post 
scriptum */
-    synctex_node_p input;   /*  The first input node, its siblings are the 
other input nodes */
-    synctex_node_p sheet;   /*  The first sheet node, its siblings are the 
other sheet nodes */
-    synctex_node_p form;    /*  The first form, its siblings are the other 
forms */
-    synctex_node_p ref_in_sheet; /*  The first form ref node in sheet, its 
friends are the other form ref nodes */
-    synctex_node_p ref_in_form;  /*  The first form ref node, its friends are 
the other form ref nodes in sheet */
-    int number_of_lists;    /*  The number of friend lists */
-    synctex_node_r lists_of_friends;/*  The friend lists */
-    synctex_class_s class_[synctex_node_number_of_types]; /*  The classes of 
the nodes of the scanner */
+    /** magnification from the synctex preamble */
+    int pre_magnification;
+    /** unit from the synctex preamble */
+    int pre_unit;
+    /** X offset from the synctex preamble */
+    int pre_x_offset;
+    /** Y offset from the synctex preamble */
+    int pre_y_offset;
+    /** Number of records, from the synctex postamble */
+    int count;
+    /** real unit, from synctex preamble or post scriptum */
+    float unit;
+    /** X offset, from synctex preamble or post scriptum */
+    float x_offset;
+    /** Y Offset, from synctex preamble or post scriptum */
+    float y_offset;
+    /** The first input node, its siblings are the other input nodes */
+    synctex_node_p input;
+    /** The first sheet node, its siblings are the other sheet nodes */
+    synctex_node_p sheet;
+    /** The first form, its siblings are the other forms */
+    synctex_node_p form;
+    /** The first form ref node in sheet, its friends are the other form ref 
nodes */    
+    synctex_node_p ref_in_sheet;
+    /** The first form ref node, its friends are the other form ref nodes in 
sheet */
+    synctex_node_p ref_in_form;
+    /** The number of friend lists */
+    int number_of_lists;
+    /** The friend lists */
+    synctex_node_r lists_of_friends;
+    /** The classes of the nodes of the scanner */
+    _synctex_class_s class_[synctex_node_number_of_types];
+    /** The display switcher value*/
     int display_switcher;
+    /** The display prompt */
     char * display_prompt;
 };
 
+/** @endcond */
+
 /**
- *  Create a new node of the given type.
- *  - parameter scanner: of type synctex_node_p
- *  - parameter type: a type, the client is responsible
- *  to ask for an acceptable type.
+ * @brief Create a new node of the given type.
+ * 
+ * @param scanner 
+ * @param type no type checking
+ * @return synctex_node_p 
  */
 synctex_node_p synctex_node_new(synctex_scanner_p scanner, synctex_node_type_t 
type) {
     return scanner? scanner->class_[type].new(scanner):NULL;
@@ -850,7 +961,7 @@
 }
 #   if defined(SYNCTEX_USE_HANDLE)
 SYNCTEX_INLINE static void __synctex_scanner_free_handle(synctex_scanner_p 
scanner) {
-    synctex_node_free(scanner->handle);
+    _synctex_node_free(scanner->handle);
 }
 SYNCTEX_INLINE static void __synctex_scanner_remove_handle_to(synctex_node_p 
node) {
     synctex_node_p arg_sibling = NULL;
@@ -864,7 +975,7 @@
             } else {
                 node->class_->scanner->handle = sibling;
             }
-            synctex_node_free(handle);
+            _synctex_node_free(handle);
             break;
         } else {
             sibling = __synctex_tree_sibling(handle);
@@ -900,17 +1011,36 @@
  *  - note: a node is meant to own its child and sibling.
  *  It is not owned by its parent, unless it is its first child.
  *  This destructor is for all nodes with children.
+ * 
+ * Recursion only occurs from parent to children, which means
+ * that there is a maximum depth determined by the calling stack size.
+ * This is not managed.
  */
 static void _synctex_free_node(synctex_node_p node) {
-    if (node) {
+    while (node) {
+        synctex_node_p sibling = __synctex_tree_sibling(node);
         SYNCTEX_SCANNER_REMOVE_HANDLE_TO(node);
         SYNCTEX_WILL_FREE(node);
-        synctex_node_free(__synctex_tree_sibling(node));
-        synctex_node_free(_synctex_tree_child(node));
+        _synctex_node_free(_synctex_tree_child(node));
         _synctex_free(node);
+        node = sibling;
     }
     return;
 }
+#if 0
+static void _synctex_free_node(synctex_node_p node) {
+    synctex_node_p sibling;
+    while (node) {
+        SYNCTEX_SCANNER_REMOVE_HANDLE_TO(node);
+        SYNCTEX_WILL_FREE(node);
+        sibling = __synctex_tree_sibling(node);
+        _synctex_node_free(_synctex_tree_child(node));
+        _synctex_free(node);
+        node = sibling;
+    }
+    return;
+}
+#endif
 /**
  *  Free the given handle.
  *  - parameter node: of type synctex_node_p
@@ -927,7 +1057,7 @@
   }
   return;
 }
- */
+*/
 static void _synctex_free_handle(synctex_node_p handle) {
   if (handle) {
     synctex_node_p n = handle;
@@ -935,6 +1065,7 @@
     __synctex_tree_set_parent(n, NULL);
   down:
     while ((nn = _synctex_tree_child(n))) {
+      __synctex_tree_set_parent(nn, n);
       n = nn;
     };
   right:
@@ -965,7 +1096,7 @@
     if (node) {
         SYNCTEX_SCANNER_REMOVE_HANDLE_TO(node);
         SYNCTEX_WILL_FREE(node);
-        synctex_node_free(__synctex_tree_sibling(node));
+        _synctex_node_free(__synctex_tree_sibling(node));
         _synctex_free(node);
     }
     return;
@@ -1003,18 +1134,25 @@
 typedef struct {
     int integer;
     synctex_status_t status;
-} synctex_is_s;
+} _synctex_is_s;
 
-static synctex_is_s _synctex_decode_int(synctex_scanner_p scanner);
-static synctex_is_s _synctex_decode_int_opt(synctex_scanner_p scanner, int 
default_value);
-static synctex_is_s _synctex_decode_int_v(synctex_scanner_p scanner);
+static _synctex_is_s _synctex_decode_int(synctex_scanner_p scanner);
+static _synctex_is_s _synctex_decode_int_opt(synctex_scanner_p scanner, int 
default_value);
+static _synctex_is_s _synctex_decode_int_v(synctex_scanner_p scanner);
 
+/**
+ * @brief String+status structure.
+ * 
+ * Used to return multiple values from functions.
+ */
 typedef struct {
+    /** string component */
     char * string;
+    /** status component */
     synctex_status_t status;
-} synctex_ss_s;
+} _synctex_ss_s;
 
-static synctex_ss_s _synctex_decode_string(synctex_scanner_p scanner);
+static _synctex_ss_s _synctex_decode_string(synctex_scanner_p scanner);
 
 #      ifdef SYNCTEX_NOTHING
 #       pragma mark -
@@ -1027,7 +1165,7 @@
   *  - parameter NODE: of type synctex_node_p
  */
 #   define SYNCTEX_DATA(NODE) ((*((((NODE)->class_))->info))(NODE))
-#if defined SYNCTEX_DEBUG > 1000
+#if SYNCTEX_DEBUG > 1000
 #   define DEFINE_SYNCTEX_DATA_HAS(WHAT) \
 SYNCTEX_INLINE static synctex_bool_t __synctex_data_has_##WHAT(synctex_node_p 
node) {\
     return (node && (node->class_->modelator->WHAT>=0));\
@@ -1070,7 +1208,7 @@
 #define DEFINE_SYNCTEX_DATA_INT_DECODE(WHAT) \
 static synctex_status_t _synctex_data_decode_##WHAT(synctex_node_p node) {\
     if (_synctex_data_has_##WHAT(node)) {\
-        synctex_is_s is = _synctex_decode_int(node->class_->scanner);\
+        _synctex_is_s is = _synctex_decode_int(node->class_->scanner);\
         if (is.status == SYNCTEX_STATUS_OK) {\
             _synctex_data_set_##WHAT(node,is.integer);\
         } \
@@ -1081,7 +1219,7 @@
 #   define DEFINE_SYNCTEX_DATA_INT_DECODE_v(WHAT) \
 static synctex_status_t _synctex_data_decode_##WHAT##_v(synctex_node_p node) {\
     if (_synctex_data_has_##WHAT(node)) {\
-        synctex_is_s is = _synctex_decode_int_v(node->class_->scanner);\
+        _synctex_is_s is = _synctex_decode_int_v(node->class_->scanner);\
         if (is.status == SYNCTEX_STATUS_OK) {\
             _synctex_data_set_##WHAT(node,is.integer);\
         } \
@@ -1108,7 +1246,7 @@
 #define DEFINE_SYNCTEX_DATA_STR_DECODE(WHAT) \
 static synctex_status_t _synctex_data_decode_##WHAT(synctex_node_p node) {\
     if (_synctex_data_has_##WHAT(node)) {\
-        synctex_ss_s ss = _synctex_decode_string(node->class_->scanner);\
+        _synctex_ss_s ss = _synctex_decode_string(node->class_->scanner);\
         if (ss.status == SYNCTEX_STATUS_OK) {\
             _synctex_data_set_##WHAT(node,ss.string);\
         } \
@@ -1145,7 +1283,7 @@
 
 #   define SYNCTEX_INPUT_MARK "Input:"
 
-static const synctex_tree_model_s synctex_tree_model_input = {
+static const _synctex_tree_model_s synctex_tree_model_input = {
     synctex_tree_sibling_idx, /* sibling */
     -1, /* parent */
     -1, /* child */
@@ -1156,7 +1294,7 @@
     -1, /* target */
     synctex_tree_s_input_max
 };
-static const synctex_data_model_s synctex_data_model_input = {
+static const _synctex_data_model_s synctex_data_model_input = {
     synctex_data_input_tag_idx, /* tag */
     synctex_data_input_line_idx,/* line */
     -1, /* column */
@@ -1186,13 +1324,13 @@
 static char * _synctex_abstract_input(synctex_node_p node);
 static void _synctex_display_input(synctex_node_p node);
 
-static const synctex_tlcpector_s synctex_tlcpector_input = {
+static const _synctex_tlcpector_s synctex_tlcpector_input = {
     &_synctex_data_tag, /* tag */
     &_synctex_int_none, /* line */
     &_synctex_int_none, /* column */
 };
 
-static synctex_class_s synctex_class_input = {
+static _synctex_class_s _synctex_class_input = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_input,    /*  Node type */
     &_synctex_new_input,        /*  creator */
@@ -1207,15 +1345,25 @@
     &synctex_vispector_none,    /*  vispector */
 };
 
+/**
+ * @brief Input node structure
+ * 
+ */
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_s_input_max+synctex_data_input_tln_max];
-} synctex_input_s;
+    _synctex_data_u data[synctex_tree_s_input_max+synctex_data_input_tln_max];
+} _synctex_input_s;
 
+/**
+ * @brief Input node constructor
+ * 
+ * @param scanner 
+ * @return synctex_node_p 
+ */
 static synctex_node_p _synctex_new_input(synctex_scanner_p scanner) {
     if (scanner) {
-        synctex_node_p node = _synctex_malloc(sizeof(synctex_input_s));
+        synctex_node_p node = _synctex_malloc(sizeof(_synctex_input_s));
         if (node) {
             node->class_ = scanner->class_+synctex_node_type_input;
             SYNCTEX_DID_NEW(node);
@@ -1227,11 +1375,16 @@
     return NULL;
 }
 
+/**
+ * @brief Input node destructor
+ * 
+ * @param node 
+ */
 static void _synctex_free_input(synctex_node_p node){
     if (node) {
         SYNCTEX_SCANNER_REMOVE_HANDLE_TO(node);
         SYNCTEX_WILL_FREE(node);
-        synctex_node_free(__synctex_tree_sibling(node));
+        _synctex_node_free(__synctex_tree_sibling(node));
         _synctex_free(_synctex_data_name(node));
         _synctex_free(node);
     }
@@ -1257,8 +1410,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_scn_sheet_max+synctex_data_p_sheet_max];
-} synctex_node_sheet_s;
+    _synctex_data_u data[synctex_tree_scn_sheet_max+synctex_data_p_sheet_max];
+} _synctex_node_sheet_s;
 
 /*  sheet node creator */
 
@@ -1266,7 +1419,7 @@
 static synctex_node_p _synctex_new_##NAME(synctex_scanner_p scanner) {\
     if (scanner) {\
         ++SYNCTEX_CUR;\
-        synctex_node_p node = 
_synctex_malloc(sizeof(synctex_node_##NAME##_s));\
+        synctex_node_p node = 
_synctex_malloc(sizeof(_synctex_node_##NAME##_s));\
         if (node) {\
             node->class_ = scanner->class_+synctex_node_type_##NAME;\
             SYNCTEX_DID_NEW(node); \
@@ -1285,7 +1438,7 @@
 static char * _synctex_abstract_sheet(synctex_node_p node);
 static void _synctex_display_sheet(synctex_node_p node);
 
-static const synctex_tree_model_s synctex_tree_model_sheet = {
+static const _synctex_tree_model_s synctex_tree_model_sheet = {
     synctex_tree_sibling_idx, /* sibling */
     -1, /* parent */
     synctex_tree_s_child_idx, /* child */
@@ -1296,7 +1449,7 @@
     -1, /* target */
     synctex_tree_scn_sheet_max
 };
-static const synctex_data_model_s synctex_data_model_sheet = {
+static const _synctex_data_model_s synctex_data_model_sheet = {
     -1, /* tag */
     -1, /* line */
     -1, /* column */
@@ -1316,7 +1469,7 @@
     synctex_data_sheet_page_idx, /* page */
     synctex_data_p_sheet_max
 };
-static synctex_class_s synctex_class_sheet = {
+static _synctex_class_s _synctex_class_sheet = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_sheet,    /*  Node type */
     &_synctex_new_sheet,        /*  creator */
@@ -1340,8 +1493,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_sct_form_max+synctex_data_t_form_max];
-} synctex_node_form_s;
+    _synctex_data_u data[synctex_tree_sct_form_max+synctex_data_t_form_max];
+} _synctex_node_form_s;
 
 DEFINE_synctex_new_scanned_NODE(form)
 
@@ -1349,7 +1502,7 @@
 static void _synctex_display_form(synctex_node_p node);
 static void _synctex_log_form(synctex_node_p node);
 
-static const synctex_tree_model_s synctex_tree_model_form = {
+static const _synctex_tree_model_s synctex_tree_model_form = {
     synctex_tree_sibling_idx, /* sibling */
     -1, /* parent */
     synctex_tree_s_child_idx, /* child */
@@ -1360,7 +1513,7 @@
     synctex_tree_sc_target_idx, /* target */
     synctex_tree_sct_form_max
 };
-static const synctex_data_model_s synctex_data_model_form = {
+static const _synctex_data_model_s synctex_data_model_form = {
     synctex_data_form_tag_idx, /* tag */
     -1, /* line */
     -1, /* column */
@@ -1380,7 +1533,7 @@
     -1, /* page */
     synctex_data_t_form_max
 };
-static synctex_class_s synctex_class_form = {
+static _synctex_class_s _synctex_class_form = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_form,     /*  Node type */
     &_synctex_new_form,         /*  creator */
@@ -1406,8 +1559,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_spcfl_vbox_max+synctex_data_box_max];
-} synctex_node_vbox_s;
+    _synctex_data_u data[synctex_tree_spcfl_vbox_max+synctex_data_box_max];
+} _synctex_node_vbox_s;
 
 /*  vertical box node creator */
 DEFINE_synctex_new_scanned_NODE(vbox)
@@ -1416,7 +1569,7 @@
 static void _synctex_display_vbox(synctex_node_p node);
 static void _synctex_log_vbox(synctex_node_p node);
 
-static const synctex_tree_model_s synctex_tree_model_vbox = {
+static const _synctex_tree_model_s synctex_tree_model_vbox = {
     synctex_tree_sibling_idx,       /* sibling */
     synctex_tree_s_parent_idx,      /* parent */
     synctex_tree_sp_child_idx,      /* child */
@@ -1433,7 +1586,7 @@
 DEFINE_SYNCTEX_DATA_INT_GETSET(column)
 static synctex_status_t _synctex_data_decode_column(synctex_node_p node) {
     if (_synctex_data_has_column(node)) {
-        synctex_is_s is = _synctex_decode_int_opt(node->class_->scanner,
+        _synctex_is_s is = _synctex_decode_int_opt(node->class_->scanner,
             SYNCTEX_DFLT_COLUMN);
         if (is.status == SYNCTEX_STATUS_OK) {
             _synctex_data_set_column(node,is.integer);
@@ -1442,6 +1595,11 @@
     }
     return SYNCTEX_STATUS_BAD_ARGUMENT;
 }
+/*
+Definitions of
+__synctex_data_has_?, _synctex_data_?, _synctex_data_decode_?
+for ? in h, v, width, height, depth
+*/
 DEFINE_SYNCTEX_DATA_INT_GETSET_DECODE(h)
 DEFINE_SYNCTEX_DATA_INT_GETSET_DECODE_v(v)
 DEFINE_SYNCTEX_DATA_INT_GETSET_DECODE(width)
@@ -1459,7 +1617,7 @@
     _synctex_data_set_v(node, _synctex_data_v(model));
 }
 
-static const synctex_data_model_s synctex_data_model_box = {
+static const _synctex_data_model_s synctex_data_model_box = {
     synctex_data_tag_idx, /* tag */
     synctex_data_line_idx,  /* line */
     synctex_data_column_idx,/* column */
@@ -1479,12 +1637,12 @@
     -1, /* page */
     synctex_data_box_max
 };
-static const synctex_tlcpector_s synctex_tlcpector_default = {
+static const _synctex_tlcpector_s synctex_tlcpector_default = {
     &_synctex_data_tag, /* tag */
     &_synctex_data_line, /* line */
     &_synctex_data_column, /* column */
 };
-static const synctex_inspector_s synctex_inspector_box = {
+static const _synctex_inspector_s _synctex_inspector_box = {
     &_synctex_data_h,
     &_synctex_data_v,
     &_synctex_data_width,
@@ -1496,7 +1654,7 @@
 static float __synctex_node_visible_width(synctex_node_p node);
 static float __synctex_node_visible_height(synctex_node_p node);
 static float __synctex_node_visible_depth(synctex_node_p node);
-static synctex_vispector_s synctex_vispector_box = {
+static _synctex_vispector_s _synctex_vispector_box = {
     &__synctex_node_visible_h,
     &__synctex_node_visible_v,
     &__synctex_node_visible_width,
@@ -1505,7 +1663,7 @@
 };
 /*  These are static class objects, each scanner will make a copy of them and 
setup the scanner field.
  */
-static synctex_class_s synctex_class_vbox = {
+static _synctex_class_s _synctex_class_vbox = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_vbox,     /*  Node type */
     &_synctex_new_vbox,         /*  creator */
@@ -1516,8 +1674,8 @@
     &synctex_tree_model_vbox,   /*  tree model */
     &synctex_data_model_box,    /*  data model */
     &synctex_tlcpector_default, /*  tlcpector */
-    &synctex_inspector_box,     /*  inspector */
-    &synctex_vispector_box,     /*  vispector */
+    &_synctex_inspector_box,     /*  inspector */
+    &_synctex_vispector_box,     /*  vispector */
 };
 
 #      ifdef SYNCTEX_NOTHING
@@ -1527,7 +1685,7 @@
 /*  Horizontal boxes must contain visible size, because 0 width does not mean 
emptiness.
  *  They also contain an average of the line numbers of the containing nodes. 
*/
 
-static const synctex_tree_model_s synctex_tree_model_hbox = {
+static const _synctex_tree_model_s synctex_tree_model_hbox = {
     synctex_tree_sibling_idx,       /* sibling */
     synctex_tree_s_parent_idx,      /* parent */
     synctex_tree_sp_child_idx,      /* child */
@@ -1558,7 +1716,7 @@
  *  - author: JL
  */
 
-static const synctex_data_model_s synctex_data_model_hbox = {
+static const _synctex_data_model_s synctex_data_model_hbox = {
     synctex_data_tag_idx, /* tag */
     synctex_data_line_idx,  /* line */
     synctex_data_column_idx,/* column */
@@ -1582,8 +1740,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_spcfln_hbox_max+synctex_data_hbox_max];
-} synctex_node_hbox_s;
+    _synctex_data_u data[synctex_tree_spcfln_hbox_max+synctex_data_hbox_max];
+} _synctex_node_hbox_s;
 
 /*  horizontal box node creator */
 DEFINE_synctex_new_scanned_NODE(hbox)
@@ -1592,7 +1750,7 @@
 static char * _synctex_abstract_hbox(synctex_node_p node);
 static void _synctex_display_hbox(synctex_node_p node);
 
-static synctex_class_s synctex_class_hbox = {
+static _synctex_class_s _synctex_class_hbox = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_hbox,     /*  Node type */
     &_synctex_new_hbox,         /*  creator */
@@ -1603,8 +1761,8 @@
     &synctex_tree_model_hbox,   /*  tree model */
     &synctex_data_model_hbox,   /*  data model */
     &synctex_tlcpector_default, /*  tlcpector */
-    &synctex_inspector_box,     /*  inspector */
-    &synctex_vispector_box,     /*  vispector */
+    &_synctex_inspector_box,     /*  inspector */
+    &_synctex_vispector_box,     /*  vispector */
 };
 
 #      ifdef SYNCTEX_NOTHING
@@ -1614,7 +1772,7 @@
 /*  This void box node implementation is either horizontal or vertical
  *  It does not contain a child field.
  */
-static const synctex_tree_model_s synctex_tree_model_spf = {
+static const _synctex_tree_model_s synctex_tree_model_spf = {
     synctex_tree_sibling_idx,   /* sibling */
     synctex_tree_s_parent_idx,  /* parent */
     -1, /* child */
@@ -1628,8 +1786,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_spf_max+synctex_data_box_max];
-} synctex_node_void_vbox_s;
+    _synctex_data_u data[synctex_tree_spf_max+synctex_data_box_max];
+} _synctex_node_void_vbox_s;
 
 /*  vertical void box node creator */
 DEFINE_synctex_new_scanned_NODE(void_vbox)
@@ -1638,7 +1796,7 @@
 static char * _synctex_abstract_void_vbox(synctex_node_p node);
 static void _synctex_display_void_vbox(synctex_node_p node);
 
-static synctex_class_s synctex_class_void_vbox = {
+static _synctex_class_s _synctex_class_void_vbox = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_void_vbox,/*  Node type */
     &_synctex_new_void_vbox,    /*  creator */
@@ -1649,8 +1807,8 @@
     &synctex_tree_model_spf,    /*  tree model */
     &synctex_data_model_box,    /*  data model */
     &synctex_tlcpector_default, /*  tlcpector */
-    &synctex_inspector_box,     /*  inspector */
-    &synctex_vispector_box,     /*  vispector */
+    &_synctex_inspector_box,     /*  inspector */
+    &_synctex_vispector_box,     /*  vispector */
 };
 
 #      ifdef SYNCTEX_NOTHING
@@ -1657,7 +1815,7 @@
 #       pragma mark void hbox.
 #   endif
 
-typedef synctex_node_void_vbox_s synctex_node_void_hbox_s;
+typedef _synctex_node_void_vbox_s _synctex_node_void_hbox_s;
 
 /*  horizontal void box node creator */
 DEFINE_synctex_new_scanned_NODE(void_hbox)
@@ -1665,7 +1823,7 @@
 static char * _synctex_abstract_void_hbox(synctex_node_p node);
 static void _synctex_display_void_hbox(synctex_node_p node);
 
-static synctex_class_s synctex_class_void_hbox = {
+static _synctex_class_s _synctex_class_void_hbox = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_void_hbox,/*  Node type */
     &_synctex_new_void_hbox,    /*  creator */
@@ -1676,8 +1834,8 @@
     &synctex_tree_model_spf,    /*  tree model */
     &synctex_data_model_box,    /*  data model */
     &synctex_tlcpector_default, /*  tlcpector */
-    &synctex_inspector_box,     /*  inspector */
-    &synctex_vispector_box,     /*  vispector */
+    &_synctex_inspector_box,     /*  inspector */
+    &_synctex_vispector_box,     /*  vispector */
 };
 
 #      ifdef SYNCTEX_NOTHING
@@ -1688,8 +1846,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_spfa_max+synctex_data_ref_thv_max];
-} synctex_node_ref_s;
+    _synctex_data_u data[synctex_tree_spfa_max+synctex_data_ref_thv_max];
+} _synctex_node_ref_s;
 
 /*  form ref node creator */
 DEFINE_synctex_new_scanned_NODE(ref)
@@ -1698,7 +1856,7 @@
 static char * _synctex_abstract_ref(synctex_node_p node);
 static void _synctex_display_ref(synctex_node_p node);
 
-static const synctex_tree_model_s synctex_tree_model_spfa = {
+static const _synctex_tree_model_s synctex_tree_model_spfa = {
     synctex_tree_sibling_idx,   /* sibling */
     synctex_tree_s_parent_idx,  /* parent */
     -1, /* child */
@@ -1709,7 +1867,7 @@
     -1, /* target */
     synctex_tree_spfa_max
 };
-static const synctex_data_model_s synctex_data_model_ref = {
+static const _synctex_data_model_s synctex_data_model_ref = {
     synctex_data_tag_idx, /* tag */
     -1, /* line */
     -1, /* column */
@@ -1729,7 +1887,7 @@
     -1, /* page */
     synctex_data_ref_thv_max /* size */
 };
-static synctex_class_s synctex_class_ref = {
+static _synctex_class_s _synctex_class_ref = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_ref,      /*  Node type */
     &_synctex_new_ref,          /*  creator */
@@ -1748,7 +1906,7 @@
 #   endif
 
 /*  The small nodes correspond to glue, penalty, math and boundary nodes. */
-static const synctex_data_model_s synctex_data_model_tlchv = {
+static const _synctex_data_model_s synctex_data_model_tlchv = {
     synctex_data_tag_idx, /* tag */
     synctex_data_line_idx, /* line */
     synctex_data_column_idx, /* column */
@@ -1772,8 +1930,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_spf_max+synctex_data_tlchv_max];
-} synctex_node_tlchv_s;
+    _synctex_data_u data[synctex_tree_spf_max+synctex_data_tlchv_max];
+} _synctex_node_tlchv_s;
 
 static void _synctex_log_tlchv_node(synctex_node_p node);
 
@@ -1781,7 +1939,7 @@
 #       pragma mark math.
 #   endif
 
-typedef synctex_node_tlchv_s synctex_node_math_s;
+typedef _synctex_node_tlchv_s _synctex_node_math_s;
 
 /*  math node creator */
 DEFINE_synctex_new_scanned_NODE(math)
@@ -1788,7 +1946,7 @@
 
 static char * _synctex_abstract_math(synctex_node_p node);
 static void _synctex_display_math(synctex_node_p node);
-static synctex_inspector_s synctex_inspector_hv = {
+static _synctex_inspector_s synctex_inspector_hv = {
     &_synctex_data_h,
     &_synctex_data_v,
     &_synctex_int_none,
@@ -1795,7 +1953,7 @@
     &_synctex_int_none,
     &_synctex_int_none,
 };
-static synctex_vispector_s synctex_vispector_hv = {
+static _synctex_vispector_s synctex_vispector_hv = {
     &__synctex_node_visible_h,
     &__synctex_node_visible_v,
     &_synctex_float_none,
@@ -1803,7 +1961,7 @@
     &_synctex_float_none,
 };
 
-static synctex_class_s synctex_class_math = {
+static _synctex_class_s _synctex_class_math = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_math,     /*  Node type */
     &_synctex_new_math,         /*  creator */
@@ -1822,7 +1980,7 @@
 #       pragma mark kern node.
 #   endif
 
-static const synctex_data_model_s synctex_data_model_tlchvw = {
+static const _synctex_data_model_s synctex_data_model_tlchvw = {
     synctex_data_tag_idx,   /* tag */
     synctex_data_line_idx,  /* line */
     synctex_data_column_idx,/* column */
@@ -1845,8 +2003,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_spf_max+synctex_data_tlchvw_max];
-} synctex_node_kern_s;
+    _synctex_data_u data[synctex_tree_spf_max+synctex_data_tlchvw_max];
+} _synctex_node_kern_s;
 
 /*  kern node creator */
 DEFINE_synctex_new_scanned_NODE(kern)
@@ -1855,7 +2013,7 @@
 static char * _synctex_abstract_kern(synctex_node_p node);
 static void _synctex_display_kern(synctex_node_p node);
 
-static synctex_inspector_s synctex_inspector_kern = {
+static _synctex_inspector_s synctex_inspector_kern = {
     &_synctex_data_h,
     &_synctex_data_v,
     &_synctex_data_width,
@@ -1864,7 +2022,7 @@
 };
 static float __synctex_kern_visible_h(synctex_node_p node);
 static float __synctex_kern_visible_width(synctex_node_p node);
-static synctex_vispector_s synctex_vispector_kern = {
+static _synctex_vispector_s synctex_vispector_kern = {
     &__synctex_kern_visible_h,
     &__synctex_node_visible_v,
     &__synctex_kern_visible_width,
@@ -1872,7 +2030,7 @@
     &_synctex_float_none,
 };
 
-static synctex_class_s synctex_class_kern = {
+static _synctex_class_s _synctex_class_kern = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_kern,     /*  Node type */
     &_synctex_new_kern,         /*  creator */
@@ -1892,13 +2050,13 @@
 #   endif
 
 /*  glue node creator */
-typedef synctex_node_tlchv_s synctex_node_glue_s;
+typedef _synctex_node_tlchv_s _synctex_node_glue_s;
 DEFINE_synctex_new_scanned_NODE(glue)
 
 static char * _synctex_abstract_glue(synctex_node_p node);
 static void _synctex_display_glue(synctex_node_p node);
 
-static synctex_class_s synctex_class_glue = {
+static _synctex_class_s _synctex_class_glue = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_glue,     /*  Node type */
     &_synctex_new_glue,         /*  creator */
@@ -1922,8 +2080,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_spf_max+synctex_data_box_max];
-} synctex_node_rule_s;
+    _synctex_data_u data[synctex_tree_spf_max+synctex_data_box_max];
+} _synctex_node_rule_s;
 
 DEFINE_synctex_new_scanned_NODE(rule)
 
@@ -1936,7 +2094,7 @@
 static float __synctex_rule_visible_width(synctex_node_p node);
 static float __synctex_rule_visible_height(synctex_node_p node);
 static float __synctex_rule_visible_depth(synctex_node_p node);
-static synctex_vispector_s synctex_vispector_rule = {
+static _synctex_vispector_s _synctex_vispector_rule = {
     &__synctex_rule_visible_h,
     &__synctex_rule_visible_v,
     &__synctex_rule_visible_width,
@@ -1944,7 +2102,7 @@
     &__synctex_rule_visible_depth,
 };
 
-static synctex_class_s synctex_class_rule = {
+static _synctex_class_s _synctex_class_rule = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_rule,     /*  Node type */
     &_synctex_new_rule,         /*  creator */
@@ -1955,8 +2113,8 @@
     &synctex_tree_model_spf,    /*  tree model */
     &synctex_data_model_box,    /*  data model */
     &synctex_tlcpector_default, /*  tlcpector */
-    &synctex_inspector_box,     /*  inspector */
-    &synctex_vispector_rule,    /*  vispector */
+    &_synctex_inspector_box,     /*  inspector */
+    &_synctex_vispector_rule,    /*  vispector */
 };
 
 #      ifdef SYNCTEX_NOTHING
@@ -1964,13 +2122,13 @@
 #   endif
 
 /*  boundary node creator */
-typedef synctex_node_tlchv_s synctex_node_boundary_s;
+typedef _synctex_node_tlchv_s _synctex_node_boundary_s;
 DEFINE_synctex_new_scanned_NODE(boundary)
 
 static char * _synctex_abstract_boundary(synctex_node_p node);
 static void _synctex_display_boundary(synctex_node_p node);
 
-static synctex_class_s synctex_class_boundary = {
+static _synctex_class_s _synctex_class_boundary = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_boundary, /*  Node type */
     &_synctex_new_boundary,     /*  creator */
@@ -1992,13 +2150,13 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_spfa_max+synctex_data_tlchv_max];
-} synctex_node_box_bdry_s;
+    _synctex_data_u data[synctex_tree_spfa_max+synctex_data_tlchv_max];
+} _synctex_node_box_bdry_s;
 
 #define DEFINE_synctex_new_unscanned_NODE(NAME)\
 SYNCTEX_INLINE static synctex_node_p _synctex_new_##NAME(synctex_scanner_p 
scanner) {\
     if (scanner) {\
-        synctex_node_p node = 
_synctex_malloc(sizeof(synctex_node_##NAME##_s));\
+        synctex_node_p node = 
_synctex_malloc(sizeof(_synctex_node_##NAME##_s));\
         if (node) {\
             node->class_ = scanner->class_+synctex_node_type_##NAME;\
             SYNCTEX_DID_NEW(node); \
@@ -2012,7 +2170,7 @@
 static char * _synctex_abstract_box_bdry(synctex_node_p node);
 static void _synctex_display_box_bdry(synctex_node_p node);
 
-static synctex_class_s synctex_class_box_bdry = {
+static _synctex_class_s _synctex_class_box_bdry = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_box_bdry, /*  Node type */
     &_synctex_new_box_bdry,     /*  creator */
@@ -2103,7 +2261,7 @@
  *  A proxy do have a target, which can be a proxy
  */
 
-static const synctex_tree_model_s synctex_tree_model_proxy_hbox = {
+static const _synctex_tree_model_s synctex_tree_model_proxy_hbox = {
     synctex_tree_sibling_idx,       /* sibling */
     synctex_tree_s_parent_idx,      /* parent */
     synctex_tree_sp_child_idx,      /* child */
@@ -2114,7 +2272,7 @@
     synctex_tree_spcfln_target_idx, /* target */
     synctex_tree_spcflnt_proxy_hbox_max
 };
-static const synctex_data_model_s synctex_data_model_proxy = {
+static const _synctex_data_model_s synctex_data_model_proxy = {
     -1, /* tag */
     -1, /* line */
     -1, /* column */
@@ -2137,8 +2295,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u 
data[synctex_tree_spcflnt_proxy_hbox_max+synctex_data_proxy_hv_max];
-} synctex_node_proxy_hbox_s;
+    _synctex_data_u 
data[synctex_tree_spcflnt_proxy_hbox_max+synctex_data_proxy_hv_max];
+} _synctex_node_proxy_hbox_s;
 
 /*  box proxy node creator */
 DEFINE_synctex_new_unscanned_NODE(proxy_hbox)
@@ -2151,7 +2309,7 @@
 static int _synctex_proxy_line(synctex_node_p);
 static int _synctex_proxy_column(synctex_node_p);
 
-static synctex_tlcpector_s synctex_tlcpector_proxy = {
+static _synctex_tlcpector_s synctex_tlcpector_proxy = {
     &_synctex_proxy_tag,
     &_synctex_proxy_line,
     &_synctex_proxy_column,
@@ -2161,7 +2319,7 @@
 static int _synctex_proxy_width(synctex_node_p);
 static int _synctex_proxy_height(synctex_node_p);
 static int _synctex_proxy_depth(synctex_node_p);
-static synctex_inspector_s synctex_inspector_proxy_box = {
+static _synctex_inspector_s synctex_inspector_proxy_box = {
     &_synctex_proxy_h,
     &_synctex_proxy_v,
     &_synctex_proxy_width,
@@ -2175,7 +2333,7 @@
 static float __synctex_proxy_visible_height(synctex_node_p);
 static float __synctex_proxy_visible_depth(synctex_node_p);
 
-static synctex_vispector_s synctex_vispector_proxy_box = {
+static _synctex_vispector_s synctex_vispector_proxy_box = {
     &__synctex_proxy_visible_h,
     &__synctex_proxy_visible_v,
     &__synctex_proxy_visible_width,
@@ -2183,7 +2341,7 @@
     &__synctex_proxy_visible_depth,
 };
 
-static synctex_class_s synctex_class_proxy_hbox = {
+static _synctex_class_s _synctex_class_proxy_hbox = {
     NULL,                           /*  No scanner yet */
     synctex_node_type_proxy_hbox,   /*  Node type */
     &_synctex_new_proxy_hbox,       /*  creator */
@@ -2204,7 +2362,7 @@
 
 /*  A proxy to a vbox. */
 
-static const synctex_tree_model_s synctex_tree_model_proxy_vbox = {
+static const _synctex_tree_model_s synctex_tree_model_proxy_vbox = {
     synctex_tree_sibling_idx,       /* sibling */
     synctex_tree_s_parent_idx,      /* parent */
     synctex_tree_sp_child_idx,      /* child */
@@ -2219,8 +2377,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u 
data[synctex_tree_spcflt_proxy_vbox_max+synctex_data_proxy_hv_max];
-} synctex_node_proxy_vbox_s;
+    _synctex_data_u 
data[synctex_tree_spcflt_proxy_vbox_max+synctex_data_proxy_hv_max];
+} _synctex_node_proxy_vbox_s;
 
 /*  box proxy node creator */
 DEFINE_synctex_new_unscanned_NODE(proxy_vbox)
@@ -2229,7 +2387,7 @@
 static char * _synctex_abstract_proxy_vbox(synctex_node_p node);
 static void _synctex_display_proxy_vbox(synctex_node_p node);
 
-static synctex_class_s synctex_class_proxy_vbox = {
+static _synctex_class_s _synctex_class_proxy_vbox = {
     NULL,                           /*  No scanner yet */
     synctex_node_type_proxy_vbox,   /*  Node type */
     &_synctex_new_proxy_vbox,       /*  creator */
@@ -2252,7 +2410,7 @@
  *  A proxy to a node but a box.
  */
 
-static const synctex_tree_model_s synctex_tree_model_proxy = {
+static const _synctex_tree_model_s synctex_tree_model_proxy = {
     synctex_tree_sibling_idx,   /* sibling */
     synctex_tree_s_parent_idx,  /* parent */
     -1, /* child */
@@ -2267,8 +2425,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u data[synctex_tree_spft_proxy_max+synctex_data_proxy_hv_max];
-} synctex_node_proxy_s;
+    _synctex_data_u 
data[synctex_tree_spft_proxy_max+synctex_data_proxy_hv_max];
+} _synctex_node_proxy_s;
 
 /*  proxy node creator */
 DEFINE_synctex_new_unscanned_NODE(proxy)
@@ -2277,7 +2435,7 @@
 static char * _synctex_abstract_proxy(synctex_node_p node);
 static void _synctex_display_proxy(synctex_node_p node);
 
-static synctex_vispector_s synctex_vispector_proxy = {
+static _synctex_vispector_s synctex_vispector_proxy = {
     &__synctex_proxy_visible_h,
     &__synctex_proxy_visible_v,
     &__synctex_proxy_visible_width,
@@ -2285,7 +2443,7 @@
     &_synctex_float_none,
 };
 
-static synctex_class_s synctex_class_proxy = {
+static _synctex_class_s _synctex_class_proxy = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_proxy,    /*  Node type */
     &_synctex_new_proxy,        /*  creator */
@@ -2308,7 +2466,7 @@
  *  A proxy to the last proxy/box boundary.
  */
 
-static const synctex_tree_model_s synctex_tree_model_proxy_last = {
+static const _synctex_tree_model_s synctex_tree_model_proxy_last = {
     synctex_tree_sibling_idx,   /* sibling */
     synctex_tree_s_parent_idx,  /* parent */
     -1, /* child */
@@ -2323,8 +2481,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u 
data[synctex_tree_spfat_proxy_last_max+synctex_data_proxy_hv_max];
-} synctex_node_proxy_last_s;
+    _synctex_data_u 
data[synctex_tree_spfat_proxy_last_max+synctex_data_proxy_hv_max];
+} _synctex_node_proxy_last_s;
 
 /*  proxy node creator */
 DEFINE_synctex_new_unscanned_NODE(proxy_last)
@@ -2333,7 +2491,7 @@
 static char * _synctex_abstract_proxy(synctex_node_p node);
 static void _synctex_display_proxy(synctex_node_p node);
 
-static synctex_class_s synctex_class_proxy_last = {
+static _synctex_class_s _synctex_class_proxy_last = {
     NULL,                           /*  No scanner yet */
     synctex_node_type_proxy_last,   /*  Node type */
     &_synctex_new_proxy,            /*  creator */
@@ -2344,7 +2502,7 @@
     &synctex_tree_model_proxy_last, /*  tree model */
     &synctex_data_model_proxy,      /*  data model */
     &synctex_tlcpector_proxy,       /*  tlcpector */
-    &synctex_inspector_proxy_box,       /*  inspector */
+    &synctex_inspector_proxy_box,   /*  inspector */
     &synctex_vispector_proxy,       /*  vispector */
 };
 
@@ -2361,7 +2519,7 @@
  *  The parent of a handle is always a handle if any.
  */
 
-static const synctex_tree_model_s synctex_tree_model_handle = {
+static const _synctex_tree_model_s synctex_tree_model_handle = {
     synctex_tree_sibling_idx,   /* sibling */
     synctex_tree_s_parent_idx,  /* parent */
     synctex_tree_sp_child_idx,  /* child */
@@ -2373,7 +2531,7 @@
     synctex_tree_spct_handle_max
 };
 
-static const synctex_data_model_s synctex_data_model_handle = {
+static const _synctex_data_model_s synctex_data_model_handle = {
     -1, /* tag */
     -1, /* line */
     -1, /* column */
@@ -2397,8 +2555,8 @@
 typedef struct {
     SYNCTEX_DECLARE_CHARINDEX
     synctex_class_p class_;
-    synctex_data_u 
data[synctex_tree_spct_handle_max+synctex_data_handle_w_max];
-} synctex_node_handle_s;
+    _synctex_data_u 
data[synctex_tree_spct_handle_max+synctex_data_handle_w_max];
+} _synctex_node_handle_s;
 
 /*  handle node creator */
 DEFINE_synctex_new_unscanned_NODE(handle)
@@ -2407,7 +2565,7 @@
 static char * _synctex_abstract_handle(synctex_node_p node);
 static void _synctex_display_handle(synctex_node_p node);
 
-static synctex_class_s synctex_class_handle = {
+static _synctex_class_s _synctex_class_handle = {
     NULL,                       /*  No scanner yet */
     synctex_node_type_handle,   /*  Node type */
     &_synctex_new_handle,       /*  creator */
@@ -2570,11 +2728,11 @@
     return NULL;
 }
 SYNCTEX_INLINE static synctex_node_p _synctex_tree_set_sibling(synctex_node_p 
node, synctex_node_p new_sibling);
-typedef struct synctex_nns_t {
+typedef struct _synctex_nns_t {
     synctex_node_p first;
     synctex_node_p last;
     synctex_status_t status;
-} synctex_nns_s;
+} _synctex_nns_s;
 /**
  *  Given a target node, create a list of proxies.
  *  The first proxy points to the target node,
@@ -2582,8 +2740,8 @@
  *  Returns the first created proxy, the last one and
  *  an error status.
  */
-SYNCTEX_INLINE static synctex_nns_s 
_synctex_new_child_proxies_to(synctex_node_p owner, synctex_node_p to_node) {
-    synctex_nns_s nns = {NULL,NULL,SYNCTEX_STATUS_OK};
+SYNCTEX_INLINE static _synctex_nns_s 
_synctex_new_child_proxies_to(synctex_node_p owner, synctex_node_p to_node) {
+    _synctex_nns_s nns = {NULL,NULL,SYNCTEX_STATUS_OK};
     if ((nns.first = nns.last = __synctex_new_child_proxy_to(owner,to_node))) {
         synctex_node_p to_next_sibling = __synctex_tree_sibling(to_node);
         synctex_node_p to_sibling;
@@ -2653,7 +2811,7 @@
         i = i%(node->class_->scanner->number_of_lists);
         old = 
synctex_tree_set_friend(node,(node->class_->scanner->lists_of_friends)[i]);
         (node->class_->scanner->lists_of_friends)[i] = node;
-#if SYNCTEX_DEBUG>500
+#if SYNCTEX_DEBUG > 500
         printf("tl(%i)=>",i);
         synctex_node_log(node);
         if (synctex_node_parent_form(node)) {
@@ -2729,7 +2887,7 @@
         if ((child = synctex_node_child(target))) {
             /*  This is a proxy with no child
              *  which target does have a child. */
-            synctex_nns_s nns = _synctex_new_child_proxies_to(node, child);
+            _synctex_nns_s nns = _synctex_new_child_proxies_to(node, child);
             if (nns.first) {
                 _synctex_node_set_child(node,nns.first);
                 return nns.first;
@@ -3659,7 +3817,7 @@
                synctex_node_line(node),
                _synctex_data_h(node),
                _synctex_data_v(node),
-               node,
+               (void*)node, // Fix GCC warning: %p expects a void* according 
to POSIX
                _synctex_node_abstract(N));
     }
     return abstract;
@@ -3743,7 +3901,7 @@
                synctex_node_width(node),
                synctex_node_height(node),
                synctex_node_depth(node),
-               node
+               (void*)node // Fix GCC warning: %p expects a void* according to 
POSIX
                SYNCTEX_PRINT_CHARINDEX_WHAT);
     }
     return abstract;
@@ -3808,32 +3966,52 @@
 #       pragma mark -
 #       pragma mark Prototypes
 #   endif
+/**
+ * @brief size+status structure
+ * 
+ * Used to return multiple values from a function.
+ */
 typedef struct {
+    /** a size */
     size_t size;
+    /** a status error */
     synctex_status_t status;
-} synctex_zs_s;
-static synctex_zs_s _synctex_buffer_get_available_size(synctex_scanner_p 
scanner, size_t size);
+} _synctex_zs_s;
+static _synctex_zs_s _synctex_buffer_get_available_size(synctex_scanner_p 
scanner, size_t size);
 static synctex_status_t _synctex_next_line(synctex_scanner_p scanner);
 static synctex_status_t _synctex_match_string(synctex_scanner_p scanner, const 
char * the_string);
 
-typedef struct synctex_ns_t {
+/**
+ * @brief node+status structure
+ * 
+ * Used to return multiple values from a function.
+ */
+typedef struct {
+    /** node component */
     synctex_node_p node;
+    /** error status component */
     synctex_status_t status;
-} synctex_ns_s;
-static synctex_ns_s __synctex_parse_new_input(synctex_scanner_p scanner);
+} _synctex_ns_s;
+static _synctex_ns_s __synctex_parse_new_input(synctex_scanner_p scanner);
 static synctex_status_t _synctex_scan_preamble(synctex_scanner_p scanner);
+/**
+ * @brief float+status structure
+ * 
+ * Used to return multiple values from a function.
+ */
 typedef struct {
+    /** float component */
     float value;
+    /** error status component */
     synctex_status_t status;
-} synctex_fs_s;
-static synctex_fs_s _synctex_scan_float_and_dimension(synctex_scanner_p 
scanner);
+} _synctex_fs_s;
+static _synctex_fs_s _synctex_scan_float_and_dimension(synctex_scanner_p 
scanner);
 static synctex_status_t _synctex_scan_post_scriptum(synctex_scanner_p scanner);
 static synctex_status_t _synctex_scan_postamble(synctex_scanner_p scanner);
 static synctex_status_t _synctex_setup_visible_hbox(synctex_node_p box);
 static synctex_status_t _synctex_scan_content(synctex_scanner_p scanner);
-int synctex_scanner_pre_x_offset(synctex_scanner_p scanner);
-int synctex_scanner_pre_y_offset(synctex_scanner_p scanner);
-const char * synctex_scanner_get_output_fmt(synctex_scanner_p scanner);
+int _synctex_scanner_pre_x_offset(synctex_scanner_p scanner);
+int _synctex_scanner_pre_y_offset(synctex_scanner_p scanner);
 
 #      ifdef SYNCTEX_NOTHING
 #       pragma mark -
@@ -3855,10 +4033,10 @@
  *  - parameter expected: expected number of bytes.
  *  - returns: a size and a status.
  */
-static synctex_zs_s _synctex_buffer_get_available_size(synctex_scanner_p 
scanner, size_t expected) {
+static _synctex_zs_s _synctex_buffer_get_available_size(synctex_scanner_p 
scanner, size_t expected) {
     size_t size = 0;
     if (NULL == scanner) {
-        return (synctex_zs_s){0,SYNCTEX_STATUS_BAD_ARGUMENT};
+        return (_synctex_zs_s){0,SYNCTEX_STATUS_BAD_ARGUMENT};
     }
     if (expected>scanner->reader->size){
         expected = scanner->reader->size;
@@ -3866,7 +4044,7 @@
     size = SYNCTEX_END - SYNCTEX_CUR; /*  available is the number of unparsed 
chars in the buffer */
     if (expected<=size) {
         /*  There are already sufficiently many characters in the buffer */
-        return (synctex_zs_s){size,SYNCTEX_STATUS_OK};
+        return (_synctex_zs_s){size,SYNCTEX_STATUS_OK};
     }
     if (SYNCTEX_FILE) {
         /*  Copy the remaining part of the buffer to the beginning,
@@ -3891,7 +4069,7 @@
             * SYNCTEX_END = '\0'; /* there is enough room */
             SYNCTEX_CUR = SYNCTEX_START;
             /*  May be available is less than size, the caller will have to 
test. */
-            return (synctex_zs_s){SYNCTEX_END - SYNCTEX_CUR,SYNCTEX_STATUS_OK};
+            return (_synctex_zs_s){SYNCTEX_END - 
SYNCTEX_CUR,SYNCTEX_STATUS_OK};
         } else if (0>already_read) {
             /*  There is a possible error in reading the file */
             int errnum = 0;
@@ -3899,10 +4077,10 @@
             if (Z_ERRNO == errnum) {
                 /*  There is an error in zlib caused by the file system */
                 _synctex_error("gzread error from the file system (%i)",errno);
-                return (synctex_zs_s){0,SYNCTEX_STATUS_ERROR};
+                return (_synctex_zs_s){0,SYNCTEX_STATUS_ERROR};
             } else if (errnum) {
                 _synctex_error("gzread error 
(%i:%i,%s)",already_read,errnum,error_string);
-                return (synctex_zs_s){0,SYNCTEX_STATUS_ERROR};
+                return (_synctex_zs_s){0,SYNCTEX_STATUS_ERROR};
             }
         }
         /*  Nothing was read, we are at the end of the file. */
@@ -3912,10 +4090,10 @@
         SYNCTEX_CUR = SYNCTEX_START;
         * SYNCTEX_END = '\0';/*  Terminate the string properly.*/
         /*  there might be a bit of text left */
-        return (synctex_zs_s){SYNCTEX_END - SYNCTEX_CUR,SYNCTEX_STATUS_EOF};
+        return (_synctex_zs_s){SYNCTEX_END - SYNCTEX_CUR,SYNCTEX_STATUS_EOF};
     }
     /*  We cannot enlarge the buffer because the end of the file was reached. 
*/
-    return (synctex_zs_s){size,SYNCTEX_STATUS_EOF};
+    return (_synctex_zs_s){size,SYNCTEX_STATUS_EOF};
 }
 
 /*  Used when parsing the synctex file.
@@ -3961,10 +4139,10 @@
  *  As side effect, the buffer state may have changed if the given argument 
string can't fit into the buffer.
  */
 static synctex_status_t _synctex_match_string(synctex_scanner_p scanner, const 
char * the_string) {
-    size_t tested_len = 0; /*  the number of characters at the beginning of 
the_string that match */
+    /* size_t tested_len = 0; */ /*  the number of characters at the beginning 
of the_string that match */
     size_t remaining_len = 0; /*  the number of remaining characters of 
the_string that should match */
     size_t available = 0;
-    synctex_zs_s zs = {0,0};
+    _synctex_zs_s zs = {0,0};
     if (NULL == scanner || NULL == the_string) {
         return SYNCTEX_STATUS_BAD_ARGUMENT;
     }
@@ -3998,7 +4176,7 @@
         the_string += zs.size;
         /*  update the remaining length and the parsed length. */
         remaining_len -= zs.size;
-        tested_len += zs.size;
+        /* tested_len += zs.size; */
         SYNCTEX_CUR += zs.size; /*  We validate the tested characters. */
         if (0 == remaining_len) {
             /*  Nothing left to test, we have found the given string. */
@@ -4049,7 +4227,7 @@
             the_string += available;
             /*  update the remaining length and the parsed length. */
             remaining_len -= zs.size;
-            tested_len += zs.size;
+            /* tested_len += zs.size; */
             SYNCTEX_CUR += zs.size; /*  We validate the tested characters. */
             goto more_characters;
         }
@@ -4075,20 +4253,20 @@
  *  It is SYNCTEX_STATUS_OK if an int has been successfully parsed.
  *  The given scanner argument must not be NULL, on the contrary, value_ref 
may be NULL.
  */
-static synctex_is_s _synctex_decode_int(synctex_scanner_p scanner) {
+static _synctex_is_s _synctex_decode_int(synctex_scanner_p scanner) {
     char * ptr = NULL;
     char * end = NULL;
-    synctex_zs_s zs = {0,0};
+    _synctex_zs_s zs = {0,0};
     int result;
     if (NULL == scanner) {
-        return (synctex_is_s){0, SYNCTEX_STATUS_BAD_ARGUMENT};
+        return (_synctex_is_s){0, SYNCTEX_STATUS_BAD_ARGUMENT};
     }
     zs = _synctex_buffer_get_available_size(scanner, SYNCTEX_BUFFER_MIN_SIZE);
     if (zs.status<SYNCTEX_STATUS_EOF) {
-        return (synctex_is_s){0,zs.status};
+        return (_synctex_is_s){0,zs.status};
     }
     if (zs.size==0) {
-        return (synctex_is_s){0,SYNCTEX_STATUS_NOT_OK};
+        return (_synctex_is_s){0,SYNCTEX_STATUS_NOT_OK};
     }
     ptr = SYNCTEX_CUR;
     /*  Optionally parse the separator */
@@ -4096,29 +4274,29 @@
         ++ptr;
         --zs.size;
         if (zs.size==0) {
-            return (synctex_is_s){0,SYNCTEX_STATUS_NOT_OK};
+            return (_synctex_is_s){0,SYNCTEX_STATUS_NOT_OK};
         }
     }
-    result = (int)strtol(ptr, &end, 10);
+    result = synctex_parse_int(ptr, &end);
     if (end>ptr) {
         SYNCTEX_CUR = end;
-        return (synctex_is_s){result,SYNCTEX_STATUS_OK};
+        return (_synctex_is_s){result,SYNCTEX_STATUS_OK};
     }
-    return (synctex_is_s){result,SYNCTEX_STATUS_NOT_OK};
+    return (_synctex_is_s){result,SYNCTEX_STATUS_NOT_OK};
 }
-static synctex_is_s _synctex_decode_int_opt(synctex_scanner_p scanner, int 
default_value) {
+static _synctex_is_s _synctex_decode_int_opt(synctex_scanner_p scanner, int 
default_value) {
     char * ptr = NULL;
     char * end = NULL;
-    synctex_zs_s zs = {0, 0};
+    _synctex_zs_s zs = {0, 0};
     if (NULL == scanner) {
-        return (synctex_is_s){default_value, SYNCTEX_STATUS_BAD_ARGUMENT};
+        return (_synctex_is_s){default_value, SYNCTEX_STATUS_BAD_ARGUMENT};
     }
     zs = _synctex_buffer_get_available_size(scanner, SYNCTEX_BUFFER_MIN_SIZE);
     if (zs.status<SYNCTEX_STATUS_EOF) {
-        return (synctex_is_s){default_value,zs.status};
+        return (_synctex_is_s){default_value,zs.status};
     }
     if (zs.size==0) {
-        return (synctex_is_s){default_value,SYNCTEX_STATUS_OK};
+        return (_synctex_is_s){default_value,SYNCTEX_STATUS_OK};
     }
     ptr = SYNCTEX_CUR;
     /*  Comma separator required */
@@ -4127,16 +4305,16 @@
         ++ptr;
         --zs.size;
         if (zs.size==0) {
-            return (synctex_is_s){default_value,SYNCTEX_STATUS_NOT_OK};
+            return (_synctex_is_s){default_value,SYNCTEX_STATUS_NOT_OK};
         }
-        result = (int)strtol(ptr, &end, 10);
+        result = synctex_parse_int(ptr, &end);
         if (end>ptr) {
             SYNCTEX_CUR = end;
-            return (synctex_is_s){result,SYNCTEX_STATUS_OK};
+            return (_synctex_is_s){result,SYNCTEX_STATUS_OK};
         }
-        return (synctex_is_s){default_value,SYNCTEX_STATUS_NOT_OK};
+        return (_synctex_is_s){default_value,SYNCTEX_STATUS_NOT_OK};
     }
-    return (synctex_is_s){default_value,SYNCTEX_STATUS_OK};
+    return (_synctex_is_s){default_value,SYNCTEX_STATUS_OK};
 }
 /*  Used when parsing the synctex file.
  *  Decode an integer for a v field.
@@ -4145,8 +4323,8 @@
  *  which is a shortcut for the last v field scanned.
  */
 #   define SYNCTEX_INPUT_COMEQUALS ",="
-static synctex_is_s _synctex_decode_int_v(synctex_scanner_p scanner) {
-    synctex_is_s is = _synctex_decode_int(scanner);
+static _synctex_is_s _synctex_decode_int_v(synctex_scanner_p scanner) {
+    _synctex_is_s is = _synctex_decode_int(scanner);
     if (SYNCTEX_STATUS_OK == is.status) {
         scanner->reader->lastv = is.integer;
         return is;
@@ -4177,14 +4355,14 @@
  *  If either scanner or value_ref is NULL, it is considered as an error and
  *  SYNCTEX_STATUS_BAD_ARGUMENT is returned.
  */
-static synctex_ss_s _synctex_decode_string(synctex_scanner_p scanner) {
+static _synctex_ss_s _synctex_decode_string(synctex_scanner_p scanner) {
     char * end = NULL;
     size_t len = 0;/*  The number of bytes to copy */
     size_t already_len = 0;
-    synctex_zs_s zs = {0,0};
+    _synctex_zs_s zs = {0,0};
     char * string = NULL;
     if (NULL == scanner) {
-        return (synctex_ss_s){NULL,SYNCTEX_STATUS_BAD_ARGUMENT};
+        return (_synctex_ss_s){NULL,SYNCTEX_STATUS_BAD_ARGUMENT};
     }
     /*  The buffer must at least contain one character: the '\n' end of line 
marker */
     if (SYNCTEX_CUR>=SYNCTEX_END) {
@@ -4191,9 +4369,9 @@
 more_characters:
         zs = _synctex_buffer_get_available_size(scanner,1);
         if (zs.status < SYNCTEX_STATUS_EOF) {
-            return (synctex_ss_s){NULL,zs.status};
+            return (_synctex_ss_s){NULL,zs.status};
         } else if (0 == zs.size) {
-            return (synctex_ss_s){NULL,SYNCTEX_STATUS_EOF};
+            return (_synctex_ss_s){NULL,SYNCTEX_STATUS_EOF};
         }
     }
     /*  Now we are sure that there is at least one available character, either 
because
@@ -4227,15 +4405,15 @@
                     }
                 }
                 string[already_len] = '\0';
-                return (synctex_ss_s){string,SYNCTEX_STATUS_OK};
+                return (_synctex_ss_s){string,SYNCTEX_STATUS_OK};
             }
             free(string);
             _synctex_error("could not copy memory (1).");
-            return (synctex_ss_s){NULL,SYNCTEX_STATUS_ERROR};
+            return (_synctex_ss_s){NULL,SYNCTEX_STATUS_ERROR};
         }
     }
     _synctex_error("could not (re)allocate memory (1).");
-    return (synctex_ss_s){NULL,SYNCTEX_STATUS_ERROR};
+    return (_synctex_ss_s){NULL,SYNCTEX_STATUS_ERROR};
 }
 
 /*  Used when parsing the synctex file.
@@ -4243,34 +4421,34 @@
  *  - parameter scanner: non NULL scanner
  *  - returns SYNCTEX_STATUS_OK on successful completions, others values 
otherwise.
  */
-static synctex_ns_s __synctex_parse_new_input(synctex_scanner_p scanner) {
+static _synctex_ns_s __synctex_parse_new_input(synctex_scanner_p scanner) {
     synctex_node_p input = NULL;
     synctex_status_t status = SYNCTEX_STATUS_BAD_ARGUMENT;
-    synctex_zs_s zs = {0,0};
+    _synctex_zs_s zs = {0,0};
     if (NULL == scanner) {
-        return (synctex_ns_s){NULL,status};
+        return (_synctex_ns_s){NULL,status};
     }
     if 
((status=_synctex_match_string(scanner,SYNCTEX_INPUT_MARK))<SYNCTEX_STATUS_OK) {
-        return (synctex_ns_s){NULL,status};
+        return (_synctex_ns_s){NULL,status};
     }
     /*  Create a node */
     if (NULL == (input = _synctex_new_input(scanner))) {
         _synctex_error("Could not create an input node.");
-        return (synctex_ns_s){NULL,SYNCTEX_STATUS_ERROR};
+        return (_synctex_ns_s){NULL,SYNCTEX_STATUS_ERROR};
     }
     /*  Decode the tag  */
     if ((status=_synctex_data_decode_tag(input))<SYNCTEX_STATUS_OK) {
         _synctex_error("Bad format of input node.");
-        synctex_node_free(input);
-        return (synctex_ns_s){NULL,status};
+        _synctex_node_free(input);
+        return (_synctex_ns_s){NULL,status};
     }
     /*  The next character is a field separator, we expect one character in 
the buffer. */
     zs = _synctex_buffer_get_available_size(scanner, 1);
     if (zs.status<=SYNCTEX_STATUS_ERROR) {
-        return (synctex_ns_s){NULL,status};
+        return (_synctex_ns_s){NULL,status};
     }
     if (0 == zs.size) {
-        return (synctex_ns_s){NULL,SYNCTEX_STATUS_EOF};
+        return (_synctex_ns_s){NULL,SYNCTEX_STATUS_EOF};
     }
     /*  We can now safely advance to the next character, stepping over the 
field separator. */
     ++SYNCTEX_CUR;
@@ -4277,9 +4455,9 @@
     --zs.size;
     /*  Then we scan the file name */
     if ((status=_synctex_data_decode_name(input))<SYNCTEX_STATUS_OK) {
-        synctex_node_free(input);
+        _synctex_node_free(input);
         _synctex_next_line(scanner);/* Ignore this whole line */
-        return (synctex_ns_s){NULL,status};
+        return (_synctex_ns_s){NULL,status};
     }
     /*  Prepend this input node to the input linked list of the scanner */
     __synctex_tree_set_sibling(input,scanner->input);/* input has no parent */
@@ -4287,11 +4465,9 @@
 #   if SYNCTEX_VERBOSE
     synctex_node_log(input);
 #   endif
-    return (synctex_ns_s){input,_synctex_next_line(scanner)};/*  read the line 
termination character, if any */
+    return (_synctex_ns_s){input,_synctex_next_line(scanner)};/*  read the 
line termination character, if any */
 }
 
-typedef synctex_is_s (*synctex_decoder_t)(synctex_scanner_p);
-
 /*  Used when parsing the synctex file.
  *  Read one of the settings.
  *  On normal completion, returns SYNCTEX_STATUS_OK.
@@ -4324,8 +4500,8 @@
  */
 static synctex_status_t _synctex_scan_preamble(synctex_scanner_p scanner) {
     synctex_status_t status = 0;
-    synctex_is_s is = {0,0};
-    synctex_ss_s ss = {NULL,0};
+    _synctex_is_s is = {0,0};
+    _synctex_ss_s ss = {NULL,0};
     if (NULL == scanner) {
         return SYNCTEX_STATUS_BAD_ARGUMENT;
     }
@@ -4405,20 +4581,20 @@
 }
 
 /*  parse a float with a dimension */
-static synctex_fs_s _synctex_scan_float_and_dimension(synctex_scanner_p 
scanner) {
-    synctex_fs_s fs = {0,0};
-    synctex_zs_s zs = {0,0};
+static _synctex_fs_s _synctex_scan_float_and_dimension(synctex_scanner_p 
scanner) {
+    _synctex_fs_s fs = {0,0};
+    _synctex_zs_s zs = {0,0};
     char * endptr = NULL;
 #ifdef HAVE_SETLOCALE
     char * loc = setlocale(LC_NUMERIC, NULL);
 #endif
     if (NULL == scanner) {
-        return (synctex_fs_s){0,SYNCTEX_STATUS_BAD_ARGUMENT};
+        return (_synctex_fs_s){0,SYNCTEX_STATUS_BAD_ARGUMENT};
     }
     zs = _synctex_buffer_get_available_size(scanner, SYNCTEX_BUFFER_MIN_SIZE);
     if (zs.status<SYNCTEX_STATUS_EOF) {
         _synctex_error("Problem with float.");
-        return (synctex_fs_s){0,zs.status};
+        return (_synctex_fs_s){0,zs.status};
     }
 #ifdef HAVE_SETLOCALE
     setlocale(LC_NUMERIC, "C");
@@ -4429,7 +4605,7 @@
 #endif
     if (endptr == SYNCTEX_CUR) {
         _synctex_error("A float was expected.");
-        return (synctex_fs_s){0,SYNCTEX_STATUS_ERROR};
+        return (_synctex_fs_s){0,SYNCTEX_STATUS_ERROR};
     }
     SYNCTEX_CUR = endptr;
     if ((fs.status = _synctex_match_string(scanner,"in")) >= 
SYNCTEX_STATUS_OK) {
@@ -4487,7 +4663,7 @@
  *  a negative error is returned otherwise */
 static synctex_status_t _synctex_scan_post_scriptum(synctex_scanner_p scanner) 
{
     synctex_status_t status = 0;
-    synctex_fs_s fs = {0,0};
+    _synctex_fs_s fs = {0,0};
     char * endptr = NULL;
 #ifdef HAVE_SETLOCALE
     char * loc = setlocale(LC_NUMERIC, NULL);
@@ -4563,7 +4739,7 @@
             _synctex_error("Problem with Y offset in the Post Scriptum.");
             return fs.status;
         }
-        scanner->x_offset = fs.value;
+        scanner->y_offset = fs.value;
         goto next_line;
     } else if (status<SYNCTEX_STATUS_EOF){
         goto report_record_problem;
@@ -4578,7 +4754,7 @@
  */
 static synctex_status_t _synctex_scan_postamble(synctex_scanner_p scanner) {
     synctex_status_t status = 0;
-    synctex_is_s is = {0,0};
+    _synctex_is_s is = {0,0};
     if (NULL == scanner) {
         return SYNCTEX_STATUS_BAD_ARGUMENT;
     }
@@ -4587,7 +4763,7 @@
     }
 count_again:
     if ((status=_synctex_next_line(scanner))<SYNCTEX_STATUS_OK) {
-        return status;
+        return SYNCTEX_STATUS_OK;
     }
     if ((status=_synctex_scan_named(scanner,"Count:"))< SYNCTEX_STATUS_EOF) {
         return status; /*  forward the error */
@@ -4598,7 +4774,7 @@
         return is.status;
     }
     if ((status=_synctex_next_line(scanner))<SYNCTEX_STATUS_OK) {
-        return status;
+        return SYNCTEX_STATUS_OK;
     }
     scanner->count = is.integer;
     /*  Now we scan the last part of the SyncTeX file: the Post Scriptum 
section. */
@@ -4738,8 +4914,8 @@
 #   define SYNCTEX_DECODE_FAILED_V(NODE,WHAT) \
 (_synctex_data_decode_##WHAT##_v(NODE)<SYNCTEX_STATUS_OK)
 
-#define SYNCTEX_NS_NULL (synctex_ns_s){NULL,SYNCTEX_STATUS_NOT_OK}
-static synctex_ns_s _synctex_parse_new_sheet(synctex_scanner_p scanner) {
+#define SYNCTEX_NS_NULL (_synctex_ns_s){NULL,SYNCTEX_STATUS_NOT_OK}
+static _synctex_ns_s _synctex_parse_new_sheet(synctex_scanner_p scanner) {
     synctex_node_p node;
     if ((node = _synctex_new_sheet(scanner))) {
         if (
@@ -4760,16 +4936,16 @@
             } else {
                 scanner->sheet = node;
             }
-            return (synctex_ns_s){node,SYNCTEX_STATUS_OK};
+            return (_synctex_ns_s){node,SYNCTEX_STATUS_OK};
         }
         _synctex_free_node(node);
     }
-    return (synctex_ns_s){NULL,SYNCTEX_STATUS_ERROR};
+    return (_synctex_ns_s){NULL,SYNCTEX_STATUS_ERROR};
 }
 /**
  *  - requirement: scanner != NULL
  */
-static synctex_ns_s _synctex_parse_new_form(synctex_scanner_p scanner) {
+static _synctex_ns_s _synctex_parse_new_form(synctex_scanner_p scanner) {
     synctex_node_p node;
     if ((node = _synctex_new_form(scanner))) {
         if (
@@ -4789,11 +4965,11 @@
             } else {
                 scanner->form = node;
             }
-            return (synctex_ns_s){node,SYNCTEX_STATUS_OK};
+            return (_synctex_ns_s){node,SYNCTEX_STATUS_OK};
         }
         _synctex_free_node(node);
     }
-    return (synctex_ns_s){NULL,SYNCTEX_STATUS_ERROR};
+    return (_synctex_ns_s){NULL,SYNCTEX_STATUS_ERROR};
 }
 #   define SYNCTEX_SHOULD_DECODE_FAILED(NODE,WHAT) \
 (_synctex_data_has_##WHAT(NODE) 
&&(_synctex_data_decode_##WHAT(NODE)<SYNCTEX_STATUS_OK))
@@ -4810,7 +4986,7 @@
     || SYNCTEX_SHOULD_DECODE_FAILED(node,height)
     || SYNCTEX_SHOULD_DECODE_FAILED(node,depth);
 }
-static synctex_ns_s _synctex_parse_new_vbox(synctex_scanner_p scanner) {
+static _synctex_ns_s _synctex_parse_new_vbox(synctex_scanner_p scanner) {

@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to