Annotation of libaitrpc/src/aitrpc.c, revision 1.1.1.1.2.2
1.1 misho 1: /*************************************************************************
2: * (C) 2010 AITNET ltd - Sofia/Bulgaria - <misho@aitbg.com>
3: * by Michael Pounov <misho@openbsd-bg.org>
4: *
5: * $Author: misho $
1.1.1.1.2.2! misho 6: * $Id: aitrpc.c,v 1.1.1.1.2.1 2010/06/18 13:36:01 misho Exp $
1.1 misho 7: *
8: *************************************************************************/
9: #include "global.h"
10:
11:
12: #pragma GCC visibility push(hidden)
13:
14: // ------------------------------------------------
15:
1.1.1.1.2.1 misho 16: int rpc_Kill;
17:
1.1 misho 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>