src/error.h File Reference


Detailed Description

Module that handles messages (errors, warnings, etc.).

Definition in file error.h.

#include <stdarg.h>
#include <stdio.h>

Include dependency graph for error.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void bug (char *fmt,...)
 Reports a bug and aborts program execution.
void errlog (char *fmt,...)
 Prints a message.
void errlognl (char *fmt,...)
 Appends a newline to a message and then prints that message.
void error (char *fmt,...)
 Prints an error message and terminates the program.
void rdd_error (int errcode, char *fmt,...)
 Prints an rdd error message and terminates the program.
void set_logfile (FILE *fp)
 Sets the log file.
void set_progname (char *name)
 Sets the program name that is used in future error messages.
void unix_error (char *fmt,...)
 Prints a Unix error message.
void unix_warn (char *fmt,...)
 Prints a Unix warning message.
void warn (char *fmt,...)
 Reports an warning message and terminates the program.


Function Documentation

void bug ( char *  fmt,
  ... 
)

Reports a bug and aborts program execution.

Parameters:
fmt a printf-style message format string
The format string must be followed by its arguments, just like a printf-style format string. This function prints the message and then calls abort() to terminate the program.

Definition at line 150 of file error.c.

References bug_message_fmt, CONSOLE, email_addr, log_flush(), log_printf(), log_vprintf(), and progname.

Here is the call graph for this function:

void errlog ( char *  fmt,
  ... 
)

Prints a message.

Definition at line 221 of file error.c.

References CONSOLE, log_printf(), log_vprintf(), new_line, and rdd_ctime().

Here is the call graph for this function:

void errlognl ( char *  fmt,
  ... 
)

Appends a newline to a message and then prints that message.

Definition at line 235 of file error.c.

References CONSOLE, log_flush(), log_printf(), log_vprintf(), new_line, and rdd_ctime().

Here is the call graph for this function:

void error ( char *  fmt,
  ... 
)

Prints an error message and terminates the program.

Parameters:
fmt a printf-style message format string
The format string must be followed by its arguments, just like a printf-style format string. This function prints the message and then calls exit() to terminate the program.

Definition at line 165 of file error.c.

References CONSOLE, log_flush(), log_printf(), log_vprintf(), and progname.

Here is the call graph for this function:

void rdd_error ( int  errcode,
char *  fmt,
  ... 
)

Prints an rdd error message and terminates the program.

Parameters:
errcode an rdd error code
fmt a printf-style message format string
The format string fmt must be followed by its arguments, just like a printf-style format string. This function prints the message and then calls exit() to terminate the program. The message is followed by the error message that corresponds with rdd error code rc.

Definition at line 251 of file error.c.

References CONSOLE, log_flush(), log_printf(), log_vprintf(), progname, RDD_NOMEM, RDD_OK, and rdd_strerror().

Here is the call graph for this function:

void set_logfile ( FILE *  fp  ) 

Sets the log file.

Parameters:
fp a valid file pointer (open for writing)
This function sets the log file. All messages produced by this module are sent to the console or, if there is no console, to the standard error stream (stderr). If a valid log file (not NULL) is specified then all messages are also written to that log file.

Definition at line 141 of file error.c.

References logfp.

void set_progname ( char *  name  ) 

Sets the program name that is used in future error messages.

Parameters:
name the program's name
This function must be called before any routine that produces a message.

Definition at line 135 of file error.c.

References progname.

void unix_error ( char *  fmt,
  ... 
)

Prints a Unix error message.

Parameters:
fmt a printf-style message format string
The format string must be followed by its arguments, just like a printf-style format string. This function prints the message and then calls exit() to terminate the program. The message is followed by the error message that corresponds with the current value of Unix error variable errno.

Definition at line 206 of file error.c.

References CONSOLE, log_flush(), log_printf(), log_vprintf(), and progname.

Here is the call graph for this function:

void unix_warn ( char *  fmt,
  ... 
)

Prints a Unix warning message.

Parameters:
fmt a printf-style message format string
The format string must be followed by its arguments, just like a printf-style format string. This function prints the message. The message is followed by the error message that the program. The message is followed the error message that corresponds with the current value of Unix error variable errno. This function does not terminate the program.

Definition at line 192 of file error.c.

References CONSOLE, log_flush(), log_printf(), log_vprintf(), and progname.

Here is the call graph for this function:

void warn ( char *  fmt,
  ... 
)

Reports an warning message and terminates the program.

Parameters:
fmt a printf-style message format string
The format string must be followed by its arguments, just like a printf-style format string. This function prints the message. It does not terminate the program.

Definition at line 179 of file error.c.

References CONSOLE, log_flush(), log_printf(), log_vprintf(), and progname.

Here is the call graph for this function:


Generated on Sun Feb 6 12:36:07 2011 for rdd by  doxygen 1.5.6