--- libaitrpc/src/lists.c 2015/07/02 22:28:15 1.18 +++ libaitrpc/src/lists.c 2025/03/31 12:18:40 1.18.12.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: lists.c,v 1.18 2015/07/02 22:28:15 misho Exp $ +* $Id: lists.c,v 1.18.12.1 2025/03/31 12:18:40 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 - 2015 +Copyright 2004 - 2025 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -65,7 +65,7 @@ rpc_funcs_cmp(struct tagRPCFunc *a, struct tagRPCFunc return ret; } -AVL_GENERATE(tagRPCFuncs, tagRPCFunc, func_node, rpc_funcs_cmp); +RB_GENERATE(tagRPCFuncs, tagRPCFunc, func_node, rpc_funcs_cmp); #pragma GCC visibility pop @@ -96,7 +96,7 @@ rpc_srv_registerCall(rpc_srv_t * __restrict srv, u_sho } /* search for duplicate */ - if (AVL_FIND(tagRPCFuncs, &srv->srv_funcs, func)) { + if (RB_FIND(tagRPCFuncs, &srv->srv_funcs, func)) { e_free(func); return 0; } @@ -107,7 +107,7 @@ rpc_srv_registerCall(rpc_srv_t * __restrict srv, u_sho /* add to list of functions */ RPC_FUNCS_LOCK(&srv->srv_funcs); SLIST_INSERT_HEAD(&srv->srv_funcs, func, func_next); - AVL_INSERT(tagRPCFuncs, &srv->srv_funcs, func); + RB_INSERT(tagRPCFuncs, &srv->srv_funcs, func); RPC_FUNCS_UNLOCK(&srv->srv_funcs); return 1; } @@ -134,7 +134,7 @@ rpc_srv_unregisterCall(rpc_srv_t * __restrict srv, u_s return 0; RPC_FUNCS_LOCK(&srv->srv_funcs); - AVL_REMOVE(tagRPCFuncs, &srv->srv_funcs, f); + RB_REMOVE(tagRPCFuncs, &srv->srv_funcs, f); SLIST_REMOVE(&srv->srv_funcs, f, tagRPCFunc, func_next); RPC_FUNCS_UNLOCK(&srv->srv_funcs); @@ -162,7 +162,7 @@ rpc_srv_getCall(rpc_srv_t * __restrict srv, uint16_t t memset(&tmp, 0, sizeof tmp); AIT_KEY(&tmp.func_name) = tag; - return AVL_FIND(tagRPCFuncs, &srv->srv_funcs, &tmp); + return RB_FIND(tagRPCFuncs, &srv->srv_funcs, &tmp); } /* --------------------------------------------------------- */