about summary refs log blame commit diff stats
path: root/state.h
blob: 56e0f6d993e2ce244d2604fc0dc017b7600b9bac (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                         





                       




                    
            
                      
                                                


        
#ifndef STATE_H
#define STATE_H

#include <stdio.h>

#define STACK_SIZE 100

typedef struct {
  double val[STACK_SIZE];
  int count;
} stack;

typedef struct {
  char *name;
  stack (*exec)(stack);
  char *description;
} command;

typedef struct {
  int command_count;
  FILE *defbuf;
  FILE *defout;
  char last_op;
  char *prompt;
  stack stk;
  /* btree elements */
  command *sorted; /* sorted by function name */
} state;

#endif