@@ -97,37 +97,23 @@ typedef uintptr_t l_uintptr_t;
97
97
* non-functioning stubs to be linked.
98
98
*/
99
99
#if !defined(HAVE_CONFIG_H ) && !defined(ANDROID_BUILD ) && !defined(OS_IOS )
100
- #define HAVE_LIBJPEG 1
101
- #define HAVE_LIBTIFF 1
102
- #define HAVE_LIBPNG 1
103
- #define HAVE_LIBZ 1
104
- #define HAVE_LIBGIF 0
105
- #define HAVE_LIBUNGIF 0
106
- #define HAVE_LIBWEBP 0
107
- #define HAVE_LIBJP2K 0
108
-
109
- /* Leptonica supports both OpenJPEG 2.0 and 2.1. If you have a
110
- * version of openjpeg (HAVE_LIBJP2K) that is not 2.1, set the
111
- * path to the openjpeg.h header in angle brackets here. */
112
- #define LIBJP2K_HEADER <openjpeg-2.1/openjpeg.h>
100
+ #define HAVE_LIBJPEG 1
101
+ #define HAVE_LIBTIFF 1
102
+ #define HAVE_LIBPNG 1
103
+ #define HAVE_LIBZ 1
104
+ #define HAVE_LIBGIF 0
105
+ #define HAVE_LIBUNGIF 0
106
+ #define HAVE_LIBWEBP 0
107
+ #define HAVE_LIBJP2K 0
108
+
109
+ /*-------------------------------------------------------------------------*
110
+ * Leptonica supports OpenJPEG 2.0+. If you have a version of openjpeg *
111
+ * (HAVE_LIBJP2K == 1) that is >= 2.0, set the path to the openjpeg.h *
112
+ * header in angle brackets here. *
113
+ *-------------------------------------------------------------------------*/
114
+ #define LIBJP2K_HEADER <openjpeg-2.3/openjpeg.h>
113
115
#endif /* ! HAVE_CONFIG_H etc. */
114
116
115
- /*
116
- * On linux systems, you can do I/O between Pix and memory. Specifically,
117
- * you can compress (write compressed data to memory from a Pix) and
118
- * uncompress (read from compressed data in memory to a Pix).
119
- * For jpeg, png, jp2k, gif, pnm and bmp, these use the non-posix GNU
120
- * functions fmemopen() and open_memstream(). These functions are not
121
- * available on other systems.
122
- * To use these functions in linux, you must define HAVE_FMEMOPEN to 1.
123
- * To use them on MacOS, which does not support these functions, set it to 0.
124
- */
125
- #if !defined(HAVE_CONFIG_H ) && !defined(ANDROID_BUILD ) && !defined(OS_IOS ) && \
126
- !defined(_WIN32 )
127
- #define HAVE_FMEMOPEN 1
128
- #endif /* ! HAVE_CONFIG_H etc. */
129
-
130
-
131
117
/*--------------------------------------------------------------------*
132
118
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*
133
119
* USER CONFIGURABLE *
@@ -148,6 +134,30 @@ typedef uintptr_t l_uintptr_t;
148
134
#define USE_PSIO 1
149
135
150
136
137
+ /*-------------------------------------------------------------------------*
138
+ * On linux systems, you can do I/O between Pix and memory. Specifically,
139
+ * you can compress (write compressed data to memory from a Pix) and
140
+ * uncompress (read from compressed data in memory to a Pix).
141
+ * For jpeg, png, jp2k, gif, pnm and bmp, these use the non-posix GNU
142
+ * functions fmemopen() and open_memstream(). These functions are not
143
+ * available on other systems.
144
+ * To use these functions in linux, you must define HAVE_FMEMOPEN to 1.
145
+ * To use them on MacOS, which does not support these functions, set it to 0.
146
+ *-------------------------------------------------------------------------*/
147
+ #if !defined(HAVE_CONFIG_H ) && !defined(ANDROID_BUILD ) && !defined(OS_IOS ) && \
148
+ !defined(_WIN32 )
149
+ #define HAVE_FMEMOPEN 1
150
+ #endif /* ! HAVE_CONFIG_H etc. */
151
+
152
+ /*-------------------------------------------------------------------------*
153
+ * fstatat() is defined by POSIX, but some systems do not support it. *
154
+ * One example is older macOS systems (pre-10.10). *
155
+ * Play it safe and set the default value to 0. *
156
+ *-------------------------------------------------------------------------*/
157
+ #if !defined(HAVE_CONFIG_H )
158
+ #define HAVE_FSTATAT 0
159
+ #endif /* ! HAVE_CONFIG_H */
160
+
151
161
/*--------------------------------------------------------------------*
152
162
* It is desirable on Windows to have all temp files written to the same
153
163
* subdirectory of the Windows <Temp> directory, because files under <Temp>
@@ -178,6 +188,20 @@ typedef unsigned long long l_uint64; /*!< unsigned 64-bit value */
178
188
#endif /* COMPILER_MSVC */
179
189
180
190
191
+ /*-------------------------------------------------------------------------*
192
+ * For security, the library is distributed in a configuration that does *
193
+ * not permit (1) forking with 'system', which is used for displaying *
194
+ * images and generating gnuplots, and (2) writing files with specified *
195
+ * compiled-in file names. All such writes are with functions such as *
196
+ * pixWriteDebug() where the "Debug" is appended to the usual name. *
197
+ * Whether the "Debug" version defaults to the standard version or is a *
198
+ * no-op depends on the value of this global variable. The default value *
199
+ * of LeptDebugOK is 0, and it is set in writefile.c. This value can be *
200
+ * over-ridden, for development and debugging, by setLeptDebugOK(). *
201
+ *-------------------------------------------------------------------------*/
202
+ LEPT_DLL extern l_int32 LeptDebugOK ; /* default is 0 */
203
+
204
+
181
205
/*------------------------------------------------------------------------*
182
206
* Standard macros *
183
207
*------------------------------------------------------------------------*/
@@ -239,7 +263,6 @@ typedef unsigned long long l_uint64; /*!< unsigned 64-bit value */
239
263
/*------------------------------------------------------------------------*
240
264
* Simple search state variables *
241
265
*------------------------------------------------------------------------*/
242
-
243
266
/*! Simple search state variables */
244
267
enum {
245
268
L_NOT_FOUND = 0 ,
@@ -250,7 +273,6 @@ enum {
250
273
/*------------------------------------------------------------------------*
251
274
* Path separator conversion *
252
275
*------------------------------------------------------------------------*/
253
-
254
276
/*! Path separator conversion */
255
277
enum {
256
278
UNIX_PATH_SEPCHAR = 0 ,
0 commit comments