Blame src/internal/tpax_errinfo_impl.h

5874a9
/**************************************************************/
5874a9
/*  tpax: a topological pax implementation                    */
bef28d
/*  Copyright (C) 2020--2024  SysDeer Technologies, LLC       */
5874a9
/*  Released under GPLv2 and GPLv3; see COPYING.TPAX.         */
5874a9
/**************************************************************/
88751e
88751e
#include <errno.h>
88751e
#include <tpax/tpax.h>
88751e
88751e
int tpax_record_error(
88751e
	const struct tpax_driver_ctx *,
88751e
	int		esyscode,
88751e
	int		elibcode,
88751e
	const char *	efunction,
88751e
	int		eline,
88751e
	unsigned	eflags,
88751e
	void *		ectx);
88751e
88751e
#define TPAX_SYSTEM_ERROR(dctx)           \
88751e
	tpax_record_error(                \
88751e
		dctx,                     \
88751e
		errno,                    \
88751e
		0,                        \
88751e
		__func__,                 \
88751e
		__LINE__,                 \
88751e
		TPAX_ERROR_TOP_LEVEL,     \
88751e
		0)
88751e
88751e
#define TPAX_BUFFER_ERROR(dctx)           \
88751e
	tpax_record_error(                \
88751e
		dctx,                     \
88751e
		ENOBUFS,                  \
88751e
		0,                        \
88751e
		__func__,                 \
88751e
		__LINE__,                 \
88751e
		TPAX_ERROR_TOP_LEVEL,     \
88751e
		0)
88751e
88751e
#define TPAX_SPAWN_ERROR(dctx)            \
88751e
	tpax_record_error(                \
88751e
		dctx,                     \
88751e
		errno,                    \
88751e
		0,                        \
88751e
		__func__,                 \
88751e
		__LINE__,                 \
88751e
		TPAX_ERROR_TOP_LEVEL      \
88751e
		| (errno ? 0              \
88751e
		   : TPAX_ERROR_CHILD),   \
88751e
		0)
88751e
88751e
#define TPAX_FILE_ERROR(dctx)             \
88751e
	tpax_record_error(                \
88751e
		dctx,                     \
88751e
		EIO,                      \
88751e
		0,                        \
88751e
		__func__,                 \
88751e
		__LINE__,                 \
88751e
		TPAX_ERROR_TOP_LEVEL,     \
88751e
		0)
88751e
88751e
#define TPAX_CUSTOM_ERROR(dctx,elibcode)  \
88751e
	tpax_record_error(                \
88751e
		dctx,                     \
88751e
		0,                        \
88751e
		elibcode,                 \
88751e
		__func__,                 \
88751e
		__LINE__,                 \
88751e
		TPAX_ERROR_TOP_LEVEL      \
88751e
		| TPAX_ERROR_CUSTOM,      \
88751e
		0)
88751e
88751e
#define TPAX_NESTED_ERROR(dctx)           \
88751e
	tpax_record_error(                \
88751e
		dctx,                     \
88751e
		0,                        \
88751e
		0,                        \
88751e
		__func__,                 \
88751e
		__LINE__,                 \
88751e
		TPAX_ERROR_NESTED,        \
88751e
		0)