The LevAWC Project
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
queue.h
Go to the documentation of this file.
1 /*
2  * _____
3  * ANSI / ___/
4  * / /__
5  * \___/
6  *
7  * Filename: queue.h
8  * Author : Kyle Loudon/Dan Levin
9  * Date : Fri Mar 22 12:40:45 GMT 2013
10  * Version : 0.51
11  * ---
12  * Description: A C interface for a generic queue ADT.
13  *
14  * Revision history - coming up below:
15  *
16  * Date Revision message
17  * 2012-12-20 Created this file
18  * 2013-02-19 Made some revision to the Doxygen documentation. Enhanced the description of
19  * in/out parameters - i.e. double-pointers.
20  * 2015-03-31 This code ready for ver. 0.51
21  *
22  */
23 
28 #ifndef _QUEUE_H_
29 #define _QUEUE_H_
30 
31 #include <stdio.h>
32 #include <stdlib.h>
33 
34 #include "slist.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40  typedef Slist Queue;
41 
42  /* INTERFACE FUNCTION DECLARATIONS */
43 
59  Queue QUEUEinit(void (*destroy)(void *data));
60 
75  void QUEUEdestroy(Queue queue);
76 
90  int QUEUEenqueue(Queue queue, const void *data);
91 
113  int QUEUEdequeue(Queue queue, void **data);
114 
124  void *QUEUEpeek(Queue queue);
125 
133  int QUEUEisempty(Queue queue);
134 
142  int QUEUEsize(Queue queue);
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif /* _QUEUE_H_ */
149