diff --git a/src/PikaObj.c b/src/PikaObj.c index c988bcb53..b3597bfdd 100644 --- a/src/PikaObj.c +++ b/src/PikaObj.c @@ -505,3 +505,30 @@ void obj_sysPrintf(PikaObj* self, char* fmt, ...) { obj_setSysOut(self, sysOut); va_end(args); } + +void method_returnStr(Args* args, char* val) { + args_setStr(args, "return", val); +} +void method_returnInt(Args* args, int32_t val) { + args_setInt(args, "return", val); +} +void method_returnFloat(Args* args, float val) { + args_setFloat(args, "return", val); +} +void method_returnPtr(Args* args, void* val) { + args_setPtr(args, "return", val); +} +void method_returnArg(Args* args, Arg* arg) { + arg = arg_setName(arg, "return"); + args_setArg(args, arg); +} + +int32_t method_getInt(Args* args, char* argName) { + return args_getInt(args, argName); +} +float method_getFloat(Args* args, char* argName) { + return args_getFloat(args, argName); +} +char* method_getStr(Args* args, char* argName) { + return args_getStr(args, argName); +} \ No newline at end of file diff --git a/src/PikaObj.h b/src/PikaObj.h index dd3c60154..324e77e5d 100644 --- a/src/PikaObj.h +++ b/src/PikaObj.h @@ -8,7 +8,6 @@ #include "dataArgs.h" #include "dataLink.h" #include "dataMemory.h" -#include "method.h" typedef struct PikaObj_t PikaObj; typedef PikaObj* (*NewFun)(Args* args); typedef PikaObj* (*InitFun)(PikaObj* self, Args* args); @@ -96,4 +95,13 @@ uint8_t obj_getAnyArg(PikaObj* self, char* sourceArgPath, Args* targetArgs); +void method_returnStr(Args* args, char* val); +void method_returnInt(Args* args, int32_t val); +void method_returnFloat(Args* args, float val); +void method_returnPtr(Args* args, void* val); +int32_t method_getInt(Args* args, char* argName); +float method_getFloat(Args* args, char* argName); +char* method_getStr(Args* args, char* argName); +void method_returnArg(Args* args, Arg* arg); + #endif diff --git a/src/pikaPlatform.c b/src/PikaPlatform.c similarity index 95% rename from src/pikaPlatform.c rename to src/PikaPlatform.c index d700851a8..d24643ec6 100644 --- a/src/pikaPlatform.c +++ b/src/PikaPlatform.c @@ -1,4 +1,4 @@ -#include "pikaPlatform.h" +#include "PikaPlatform.h" #include #include #include diff --git a/src/pikaPlatform.h b/src/PikaPlatform.h similarity index 100% rename from src/pikaPlatform.h rename to src/PikaPlatform.h diff --git a/src/dataMemory.h b/src/dataMemory.h index cf1b34f54..4a8fdce33 100644 --- a/src/dataMemory.h +++ b/src/dataMemory.h @@ -9,7 +9,7 @@ #include #include #include -#include "pikaPlatform.h" +#include "PikaPlatform.h" typedef struct { uint32_t heapUsed; diff --git a/src/method.c b/src/method.c deleted file mode 100644 index 0c16c1945..000000000 --- a/src/method.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - Author: lyon - Tencent QQ: 645275593 -*/ - -#include "PikaObj.h" -#include "dataArgs.h" - -void method_returnStr(Args* args, char* val) { - args_setStr(args, "return", val); -} -void method_returnInt(Args* args, int32_t val) { - args_setInt(args, "return", val); -} -void method_returnFloat(Args* args, float val) { - args_setFloat(args, "return", val); -} -void method_returnPtr(Args* args, void* val) { - args_setPtr(args, "return", val); -} -void method_returnArg(Args* args, Arg* arg) { - arg = arg_setName(arg, "return"); - args_setArg(args, arg); -} - -int32_t method_getInt(Args* args, char* argName) { - return args_getInt(args, argName); -} -float method_getFloat(Args* args, char* argName) { - return args_getFloat(args, argName); -} -char* method_getStr(Args* args, char* argName) { - return args_getStr(args, argName); -} diff --git a/src/method.h b/src/method.h deleted file mode 100644 index a30f952d7..000000000 --- a/src/method.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - Author: lyon - Tencent QQ: 645275593 -*/ - -#ifndef METHOD__H -#define METHOD__H -#include "dataArgs.h" -void method_returnStr(Args* args, char* val); -void method_returnInt(Args* args, int32_t val); -void method_returnFloat(Args* args, float val); -void method_returnPtr(Args* args, void* val); -int32_t method_getInt(Args* args, char* argName); -float method_getFloat(Args* args, char* argName); -char* method_getStr(Args* args, char* argName); -void method_returnArg(Args* args, Arg* arg); -#endif