Changeset 26 in libcf for trunk/src/cf_debug.c
- Timestamp:
- 02/04/13 17:00:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cf_debug.c
r23 r26 46 46 CF_DEBUG_CALLSTACK callstack; 47 47 } S_CF_DEBUG_CTX, CF_DEBUG_CTX; 48 49 static int 50 CF_Debug_Local_UpdateCtx (CF_Debug_Ctx ctx, 51 const char * file, 52 const char * func, 53 const int line) 54 { 55 CF_DEBUG_CTX * context = (CF_DEBUG_CTX *) ctx; 56 57 CHECK_INVALID_CTX (ctx); 58 59 strncpy (context->file, file, strlen (file)); 60 strncpy (context->func, func, strlen (func)); 61 context->line = line; 62 63 return CF_OK; 64 } 48 65 49 66 static int … … 205 222 206 223 int 207 CF_Debug_UpdateCtx (CF_Debug_Ctx ctx,208 const char * file,209 const char * func,210 const int line)211 {212 CF_DEBUG_CTX * context = (CF_DEBUG_CTX *) ctx;213 214 CHECK_INVALID_CTX (ctx);215 216 strncpy (context->file, file, strlen (file));217 strncpy (context->func, func, strlen (func));218 context->line = line;219 220 return CF_OK;221 }222 223 int224 224 CF_Debug_Trace (CF_Debug_Ctx ctx, 225 const char * file, 226 const char * func, 227 const int line, 225 228 const char * fmt, ...) 226 229 { … … 229 232 230 233 CHECK_INVALID_CTX (ctx); 234 235 CF_Debug_Local_UpdateCtx (ctx, file, func, line); 231 236 232 237 va_start (valist, fmt); … … 243 248 int 244 249 CF_Debug_TraceBin (CF_Debug_Ctx ctx, 250 const char * file, 251 const char * func, 252 const int line, 245 253 const unsigned char * bin, 246 254 const int len, … … 251 259 252 260 CHECK_INVALID_CTX (ctx); 261 262 CF_Debug_Local_UpdateCtx (ctx, file, func, line); 253 263 254 264 va_start (valist, fmt); … … 291 301 context->callstack.caller = push; 292 302 293 CF_Debug_ UpdateCtx (ctx, file, func, line);303 CF_Debug_Local_UpdateCtx (ctx, file, func, line); 294 304 295 305 return CF_OK; … … 323 333 if (pop->caller != NULL) 324 334 { 325 CF_Debug_ UpdateCtx (ctx,326 pop->caller->file,327 pop->caller->func,328 pop->caller->line);335 CF_Debug_Local_UpdateCtx (ctx, 336 pop->caller->file, 337 pop->caller->func, 338 pop->caller->line); 329 339 } 330 340
Note:
See TracChangeset
for help on using the changeset viewer.