Noise-C
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Functions
Error reporting

Functions

void noise_perror (const char *s, int err)
 Prints a descriptive string for an error to stderr. More...
 
int noise_strerror (int err, char *buf, size_t size)
 Gets the descriptive string for an error code. More...
 

Detailed Description

Function Documentation

void noise_perror ( const char *  s,
int  err 
)

Prints a descriptive string for an error to stderr.

Parameters
sThe extra string to display, which defines the context in which the error occurred.
errThe error code.

Definition at line 92 of file errors.c.

int noise_strerror ( int  err,
char *  buf,
size_t  size 
)

Gets the descriptive string for an error code.

Parameters
errThe error code.
bufThe buffer to write the descriptive string to.
sizeThe size of the buffer.
Returns
Returns zero if the error string was returned or -1 if buf is NULL or size is zero.

The string may be truncated if size is not large enough. This function guarantees to NUL-terminate the returned string.

Definition at line 116 of file errors.c.