Blame src/internal/apimagic_errinfo_impl.h

bbcd7d
#include <errno.h>
bbcd7d
#include <apimagic/apimagic.h>
bbcd7d
bbcd7d
int amgc_record_error(
bbcd7d
	const struct amgc_driver_ctx *,
bbcd7d
	int		esyscode,
bbcd7d
	int		elibcode,
bbcd7d
	const char *	efunction,
bbcd7d
	int		eline,
bbcd7d
	unsigned	eflags,
bbcd7d
	void *		ectx);
bbcd7d
bbcd7d
#define AMGC_SYSTEM_ERROR(dctx)           \
bbcd7d
	amgc_record_error(                \
bbcd7d
		dctx,                     \
bbcd7d
		errno,                    \
bbcd7d
		0,                        \
bbcd7d
		__func__,                 \
bbcd7d
		__LINE__,                 \
bbcd7d
		AMGC_ERROR_TOP_LEVEL,     \
bbcd7d
		0)
bbcd7d
bbcd7d
#define AMGC_BUFFER_ERROR(dctx)           \
bbcd7d
	amgc_record_error(                \
bbcd7d
		dctx,                     \
bbcd7d
		ENOBUFS,                  \
bbcd7d
		0,                        \
bbcd7d
		__func__,                 \
bbcd7d
		__LINE__,                 \
bbcd7d
		AMGC_ERROR_TOP_LEVEL,     \
bbcd7d
		0)
bbcd7d
bbcd7d
#define AMGC_SPAWN_ERROR(dctx)            \
bbcd7d
	amgc_record_error(                \
bbcd7d
		dctx,                     \
bbcd7d
		errno,                    \
bbcd7d
		0,                        \
bbcd7d
		__func__,                 \
bbcd7d
		__LINE__,                 \
bbcd7d
		AMGC_ERROR_TOP_LEVEL      \
bbcd7d
		| (errno ? 0              \
bbcd7d
		   : AMGC_ERROR_CHILD),   \
bbcd7d
		0)
bbcd7d
bbcd7d
#define AMGC_FILE_ERROR(dctx)             \
bbcd7d
	amgc_record_error(                \
bbcd7d
		dctx,                     \
bbcd7d
		EIO,                      \
bbcd7d
		0,                        \
bbcd7d
		__func__,                 \
bbcd7d
		__LINE__,                 \
bbcd7d
		AMGC_ERROR_TOP_LEVEL,     \
bbcd7d
		0)
bbcd7d
bbcd7d
#define AMGC_CUSTOM_ERROR(dctx,elibcode)  \
bbcd7d
	amgc_record_error(                \
bbcd7d
		dctx,                     \
bbcd7d
		0,                        \
bbcd7d
		elibcode,                 \
bbcd7d
		__func__,                 \
bbcd7d
		__LINE__,                 \
bbcd7d
		AMGC_ERROR_TOP_LEVEL      \
bbcd7d
		| AMGC_ERROR_CUSTOM,      \
bbcd7d
		0)
bbcd7d
bbcd7d
#define AMGC_NESTED_ERROR(dctx)           \
bbcd7d
	amgc_record_error(                \
bbcd7d
		dctx,                     \
bbcd7d
		0,                        \
bbcd7d
		0,                        \
bbcd7d
		__func__,                 \
bbcd7d
		__LINE__,                 \
bbcd7d
		AMGC_ERROR_NESTED,        \
bbcd7d
		0)