source: terepaima/terepaima-0.4.16/synctex/synctex_parser_utils.h

desarrollostretch
Last change on this file was 1f4adec, checked in by aosorio <aosorio@…>, 8 years ago

Agregado proyecto base, esto luego del dh_make -f

  • Property mode set to 100644
File size: 5.6 KB
Line 
1/*
2Copyright (c) 2008, 2009, 2010, 2011 jerome DOT laurens AT u-bourgogne DOT fr
3
4This file is part of the SyncTeX package.
5
6Latest Revision: Tue Jun 14 08:23:30 UTC 2011
7
8Version: 1.18
9
10See synctex_parser_readme.txt for more details
11
12License:
13--------
14Permission is hereby granted, free of charge, to any person
15obtaining a copy of this software and associated documentation
16files (the "Software"), to deal in the Software without
17restriction, including without limitation the rights to use,
18copy, modify, merge, publish, distribute, sublicense, and/or sell
19copies of the Software, and to permit persons to whom the
20Software is furnished to do so, subject to the following
21conditions:
22
23The above copyright notice and this permission notice shall be
24included in all copies or substantial portions of the Software.
25
26THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
28OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
30HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
31WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
32FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
33OTHER DEALINGS IN THE SOFTWARE
34
35Except as contained in this notice, the name of the copyright holder 
36shall not be used in advertising or otherwise to promote the sale, 
37use or other dealings in this Software without prior written 
38authorization from the copyright holder.
39
40*/
41
42/*  The utilities declared here are subject to conditional implementation.
43 *  All the operating system special stuff goes here.
44 *  The problem mainly comes from file name management: path separator, encoding...
45 */
46
47#       define synctex_bool_t int
48#       define synctex_YES -1
49#       define synctex_ADD_QUOTES -1
50#       define synctex_COMPRESS -1
51#       define synctex_NO 0
52#       define synctex_DONT_ADD_QUOTES 0
53#       define synctex_DONT_COMPRESS 0
54
55#ifndef __SYNCTEX_PARSER_UTILS__
56#   define __SYNCTEX_PARSER_UTILS__
57
58#include <stdlib.h>
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64#       if defined(_WIN32) || defined(__OS2__)
65#       define SYNCTEX_CASE_SENSITIVE_PATH 0
66#               define SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c || '\\' == c)
67#       else
68#       define SYNCTEX_CASE_SENSITIVE_PATH 1
69#               define SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c)
70#       endif
71   
72#       if defined(_WIN32) || defined(__OS2__)
73#               define SYNCTEX_IS_DOT(c) ('.' == c)
74#       else
75#               define SYNCTEX_IS_DOT(c) ('.' == c)
76#       endif
77   
78#       if SYNCTEX_CASE_SENSITIVE_PATH
79#               define SYNCTEX_ARE_PATH_CHARACTERS_EQUAL(left,right) (left != right)
80#       else
81#               define SYNCTEX_ARE_PATH_CHARACTERS_EQUAL(left,right) (toupper(left) != toupper(right))
82#       endif
83   
84/*  This custom malloc functions initializes to 0 the newly allocated memory.
85 *  There is no bzero function on windows. */
86void *_synctex_malloc(size_t size);
87
88/*  This is used to log some informational message to the standard error stream.
89 *  On Windows, the stderr stream is not exposed and another method is used.
90 *      The return value is the number of characters printed.   */
91int _synctex_error(const char * reason,...);
92
93/*  strip the last extension of the given string, this string is modified!
94 *  This function depends on the OS because the path separator may differ.
95 *  This should be discussed more precisely. */
96void _synctex_strip_last_path_extension(char * string);
97
98/*  Compare two file names, windows is sometimes case insensitive...
99 *  The given strings may differ stricto sensu, but represent the same file name.
100 *  It might not be the real way of doing things.
101 *  The return value is an undefined non 0 value when the two file names are equivalent.
102 *  It is 0 otherwise. */
103synctex_bool_t _synctex_is_equivalent_file_name(const char *lhs, const char *rhs);
104
105/*      Description forthcoming.*/
106synctex_bool_t _synctex_path_is_absolute(const char * name);
107
108/*      Description forthcoming...*/
109const char * _synctex_last_path_component(const char * name);
110
111/*      Description forthcoming...*/
112const char * _synctex_base_name(const char *path);
113
114/*      If the core of the last path component of src is not already enclosed with double quotes ('"')
115 *  and contains a space character (' '), then a new buffer is created, the src is copied and quotes are added.
116 *      In all other cases, no destination buffer is created and the src is not copied.
117 *  0 on success, which means no error, something non 0 means error, mainly due to memory allocation failure, or bad parameter.
118 *  This is used to fix a bug in the first version of pdftex with synctex (1.40.9) for which names with spaces
119 *  were not managed in a standard way.
120 *  On success, the caller owns the buffer pointed to by dest_ref (is any) and
121 *  is responsible of freeing the memory when done.
122 *      The size argument is the size of the src buffer. On return the dest_ref points to a buffer sized size+2.*/
123int _synctex_copy_with_quoting_last_path_component(const char * src, char ** dest_ref, size_t size);
124
125/*  These are the possible extensions of the synctex file */
126extern const char * synctex_suffix;
127extern const char * synctex_suffix_gz;
128
129typedef unsigned int synctex_io_mode_t;
130
131typedef enum {
132        synctex_io_append_mask = 1,
133    synctex_io_gz_mask = synctex_io_append_mask<<1
134} synctex_io_mode_masks_t;
135
136typedef enum {
137        synctex_compress_mode_none = 0,
138        synctex_compress_mode_gz = 1
139} synctex_compress_mode_t;
140
141int _synctex_get_name(const char * output, const char * build_directory, char ** synctex_name_ref, synctex_io_mode_t * io_mode_ref);
142
143/*  returns the correct mode required by fopen and gzopen from the given io_mode */
144const char * _synctex_get_io_mode_name(synctex_io_mode_t io_mode);
145
146synctex_bool_t synctex_ignore_leading_dot_slash_in_path(const char ** name);
147   
148#ifdef __cplusplus
149}
150#endif
151
152#endif
Note: See TracBrowser for help on using the repository browser.