Blame src/internal/mdso_errinfo_impl.h

4ecd08
/****************************************************************/
4ecd08
/*  mdso: midipix dso scavenger                                 */
78ab3c
/*  Copyright (C) 2015--2017  Z. Gilboa                         */
4ecd08
/*  Released under GPLv2 and GPLv3; see COPYING.MDSO.           */
4ecd08
/****************************************************************/
4ecd08
4ecd08
#include <errno.h>
4ecd08
#include <mdso/mdso.h>
4ecd08
4ecd08
int mdso_record_error(
4ecd08
	const struct mdso_driver_ctx *,
1d4a9e
	int		esyscode,
1d4a9e
	int		elibcode,
1d4a9e
	const char *	efunction,
1d4a9e
	int		eline,
1d4a9e
	unsigned	eflags,
1d4a9e
	void *		eany);
4ecd08
4ecd08
#define MDSO_SYSTEM_ERROR(dctx)           \
4ecd08
	mdso_record_error(                \
4ecd08
		dctx,                     \
4ecd08
		errno,                    \
4ecd08
		0,                        \
4ecd08
		__func__,                 \
4ecd08
		__LINE__,                 \
4ecd08
		MDSO_ERROR_TOP_LEVEL,     \
4ecd08
		0)
4ecd08
4ecd08
#define MDSO_BUFFER_ERROR(dctx)           \
4ecd08
	mdso_record_error(                \
4ecd08
		dctx,                     \
4ecd08
		ENOBUFS,                  \
4ecd08
		0,                        \
4ecd08
		__func__,                 \
4ecd08
		__LINE__,                 \
4ecd08
		MDSO_ERROR_TOP_LEVEL,     \
4ecd08
		0)
4ecd08
4ecd08
#define MDSO_SPAWN_ERROR(dctx)            \
4ecd08
	mdso_record_error(                \
4ecd08
		dctx,                     \
4ecd08
		errno,                    \
4ecd08
		0,                        \
4ecd08
		__func__,                 \
4ecd08
		__LINE__,                 \
4ecd08
		MDSO_ERROR_TOP_LEVEL      \
4ecd08
		| (errno ? 0              \
4ecd08
		   : MDSO_ERROR_CHILD),   \
4ecd08
		0)
4ecd08
4ecd08
#define MDSO_FILE_ERROR(dctx)             \
4ecd08
	mdso_record_error(                \
4ecd08
		dctx,                     \
4ecd08
		EIO,                      \
4ecd08
		0,                        \
4ecd08
		__func__,                 \
4ecd08
		__LINE__,                 \
4ecd08
		MDSO_ERROR_TOP_LEVEL,     \
4ecd08
		0)
4ecd08
1d4a9e
#define MDSO_CUSTOM_ERROR(dctx,elibcode)  \
4ecd08
	mdso_record_error(                \
4ecd08
		dctx,                     \
4ecd08
		0,                        \
1d4a9e
		elibcode,                 \
4ecd08
		__func__,                 \
4ecd08
		__LINE__,                 \
4ecd08
		MDSO_ERROR_TOP_LEVEL      \
4ecd08
		| MDSO_ERROR_CUSTOM,      \
4ecd08
		0)
4ecd08
4ecd08
#define MDSO_NESTED_ERROR(dctx)           \
4ecd08
	mdso_record_error(                \
4ecd08
		dctx,                     \
4ecd08
		0,                        \
4ecd08
		0,                        \
4ecd08
		__func__,                 \
4ecd08
		__LINE__,                 \
4ecd08
		MDSO_ERROR_NESTED,        \
4ecd08
		0)