home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / pascal / rehack / contain / queue.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-01  |  367 b   |  26 lines

  1. #include "queue.h"
  2.  
  3. void queue::destroy()
  4.  {
  5.   link_node *old_node = tail;
  6.  
  7.   if (tail == NULL)
  8.     return;
  9.   tail = tail->last;
  10.   tail->next = NULL;
  11.   delete old_node;
  12.  }
  13.  
  14. containable *queue::remove()
  15.  {
  16.   containable *result;
  17.  
  18.   if (tail == NULL)
  19.     return NULL;
  20.   result = tail->item();
  21.   tail->empty();
  22.   destroy();
  23.   return result;
  24.  }
  25.  
  26.