// calculator.h - declarations for calculator.c

#ifndef __calculator_h__
#define __calculator_h__

#define DEBUG_CALC 0x4000

#define TRUE  1
#define FALSE 0

#define NOT_ENOUGH_OPERANDS 0x4001

//------------------------------------------------------------
// some standard functions

void registerAllHandlers();

void standardErrorHandler(int error_type,void *special);

void defaultDestructor(void *element,
                       void (*error_handler)(int error_type,
                                             void *special));

void showStack(Stack *stack);

//------------------------------------------------------------
// all handlers for the calculator

void addOperation(unsigned char* command,
                  unsigned char **params,
                  unsigned num_params);

void subtractOperation(unsigned char* command,
                       unsigned char **params,
                       unsigned num_params);

void multiplyOperation(unsigned char* command,
                       unsigned char **params,
                       unsigned num_params);

void divideOperation(unsigned char* command,
                     unsigned char **params,
                     unsigned num_params);

void popOperation(unsigned char* command,
                  unsigned char **params,
                  unsigned num_params);

void dupOperation(unsigned char* command,
                  unsigned char **params,
                  unsigned num_params);

void swapOperation(unsigned char* command,
                   unsigned char **params,
                   unsigned num_params);

void clearOperation(unsigned char* command,
                    unsigned char **params,
                    unsigned num_params);

void quitOperation(unsigned char* command,
                   unsigned char **params,
                   unsigned num_params);

void operand(unsigned char* command,unsigned char **params,
             unsigned num_params);

#endif // __calculator_h__

