[BACK]Return to test-ohash.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/test-ohash.c between version 1.1 and 1.4

version 1.1, 2012/06/09 11:00:13 version 1.4, 2015/10/06 18:32:20
Line 3 
Line 3 
 #include <stdlib.h>  #include <stdlib.h>
 #include <ohash.h>  #include <ohash.h>
   
 void *xalloc(size_t sz, void *arg) { return(calloc(sz,1)); }  void *xmalloc(size_t sz, void *arg) { return calloc(1,sz); }
 void xfree(void *p, size_t sz, void *arg) { free(p); }  void *xcalloc(size_t nmemb, size_t sz, void *arg) { return calloc(nmemb,sz); }
   void xfree(void *p, void *arg) { free(p); }
   
 int  int
 main(void)  main(void)
 {  {
         struct ohash h;          struct ohash h;
         struct ohash_info i;          struct ohash_info i;
         i.halloc = i.alloc = xalloc;          i.alloc = xmalloc;
         i.free = free;          i.calloc = xcalloc;
           i.free = xfree;
         ohash_init(&h, 2, &i);          ohash_init(&h, 2, &i);
         ohash_delete(&h);          ohash_delete(&h);
         return 0;          return 0;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

CVSweb