Gammu internals  1.38.0
debug.h
Go to the documentation of this file.
1 #ifndef __gammu_common_debug_h
2 #define __gammu_common_debug_h
3 
4 #include <gammu-debug.h>
5 #include <stdarg.h>
6 
7 /* ------------------------------------------------------------------------- */
8 
9 
12 
13 void DumpMessage(GSM_Debug_Info *d, const unsigned char *message, const size_t messagesize);
14 void DumpMessageText(GSM_Debug_Info *d, const unsigned char *message, const size_t messagesize);
15 
16 
17 /* ------------------------------------------------------------------------- */
18 
19 
23 typedef enum {
24  DL_NONE = 0,
25  DL_BINARY = 1,
32 } Debug_Level;
33 
36  FILE *df;
38  const char *coding;
48  void * user_data;
49 };
50 
51 
52 PRINTF_STYLE(2, 3)
53 int smfprintf(GSM_Debug_Info *d, const char *format, ...);
54 
55 PRINTF_STYLE(2, 0)
56 int dbg_vprintf(GSM_Debug_Info *d, const char *format, va_list argp);
57 
66 #ifdef DEBUG
67 #define dbgprintf smfprintf
68 #else
69 # ifdef __GNUC__
70 # define dbgprintf(...) do { } while (0)
71 # else
72 # define dbgprintf
73 # endif
74 #endif
75 
79 typedef enum {
93 
104 PRINTF_STYLE(3, 4)
105 int smprintf_level(GSM_StateMachine * s, GSM_DebugSeverity severity, const char *format, ...);
106 
107 #endif
void DumpMessageText(GSM_Debug_Info *d, const unsigned char *message, const size_t messagesize)
Definition: debug.c:371
GSM_Log_Function log_function
Definition: debug.h:44
Definition: debug.h:26
FILE * df
Definition: debug.h:36
int dbg_vprintf(GSM_Debug_Info *d, const char *format, va_list argp)
Definition: debug.c:57
void DumpMessage(GSM_Debug_Info *d, const unsigned char *message, const size_t messagesize)
Definition: debug.c:314
Debug_Level
Definition: debug.h:23
GSM_Debug_Info GSM_none_debug
Definition: debug.c:22
gboolean was_lf
Definition: debug.h:39
#define PRINTF_STYLE(f, a)
Definition: gammu-misc.h:92
int smfprintf(GSM_Debug_Info *d, const char *format,...)
Definition: debug.c:240
void(* GSM_Log_Function)(const char *text, void *data)
int smprintf_level(GSM_StateMachine *s, GSM_DebugSeverity severity, const char *format,...)
Definition: debug.c:278
const char * coding
Definition: debug.h:38
int gboolean
Definition: gammu-types.h:23
Definition: debug.h:83
void * user_data
Definition: debug.h:48
gboolean use_global
Definition: debug.h:37
Definition: debug.h:24
gboolean closable
Definition: debug.h:40
GSM_Debug_Info GSM_global_debug
Definition: debug.c:33
Definition: debug.h:87
GSM_DebugSeverity
Definition: debug.h:79
Debug_Level dl
Definition: debug.h:35
Definition: debug.h:91