plhashentry.rst (996B)
1 Syntax 2 ------ 3 4 .. code:: 5 6 #include <plhash.h> 7 8 typedef struct PLHashEntry PLHashEntry; 9 10 11 Description 12 ----------- 13 14 ``PLHashEntry`` is a structure that represents an entry in the hash 15 table. An entry has a key and a value, represented by the following 16 fields in the ``PLHashEntry`` structure. 17 18 .. code:: 19 20 const void *key; 21 void *value; 22 23 The key field is a pointer to an opaque key. The value field is a 24 pointer to an opaque value. If the key of an entry is an integral value 25 that can fit into a ``void *`` pointer, you can just cast the key itself 26 to ``void *`` and store it in the key field. Similarly, if the value of 27 an entry is an integral value that can fit into a ``void *`` pointer, 28 you can cast the value itself to ``void *`` and store it in the value 29 field. 30 31 .. warning:: 32 33 **Warning**: There are other fields in the ``PLHashEntry`` structure 34 besides key and value. These fields are for use by the hash table 35 library functions and the user should not tamper with them.