A proposal of a new (simpler? better?) Judy-arrays API.
Hier an example for JudyL functions.
-----------------------------------------------------------------------

#include <Judy.h>

struct judy_s { Pcvoid_t *judy; };
typedef struct judy_s judy;
typedef Word_t value_t;  // or typedef uintptr_t value_t;   /*32/64 bits-value*/

judy *judynew() { return NULL; }

value_t *judylins(judy *judy, value_t x) { return (Word_t 
*)JudyLIns((PPvoid_t)judy, x, NULL); }

value_t *judyldel(judy *judy, value_t x) { return (Word_t 
*)JudyLDel((PPvoid_t)judy, x, NULL); }

void judyldestroy(judy *judy) { JudyLFreeArray((PPvoid_t)judy, NULL); }

value_t *judylget(judy *judy, value_t x) { return (Word_t 
*)JudyLGet(judy->judy, x, NULL); }

value_t *judylprev(judy *judy, value_t *x) { return (Word_t 
*)JudyLPrev(judy->judy, x, NULL); }

value_t *judylnext(judy *judy, value_t *x) { return (Word_t 
*)JudyLNext(judy->judy, x, NULL); }

value_t *judylfirst(judy *judy, value_t *x) { return (Word_t 
*)JudyLFirst(judy->judy, x, NULL); }

value_t *judyllast(judy *judy, value_t *x) { return (Word_t 
*)JudyLLast(judy->judy, x, NULL); }

main() {
  judy *judy = judynew();
  //...
  judydestroy(judy);
}


      

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel

Reply via email to