Estonian ID Card C-library
DigiDocDebug.h
1 #ifndef __DIGIDOC_DEBUG_H__
2 #define __DIGIDOC_DEBUG_H__
3 //==================================================
4 // FILE: DigiDocDebug.h
5 // PROJECT: Digi Doc
6 // DESCRIPTION: Digi Doc functions for debug output
7 // AUTHOR: Veiko Sinivee, S|E|B IT Partner Estonia
8 //==================================================
9 // Copyright (C) AS Sertifitseerimiskeskus
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 // GNU Lesser General Public Licence is available at
19 // http://www.gnu.org/copyleft/lesser.html
20 //==========< HISTORY >=============================
21 // 10.08.2004 Veiko Sinivee
22 // Creation
23 //==================================================
24 
25 #include <libdigidoc/DigiDocMem.h>
26 #include <libdigidoc/DigiDocDefs.h>
27 #include <stdarg.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 //-----------------------------------------
34 // Formats debug output
35 // level - debug level to output this message on
36 // func - name of the function
37 // format - message format and arguments
38 //-----------------------------------------
39 EXP_OPTION void ddocDebug(int level, const char* func, const char* format, ...);
40 
41 //-----------------------------------------
42 // Formats debug output
43 // level - debug level to output this message on
44 // func - name of the function
45 // msg - message format and arguments
46 // args - va_list struct
47 //-----------------------------------------
48 EXP_OPTION void ddocDebugVaArgs(int level, const char* func, const char* msg, va_list args);
49 
50 //-----------------------------------------
51 // Deletes the log file if it exists.
52 //-----------------------------------------
53 EXP_OPTION void ddocDebugTruncateLog();
54 
55 //-----------------------------------------
56 // Reads the contents of the log file
57 // pMemBuf - buffer for log data
58 //-----------------------------------------
59 EXP_OPTION int ddocDebugReadLog(DigiDocMemBuf *pMemBuf);
60 
61 //-----------------------------------------
62 // Writes debug data in a file
63 // level - debug level to write on
64 // szFileName - target file name
65 // pMemBuf - buffer for log data
66 //-----------------------------------------
67 EXP_OPTION int ddocDebugWriteFile(int level, const char* szFileName, DigiDocMemBuf *pMemBuf);
68 
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif // __DIGIDOC_DEBUG_H__
75 
DigiDocMemBuf_st
Definition: DigiDocMem.h:32