Skip to content

Commit

Permalink
MSVC library implementation submitted by kevingarceau.
Browse files Browse the repository at this point in the history
Issue #175
  • Loading branch information
zik.saleeba committed Feb 23, 2013
1 parent 2e473ae commit 18360f0
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion platform/library_msvc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
#include "../interpreter.h"

void PlatformLibraryInit()
void MsvcSetupFunc()
{
}

void CTest (struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
{
printf("test(%d)\n", Param[0]->Val->Integer);
Param[0]->Val->Integer = 1234;
}

void CLineNo (struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
{
ReturnValue->Val->Integer = Parser->Line;
}

/* list of all library functions and their prototypes */
struct LibraryFunction MsvcFunctions[] =
{
{ CTest, "void Test(int);" },
{ CLineNo, "int LineNo();" },
{ NULL, NULL }
};

void PlatformLibraryInit(Picoc *pc)
{
IncludeRegister(pc, "picoc_msvc.h", &MsvcSetupFunc, &MsvcFunctions[0], NULL);
}

0 comments on commit 18360f0

Please sign in to comment.