2011-10-05 06:57:24 -04:00
|
|
|
#include "../interpreter.h"
|
|
|
|
|
2013-02-23 18:16:34 -05:00
|
|
|
void MsvcSetupFunc(Picoc *pc)
|
2015-06-07 00:51:02 -04:00
|
|
|
{
|
2013-02-23 18:12:47 -05:00
|
|
|
}
|
|
|
|
|
2015-06-10 19:49:09 -04:00
|
|
|
void CTest (struct ParseState *Parser, struct Value *ReturnValue,
|
|
|
|
struct Value **Param, int NumArgs)
|
2013-02-23 18:12:47 -05:00
|
|
|
{
|
|
|
|
printf("test(%d)\n", Param[0]->Val->Integer);
|
|
|
|
Param[0]->Val->Integer = 1234;
|
|
|
|
}
|
|
|
|
|
2015-06-10 19:49:09 -04:00
|
|
|
void CLineNo (struct ParseState *Parser, struct Value *ReturnValue,
|
|
|
|
struct Value **Param, int NumArgs)
|
2011-10-05 06:57:24 -04:00
|
|
|
{
|
2013-02-23 18:12:47 -05:00
|
|
|
ReturnValue->Val->Integer = Parser->Line;
|
2011-10-05 06:57:24 -04:00
|
|
|
}
|
2013-02-23 18:12:47 -05:00
|
|
|
|
|
|
|
/* list of all library functions and their prototypes */
|
|
|
|
struct LibraryFunction MsvcFunctions[] =
|
|
|
|
{
|
2015-06-07 00:51:02 -04:00
|
|
|
{CTest, "void Test(int);"},
|
|
|
|
{CLineNo, "int LineNo();"},
|
|
|
|
{NULL, NULL}
|
2013-02-23 18:12:47 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
void PlatformLibraryInit(Picoc *pc)
|
|
|
|
{
|
|
|
|
IncludeRegister(pc, "picoc_msvc.h", &MsvcSetupFunc, &MsvcFunctions[0], NULL);
|
|
|
|
}
|
|
|
|
|