Added JS engine.
This commit is contained in:
24
include/dawn/script/scripter.h
Normal file
24
include/dawn/script/scripter.h
Normal 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);
|
Reference in New Issue
Block a user