debug.h File Reference


Detailed Description

Debugging support module.

This module defines rudimentary support for debugging and is intended for use by developers only.

The library internally maintains a "current debug level," defined by a non-negative integer. When the level is set to 0, no debugging messages are displayed, and as the level increases, more frequent (or more detailed) debugging messages are displayed.

Developers can call oski_PrintDebugMessage to display debgging information, specifying the level at which the message should appear to the user.

Revision
1.1.1.1

Revision history:

#include <stdio.h>

Go to the source code of this file.

Defines

#define INC_OSKI_DEBUG_H
 oski/debug.h has been included

Functions

unsigned oski_GetDebugLevel (void)
 Return the current debugging level.
void oski_SetDebugLevel (unsigned new_level)
 Change the current debugging level.
FILE * oski_GetDebugOutput (void)
 Return the file to which debugging output is currently redirected.
void oski_SetDebugOutput (FILE *fp)
 Change the file to which debugging output is to be redirected.
void oski_PrintDebugMessage (unsigned level, const char *fmt,...)
 Display a debugging message.
void oski_PrintDebugMessageShort (unsigned level, const char *fmt,...)
 Display a debugging message without a trailing newline.


Function Documentation

FILE* oski_GetDebugOutput void   ) 
 

Return the file to which debugging output is currently redirected.

Returns:
A pointer to the FILE to which debugging output is currently directed. This return should never be NULL.
Postcondition:
If g_debug_file is NULL, sets it to stderr and returns stderr.

void oski_PrintDebugMessage unsigned  level,
const char *  fmt,
  ...
 

Display a debugging message.

Parameters:
[in] level Level at and above which this message should be printed to the current debug file.
[in] fmt A printf-compatible format string.
[in] ... Options for the formatting string.
Postcondition:
The message is displayed to the current debug file only if level >= the current debugging level.
Precondition:
oski_GetDebugOutput() != NULL
Postcondition:
Prints a newline character to the debug file.

void oski_PrintDebugMessageShort unsigned  level,
const char *  fmt,
  ...
 

Display a debugging message without a trailing newline.

See also:
oski_PrintDebugMessage

void oski_SetDebugLevel unsigned  new_level  ) 
 

Change the current debugging level.

Parameters:
[in] new_level New debugging level.
Postcondition:
Sets g_cur_debug_level to the given level.

void oski_SetDebugOutput FILE *  fp  ) 
 

Change the file to which debugging output is to be redirected.

Parameters:
[in,out] fp New file to which debugging output should be redirected.
Postcondition:
Sets g_debug_file to fp unless g_debug_file is NULL, in which case fp is set to stderr.


Generated on Wed Sep 19 16:41:22 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6