Removed asinh(), acosh(), atanh() as unnecessary.
Added exit(). git-svn-id: http://picoc.googlecode.com/svn/trunk@332 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
32727cc365
commit
93713ed830
24
clibrary.c
24
clibrary.c
|
@ -321,6 +321,11 @@ void LibGetc(struct ParseState *Parser, struct Value *ReturnValue, struct Value
|
||||||
ReturnValue->Val->Integer = PlatformGetCharacter();
|
ReturnValue->Val->Integer = PlatformGetCharacter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LibExit(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
||||||
|
{
|
||||||
|
PlatformExit();
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef PICOC_MATH_LIBRARY
|
#ifdef PICOC_MATH_LIBRARY
|
||||||
void LibSin(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
void LibSin(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
||||||
{
|
{
|
||||||
|
@ -367,21 +372,6 @@ void LibTanh(struct ParseState *Parser, struct Value *ReturnValue, struct Value
|
||||||
ReturnValue->Val->FP = math_tanh(Param[0]->Val->FP);
|
ReturnValue->Val->FP = math_tanh(Param[0]->Val->FP);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LibAsinh(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
|
||||||
{
|
|
||||||
ReturnValue->Val->FP = math_asinh(Param[0]->Val->FP);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LibAcosh(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
|
||||||
{
|
|
||||||
ReturnValue->Val->FP = math_acosh(Param[0]->Val->FP);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LibAtanh(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
|
||||||
{
|
|
||||||
ReturnValue->Val->FP = math_atanh(Param[0]->Val->FP);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LibExp(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
void LibExp(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
||||||
{
|
{
|
||||||
ReturnValue->Val->FP = math_exp(Param[0]->Val->FP);
|
ReturnValue->Val->FP = math_exp(Param[0]->Val->FP);
|
||||||
|
@ -435,6 +425,7 @@ struct LibraryFunction CLibrary[] =
|
||||||
{ LibSPrintf, "char *sprintf(char *, char *, ...)" },
|
{ LibSPrintf, "char *sprintf(char *, char *, ...)" },
|
||||||
{ LibGets, "void gets(char *, int)" },
|
{ LibGets, "void gets(char *, int)" },
|
||||||
{ LibGetc, "int getchar()" },
|
{ LibGetc, "int getchar()" },
|
||||||
|
{ LibExit, "void exit()" },
|
||||||
#ifdef PICOC_MATH_LIBRARY
|
#ifdef PICOC_MATH_LIBRARY
|
||||||
{ LibSin, "float sin(float)" },
|
{ LibSin, "float sin(float)" },
|
||||||
{ LibCos, "float cos(float)" },
|
{ LibCos, "float cos(float)" },
|
||||||
|
@ -445,9 +436,6 @@ struct LibraryFunction CLibrary[] =
|
||||||
{ LibSinh, "float sinh(float)" },
|
{ LibSinh, "float sinh(float)" },
|
||||||
{ LibCosh, "float cosh(float)" },
|
{ LibCosh, "float cosh(float)" },
|
||||||
{ LibTanh, "float tanh(float)" },
|
{ LibTanh, "float tanh(float)" },
|
||||||
{ LibAsinh, "float asinh(float)" },
|
|
||||||
{ LibAcosh, "float acosh(float)" },
|
|
||||||
{ LibAtanh, "float atanh(float)" },
|
|
||||||
{ LibExp, "float exp(float)" },
|
{ LibExp, "float exp(float)" },
|
||||||
{ LibFabs, "float fabs(float)" },
|
{ LibFabs, "float fabs(float)" },
|
||||||
{ LibLog, "float log(float)" },
|
{ LibLog, "float log(float)" },
|
||||||
|
|
|
@ -659,11 +659,6 @@ void Cnnlearnblob (struct ParseState *Parser, struct Value *ReturnValue, struct
|
||||||
nndisplay(ix);
|
nndisplay(ix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cexit (struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) {
|
|
||||||
ExitBuf[40] = 1;
|
|
||||||
longjmp(ExitBuf, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* list of all library functions and their prototypes */
|
/* list of all library functions and their prototypes */
|
||||||
struct LibraryFunction PlatformLibrary[] =
|
struct LibraryFunction PlatformLibrary[] =
|
||||||
{
|
{
|
||||||
|
@ -719,7 +714,6 @@ struct LibraryFunction PlatformLibrary[] =
|
||||||
{ Cnntest, "void nntest(int, int, int, int, int, int, int, int)" },
|
{ Cnntest, "void nntest(int, int, int, int, int, int, int, int)" },
|
||||||
{ Cnnmatchblob, "void nnmatchblob(int)" },
|
{ Cnnmatchblob, "void nnmatchblob(int)" },
|
||||||
{ Cnnlearnblob, "void nnlearnblob(int)" },
|
{ Cnnlearnblob, "void nnlearnblob(int)" },
|
||||||
{ Cexit, "void exit()" },
|
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,16 @@ void PlatformLibraryInit()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/* list of all library functions and their prototypes */
|
/* list of all library functions and their prototypes */
|
||||||
struct LibraryFunction PlatformLibrary[] =
|
struct LibraryFunction PlatformLibrary[] =
|
||||||
{
|
{
|
||||||
|
{ Ctest, "void test(int)" },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue