libuproc  1.2.0
Macros | Typedefs | Enumerations | Functions
error.h File Reference

Module: Error handling. More...

#include "uproc/common.h"

Go to the source code of this file.

Macros

#define uproc_error_msg(num, ...)
 Set uproc_errno with a custom message. More...
 
#define uproc_error(num)   uproc_error_msg((num), NULL)
 Set uproc_errno with a standard message. More...
 
#define uproc_errno   (*(uproc_error_errno_()))
 errno -like error indicator More...
 
#define uproc_errmsg   (uproc_error_errmsg_())
 Error message. More...
 
#define uproc_errloc   (uproc_error_errloc_())
 Error location. More...
 

Typedefs

typedef void uproc_error_handler(enum uproc_error_code num, const char *msg, const char *loc, void *context)
 Error handler type. More...
 

Enumerations

enum  uproc_error_code {
  UPROC_SUCCESS = 0,
  UPROC_FAILURE,
  UPROC_ERRNO,
  UPROC_ENOMEM,
  UPROC_EINVAL,
  UPROC_ENOENT,
  UPROC_EEXIST,
  UPROC_EIO,
  UPROC_ENOTSUP
}
 Available error codes. More...
 

Functions

void uproc_perror (const char *fmt,...)
 Print error message to stderr. More...
 
void uproc_error_set_handler (uproc_error_handler *hdl, void *context)
 Set error handler. More...
 

Detailed Description

Module: Error handling.