|
@@ -1,7 +1,7 @@
|
|
|
#include <stdlib.h>
|
|
|
#include <string.h>
|
|
|
|
|
|
-#include "FunctionMap.h"
|
|
|
+#include "utils/FunctionMap.h"
|
|
|
|
|
|
void fmInit(FunctionMap* fm) {
|
|
|
fm->capacity = 16;
|
|
@@ -19,14 +19,16 @@ void fmDelete(FunctionMap* fm) {
|
|
|
|
|
|
Function* fmSearch(FunctionMap* fm, const char* name, int arguments) {
|
|
|
for(int i = 0; i < fm->entries; i++) {
|
|
|
- if(fm->data[i].arguments == arguments && strcmp(fm->data[i].name, name) == 0) {
|
|
|
+ if(fm->data[i].arguments == arguments &&
|
|
|
+ strcmp(fm->data[i].name, name) == 0) {
|
|
|
return fm->data + i;
|
|
|
}
|
|
|
}
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
-bool fmAdd(FunctionMap* fm, const char* name, int arguments, int address, bool returns) {
|
|
|
+bool fmAdd(FunctionMap* fm, const char* name, int arguments, int address,
|
|
|
+ bool returns) {
|
|
|
if(fmSearch(fm, name, arguments) != NULL) {
|
|
|
return false;
|
|
|
}
|
|
@@ -42,10 +44,12 @@ bool fmAdd(FunctionMap* fm, const char* name, int arguments, int address, bool r
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-void fmEnqueue(FunctionMap* fm, const char* name, int arguments, int line, int reserved, bool noReturn) {
|
|
|
+void fmEnqueue(FunctionMap* fm, const char* name, int arguments, int line,
|
|
|
+ int reserved, bool noReturn) {
|
|
|
if(fm->queueEntries >= fm->queueCapacity) {
|
|
|
fm->queueCapacity *= 2;
|
|
|
- fm->queue = realloc(fm->queue, sizeof(LingeringFunction) * fm->queueCapacity);
|
|
|
+ fm->queue =
|
|
|
+ realloc(fm->queue, sizeof(LingeringFunction) * fm->queueCapacity);
|
|
|
}
|
|
|
int index = fm->queueEntries++;
|
|
|
fm->queue[index].name = name;
|