Lines Matching defs:stack

5 /*    Adobe's code for emulating a CFF stack (body).                       */
58 CF2_Stack stack = NULL;
61 if ( !FT_QNEW( stack ) )
64 stack->memory = memory;
65 stack->error = e;
66 stack->top = &stack->buffer[0]; /* empty stack */
69 return stack;
74 cf2_stack_free( CF2_Stack stack )
76 if ( stack )
78 FT_Memory memory = stack->memory;
82 FT_FREE( stack );
88 cf2_stack_count( CF2_Stack stack )
90 return (CF2_UInt)( stack->top - &stack->buffer[0] );
95 cf2_stack_pushInt( CF2_Stack stack,
98 if ( stack->top == &stack->buffer[CF2_OPERAND_STACK_SIZE] )
100 CF2_SET_ERROR( stack->error, Stack_Overflow );
101 return; /* stack overflow */
104 stack->top->u.i = val;
105 stack->top->type = CF2_NumberInt;
106 ++stack->top;
111 cf2_stack_pushFixed( CF2_Stack stack,
114 if ( stack->top == &stack->buffer[CF2_OPERAND_STACK_SIZE] )
116 CF2_SET_ERROR( stack->error, Stack_Overflow );
117 return; /* stack overflow */
120 stack->top->u.r = val;
121 stack->top->type = CF2_NumberFixed;
122 ++stack->top;
128 cf2_stack_popInt( CF2_Stack stack )
130 if ( stack->top == &stack->buffer[0] )
132 CF2_SET_ERROR( stack->error, Stack_Underflow );
135 if ( stack->top[-1].type != CF2_NumberInt )
137 CF2_SET_ERROR( stack->error, Syntax_Error );
141 --stack->top;
143 return stack->top->u.i;
150 cf2_stack_popFixed( CF2_Stack stack )
152 if ( stack->top == &stack->buffer[0] )
154 CF2_SET_ERROR( stack->error, Stack_Underflow );
158 --stack->top;
160 switch ( stack->top->type )
163 return cf2_intToFixed( stack->top->u.i );
165 return cf2_fracToFixed( stack->top->u.f );
167 return stack->top->u.r;
175 cf2_stack_getReal( CF2_Stack stack,
178 FT_ASSERT( cf2_stack_count( stack ) <= CF2_OPERAND_STACK_SIZE );
180 if ( idx >= cf2_stack_count( stack ) )
182 CF2_SET_ERROR( stack->error, Stack_Overflow );
186 switch ( stack->buffer[idx].type )
189 return cf2_intToFixed( stack->buffer[idx].u.i );
191 return cf2_fracToFixed( stack->buffer[idx].u.f );
193 return stack->buffer[idx].u.r;
199 cf2_stack_clear( CF2_Stack stack )
201 stack->top = &stack->buffer[0];