--- libaitrpc/inc/aitrpc.h 2024/03/20 17:32:30 1.29 +++ libaitrpc/inc/aitrpc.h 2025/03/31 12:21:07 1.30 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitrpc.h,v 1.29 2024/03/20 17:32:30 misho Exp $ +* $Id: aitrpc.h,v 1.30 2025/03/31 12:21:07 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2024 +Copyright 2004 - 2025 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -74,7 +74,7 @@ typedef struct tagRPCFunc { void *func_parent; SLIST_ENTRY(tagRPCFunc) func_next; - AVL_ENTRY(tagRPCFunc) func_node; + RB_ENTRY(tagRPCFunc) func_node; } rpc_func_t; #define RPC_FUNC_SERVER(x) ((rpc_srv_t*) (x)->func_parent) @@ -83,11 +83,11 @@ typedef struct tagRPCFuncs { pthread_mutex_t mtx; struct tagRPCFunc *slh_first; - struct tagRPCFunc *avlh_root; + struct tagRPCFunc *rbh_root; } rpc_funcs_t; #define RPC_FUNCS_LOCK(x) pthread_mutex_lock(&(x)->mtx) #define RPC_FUNCS_UNLOCK(x) pthread_mutex_unlock(&(x)->mtx) -#define RPC_FUNCS_ISEMPTY(x) AVL_EMPTY((x)) +#define RPC_FUNCS_ISEMPTY(x) RB_EMPTY((x)) /* BLOB register element */ @@ -156,6 +156,10 @@ typedef int (*rpc_callback_t)(rpc_cli_t *, struct tagR /* ----------------------------------------------------------------------- */ +#ifdef __cplusplus +extern "C" { +#endif + /* * rpc_register_srvPing() - Register ping service function * @@ -398,5 +402,8 @@ int rpc_srv_recvBLOB(rpc_cli_t * __restrict cli, rpc_b */ int rpc_srv_Return(rpc_cli_t *c); +#ifdef __cplusplus +} +#endif #endif