9 byval stk
as TSTACK
ptr, _
10 byval nodes
as integer _
16 byval stk
as TSTACK
ptr, _
17 byval nodes
as integer, _
18 byval nodelen
as integer, _
19 byval doclear
as integer _
26 stk->nodelen = nodelen +
len( TSTACKNODE )
38 byval stk
as TSTACK
ptr _
41 dim as TSTACKTB
ptr tb, nxt
45 do while( tb <> NULL )
47 deallocate( tb->nodetb )
63 byval stk
as TSTACK
ptr, _
64 byval nodes
as integer _
67 dim as TSTACKNODE
ptr nodetb, node, prev
68 dim as TSTACKTB
ptr tb
81 nodetb =
xallocate( nodes * stk->nodelen )
88 if( stk->tbhead = NULL )
then
91 if( stk->tbtail <> NULL )
then
92 stk->tbtail->
next = tb
105 if( prev <> NULL )
then
111 node->
next =
cast( TSTACKNODE
ptr,
cast(
byte ptr, node ) + stk->nodelen)
127 byval stk
as TSTACK
ptr _
131 if( stk->tos = NULL )
then
132 stk->tos = stk->tbhead->nodetb
135 if( stk->tos->
next = NULL )
Then
136 hAllocTB( stk, cunsg(stk->nodes) \ 4 )
139 stk->tos = stk->tos->
next
142 function =
cast(
byte ptr, stk->tos ) +
len( TSTACKNODE )
149 byval stk
as TSTACK
ptr _
153 if( stk->
clear )
then
154 clear(
byval cast(TSTACKNODE
ptr, stk->tos) + 1, 0, stk->nodelen -
len( TSTACKNODE ) )
158 stk->tos = stk->tos->prev
165 byval stk
as TSTACK
ptr _
168 if( stk->tos = NULL )
then
171 return cast(
byte ptr, stk->tos ) +
len( TSTACKNODE )