Functions.h 645 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef FUNCTIONS_H
  2. #define FUNCTIONS_H
  3. #include <stdbool.h>
  4. #include "DataType.h"
  5. #define FUNCTION_ARGUMENTS 9
  6. typedef struct {
  7. const char* name;
  8. int arguments;
  9. DataType argumentTypes[FUNCTION_ARGUMENTS];
  10. DataType returnType;
  11. int address;
  12. int size;
  13. int line;
  14. } Function;
  15. typedef struct {
  16. int capacity;
  17. int entries;
  18. Function* data;
  19. } Functions;
  20. void fInit(Function* f, const char* name, int line);
  21. bool fAddArgument(Function* f, DataType type);
  22. void fsInit(Functions* fs);
  23. void fsDelete(Functions* fs);
  24. Function* fsSearch(Functions* fs, Function* f);
  25. void fsAdd(Functions* fs, Function* f);
  26. #endif