FunctionMap.h 774 B

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