pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] Hash module API


From: gerel
Subject: Re: [pdf-devel] Hash module API
Date: Mon, 07 Apr 2008 23:37:28 -0300

 > Date: Mon, 07 Apr 2008 18:19:24 +0200
 > From: address@hidden
 > 
 > 
 >    BTW, regarding the implementation. What about using gl_list ?
 > 
 >    ##
 >       The implementations are:
 >         GL_ARRAY_LIST        a growable array
 >         GL_CARRAY_LIST       a growable circular array
 >         GL_LINKED_LIST       a linked list
 >         GL_AVLTREE_LIST      a binary tree (AVL tree)
 >         GL_RBTREE_LIST       a binary tree (red-black tree)
 >         GL_LINKEDHASH_LIST   a hash table with a linked list
 >         GL_AVLTREEHASH_LIST  a hash table with a binary tree (AVL tree)
 >         GL_RBTREEHASH_LIST   a hash table with a binary tree (red-black tree)
 >    ###
 > 
 >    We may use GL_LINKEDHASH_LIST and write wrappers for it (like in the List 
 > Module).
 > 
 > That is what I had in mind. The hash algorithms implemented in gl_list
 > fit our needs (null-terminated string keys).

Are you sure ? I've read gl_list Hash code and actually I haven't found any
notion of a "string key". Rather we would need to implement the Hash calculation
function and call gl_list_create() with a pointer to it.

Here is the type definition for the Hash calculation function:
##
/* Type of function used to compute a hash code.
   NULL denotes a function that depends only on the pointer itself.  */
typedef size_t (*gl_listelement_hashcode_fn) (const void *elt);
###

Later on, we could implement the notion of an order of keys by defining
different comparision functions, one for each order type.

Correct me If I'm wrong.

best regards

-gerel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]