Added JS engine.

This commit is contained in:
2021-09-18 00:39:00 -07:00
parent 9dd9ce7cbd
commit ef9137fabb
52 changed files with 547 additions and 35712 deletions

View File

@ -0,0 +1,24 @@
// Copyright (c) 2021 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "../libs.h"
/** Implies that the arguments the function will take is variable */
#define SCRIPTER_VARIABLE_ARGUMENT_COUNT DUK_VARARGS
/** Global context defintion of the pointer referring back to the scripter */
#define SCRIPTER_SELF_NAME "__scripter"
/** Type forwarders */
typedef duk_context scriptercontext_t;
typedef duk_ret_t scripterreturn_t;
typedef struct {
duk_context *context;
engine_t *engine;
void *user;
} scripter_t;
typedef scripterreturn_t scriptermethod_t(scriptercontext_t *context);