2011-02-17 02:11:20 -05:00
|
|
|
#include "../interpreter.h"
|
2009-03-15 03:07:21 -04:00
|
|
|
|
2010-06-13 16:47:17 -04:00
|
|
|
void UnixSetupFunc()
|
2015-06-07 00:51:02 -04:00
|
|
|
{
|
2009-04-08 08:00:45 -04:00
|
|
|
}
|
|
|
|
|
2015-06-07 00:51:02 -04:00
|
|
|
void Ctest (struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
2009-06-15 10:33:21 -04:00
|
|
|
{
|
|
|
|
printf("test(%d)\n", Param[0]->Val->Integer);
|
|
|
|
Param[0]->Val->Integer = 1234;
|
|
|
|
}
|
|
|
|
|
2015-06-07 00:51:02 -04:00
|
|
|
void Clineno (struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
2010-06-05 15:00:46 -04:00
|
|
|
{
|
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
|
|
|
{
|
2015-06-07 00:51:02 -04:00
|
|
|
{Ctest, "void test(int);"},
|
|
|
|
{Clineno, "int lineno();"},
|
|
|
|
{NULL, NULL}
|
2009-03-15 03:07:21 -04:00
|
|
|
};
|
|
|
|
|
2012-09-22 01:11:44 -04:00
|
|
|
void PlatformLibraryInit(Picoc *pc)
|
2010-06-13 16:47:17 -04:00
|
|
|
{
|
2012-09-22 01:11:44 -04:00
|
|
|
IncludeRegister(pc, "picoc_unix.h", &UnixSetupFunc, &UnixFunctions[0], NULL);
|
2010-06-13 16:47:17 -04:00
|
|
|
}
|