File:  [ELWIX - Embedded LightWeight unIX -] / libaitrpc / src / aitrpc.c
Revision 1.1.1.1.2.2: download - view: text, annotated - select for diffs - revision graph
Wed Jun 23 15:07:15 2010 UTC (14 years, 1 month ago) by misho
Branches: rpc1_0
Diff to: branchpoint 1.1.1.1: preferred, unified
new file

    1: /*************************************************************************
    2: * (C) 2010 AITNET ltd - Sofia/Bulgaria - <misho@aitbg.com>
    3: *  by Michael Pounov <misho@openbsd-bg.org>
    4: *
    5: * $Author: misho $
    6: * $Id: aitrpc.c,v 1.1.1.1.2.2 2010/06/23 15:07:15 misho Exp $
    7: *
    8: *************************************************************************/
    9: #include "global.h"
   10: 
   11: 
   12: #pragma GCC visibility push(hidden)
   13: 
   14: // ------------------------------------------------
   15: 
   16: int rpc_Kill;
   17: 
   18: int rpc_Errno;
   19: char rpc_Error[STRSIZ];
   20: 
   21: #pragma GCC visibility pop
   22: 
   23: // rpc_GetErrno() Get error code of last operation
   24: inline int
   25: rpc_GetErrno()
   26: {
   27: 	return rpc_Errno;
   28: }
   29: 
   30: // rpc_GetError() Get error text of last operation
   31: inline const char *
   32: rpc_GetError()
   33: {
   34: 	return rpc_Error;
   35: }
   36: 
   37: // rpc_SetErr() Set error to variables for internal use!!!
   38: inline void
   39: rpc_SetErr(int eno, char *estr, ...)
   40: {
   41: 	va_list lst;
   42: 
   43: 	rpc_Errno = eno;
   44: 	memset(rpc_Error, 0, STRSIZ);
   45: 	va_start(lst, estr);
   46: 	vsnprintf(rpc_Error, STRSIZ, estr, lst);
   47: 	va_end(lst);
   48: }
   49: 
   50: // ------------------------------------------------------------
   51: 

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