--- libaitio/inc/aitio.h 2012/07/22 20:39:45 1.21 +++ libaitio/inc/aitio.h 2012/07/25 15:21:59 1.22 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitio.h,v 1.21 2012/07/22 20:39:45 misho Exp $ +* $Id: aitio.h,v 1.22 2012/07/25 15:21:59 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -306,6 +306,23 @@ typedef struct { __val->val_type = empty; \ __val->val_opt ^= __val->val_opt; \ AIT_LEN(__val) = 0; \ + AIT_KEY(__val) = 0; \ + } while (0) +#define AIT_ZERO_VAL(_vl) do { ait_val_t *__val = (_vl); assert(__val); \ + switch (AIT_TYPE(__val)) { \ + case buffer: \ + case string: \ + memset(__val->val.buffer, 0, \ + AIT_LEN(__val)); \ + break; \ + case data: \ + memset(__val->val_data, 0, \ + AIT_LEN(__val)); \ + break; \ + default: \ + __val->val.net = 0LL; \ + break; \ + } \ AIT_KEY(__val) = 0; \ } while (0)