--- libaitio/src/Attic/vars.c 2012/08/28 08:53:32 1.12.4.1 +++ libaitio/src/Attic/vars.c 2012/08/29 13:30:28 1.12.4.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: vars.c,v 1.12.4.1 2012/08/28 08:53:32 misho Exp $ +* $Id: vars.c,v 1.12.4.2 2012/08/29 13:30:28 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -719,3 +719,23 @@ io_hashKeyVars(array_t * __restrict vars) return 0; } + +/* + * io_findKeyHash() - Find variable by hash string from array + * + * @vars = Variables + * @key = Search string + * return: NULL error or not found, !=NULL valid element + */ +inline ait_val_t * +io_findKeyHash(array_t * __restrict vars, const char * __restrict key) +{ + u_short k = 0; + + if (!vars || !key) + return NULL; + + k = crcFletcher16((u_short*) key, (strlen(key) + 1) / 2); + return io_findKeyVars(vars, k); +} +