#include #include #include "../include/swserv-plugins.h" /* * SWServ Plugin destroy notify. * * This function is called whenever an object is destroyed. * * The destroyed_obj_num is the object that was destroyed, this * object is valid because this function is called just before * the object is actually recycled by SWServ. * * The destroyer_obj_num is the object that caused the destruction * of destroyed_obj_num, the destroyer_obj_num can be -1 if it is * not available or not applicable to the cause of the destruction. * * The destroyer_obj_owner_num is the owner of destroyer_obj_num, * this value may also be -1. */ SWPLUGIN_DESTROY_NOTIFY_FUNCRTN SWPLUGIN_DESTROY_NOTIFY_FUNC( int reason, int destroyed_obj_num, int destroyer_obj_num, int destroyer_obj_owner_num, SWServContext *ctx ) { xsw_object_struct *dobj = SWServObjectGetPointer(ctx, destroyed_obj_num), *cobj = SWServObjectGetPointer(ctx, destroyer_obj_num), *oobj = SWServObjectGetPointer(ctx, destroyer_obj_owner_num); if((dobj != NULL) && (cobj != NULL) && (oobj != NULL)) { printf( "`%s' destroyed by `%s' fired by `%s'.\n", dobj->name, cobj->name, oobj->name ); } else if(dobj != NULL) { printf( "`%s' has been destroyed.\n", dobj->name ); } } /* * SWServ Plugin initialize. */ SWPLUGIN_INIT_FUNCRTN SWPLUGIN_INIT_FUNC(SWPLUGIN_INIT_FUNCINPUT) { return(0); } /* * SWServ Plugin manage. */ SWPLUGIN_MANAGE_FUNCRTN SWPLUGIN_MANAGE_FUNC(SWPLUGIN_MANAGE_FUNCINPUT) { return(0); } /* * SWServ Plugin shutdown. */ SWPLUGIN_SHUTDOWN_FUNCRTN SWPLUGIN_SHUTDOWN_FUNC(SWPLUGIN_SHUTDOWN_FUNCINPUT) { return; }