File:  [ELWIX - Embedded LightWeight unIX -] / libaitrpc / src / aitrpc.c
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Fri Jun 18 01:48:06 2010 UTC (14 years ago) by misho
Branches: MAIN
CVS tags: HEAD
Initial revision

/*************************************************************************
* (C) 2010 AITNET ltd - Sofia/Bulgaria - <misho@aitbg.com>
*  by Michael Pounov <misho@openbsd-bg.org>
*
* $Author: misho $
* $Id: aitrpc.c,v 1.1 2010/06/18 01:48:06 misho Exp $
*
*************************************************************************/
#include "global.h"


#pragma GCC visibility push(hidden)

// ------------------------------------------------

int rpc_Errno;
char rpc_Error[STRSIZ];

#pragma GCC visibility pop

// rpc_GetErrno() Get error code of last operation
inline int
rpc_GetErrno()
{
	return rpc_Errno;
}

// rpc_GetError() Get error text of last operation
inline const char *
rpc_GetError()
{
	return rpc_Error;
}

// rpc_SetErr() Set error to variables for internal use!!!
inline void
rpc_SetErr(int eno, char *estr, ...)
{
	va_list lst;

	rpc_Errno = eno;
	memset(rpc_Error, 0, STRSIZ);
	va_start(lst, estr);
	vsnprintf(rpc_Error, STRSIZ, estr, lst);
	va_end(lst);
}

// ------------------------------------------------------------


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>