This file is indexed.

/usr/include/gwenhywfar4/gwenhywfar/debug.h is in libgwenhywfar60-dev 4.10.0beta-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
/***************************************************************************
 $RCSfile$
 -------------------
 cvs         : $Id$
 begin       : Thu Nov 28 2002
 copyright   : (C) 2002 by Martin Preuss
 email       : martin@libchipcard.de

 ***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or         *
 *   modify it under the terms of the GNU Lesser General Public            *
 *   License as published by the Free Software Foundation; either          *
 *   version 2.1 of the License, or (at your option) any later version.    *
 *                                                                         *
 *   This library is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 *   Lesser General Public License for more details.                       *
 *                                                                         *
 *   You should have received a copy of the GNU Lesser General Public      *
 *   License along with this library; if not, write to the Free Software   *
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
 *   MA  02111-1307  USA                                                   *
 *                                                                         *
 ***************************************************************************/


#ifndef GWEN_DEBUG_H
#define GWEN_DEBUG_H

#include <stdio.h>
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/logger.h>
#include <gwenhywfar/error.h>
#include <gwenhywfar/types.h>

#ifdef __cplusplus
extern "C" {
#endif

#if (defined HAVE_FUNC && (DEBUGMODE>10))
# define DBG_ENTER fprintf(stderr,"Enter \""__func__"\" \n")
# define DBG_LEAVE fprintf(stderr,"Leave \""__func__"\" \n")
#else
# define DBG_ENTER
# define DBG_LEAVE
#endif

#define GWEN_MEMORY_DEBUG_MODE_ALL      0
#define GWEN_MEMORY_DEBUG_MODE_OPEN     1
#define GWEN_MEMORY_DEBUG_MODE_DETAILED 2
#define GWEN_MEMORY_DEBUG_MODE_SHORT    3

typedef struct GWEN_MEMORY_DEBUG_OBJECT GWEN_MEMORY_DEBUG_OBJECT;

GWENHYWFAR_API
void GWEN_MemoryDebug_Increment(const char *name,
                                const char *wFile,
                                int wLine,
                                int attach);
GWENHYWFAR_API
void GWEN_MemoryDebug_Decrement(const char *name,
                                const char *wFile,
                                int wLine);

GWENHYWFAR_API
void GWEN_MemoryDebug_Dump(uint32_t mode);

GWENHYWFAR_API
void GWEN_MemoryDebug_DumpObject(const char *name,
                                 uint32_t mode);

GWENHYWFAR_API
long int GWEN_MemoryDebug_GetObjectCount(const char *name);

GWENHYWFAR_API
void GWEN_MemoryDebug_CleanUp(void);


#ifdef GWEN_MEMORY_DEBUG
# define DBG_MEM_INC(o, attach)\
  GWEN_MemoryDebug_Increment(o, __FILE__, __LINE__, attach)
# define DBG_MEM_DEC(o)\
  GWEN_MemoryDebug_Decrement(o, __FILE__, __LINE__)
#else
# define DBG_MEM_INC(o, attach)
# define DBG_MEM_DEC(o)
#endif

GWENHYWFAR_API
uint32_t GWEN_Debug_Snprintf(char *buffer,
                                     uint32_t size,
                                     const char *fmt, ...);

#ifndef NO_VARIADIC_MACROS
# define DBG_ERROR(dbg_logger, format, args...) if (1){\
  char dbg_buffer[256]; \
  snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
  __FILE__":%5d: " format  , __LINE__ , ## args); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Error, dbg_buffer);};
#else /* #ifndef NO_VARIADIC_MACROS */
GWENHYWFAR_API 
void DBG_ERROR(const char *logdomain, const char *format, ...);
#endif /* #ifndef NO_VARIADIC_MACROS */

#define DBG_ERROR_ERR(dbg_logger, dbg_err) {\
 char dbg_buffer[256]; \
 char dbg_errbuff[256]; \
 GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
 snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
 __FILE__":%5d: %s" , __LINE__ , dbg_errbuff); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Error, dbg_buffer);};

#ifndef NO_VARIADIC_MACROS
# define DBG_WARN(dbg_logger, format, args...) {\
  char dbg_buffer[256]; \
  snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
  __FILE__":%5d: " format  , __LINE__ , ## args); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Warning, dbg_buffer);};
#else /* #ifndef NO_VARIADIC_MACROS */
GWENHYWFAR_API 
void DBG_WARN(const char *logdomain, const char *format, ...);
#endif /* #ifndef NO_VARIADIC_MACROS */

