--- libaitio/inc/aitio.h 2012/03/29 01:31:33 1.16 +++ libaitio/inc/aitio.h 2012/03/29 09:37:19 1.16.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitio.h,v 1.16 2012/03/29 01:31:33 misho Exp $ +* $Id: aitio.h,v 1.16.2.1 2012/03/29 09:37:19 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -91,7 +91,7 @@ typedef enum { typedef struct { uint8_t val_type; uint8_t val_pad; - uint16_t val_hash; + uint16_t val_key; uint32_t val_len; union { uint64_t net; @@ -116,7 +116,7 @@ typedef struct { #define AIT_TYPE(_vl) ((ait_type_t) (_vl)->val_type) #define AIT_LEN(_vl) (_vl)->val_len -#define AIT_HASH(_vl) (_vl)->val_hash +#define AIT_KEY(_vl) (_vl)->val_key #define AIT_RAW(_vl) (_vl)->val.net #define AIT_VOID(_vl) (_vl)->val.ptr #define AIT_BLOB_CHUNKS(_vl, _n) (assert((_vl)), AIT_LEN((_vl)) / _n + (AIT_LEN((_vl)) % _n) ? 1 : 0) @@ -375,6 +375,16 @@ inline int io_clrVars(array_t * __restrict vars); * return: none */ inline void io_freeVars(array_t ** __restrict vars); +/* + * io_sortVars() - Sorting array with variables + * + * @vars = Variable array + * @order = Sort order. If =0 ascend ot !=0 descend + * @cmp = Compare function for sorting. If =NULL compare by key + * return: none + */ +inline void io_sortVars(array_t * __restrict vars, int order, + int (*cmp)(const void*, const void*)); /*