libusual  0.1
Functions
usual/err.h File Reference

Error printing for command-line utilities. More...

Functions

void err (int e, const char *fmt,...) _PRINTF(2
 Print formatted message and strerror(errno) to stderr and exit with given error code.
void void errx (int e, const char *fmt,...) _PRINTF(2
 Print formatted message to stderr and exit with given error code.
void void void warn (const char *fmt,...) _PRINTF(1
 Print formatted message and strerror(errno) to stderr.
void void void void warnx (const char *fmt,...) _PRINTF(1
 Print formatted message to stderr.
void void void void void setprogname (const char *s)
 Set program name to that will printed as prefix to error messages.
const char * getprogname (void)
 Return program name set with setprogname.
void * xmalloc (size_t len)
 Malloc that exits on failure.
void * xrealloc (void *p, size_t len)
 Realloc that exits on failure.
char * xstrdup (const char *s)
 strdup that exits on failure

Detailed Description

Error printing for command-line utilities.


Function Documentation

void err ( int  e,
const char *  fmt,
  ... 
)

Print formatted message and strerror(errno) to stderr and exit with given error code.

Referenced by hashtab_copy().

void void errx ( int  e,
const char *  fmt,
  ... 
)

Print formatted message to stderr and exit with given error code.

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

Print formatted message and strerror(errno) to stderr.

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

Print formatted message to stderr.

void void void void void setprogname ( const char *  s)

Set program name to that will printed as prefix to error messages.

const char* getprogname ( void  )

Return program name set with setprogname.

void* xmalloc ( size_t  len)

Malloc that exits on failure.

void* xrealloc ( void *  p,
size_t  len 
)

Realloc that exits on failure.

char* xstrdup ( const char *  s)

strdup that exits on failure