FunctionMap.h 826 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef FUNCTIONMAP_H
  2. #define FUNCTIONMAP_H
  3. #include <stdbool.h>
  4. typedef struct {
  5. const char* name;
  6. int arguments;
  7. int address;
  8. bool returns;
  9. } Function;
  10. typedef struct {
  11. const char* name;
  12. int arguments;
  13. int line;
  14. int reserved;
  15. bool noReturn;
  16. } LingeringFunction;
  17. typedef struct {
  18. int capacity;
  19. int entries;
  20. Function* data;
  21. int queueCapacity;
  22. int queueEntries;
  23. LingeringFunction* queue;
  24. } FunctionMap;
  25. void fmInit(FunctionMap* fm);
  26. void fmDelete(FunctionMap* fm);
  27. Function* fmSearch(FunctionMap* fm, const char* name, int arguments);
  28. bool fmAdd(FunctionMap* fm, const char* name, int arguments, int address,
  29. bool returns);
  30. void fmEnqueue(FunctionMap* fm, const char* name, int arguments, int line,
  31. int reserved, bool noReturn);
  32. #endif