2 * Trampoline functions for the ItemKeyFun callbacks.
6 #include <ItemKeyFun.h>
9 * \brief Trampoline function for the ItemKeyFun.hashcode callback.
11 * The default is to use the pointer itself.
13 unsigned long ItemKeyFun_hashcode(void *this,void *key) {
14 ItemKeyFun *type = (ItemKeyFun*) this;
16 return type->hashcode? type->hashcode( type, key ) : (unsigned long) key;
20 * \brief Trampoline function for the ItemKeyFun.itemkey callback.
22 void *ItemKeyFun_itemkey(void *this,void *item) {
23 ItemKeyFun *type = (ItemKeyFun*) this;
25 return type->itemkey? type->itemkey( type, item ) : item;
29 * \brief Trampoline function for the ItemKeyFun.haskey callback.
31 int ItemKeyFun_haskey(void *this,void *item,void *key) {
32 ItemKeyFun *type = (ItemKeyFun*) this;
35 return type->haskey( this, item, key );
37 void *ikey = ItemKeyFun_itemkey( this, item );
39 ItemKeyFun_releasekey( this, ikey );
44 * \brief Trampoline function for the ItemKeyFun.releasekey callback.
46 void ItemKeyFun_releasekey(void *this,void *key) {
47 ItemKeyFun *type = (ItemKeyFun*) this;
49 if ( type->releasekey ) {
50 type->releasekey( type, key );
55 * \brief Trampoline function for the ItemKeyFun.tostring callback.
57 int ItemKeyFun_tostring(void *this,void *item,char *buffer,int limit) {
58 ItemKeyFun *type = (ItemKeyFun*) this;
60 if ( type->tostring ) {
61 return type->tostring( type, item, buffer, limit );
63 void *key = ItemKeyFun_itemkey( this, item );
64 int n = snprintf( buffer, limit, "{%p/%p@%p}", type, key, item );
65 ItemKeyFun_releasekey( this, key );