3
(c) 1998-2002 (W3C) MIT, INRIA, Keio University
4
See tidy.c for the copyright notice.
8
$Author: terry_teague $
9
$Date: 2002/02/18 02:27:04 $
15
Uncomment and edit one of the following #defines if you
16
want to specify the config file at compile-time.
19
/* #define CONFIG_FILE "/etc/tidy_config.txt" */ /* original */
20
/* #define CONFIG_FILE "/etc/tidyrc" */
21
/* #define CONFIG_FILE "/etc/tidy.conf" */
24
Uncomment the following #define if you are on a Unix system
25
supporting the call getpwnam() and the HOME environment variable.
26
It enables tidy to find config files named ~/.tidyrc and
27
~your/.tidyrc etc if the HTML_TIDY environment
28
variable is not set. Contributed by Todd Lewis.
31
/* #define SUPPORT_GETPWNAM */
33
/* Enable/disable support for Big5 and Shift_JIS character encodings */
34
#ifndef SUPPORT_ASIAN_ENCODINGS
35
#define SUPPORT_ASIAN_ENCODINGS 0
38
/* Enable/disable support for UTF-16 character encodings */
39
#ifndef SUPPORT_UTF16_ENCODINGS
40
#define SUPPORT_UTF16_ENCODINGS 0
43
/* Convenience defines for Mac platforms */
45
#if defined(macintosh)
46
/* Mac OS 6.x/7.x/8.x/9.x, with or without CarbonLib - MPW or Metrowerks 68K/PPC compilers */
47
#define MAC_OS_CLASSIC
49
#define PLATFORM_NAME "Mac OS"
52
#elif defined(__linux__) && defined(__powerpc__)
54
/* MkLinux on PPC - gcc (egcs) compiler */
55
#define MAC_OS_MKLINUX
57
#define PLATFORM_NAME "MkLinux"
61
#elif defined(__APPLE__) && defined(__MACH__)
62
/* Mac OS X (client) 10.x (or server 1.x/10.x) - gcc or Metrowerks MachO compilers */
65
#define PLATFORM_NAME "Mac OS X"
70
#if defined(MAC_OS_CLASSIC) || defined(MAC_OS_MKLINUX) || defined(MAC_OS_X)
71
/* Any OS on Mac platform */
75
/* Convenience defines for BSD like platforms */
77
#if defined(__FreeBSD__)
80
#define PLATFORM_NAME "FreeBSD"
83
#elif defined(__NetBSD__)
86
#define PLATFORM_NAME "NetBSD"
89
#elif defined(__OpenBSD__)
92
#define PLATFORM_NAME "OpenBSD"
95
#elif defined(__MINT__)
98
#define PLATFORM_NAME "FreeMiNT"
103
/* Convenience defines for Windows platforms */
105
#if defined(WINDOWS) || defined(_WIN32)
107
#define PLATFORM_NAME "Windows"
110
/* Convenience defines for Linux platforms */
112
#if defined(linux) && defined(__alpha__)
113
/* Linux on Alpha - gcc compiler */
115
#ifndef PLATFORM_NAME
116
#define PLATFORM_NAME "Linux/Alpha"
119
#elif defined(linux) && defined(__sparc__)
120
/* Linux on Sparc - gcc compiler */
122
#ifndef PLATFORM_NAME
123
#define PLATFORM_NAME "Linux/Sparc"
126
#elif defined(linux) && (defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__))
127
/* Linux on x86 - gcc compiler */
129
#ifndef PLATFORM_NAME
130
#define PLATFORM_NAME "Linux/x86"
133
#elif defined(linux) && defined(__powerpc__)
134
/* Linux on PPC - gcc compiler */
136
#ifndef PLATFORM_NAME
137
#define PLATFORM_NAME "Linux/PPC"
140
#elif defined(linux) || defined(__linux__)
143
#ifndef PLATFORM_NAME
144
#define PLATFORM_NAME "Linux"
149
/* Convenience defines for Solaris platforms */
153
#ifndef PLATFORM_NAME
154
#define PLATFORM_NAME "Solaris"
158
/* Convenience defines for HPUX + gcc platforms */
162
#ifndef PLATFORM_NAME
163
#define PLATFORM_NAME "HPUX"
167
/* Convenience defines for RISCOS + gcc platforms */
169
#if defined(__riscos__)
171
#ifndef PLATFORM_NAME
172
#define PLATFORM_NAME "RISC OS"
176
/* Convenience defines for OS/2 + icc/gcc platforms */
178
#if defined(__OS2__) || defined(__IBMC__) || defined(__EMX__)
180
#ifndef PLATFORM_NAME
181
#define PLATFORM_NAME "OS/2"
185
/* Convenience defines for BeOS platforms */
187
#if defined(__BEOS__)
189
#ifndef PLATFORM_NAME
190
#define PLATFORM_NAME "BeOS"
194
/* Convenience defines for Cygwin platforms */
196
#if defined(__CYGWIN__)
198
#ifndef PLATFORM_NAME
199
#define PLATFORM_NAME "Cygwin"
205
#include <setjmp.h> /* for longjmp on error exit */
207
#include <stdarg.h> /* may need <varargs.h> for Unix V */
211
#ifdef NEEDS_MALLOC_H
215
#ifdef SUPPORT_GETPWNAM
219
#ifdef NEEDS_UNISTD_H
220
#include <unistd.h> /* needed for unlink on some Unix systems */
224
Tidy preserves the last modified time for the files it
229
If your platform doesn't support <utime.h> and the
230
utime() function, or <sys/futime> and the futime()
231
function then set PRESERVE_FILE_TIMES to 0.
233
If your platform doesn't support <sys/utime.h> and the
234
futime() function, then set HAS_FUTIME to 0.
236
If your platform supports <utime.h> and the
237
utime() function requires the file to be
238
closed first, then set UTIME_NEEDS_CLOSED_FILE to 1.
241
/* Keep old PRESERVEFILETIMES define for compatibility */
242
#ifdef PRESERVEFILETIMES
243
#undef PRESERVE_FILE_TIMES
244
#define PRESERVE_FILE_TIMES PRESERVEFILETIMES
247
#ifndef PRESERVE_FILE_TIMES
249
#define PRESERVE_FILE_TIMES 0
251
#define PRESERVE_FILE_TIMES 1
255
#if PRESERVE_FILE_TIMES
258
#if defined(CYGWIN_OS) || defined(BE_OS) || defined(OS2_OS) || defined(HPUX_OS) || defined(SOLARIS_OS) || defined(LINUX_OS) || defined(BSD_BASED_OS) || defined(MAC_OS) || defined(__MSL__)
265
#ifndef UTIME_NEEDS_CLOSED_FILE
266
#if defined(SOLARIS_OS) || defined(BSD_BASED_OS) || defined(MAC_OS) || defined(__MSL__)
267
#define UTIME_NEEDS_CLOSED_FILE 1
269
#define UTIME_NEEDS_CLOSED_FILE 0
273
#if defined(MAC_OS_X) || (!defined(MAC_OS_CLASSIC) && !defined(__MSL__))
274
#include <sys/types.h>
275
#include <sys/stat.h>
281
#include <sys/utime.h>
284
#endif /* HASFUTIME */
287
MS Windows needs _ prefix for Unix file functions.
288
Not required by Metrowerks Standard Library (MSL).
290
Tidy uses following for preserving the last modified time.
292
WINDOWS automatically set by Win16 compilers.
293
_WIN32 automatically set by Win32 compilers.
295
#if defined(_WIN32) && !defined(__MSL__)
296
#define futime _futime
298
#define utimbuf _utimbuf
300
#define fileno _fileno
303
#endif /* PRESERVE_FILE_TIMES */
305
/* hack for gnu sys/types.h file which defines uint and ulong */
306
/* you may need to delete the #ifndef and #endif on your system */
309
#if defined(BE_OS) || defined(SOLARIS_OS) || defined(BSD_BASED_OS) || defined(MAC_OS_X)
310
#include <sys/types.h>
312
#ifndef _INCLUDE_HPUX_SOURCE
313
typedef unsigned int uint;
314
#endif /* _INCLUDE_HPUX_SOURCE */
315
typedef unsigned long ulong;
317
#endif /* __USE_MISC */
319
typedef unsigned char byte;
322
bool is a reserved word in some but
323
not all C++ compilers depending on age
324
work around is to avoid bool altogether
325
by introducing a new enum called Bool
333
/* for null pointers */
337
portability hack for deleting files - this is used
338
in pprint.c for deleting superfluous slides.
340
Win32 defines _unlink as per Unix unlink function.
341
Except, MSVC will not recognize unlink() w/
342
language extensions disabled (i.e. pure ANSI mode).
344
WINDOWS automatically set by Win16 compilers.
345
_WIN32 automatically set by Win32 compilers.
348
#if defined(WINDOWS_OS) && !defined(__MSL__)
349
#define unlink _unlink
353
#define unlink remove
360
/* were defined in html.h - TRT */
361
void *MemAlloc(uint size);
362
void *MemRealloc(void *mem, uint newsize);
363
void MemFree(void *mem);
364
void ClearMemory(void *, uint size);