version 1.22.2.13, 2012/07/31 15:19:11
|
version 1.22.2.15, 2012/07/31 16:04:52
|
Line 180 typedef struct {
|
Line 180 typedef struct {
|
#define AIT_GET_F32(_vl) (assert(AIT_TYPE((_vl)) == f32), (_vl)->val.f32) |
#define AIT_GET_F32(_vl) (assert(AIT_TYPE((_vl)) == f32), (_vl)->val.f32) |
#define AIT_GET_F64(_vl) (assert(AIT_TYPE((_vl)) == f64), (_vl)->val.f64) |
#define AIT_GET_F64(_vl) (assert(AIT_TYPE((_vl)) == f64), (_vl)->val.f64) |
|
|
#define AIT_SET_DATA(_vl, _p, _len) do { ait_val_t *__val = (_vl); \ | #define AIT_SET_DATA(_vl, _p, _len) do { ait_val_t *__val = io_realloc((_vl), (sizeof(ait_val_t) + _len)); \ |
__val = io_realloc(__val, sizeof(ait_val_t) + _len); \ | |
if (__val) { \ |
if (__val) { \ |
__val->val_type = data; AIT_LEN(__val) = _len; \ |
__val->val_type = data; AIT_LEN(__val) = _len; \ |
if ((_p)) \ | if ((_p)) { \ |
memcpy(__val->val_data, (_p), _len); \ |
memcpy(__val->val_data, (_p), _len); \ |
|
} \ |
(_vl) = __val; \ |
(_vl) = __val; \ |
} \ |
} \ |
} while (0); |
} while (0); |
Line 214 typedef struct {
|
Line 214 typedef struct {
|
} } while (0) |
} } while (0) |
#define AIT_SET_STR(_vl, _v) do { ait_val_t *__val = (_vl); assert(__val); \ |
#define AIT_SET_STR(_vl, _v) do { ait_val_t *__val = (_vl); assert(__val); \ |
__val->val_type = string; \ |
__val->val_type = string; \ |
if ((_v)) { \ | if ((_v) && *(_v)) { \ |
__val->val.string = (int8_t*) io_strdup((_v)); \ |
__val->val.string = (int8_t*) io_strdup((_v)); \ |
AIT_LEN(__val) = strlen((const char*) \ |
AIT_LEN(__val) = strlen((const char*) \ |
__val->val.string) + 1; \ |
__val->val.string) + 1; \ |