parent
233a13aee7
commit
4d5489cdea
|
@ -7,11 +7,35 @@
|
|||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct ExternalVariable {
|
||||
char name[32];
|
||||
char* programName;
|
||||
opcode_t type;
|
||||
union {
|
||||
int value;
|
||||
char* stringValue;
|
||||
};
|
||||
} ExternalVariable;
|
||||
|
||||
typedef struct ExternalProcedure {
|
||||
char name[32];
|
||||
Program* program;
|
||||
int argumentCount;
|
||||
int address;
|
||||
} ExternalProcedure;
|
||||
|
||||
static unsigned int _hashName(const char* identifier);
|
||||
static ExternalProcedure* externalProcedureFind(const char* identifier);
|
||||
static ExternalProcedure* externalProcedureAdd(const char* identifier);
|
||||
static ExternalVariable* externalVariableFind(const char* identifier);
|
||||
static ExternalVariable* externalVariableAdd(const char* identifier);
|
||||
static void _removeProgramReferences(Program* program);
|
||||
|
||||
// 0x570C00
|
||||
ExternalProcedure gExternalProcedures[1013];
|
||||
static ExternalProcedure gExternalProcedures[1013];
|
||||
|
||||
// 0x57BA1C
|
||||
ExternalVariable gExternalVariables[1013];
|
||||
static ExternalVariable gExternalVariables[1013];
|
||||
|
||||
// NOTE: Inlined.
|
||||
//
|
||||
|
|
25
src/export.h
25
src/export.h
|
@ -3,34 +3,9 @@
|
|||
|
||||
#include "interpreter.h"
|
||||
|
||||
typedef struct ExternalVariable {
|
||||
char name[32];
|
||||
char* programName;
|
||||
opcode_t type;
|
||||
union {
|
||||
int value;
|
||||
char* stringValue;
|
||||
};
|
||||
} ExternalVariable;
|
||||
|
||||
typedef struct ExternalProcedure {
|
||||
char name[32];
|
||||
Program* program;
|
||||
int argumentCount;
|
||||
int address;
|
||||
} ExternalProcedure;
|
||||
|
||||
extern ExternalProcedure gExternalProcedures[1013];
|
||||
extern ExternalVariable gExternalVariables[1013];
|
||||
|
||||
ExternalProcedure* externalProcedureFind(const char* identifier);
|
||||
ExternalProcedure* externalProcedureAdd(const char* identifier);
|
||||
ExternalVariable* externalVariableFind(const char* identifier);
|
||||
ExternalVariable* externalVariableAdd(const char* identifier);
|
||||
int externalVariableSetValue(Program* program, const char* identifier, opcode_t opcode, int data);
|
||||
int externalVariableGetValue(Program* program, const char* name, opcode_t* opcodePtr, int* dataPtr);
|
||||
int externalVariableCreate(Program* program, const char* identifier);
|
||||
void _removeProgramReferences(Program* program);
|
||||
void _initExport();
|
||||
void externalVariablesClear();
|
||||
Program* externalProcedureGetProgram(const char* identifier, int* addressPtr, int* argumentCountPtr);
|
||||
|
|
Loading…
Reference in New Issue