示例#1
0
文件: player.c 项目: rsenn/tichu
/* -------------------------------------------------------------------------- *
 * Delete a player.                                                           *
 * -------------------------------------------------------------------------- */
void player_delete(struct player *player)
{
  debug(player_log, "Destroying player block: %s", player->name);
  
  dlink_delete(&player_list, &player->node);
  
  player_release(player);
  
  mem_static_free(&player_heap, player);
}
示例#2
0
/* -------------------------------------------------------------------------- *
 * -------------------------------------------------------------------------- */
void chanmode_change_destroy(struct list *list)
{
  struct chanmodechange *cmcptr;
  struct node           *next;

  dlink_foreach_safe(list, cmcptr, next)
  {
    dlink_delete(list, &cmcptr->node);

    mem_static_free(&chanmode_heap, cmcptr);
  }
示例#3
0
/* -------------------------------------------------------------------------- *
 * Hook when a lclient is released.                                           *
 * -------------------------------------------------------------------------- */
static void lc_cookie_release(struct lclient *lcptr)
{
  struct lc_cookie *cookie;

  cookie = lcptr->plugdata[LCLIENT_PLUGDATA_COOKIE];

  if(cookie)
  {
    dlink_delete(&lc_cookie_list, &cookie->node);
    lcptr->plugdata[LCLIENT_PLUGDATA_COOKIE] = NULL;
    mem_static_free(&lc_cookie_heap, cookie);
    mem_static_collect(&lc_cookie_heap);
  }
}
// 删除组后一个节点
int dlink_delete_last() 
{
	return dlink_delete(count-1);
}
// 删除第一个节点
int dlink_delete_first() 
{
	return dlink_delete(0);
}