Blame src/internal/sofort_errinfo_impl.c

d413d6
#include <sofort/sofort.h>
d413d6
#include "sofort_driver_impl.h"
d413d6
#include "sofort_errinfo_impl.h"
d413d6
d413d6
int sfrt_record_error(
d413d6
	const struct sfrt_driver_ctx *	dctx,
d413d6
	int				esyscode,
d413d6
	int				elibcode,
d413d6
	const char *			efunction,
d413d6
	int				eline,
d413d6
	unsigned			eflags,
d413d6
	void *				eany)
d413d6
{
d413d6
	struct sfrt_driver_ctx_impl *	ictx;
d413d6
	struct sfrt_error_info *	erri;
d413d6
d413d6
	ictx = sfrt_get_driver_ictx(dctx);
d413d6
d413d6
	if (ictx->errinfp == ictx->erricap)
d413d6
		return -1;
d413d6
d413d6
	*ictx->errinfp = &ictx->erribuf[ictx->errinfp - ictx->erriptr];
d413d6
	erri = *ictx->errinfp;
d413d6
d413d6
	erri->euctx     = ictx->euctx;
d413d6
	erri->eunit     = ictx->eunit;
d413d6
d413d6
	erri->edctx     = dctx;
d413d6
	erri->esyscode  = esyscode;
d413d6
	erri->elibcode  = elibcode;
d413d6
	erri->efunction = efunction;
d413d6
	erri->eline     = eline;
d413d6
	erri->eflags    = eflags;
d413d6
	erri->eany      = eany;
d413d6
d413d6
	ictx->errinfp++;
d413d6
d413d6
	return -1;
d413d6
}