19 #define SHEEP_VERSION_MAJOR 0
20 #define SHEEP_VERSION_MINOR 4
21 #define SHEEP_VERSION_REVISION 0
23 #define SHEEP_VERBOSITY_SILENT 0
24 #define SHEEP_VERBOSITY_POLITE 1
25 #define SHEEP_VERBOSITY_ANNOYING 2
26 #define SHEEP_VERBOSITY_EXTREME 3
28 typedef unsigned char byte;
44 float InitialFloatValue;
45 int InitialStringIndexValue;
103 void* (SHP_CALLBACK *Allocator)(
size_t);
104 void (SHP_CALLBACK *Deallocator)(
void*);
109 SHP_DECLSPEC
void SHP_LIB_CALL SHP_SetAllocator(
SHP_Allocator* allocator);
112 typedef void (SHP_CALLBACK *SHP_MessageCallback)(
int linenumber,
const char* message);
113 SHP_DECLSPEC
void SHP_LIB_CALL SHP_SetOutputCallback(
SheepVM* vm, SHP_MessageCallback callback);
116 SHP_DECLSPEC
int SHP_LIB_CALL shp_Execute(
SheepVMContext* context);
117 SHP_DECLSPEC
int SHP_LIB_CALL shp_GetNumVariables(
SheepVMContext* context);
118 SHP_DECLSPEC
int SHP_LIB_CALL shp_GetVariableName(
SheepVMContext* context,
int index,
const char** name);
119 SHP_DECLSPEC
int SHP_LIB_CALL shp_GetVariableI(
SheepVMContext* context,
int index,
int* value);
120 SHP_DECLSPEC
int SHP_LIB_CALL shp_GetVariableF(
SheepVMContext* context,
int index,
float* value);
121 SHP_DECLSPEC
int SHP_LIB_CALL shp_SetVariableI(
SheepVMContext* context,
int index,
int value);
122 SHP_DECLSPEC
int SHP_LIB_CALL shp_SetVariableF(
SheepVMContext* context,
int index,
float value);
124 typedef void (SHP_CALLBACK *SHP_ImportCallback)(
SheepVM* vm);
125 SHP_DECLSPEC
void SHP_LIB_CALL SHP_SetImportCallback(
SheepVM* vm,
const char* name, SHP_ImportCallback callback);
127 SHP_DECLSPEC
int SHP_LIB_CALL SHP_PopIntFromStack(
SheepVMContext* vm,
int* result);
128 SHP_DECLSPEC
int SHP_LIB_CALL SHP_PopFloatFromStack(
SheepVMContext* vm,
float* result);
129 SHP_DECLSPEC
int SHP_LIB_CALL SHP_PopStringFromStack(
SheepVMContext* vm,
const char** result);
131 SHP_DECLSPEC
int SHP_LIB_CALL SHP_PushIntOntoStack(
SheepVMContext* vm,
int i);
137 SHP_DECLSPEC
int SHP_LIB_CALL SHP_GetNumContexts(
SheepVM* vm);
138 SHP_DECLSPEC
int SHP_LIB_CALL SHP_GetCurrentContextStackSize(
SheepVM* vm);
139 SHP_DECLSPEC
void SHP_LIB_CALL SHP_SetVerbosity(
SheepVM* vm,
int verbosity);
140 SHP_DECLSPEC
void SHP_LIB_CALL SHP_PrintMemoryUsage();
141 SHP_DECLSPEC
void SHP_LIB_CALL SHP_PrintStackTrace(
SheepVM* vm);
177 SHP_DECLSPEC
int SHP_LIB_CALL SHP_IsInWaitSection(
SheepVM* vm);
178 SHP_DECLSPEC
int SHP_LIB_CALL SHP_Suspend(
SheepVMContext* context);
180 SHP_DECLSPEC
void SHP_LIB_CALL SHP_SetEndWaitCallback(
SheepVM* vm, SHP_EndWaitCallback callback);
194 SHP_DECLSPEC
const char* SHP_GetDisassemblyText(
const SheepDisassembly* disassembly);
198 SHP_DECLSPEC
SheepCompiler* SHP_LIB_CALL shp_CreateNewCompiler(
int languageVersion);
199 SHP_DECLSPEC
void SHP_LIB_CALL shp_DestroyCompiler(
SheepCompiler* compiler);
200 SHP_DECLSPEC
int SHP_LIB_CALL shp_DefineImportFunction(
SheepCompiler* compiler,
const char* name, SHP_SymbolType returnType, SHP_SymbolType parameters[],
int numParameters);
202 SHP_DECLSPEC
int SHP_LIB_CALL shp_LoadScriptFromBytecode(
const char* bytecode,
int length,
SheepScript** result);
203 SHP_DECLSPEC
void SHP_LIB_CALL shp_ReleaseSheepScript(
SheepScript* script);
SHP_DECLSPEC SheepVM *SHP_LIB_CALL SHP_CreateNewVM(int languageVersion)
Creates a new virtual machine.
SHP_DECLSPEC void SHP_LIB_CALL SHP_SetVMTag(SheepVM *vm, void *tag)
SHP_DECLSPEC void *SHP_LIB_CALL SHP_GetVMTag(SheepVM *vm)
Gets the "tag" data.
Handle to a virtual machine object.
Definition: sheepc.h:79
Handle to a Sheep script object.
Definition: sheepc.h:87
Handle to a virtual machine context object.
Definition: sheepc.h:82
SHP_DECLSPEC void SHP_LIB_CALL SHP_DestroyVM(SheepVM *vm)
Destroys an existing virtual machine.