~k1n/c-icap/c-icap

« back to all changes in this revision

Viewing changes to c-icap/include/array.h

  • Committer: chtsanti
  • Date: 2012-04-09 21:11:49 UTC
  • Revision ID: svn-v4:a5cfe682-fa50-0410-8a04-e816b4a88288:c-icap-server/trunk:847
dnsbl lookup tables improvments, and other changes

 - dnsbl lookup tables now return a list of ip addresses
 - ci_cache_t: Support caching vector objects
 - Investigate the ci_vector_cast_to_voidvoid/ci_vector_cast_from_voidvoid
   functions to support conversion from vector to void ** array and the reverse.
 - bug fix: On cache destroy do not try to free items which are not allocated
   (ci_cache_entry::val_size=0)

Show diffs side-by-side

added added

removed removed

Lines of Context:
403
403
 */
404
404
#define ci_vector_get(vector, i) (i < vector->count ? (const void *)vector->items[i]:  (const void *)NULL)
405
405
 
 
406
 
 
407
const void **ci_vector_cast_to_voidvoid(ci_vector_t *vector);
 
408
ci_vector_t *ci_vector_cast_from_voidvoid(const void **p);
 
409
 
406
410
/**
407
411
 \defgroup STR_VECTORS  Vectors of strings
408
412
 \ingroup VECTORS
423
427
#define ci_str_vector_add(vect, string) ((const char *)ci_vector_add(vect, string, (strlen(string)+1)))
424
428
#define ci_str_vector_get(vector, i) (i < vector->count ? (const char *)vector->items[i]:  (const char *)NULL)
425
429
#define ci_str_vector_pop(vect)  ((const char *)ci_vector_pop(vect))
 
430
#define ci_str_vector_cast_to_charchar(vector) ((const char **)ci_vector_cast_to_voidvoid(vector))
 
431
#define ci_str_vector_cast_from_charchar(p) (ci_vector_cast_from_voidvoid((void **)p))
426
432
 
427
433
/**
428
434
 * Run the given function for each string vector item