var.h 1013 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef VIRTUALMATH_VAR_H
  2. #define VIRTUALMATH_VAR_H
  3. #include "inter.h"
  4. #define MAX_SIZE (1024)
  5. typedef struct VirtualMathVar{
  6. char *name;
  7. struct VirtualMathLinkValue *value;
  8. struct VirtualMathVar *next;
  9. } Var;
  10. typedef struct VirtualMathHashTable{
  11. struct VirtualMathVar **hashtable;
  12. int count;
  13. struct VirtualMathHashTable *next;
  14. struct VirtualMathHashTable *last;
  15. } HashTable;
  16. typedef struct VirtualMathVarList{
  17. struct VirtualMathHashTable *hashtable;
  18. struct VirtualMathVarList *next;
  19. } VarList;
  20. VarList *makeVarList(Inter *inter);
  21. VarList *freeVarList(VarList *vl, bool self);
  22. LinkValue *findFromVarList(char *name, VarList *var_list, NUMBER_TYPE times);
  23. void addFromVarList(char *name, VarList *var_list, NUMBER_TYPE times, LinkValue *value);
  24. void freeHashTable(HashTable *ht, Inter *inter);
  25. VarList *pushVarList(VarList *base, Inter *inter);
  26. VarList *popVarList(VarList *base);
  27. VarList *copyVarList(VarList *base, bool n_new, Inter *inter);
  28. #endif //VIRTUALMATH_VAR_H