The LevAWC Project
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
stack.h
Go to the documentation of this file.
1 /*
2  * _____
3  * ANSI / ___/
4  * / /__
5  * \___/
6  *
7  * Filename: stack.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 stack 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 version 0.51
21  *
22  */
23 
28 #ifndef _STACK_H_
29 #define _STACK_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 Stack;
41 
42  /* INTERFACE FUNCTION DECLARATIONS */
58  Stack STACKinit(void (*destroy)(void *data));
59 
74  void STACKdestroy(Stack stk);
75 
89  int STACKpush(Stack stk, const void *data);
90 
112  int STACKpop(Stack stk, void **data);
113 
123  void *STACKpeek(Stack stk);
124 
132  int STACKisempty(Stack stk);
133 
141  int STACKsize(Stack stk);
142 
143 #ifdef __cplusplus
144 }
145 #endif
146 
147 #endif /* _STACK_H_ */
148