/*****************************************************************************/ /* */ /* Copyright (C) 2000-2023 M. Held */ /* */ /* This code is not in the public domain. All rights reserved! Please make */ /* sure to read the full copyright statement contained in "README.txt" or in */ /* the "main" file of this code, such as "main.cc". */ /* */ /*****************************************************************************/ /* */ /* Written by: Martin Held */ /* */ /* E-Mail: held@cs.sbg.ac.at */ /* Fax Mail: (+43 662) 8044-172 */ /* Voice Mail: (+43 662) 8044-6304 */ /* Snail Mail: Martin Held */ /* FB Informatik */ /* Universitaet Salzburg */ /* A-5020 Salzburg, Austria */ /* */ /*****************************************************************************/ #ifndef VRONI_STACK_H #define VRONI_STACK_H #define Push(data) \ {\ ++num_stack; \ if (num_stack >= max_num_stack) { \ max_num_stack += STACK_INCR; \ stack = (STACK_TYPE*) ReallocateArray(stack, max_num_stack, sizeof(STACK_TYPE), STACK_STRING); \ } \ stack[num_stack] = data; \ } #define Pop(data) \ {\ assert(num_stack > 0); \ data = stack[num_stack]; \ --num_stack; \ } #define GetStackSize (num_stack) #define StackIsNotEmpty (num_stack > 0) #define StackIsEmpty (num_stack <= 0) #define ResetStack { num_stack = 0; } #endif