*/
void *ItemKeyFun_itemkey(void *this,void *item) {
ItemKeyFun *type = (ItemKeyFun*) this;
- assert( type );
- return type->itemkey? type->itemkey( type, item ) : item;
+ return ( type && type->itemkey )? type->itemkey( type, item ) : item;
}
/**
*/
int ItemKeyFun_haskey(void *this,void *item,void *key) {
ItemKeyFun *type = (ItemKeyFun*) this;
- assert( type );
- if ( type->haskey ) {
+ if ( type && type->haskey ) {
return type->haskey( this, item, key );
}
void *ikey = ItemKeyFun_itemkey( this, item );
*/
void ItemKeyFun_releasekey(void *this,void *key) {
ItemKeyFun *type = (ItemKeyFun*) this;
- assert( type );
- if ( type->releasekey ) {
+ if( type && type->releasekey ) {
type->releasekey( type, key );
}
}
*/
int ItemKeyFun_tostring(void *this,void *item,char *buffer,int limit) {
ItemKeyFun *type = (ItemKeyFun*) this;
- assert( type );
- if ( type->tostring ) {
+ if( type && type->tostring ) {
return type->tostring( type, item, buffer, limit );
}
void *key = ItemKeyFun_itemkey( this, item );