/**
* This callback function returns the hashcode of a key. The hashcode
- * is used for indexing into the backing vector for finding the an
+ * is used for indexing into the backing Vector for finding the an
* item via its key. The same key must map consistently to the same
* hashcode while the hashtable contains an item with that key.
* Different keys map map to the same hashcode, in which case the
- * vector placement is made at the first empty or hole slot following
+ * Vector placement is made at the first empty or hole slot following
* the hashcode index.
*/
static unsigned long integeritem_hashcode(void *this,void *key) {
static void integeritem_releasekey(void *this,void *key) {
}
-itemkeyfun integeritem = {
+/**
+ * This callback function writes a representation of an item into
+ * a character buffer.
+ */
+static int integeritem_tostring(void *this,void *item,char *buffer,int limit) {
+ return snprintf( buffer, limit, "%lld", (long long) item );
+}
+
+ItemKeyFun integeritem = {
.hashcode = integeritem_hashcode,
.haskey = integeritem_haskey,
.itemkey = integeritem_itemkey,
- .releasekey = integeritem_releasekey
+ .releasekey = integeritem_releasekey,
+ .tostring = integeritem_tostring
};