HTML Tidy  5.8.0
The HTACG Tidy HTML Project
sprtf.h
Go to the documentation of this file.
1 #ifndef _SPRTF_HXX_
2 #define _SPRTF_HXX_
3 
4 /**************************************************************************//**
5  * @file
6  * Log output utility - part of the HTML Tidy project
7  *
8  * @author Geoff R. McLane [reports _at_ geoffair _dot_ info]
9  *
10  * @copyright
11  * Copyright (c) 1998-2017 Geoff R. McLane and HTACG.
12  * @par
13  * All Rights Reserved.
14  * @par
15  * See `tidy.h` for the complete license.
16  *
17  * @date 2017/02/12 17:06:02 Revision 1.0.2 geoff - correct license and coding style
18  * @date 2012/11/06 13:01:25 Revision 1.0.1 geoff
19  * @date 2012/10/17 00:00:00 Revision 1.0.0 geoff
20  * @date Additional updates: consult git log
21  *
22  ******************************************************************************/
23 
24 #include "tidyplatform.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 #ifdef ENABLE_DEBUG_LOG
30  /*=============================================================================
31  * EXTRA Debugging, and information aid.
32  *
33  * When building and defining the ENABLE_DEBUG_LOG macro, Tidy will output
34  * extensive debug information. In addition to this macro, you can supply
35  * cmake build flags for additional diagnostic information:
36  * - -DENABLE_ALLOC_DEBUG:BOOL=ON - DEBUG_ALLOCATION
37  * - -DENABLE_MEMORY_DEBUG:BOOL=ON - DEBUG_MEMORY
38  * - -DENABLE_CRTDBG_MEMORY:BOOL=ON - _CRTDBG_MAP_ALLOC (WIN32 only)
39  *
40  * _MSC_VER Only - ENABLE_DEBUG_LOG is automatically enabled in the Debug
41  * build, unless DISABLE_DEBUG_LOG is defined. See 'tidyplatform.h'
42  *
43  * You can use DEBUG_LOG( SPRTF() ) to avoid #ifdef ENABLE_DEBUG_LOG for
44  * one-liners.
45  *
46  * This EXTRA Debug information is also written to a 'temptidy.txt' log
47  * file, for review, and analysis.
48  *
49  *===========================================================================*/
50 
51 #ifndef SPRTF
52 # define SPRTF sprtf
53 #endif
54 
55 #ifdef _MSC_VER
56 # define MCDECL _cdecl
57 #else
58 # define MCDECL
59 #endif
60 
61 TIDY_EXPORT int add_std_out( int val );
62 TIDY_EXPORT int add_sys_time( int val );
63 TIDY_EXPORT int add_sys_date( int val );
64 
65 TIDY_EXPORT int add_screen_out( int val );
66 TIDY_EXPORT int add_list_out( int val );
67 TIDY_EXPORT int add_append_log( int val );
68 
69 TIDY_EXPORT int open_log_file( void );
70 TIDY_EXPORT void close_log_file( void );
71 TIDY_EXPORT void set_log_file( char * nf, int open );
72 TIDY_EXPORT char * get_log_file( void );
73 
74 TIDY_EXPORT int MCDECL sprtf( const char *pf, ... );
75 #define M_MAX_SPRTF 2048
76 TIDY_EXPORT int direct_out_it( char *cp );
77 
78 TIDY_EXPORT char *GetNxtBuf(void);
79 
80 #define EndBuf(a) ( a + strlen(a) )
81 
82 TIDY_EXPORT char *get_date_stg(void);
83 TIDY_EXPORT char *get_time_stg(void);
84 TIDY_EXPORT char *get_date_time_stg(void);
85 
86 #ifdef _MSC_VER
87 TIDY_EXPORT int gettimeofday(struct timeval *tp, void *tzp);
88 #endif
89 
90 # define DEBUG_LOG(ARG) do { ARG; } while(0)
91 
92 #else
93 # define DEBUG_LOG(ARG)
94 #endif
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 #endif /* #ifndef _SPRTF_HXX_*/
100 /* eof - sprtf.h */
Platform specific definitions, specifics, and headers.