libpcp  0.2.1
Functions | Variables
FATALS

A couple of functions to catch errors and display them. More...

Functions

void fatal (const char *fmt,...)
 Set an error message.
 
void fatals_ifany ()
 Prints error messages to STDERR, if there are some.
 
void fatals_reset ()
 Reset the error variables.
 
void fatals_done ()
 Cleans up memory allocation of global error variables.
 

Variables

char * PCP_ERR
 Global variable holding the last error message.
 
byte PCP_ERRSET
 Global variable indicating if an error occurred.
 
int PCP_EXIT
 Exitcode for the pcp commandline utility.
 

Detailed Description

A couple of functions to catch errors and display them.

Function Documentation

void fatal ( const char *  fmt,
  ... 
)

Set an error message.

This function gets a printf() like error message, which it stores in the global PCP_ERR variable and sets PCP_ERRSET to 1.

Parameters
[in]fmtprintf() like format description.
[in]...format parameters, if any.
void fatals_done ( )

Cleans up memory allocation of global error variables.

void fatals_ifany ( )

Prints error messages to STDERR, if there are some.

FIXME: add something like this which returns the message.

void fatals_reset ( )

Reset the error variables.

This can be used to ignore previous errors. Use with care.

Variable Documentation

PCP_ERR

Global variable holding the last error message.

Can be retrieved with fatals_ifany().

PCP_ERRSET

Global variable indicating if an error occurred.

PCP_EXIT

Exitcode for the pcp commandline utility.