|
version 1.16, 2012/03/29 01:31:33
|
version 1.16.2.3, 2012/04/02 08:08:09
|
|
Line 91 typedef enum {
|
Line 91 typedef enum {
|
| typedef struct { |
typedef struct { |
| uint8_t val_type; |
uint8_t val_type; |
| uint8_t val_pad; |
uint8_t val_pad; |
| uint16_t val_hash; | uint16_t val_key; |
| uint32_t val_len; |
uint32_t val_len; |
| union { |
union { |
| uint64_t net; |
uint64_t net; |
|
Line 116 typedef struct {
|
Line 116 typedef struct {
|
| |
|
| #define AIT_TYPE(_vl) ((ait_type_t) (_vl)->val_type) |
#define AIT_TYPE(_vl) ((ait_type_t) (_vl)->val_type) |
| #define AIT_LEN(_vl) (_vl)->val_len |
#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_RAW(_vl) (_vl)->val.net |
| #define AIT_VOID(_vl) (_vl)->val.ptr |
#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) |
#define AIT_BLOB_CHUNKS(_vl, _n) (assert((_vl)), AIT_LEN((_vl)) / _n + (AIT_LEN((_vl)) % _n) ? 1 : 0) |
| #define AIT_ISEMPTY(_vl) (assert((_vl)), AIT_TYPE((_vl)) == empty) |
#define AIT_ISEMPTY(_vl) (assert((_vl)), AIT_TYPE((_vl)) == empty) |
| |
|
| #define AIT_GET_LIKE(_vl, _type) (assert((_vl)), (_type) (_vl)->val.ptr) | #define AIT_GET_LIKE(_vl, _type) ((_type) ((_vl) ? (_vl)->val.ptr : NULL)) |
| |
|
| #define AIT_GET_PTR(_vl) (assert((_vl)), assert(AIT_TYPE((_vl)) == ptr), (_vl)->val.ptr) |
#define AIT_GET_PTR(_vl) (assert((_vl)), assert(AIT_TYPE((_vl)) == ptr), (_vl)->val.ptr) |
| #define AIT_GET_DATA(_vl) (assert((_vl)), assert(AIT_TYPE((_vl)) == data), (_vl)->val_data) |
#define AIT_GET_DATA(_vl) (assert((_vl)), assert(AIT_TYPE((_vl)) == data), (_vl)->val_data) |
|
Line 166 typedef struct {
|
Line 166 typedef struct {
|
| } } while (0) |
} } while (0) |
| #define AIT_SET_STRCAT(_vl, _v) do { ait_val_t *__val = (_vl); assert(__val); \ |
#define AIT_SET_STRCAT(_vl, _v) do { ait_val_t *__val = (_vl); assert(__val); \ |
| assert(AIT_TYPE(__val) == string); \ |
assert(AIT_TYPE(__val) == string); \ |
| void *__p = realloc(AIT_LEN(__val) + strlen((_v))); \ | void *__p = realloc(__val->val.string, \ |
| | AIT_LEN(__val) + strlen((_v))); \ |
| if (__p) { \ |
if (__p) { \ |
| __val->val.string = __p; \ |
__val->val.string = __p; \ |
| AIT_LEN(__val) += strlen((_v)); \ |
AIT_LEN(__val) += strlen((_v)); \ |
|
Line 375 inline int io_clrVars(array_t * __restrict vars);
|
Line 376 inline int io_clrVars(array_t * __restrict vars);
|
| * return: none |
* return: none |
| */ |
*/ |
| inline void io_freeVars(array_t ** __restrict vars); |
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*)); |
| |
/* |
| |
* io_findKeyVars() Find variable by key from array |
| |
* |
| |
* @vars = Variables |
| |
* @key = Search key |
| |
* return: NULL error or not found, !=NULL valid element |
| |
*/ |
| |
ait_val_t *io_findKeyVars(array_t * __restrict vars, u_short key); |
| |
|
| |
|
| /* |
/* |