#define DBG_WARN_ERR(dbg_logger, dbg_err) {\
 char dbg_buffer[256]; \
 char dbg_errbuff[256]; \
 GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
 snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
 __FILE__":%5d: %s" , __LINE__ , dbg_errbuff); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Warning, dbg_buffer);};


#ifndef NO_VARIADIC_MACROS
# define DBG_NOTICE(dbg_logger, format, args...) \
 if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Notice) {\
 char dbg_buffer[256]; \
 snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
 __FILE__":%5d: " format  , __LINE__ , ## args); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Notice, dbg_buffer);};
#else /* #ifndef NO_VARIADIC_MACROS */
GWENHYWFAR_API 
void DBG_NOTICE(const char *logdomain, const char *format, ...);
#endif /* #ifndef NO_VARIADIC_MACROS */

#define DBG_NOTICE_ERR(dbg_logger, dbg_err) \
 if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Notice) {\
 char dbg_buffer[256]; \
 char dbg_errbuff[256]; \
 GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
 snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
 __FILE__":%5d: %s" , __LINE__ , dbg_errbuff); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Notice, dbg_buffer);};


#ifndef NO_VARIADIC_MACROS
# define DBG_INFO(dbg_logger, format, args...) \
 if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Info) {\
  char dbg_buffer[256]; \
 snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
 __FILE__":%5d: " format  , __LINE__ , ## args); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Info, dbg_buffer);};
#else /* #ifndef NO_VARIADIC_MACROS */
GWENHYWFAR_API 
void DBG_INFO(const char *logdomain, const char *format, ...);
#endif /* #ifndef NO_VARIADIC_MACROS */

#define DBG_INFO_ERR(dbg_logger, dbg_err) \
 if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Info) {\
 char dbg_buffer[256]; \
 char dbg_errbuff[256]; \
 GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
 snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
 __FILE__":%5d: %s" , __LINE__ , dbg_errbuff); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Info, dbg_buffer);};




#ifndef DISABLE_DEBUGLOG

# ifndef NO_VARIADIC_MACROS
#  define DBG_DEBUG(dbg_logger, format, args...) \
 if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Debug) {\
 char dbg_buffer[256]; \
 snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
 __FILE__":%5d: " format  , __LINE__ , ## args); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Debug, dbg_buffer);};

#  define DBG_VERBOUS(dbg_logger, format, args...) \
 if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Verbous) {\
 char dbg_buffer[256]; \
 snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
 __FILE__":%5d: " format  , __LINE__ , ## args); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Verbous, dbg_buffer);};
# endif /* #ifndef NO_VARIADIC_MACROS */

# define DBG_DEBUG_ERR(dbg_logger, dbg_err) \
 if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Debug) {\
 char dbg_buffer[256]; \
 char dbg_errbuff[256]; \
 GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
 snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
 __FILE__":%5d: %s" , __LINE__ , dbg_errbuff); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Debug, dbg_buffer);};

# define DBG_VERBOUS_ERR(dbg_logger, dbg_err) \
 if (GWEN_Logger_GetLevel(dbg_logger)>=GWEN_LoggerLevel_Verbous) {\
 char dbg_buffer[256]; \
 char dbg_errbuff[256]; \
 GWEN_Error_ToString(dbg_err,dbg_errbuff, sizeof(dbg_errbuff)); \
 snprintf(dbg_buffer, sizeof(dbg_buffer)-1,\
 __FILE__":%5d: %s" , __LINE__ , dbg_errbuff); \
  dbg_buffer[sizeof(dbg_buffer)-1]=0; \
 GWEN_Logger_Log(dbg_logger, GWEN_LoggerLevel_Verbous, dbg_buffer);};



#else

# ifndef NO_VARIADIC_MACROS
#  define DBG_DEBUG(dbg_logger, format, args...)
#  define DBG_VERBOUS(dbg_logger, format, args...)
# endif /* ifndef NO_VARIADIC_MACROS */

# define DBG_DEBUG_ERR(dbg_logger, dbg_err)
# define DBG_VERBOUS_ERR(dbg_logger, dbg_err)

#endif /* DISABLE_DEBUGLOG */

#ifdef NO_VARIADIC_MACROS
GWENHYWFAR_API 
void DBG_DEBUG(const char *logdomain, const char *format, ...);
GWENHYWFAR_API 
void DBG_VERBOUS(const char *logdomain, const char *format, ...);
#endif /* #ifdef NO_VARIADIC_MACROS */


#ifdef __cplusplus
}
#endif


#endif