Annotation of libaitrpc/src/aitrpc.c, revision 1.1.1.1
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 $
6: * $Id: aitcli.c,v 1.2.2.17 2010/06/09 09:32:30 misho Exp $
7: *
8: *************************************************************************/
9: #include "global.h"
10:
11:
12: #pragma GCC visibility push(hidden)
13:
14: // ------------------------------------------------
15:
16: int rpc_Errno;
17: char rpc_Error[STRSIZ];
18:
19: #pragma GCC visibility pop
20:
21: // rpc_GetErrno() Get error code of last operation
22: inline int
23: rpc_GetErrno()
24: {
25: return rpc_Errno;
26: }
27:
28: // rpc_GetError() Get error text of last operation
29: inline const char *
30: rpc_GetError()
31: {
32: return rpc_Error;
33: }
34:
35: // rpc_SetErr() Set error to variables for internal use!!!
36: inline void
37: rpc_SetErr(int eno, char *estr, ...)
38: {
39: va_list lst;
40:
41: rpc_Errno = eno;
42: memset(rpc_Error, 0, STRSIZ);
43: va_start(lst, estr);
44: vsnprintf(rpc_Error, STRSIZ, estr, lst);
45: va_end(lst);
46: }
47:
48: // ------------------------------------------------------------
49:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>