AerScript on the read

This commit is contained in:
Rafal Kupiec 2018-08-01 17:04:42 +02:00
parent b0cbf5c0f6
commit 7afe2c7c41
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 6 additions and 6 deletions

View File

@ -1,11 +1,11 @@
#include "dummy.h"
static void PSHARP_DUMMY_CONSTANT_Const(ph7_value *pVal, void *pUserData) {
static void AER_DUMMY_CONSTANT_Const(ph7_value *pVal, void *pUserData) {
SXUNUSED(pUserData); /* cc warning */
ph7_value_bool(pVal, 1);
}
int psharp_dummy_function(ph7_context *pCtx, int nArg, ph7_value **apArg) {
int aer_dummy_function(ph7_context *pCtx, int nArg, ph7_value **apArg) {
SyString dummy;
const char *text = "Hello world from dummy module!";
SyStringInitFromBuf(&dummy, text, SyStrlen(text));

View File

@ -11,17 +11,17 @@
PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc);
/* Constants provided by DUMMY module */
static void PSHARP_DUMMY_CONSTANT_Const(ph7_value *pVal, void *pUserData);
static void AER_DUMMY_CONSTANT_Const(ph7_value *pVal, void *pUserData);
/* Functions provided by DUMMY module */
int psharp_dummy_function(ph7_context *pCtx, int nArg, ph7_value **apArg);
int aer_dummy_function(ph7_context *pCtx, int nArg, ph7_value **apArg);
static const ph7_builtin_constant dummyConstList[] = {
{"DUMMY_CONSTANT", PSHARP_DUMMY_CONSTANT_Const},
{"DUMMY_CONSTANT", AER_DUMMY_CONSTANT_Const},
};
static const ph7_builtin_func dummyFuncList[] = {
{"dummy_function", psharp_dummy_function },
{"dummy_function", aer_dummy_function },
};
#endif