--- libelwix/inc/elwix/aiov.h 2021/03/19 00:40:28 1.1.2.2 +++ libelwix/inc/elwix/aiov.h 2021/03/21 01:32:04 1.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aiov.h,v 1.1.2.2 2021/03/19 00:40:28 misho Exp $ +* $Id: aiov.h,v 1.2 2021/03/21 01:32:04 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -54,6 +54,7 @@ struct tagIOV { typedef struct tagIOV iovec_t; #define iov_Size(x) (x)->iov_size +#define iov_Array(x) (x)->iov_array /* * iov_Init() - Init new iovec array @@ -77,7 +78,7 @@ void iov_Destroy(iovec_t ** __restrict iov); * @datlen = data length * return: -1 error, 0 ok */ -int iov_Get(iovec_t * __restrict iov, unsigned int pos, void **data, size_t *datlen); +int iov_Get(iovec_t * __restrict iov, unsigned int pos, void *data, size_t *datlen); /* * iov_Insert() - Insert data at position into array * @@ -115,7 +116,7 @@ int iov_Push(iovec_t * __restrict iov, void *data, siz * @mustfree = data must be free before delete * return: -1 error, !=-1 poped from position */ -int iov_Pop(iovec_t * __restrict iov, void **data, size_t *datlen, int mustfree); +int iov_Pop(iovec_t * __restrict iov, void *data, size_t *datlen, int mustfree); /* * iov_PushPair() - Push pair/named data on first free position * @@ -137,8 +138,16 @@ int iov_PushPair(iovec_t * __restrict iov, const char * @mustfree = data must be free before delete * return: -1 error, !=-1 poped from position */ -int iov_PopPair(iovec_t * __restrict iov, char **name, size_t *namlen, - void **data, size_t *datlen); +int iov_PopPair(iovec_t * __restrict iov, char *name, size_t *namlen, + void *data, size_t *datlen, int mustfree); +/* + * iov_FreePairs() - Free pairs/named data in iovec array + * + * @iov = iovec array + * @mustfree = data must be free before delete + * return: -1 error or 0 ok + */ +int iov_FreePairs(iovec_t * __restrict iov, int mustfree); /* * iov_Debug() - Debug of iovec array