#include <stdlib.h>
#include "cpp_io.h"
#include "cpp_conv.h"
#include "cpp_calc.h"
Functions | |
_calc * | Calc_Create () |
create and initialise a struct _calc | |
void | Calc_Destroy (struct _calc *s) |
destroy a variable of struct _calc | |
void | Calc_Dump (struct _calc *s, int fd) |
dump the stack to stderr | |
void | Calc_Push (struct _calc *s, int n) |
push a value onto the stack | |
int | Calc_Pop (struct _calc *s) |
pop a value from the top of the stack | |
void | Calc_Dup (struct _calc *s) |
duplicate the value from the top of the stack | |
int | Calc_Stack_Length (struct _calc *s) |
return the current length of the calculator stack | |
void | Calc_Add (struct _calc *s) |
add the two top values on the stack and push the result onto the stack | |
void | Calc_Subtract (struct _calc *s) |
subtract the two top values on the stack and push the result onto the stack | |
void | Calc_Multiply (struct _calc *s) |
multiply the two top values on the stack and push the result onto the stack | |
void | Calc_Divide (struct _calc *s) |
divide the two top values on the stack and push the result onto the stack | |
void | Calc_Rem (struct _calc *s) |
divide the two top values on the stack and push the reminder onto the stack | |
void | Calc_And (struct _calc *s) |
do a logical and of the two top values on the stack and push the result onto the stack | |
void | Calc_Or (struct _calc *s) |
do a logical or of the two top values on the stack and push the result onto the stack | |
void | Calc_Not (struct _calc *s) |
logically negate the top value on the stack and push the result onto the stack | |
void | Calc_Shift_Left (struct _calc *s) |
shift the top but one value on the stack left by the top value of the stack and push the result onto the stack | |
void | Calc_Shift_Right (struct _calc *s) |
add the two top values on the stack and push the result onto the stack | |
void | Calc_Cmp_EQ (struct _calc *s) |
compare the two top values on the stack and push the result onto the stack | |
void | Calc_Cmp_NEQ (struct _calc *s) |
compare the two top values on the stack and push the result onto the stack | |
void | Calc_Cmp_GE (struct _calc *s) |
compare the two top values on the stack and push the result onto the stack | |
void | Calc_Cmp_GT (struct _calc *s) |
compare the two top values on the stack and push the result onto the stack | |
void | Calc_Cmp_LE (struct _calc *s) |
compare the two top values on the stack and push the result onto the stack | |
void | Calc_Cmp_LT (struct _calc *s) |
compare the two top values on the stack and push the result onto the stack |
|
create and initialise a struct _calc
|
|
destroy a variable of struct _calc
|
|
dump the stack to stderr
|
|
pop a value from the top of the stack
|