Blame src/internal/perk_errinfo_impl.h
|
|
db655e |
/***************************************************************/
|
|
|
db655e |
/* perk: PE Resource Kit */
|
|
|
ced38a |
/* Copyright (C) 2015--2017 Z. Gilboa */
|
|
|
db655e |
/* Released under GPLv2 and GPLv3; see COPYING.PERK. */
|
|
|
db655e |
/***************************************************************/
|
|
|
db655e |
|
|
|
db655e |
#include <errno.h>
|
|
|
db655e |
#include <perk/perk.h>
|
|
|
db655e |
|
|
|
db655e |
int pe_record_error(
|
|
|
db655e |
const struct pe_driver_ctx *,
|
|
|
f006c4 |
int esyscode,
|
|
|
f006c4 |
int elibcode,
|
|
|
f006c4 |
const char * efunction,
|
|
|
f006c4 |
int eline,
|
|
|
f006c4 |
unsigned eflags,
|
|
|
f006c4 |
void * ectx);
|
|
|
db655e |
|
|
|
db655e |
#define PERK_SYSTEM_ERROR(dctx) \
|
|
|
db655e |
pe_record_error( \
|
|
|
db655e |
dctx, \
|
|
|
db655e |
errno, \
|
|
|
db655e |
0, \
|
|
|
db655e |
__func__, \
|
|
|
db655e |
__LINE__, \
|
|
|
db655e |
PERK_ERROR_TOP_LEVEL, \
|
|
|
db655e |
0)
|
|
|
db655e |
|
|
|
db655e |
#define PERK_BUFFER_ERROR(dctx) \
|
|
|
db655e |
pe_record_error( \
|
|
|
db655e |
dctx, \
|
|
|
db655e |
ENOBUFS, \
|
|
|
db655e |
0, \
|
|
|
db655e |
__func__, \
|
|
|
db655e |
__LINE__, \
|
|
|
db655e |
PERK_ERROR_TOP_LEVEL, \
|
|
|
db655e |
0)
|
|
|
db655e |
|
|
|
db655e |
#define PERK_SPAWN_ERROR(dctx) \
|
|
|
db655e |
pe_record_error( \
|
|
|
db655e |
dctx, \
|
|
|
db655e |
errno, \
|
|
|
db655e |
0, \
|
|
|
db655e |
__func__, \
|
|
|
db655e |
__LINE__, \
|
|
|
db655e |
PERK_ERROR_TOP_LEVEL \
|
|
|
db655e |
| (errno ? 0 \
|
|
|
db655e |
: PERK_ERROR_CHILD), \
|
|
|
db655e |
0)
|
|
|
db655e |
|
|
|
db655e |
#define PERK_FILE_ERROR(dctx) \
|
|
|
db655e |
pe_record_error( \
|
|
|
db655e |
dctx, \
|
|
|
db655e |
EIO, \
|
|
|
db655e |
0, \
|
|
|
db655e |
__func__, \
|
|
|
db655e |
__LINE__, \
|
|
|
db655e |
PERK_ERROR_TOP_LEVEL, \
|
|
|
db655e |
0)
|
|
|
db655e |
|
|
|
f006c4 |
#define PERK_CUSTOM_ERROR(dctx,elibcode) \
|
|
|
db655e |
pe_record_error( \
|
|
|
db655e |
dctx, \
|
|
|
db655e |
0, \
|
|
|
f006c4 |
elibcode, \
|
|
|
db655e |
__func__, \
|
|
|
db655e |
__LINE__, \
|
|
|
db655e |
PERK_ERROR_TOP_LEVEL \
|
|
|
db655e |
| PERK_ERROR_CUSTOM, \
|
|
|
db655e |
0)
|
|
|
db655e |
|
|
|
db655e |
#define PERK_NESTED_ERROR(dctx) \
|
|
|
db655e |
pe_record_error( \
|
|
|
db655e |
dctx, \
|
|
|
db655e |
0, \
|
|
|
db655e |
0, \
|
|
|
db655e |
__func__, \
|
|
|
db655e |
__LINE__, \
|
|
|
db655e |
PERK_ERROR_NESTED, \
|
|
|
db655e |
0)
|