From 88751e9e5ee3726b8a6987aeaae04e956c2234f5 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 27 Jan 2020 08:36:51 -0500 Subject: created lib-app skeleton (foss21.org lib-app model). --- src/internal/tpax_errinfo_impl.c | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/internal/tpax_errinfo_impl.c (limited to 'src/internal/tpax_errinfo_impl.c') diff --git a/src/internal/tpax_errinfo_impl.c b/src/internal/tpax_errinfo_impl.c new file mode 100644 index 0000000..b610869 --- /dev/null +++ b/src/internal/tpax_errinfo_impl.c @@ -0,0 +1,45 @@ +/******************************************************/ +/* tpax: a topological pax implementation */ +/* Copyright (C) 2020 Z. Gilboa */ +/* Released under GPLv2 and GPLv3; see COPYING.TPAX. */ +/******************************************************/ + +#include +#include "tpax_driver_impl.h" +#include "tpax_errinfo_impl.h" + +int tpax_record_error( + const struct tpax_driver_ctx * dctx, + int esyscode, + int elibcode, + const char * efunction, + int eline, + unsigned eflags, + void * eany) +{ + struct tpax_driver_ctx_impl * ictx; + struct tpax_error_info * erri; + + ictx = tpax_get_driver_ictx(dctx); + + if (ictx->errinfp == ictx->erricap) + return -1; + + *ictx->errinfp = &ictx->erribuf[ictx->errinfp - ictx->erriptr]; + erri = *ictx->errinfp; + + erri->euctx = ictx->euctx; + erri->eunit = ictx->eunit; + + erri->edctx = dctx; + erri->esyscode = esyscode; + erri->elibcode = elibcode; + erri->efunction = efunction; + erri->eline = eline; + erri->eflags = eflags; + erri->eany = eany; + + ictx->errinfp++; + + return -1; +} -- cgit v1.2.3