>     void  *  PArray[100]
>     ...
>     PValue = JudySLIns (& PArray[i], record, &JError);
>     ...
>     PPValue = JudySLGet( & PArray[i], needle, 0 );

In what way doesn't it work?  Not clear what problem you are having.
Compiler, run-time?

You talked about array-of-array, but you're really only using one Judy
level of array, right?  You have a fixed-size top array of JudySL array
pointers.

Array-of-array is the trickiest part of using libJudy.  You must pay
close attention to pointer levels and types.  Here's an example from
actual code that uses the macros to create JudySL -> JudySL -> Judy1.
Dunno if this will help you or not.

    Pvoid_t map = NULL;         // top JudySL array.
    char *  index1 = ...;
    char *  index2 = ...;
    Word_t  index3 = ...;
    ...

    Word_t * valuep;    // in JudySL arrays.
    PPvoid_t subpp;     // JudySL subarray pointer, for using macros.
    int      rc;
                               JSLI(valuep, map,    index1);
    subpp = (PPvoid_t) valuep; JSLI(valuep, *subpp, index2);
    subpp = (PPvoid_t) valuep; J1S( rc,     *subpp, index3);

The macros hide error handling and "conform" the signatures (parameter
types), which makes this look very simple, but also requires the odd use
of PPvoid_t and then passing *subpp.  But it works -- very well -- and
can be written very briefly.

Cheers,
Alan Silverstein

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel

Reply via email to