plhashenumerator.rst (1150B)
1 Syntax 2 ------ 3 4 .. code:: 5 6 #include <plhash.h> 7 8 typedef PRIntn (PR_CALLBACK *PLHashEnumerator)(PLHashEntry *he, PRIntn index, void *arg); 9 10 /* Return value */ 11 #define HT_ENUMERATE_NEXT 0 /* continue enumerating entries */ 12 #define HT_ENUMERATE_STOP 1 /* stop enumerating entries */ 13 #define HT_ENUMERATE_REMOVE 2 /* remove and free the current entry */ 14 #define HT_ENUMERATE_UNHASH 4 /* just unhash the current entry */ 15 16 17 Description 18 ----------- 19 20 ``PLHashEnumerator`` is a function type used in the enumerating a hash 21 table. When all the table entries are enumerated, each entry is passed 22 to a user-specified function of type ``PLHashEnumerator`` with the hash 23 table entry, an integer index, and an arbitrary piece of user data as 24 argument. 25 26 27 Remark 28 ------ 29 30 The meaning of ``HT_ENUMERATE_UNHASH`` is not clear. In the current 31 implementation, it will leave the hash table in an inconsistent state. 32 The entries are unlinked from the table, they are not freed, but the 33 entry count (the ``nentries`` field of the ``PLHashTable`` structure) is 34 not decremented. 35 36 37 See Also 38 -------- 39 40 :ref:`PL_HashTableEnumerateEntries`