Diff for /libaitio/inc/aitio.h between versions 1.16 and 1.16.2.4

version 1.16, 2012/03/29 01:31:33 version 1.16.2.4, 2012/04/02 08:10:57
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)); \
                                                        strlcat(__val->val.string, (_v), AIT_LEN(__val)); \                                                        strlcat((char*) __val->val.string, (_v), \
                                                                         AIT_LEN(__val)); \
                                                 } } while (0)                                                  } } while (0)
 #define AIT_SET_BLOB(_vl, _n, _len)     do { ait_val_t *__val = (_vl); assert(__val); \  #define AIT_SET_BLOB(_vl, _n, _len)     do { ait_val_t *__val = (_vl); assert(__val); \
                                                 __val->val_type = blob; AIT_LEN(__val) = _len; \                                                  __val->val_type = blob; AIT_LEN(__val) = _len; \
Line 375  inline int io_clrVars(array_t * __restrict vars); Line 377  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);
   
   
 /*  /*

Removed from v.1.16  
changed lines
  Added in v.1.16.2.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>