picoc/platform/library_unix.c
zik.saleeba b23d1e8e06 Big reorganisation to make it easier to access picoc as a library.
Also moved most internal header stuff to the new header interpreter.h.


git-svn-id: http://picoc.googlecode.com/svn/trunk@549 21eae674-98b7-11dd-bd71-f92a316d2d60
2011-02-17 07:11:20 +00:00

30 lines
726 B
C

#include "../interpreter.h"
void UnixSetupFunc()
{
}
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 UnixFunctions[] =
{
{ Ctest, "void test(int);" },
{ Clineno, "int lineno();" },
{ NULL, NULL }
};
void PlatformLibraryInit()
{
IncludeRegister("picoc_unix.h", &UnixSetupFunc, &UnixFunctions[0], NULL);
}