icqlist.cpp
上传用户:zslianheng
上传日期:2013-04-03
资源大小:946k
文件大小:1k
源码类别:

Linux/Unix编程

开发平台:

Visual C++

  1. /***************************************************************************
  2.  *                                                                         *
  3.  *   This program is free software; you can redistribute it and/or modify  *
  4.  *   it under the terms of the GNU General Public License as published by  *
  5.  *   the Free Software Foundation; either version 2 of the License, or     *
  6.  *   (at your option) any later version.                                   *
  7.  *                                                                         *
  8.  *   copyright            : (C) 2002 by Zhang Yong                         *
  9.  *   email                : z-yong163@163.com                              *
  10.  ***************************************************************************/
  11. #include "icqlist.h"
  12. void IcqListItem::remove()
  13. {
  14. prev->next = next;
  15. next->prev = prev;
  16. prev = next = this;
  17. }
  18. void IcqList::add(IcqListItem *item)
  19. {
  20. item->prev = head.prev;
  21. item->next = &head;
  22. head.prev->next = item;
  23. head.prev = item;
  24. }
  25. void IcqList::addHead(IcqListItem *item)
  26. {
  27. item->prev = &head;
  28. item->next = head.next;
  29. head.next->prev = item;
  30. head.next = item;
  31. }