2010-06-13 05:17:42 -04:00
|
|
|
#include "../picoc.h"
|
2009-03-15 03:07:21 -04:00
|
|
|
|
2010-06-13 16:47:17 -04:00
|
|
|
void UnixSetupFunc()
|
|
|
|
{
|
2009-04-08 08:00:45 -04:00
|
|
|
}
|
|
|
|
|
2009-06-15 10:33:21 -04:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2010-06-05 15:00:46 -04:00
|
|
|
void Clineno (struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
|
|
|
{
|
2010-02-03 15:01:01 -05:00
|
|
|
ReturnValue->Val->Integer = Parser->Line;
|
|
|
|
}
|
|
|
|
|
2009-03-15 03:07:21 -04:00
|
|
|
/* list of all library functions and their prototypes */
|
2010-06-13 16:47:17 -04:00
|
|
|
struct LibraryFunction UnixFunctions[] =
|
2009-03-15 03:07:21 -04:00
|
|
|
{
|
2010-03-01 15:39:08 -05:00
|
|
|
{ Ctest, "void test(int);" },
|
|
|
|
{ Clineno, "int lineno();" },
|
2009-03-15 03:07:21 -04:00
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2010-06-13 16:47:17 -04:00
|
|
|
void PlatformLibraryInit()
|
|
|
|
{
|
|
|
|
IncludeRegister("picoc_unix.h", &UnixSetupFunc, &UnixFunctions, NULL);
|
|
|
|
}
|