FreeBASIC  0.91.0
stack.bi
Go to the documentation of this file.
1 #ifndef __STACK_BI__
2 #define __STACK_BI__
3 
4 #include once "common.bi"
5 
6 type TSTACKNODE
7  prev as TSTACKNODE ptr
8  next as TSTACKNODE ptr
9 end type
10 
11 type TSTACKTB
12  next as TSTACKTB ptr
13  nodetb as TSTACKNODE ptr
14  nodes as integer
15 end type
16 
17 type TSTACK
18  tbhead as TSTACKTB ptr
19  tbtail as TSTACKTB ptr
20  nodes as integer
21  nodelen as integer
22  tos as TSTACKNODE ptr '' top-of-stack
23  clear as integer '' clear nodes?
24 end type
25 
26 declare function stackNew _
27  ( _
28  byval stk as TSTACK ptr, _
29  byval nodes as integer, _
30  byval nodelen as integer, _
31  byval doclear as integer = TRUE _
32  ) as integer
33 
34 declare function stackFree _
35  ( _
36  byval stk as TSTACK ptr _
37  ) as integer
38 
39 declare function stackPush _
40  ( _
41  byval stk as TSTACK ptr _
42  ) as any ptr
43 
44 declare sub stackPop _
45  ( _
46  byval stk as TSTACK ptr _
47  )
48 
49 declare function stackGetTOS _
50  ( _
51  byval stk as TSTACK ptr _
52  ) as any ptr
53 
54 #endif '' _STACK_BI__
55