home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / QUEUE.H < prev    next >
C/C++ Source or Header  |  1997-07-05  |  1KB  |  44 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /*
  4. +----------------------------------------------------+
  5. |                Thunderbird Software                |
  6. +----------------------------------------------------+
  7. | Filespec  :  QUEUE.H                               |
  8. | Date      :  August 30, 1994                       |
  9. | Time      :  5:40 PM                               |
  10. | Revision  :  0.0                                   |
  11. +----------------------------------------------------+
  12. | Programmer:  Scott Andrews                         |
  13. | Address   :  5358 Summit RD SW                     |
  14. | City/State:  Pataskala, Ohio                       |
  15. | Zip       :  43062                                 |
  16. +----------------------------------------------------+
  17. | Released to the Public Domain                      |
  18. +----------------------------------------------------+
  19. */
  20.  
  21. #ifndef QUEUE__H
  22. #define QUEUE__H
  23.  
  24. /* Needed by Serial.C */
  25.  
  26. typedef struct
  27. { int   size;
  28.   int   head;
  29.   int   tail;
  30.   int   avail;
  31.   char *buffer;
  32. } QUEUE;
  33.  
  34. #define queue_empty(queue) (queue)->head == (queue)->tail
  35. #define queue_avail(queue) (queue)->avail
  36.  
  37. QUEUE *alloc_queue( int size);
  38. int   en_queue( QUEUE *queue_ptr, char data);
  39. int   de_queue( QUEUE *queue_ptr);
  40.  
  41. /* End of Queue.H */
  42.  
  43. #endif /* QUEUE__H */
  44.