Scripting: Tidy up public headers

This commit is contained in:
Vicki Pfau 2023-03-30 05:36:21 -07:00
parent e80b533549
commit 64408b8fd1
12 changed files with 47 additions and 22 deletions

16
include/mgba/script.h Normal file
View File

@ -0,0 +1,16 @@
/* Copyright (c) 2013-2023 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef M_SCRIPT_H
#define M_SCRIPT_H
#include <mgba/script/base.h>
#include <mgba/script/context.h>
#include <mgba/script/input.h>
#include <mgba/script/macros.h>
#include <mgba/script/storage.h>
#include <mgba/script/types.h>
#endif

View File

@ -0,0 +1,21 @@
/* Copyright (c) 2013-2023 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef M_SCRIPT_BASE_H
#define M_SCRIPT_BASE_H
#include <mgba-util/common.h>
CXX_GUARD_START
#include <mgba/script/macros.h>
struct mScriptContext;
void mScriptContextAttachStdlib(struct mScriptContext* context);
void mScriptContextAttachSocket(struct mScriptContext* context);
CXX_GUARD_END
#endif

View File

@ -91,8 +91,6 @@ struct mScriptValue* mScriptContextAccessWeakref(struct mScriptContext*, struct
void mScriptContextClearWeakref(struct mScriptContext*, uint32_t weakref); void mScriptContextClearWeakref(struct mScriptContext*, uint32_t weakref);
void mScriptContextDisownWeakref(struct mScriptContext*, uint32_t weakref); void mScriptContextDisownWeakref(struct mScriptContext*, uint32_t weakref);
void mScriptContextAttachStdlib(struct mScriptContext* context);
void mScriptContextAttachSocket(struct mScriptContext* context);
void mScriptContextExportConstants(struct mScriptContext* context, const char* nspace, struct mScriptKVPair* constants); void mScriptContextExportConstants(struct mScriptContext* context, const char* nspace, struct mScriptKVPair* constants);
void mScriptContextExportNamespace(struct mScriptContext* context, const char* nspace, struct mScriptKVPair* value); void mScriptContextExportNamespace(struct mScriptContext* context, const char* nspace, struct mScriptKVPair* value);

View File

@ -19,8 +19,7 @@
#include "scripting/ScriptingTextBuffer.h" #include "scripting/ScriptingTextBuffer.h"
#include "scripting/ScriptingTextBufferModel.h" #include "scripting/ScriptingTextBufferModel.h"
#include <mgba/script/input.h> #include <mgba/script.h>
#include <mgba/script/storage.h>
#include <mgba-util/math.h> #include <mgba-util/math.h>
#include <mgba-util/string.h> #include <mgba-util/string.h>

View File

@ -7,6 +7,7 @@
#include <mgba/core/scripting.h> #include <mgba/core/scripting.h>
#include <mgba/core/version.h> #include <mgba/core/version.h>
#include <mgba/internal/script/types.h> #include <mgba/internal/script/types.h>
#include <mgba/script/base.h>
#include <mgba/script/context.h> #include <mgba/script/context.h>
#include <mgba/script/input.h> #include <mgba/script/input.h>
#include <mgba/script/storage.h> #include <mgba/script/storage.h>

View File

@ -3,10 +3,11 @@
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <mgba/script/context.h> #include <mgba/script/base.h>
#include <mgba/core/core.h> #include <mgba/core/core.h>
#include <mgba/core/serialize.h> #include <mgba/core/serialize.h>
#include <mgba/script/context.h>
#include <mgba/script/macros.h> #include <mgba/script/macros.h>
#ifdef M_CORE_GBA #ifdef M_CORE_GBA
#include <mgba/internal/gba/input.h> #include <mgba/internal/gba/input.h>

View File

@ -5,9 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "util/test/suite.h" #include "util/test/suite.h"
#include <mgba/script/context.h> #include <mgba/script.h>
#include <mgba/script/macros.h>
#include <mgba/script/types.h>
struct TestA { struct TestA {
int32_t i; int32_t i;

View File

@ -5,9 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "util/test/suite.h" #include "util/test/suite.h"
#include <mgba/script/context.h> #include <mgba/script.h>
#include <mgba/script/macros.h>
#include <mgba/script/types.h>
M_TEST_DEFINE(weakrefBasic) { M_TEST_DEFINE(weakrefBasic) {
struct mScriptContext context; struct mScriptContext context;

View File

@ -6,9 +6,7 @@
#include "util/test/suite.h" #include "util/test/suite.h"
#include <mgba/internal/script/lua.h> #include <mgba/internal/script/lua.h>
#include <mgba/script/context.h> #include <mgba/script.h>
#include <mgba/script/input.h>
#include <mgba/script/types.h>
#include "script/test.h" #include "script/test.h"

View File

@ -6,9 +6,7 @@
#include "util/test/suite.h" #include "util/test/suite.h"
#include <mgba/internal/script/lua.h> #include <mgba/internal/script/lua.h>
#include <mgba/script/context.h> #include <mgba/script.h>
#include <mgba/script/macros.h>
#include <mgba/script/types.h>
#include "script/test.h" #include "script/test.h"

View File

@ -6,8 +6,7 @@
#include "util/test/suite.h" #include "util/test/suite.h"
#include <mgba/internal/script/lua.h> #include <mgba/internal/script/lua.h>
#include <mgba/script/storage.h> #include <mgba/script.h>
#include <mgba/script/types.h>
#include "script/test.h" #include "script/test.h"

View File

@ -5,9 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "util/test/suite.h" #include "util/test/suite.h"
#include <mgba/script/context.h> #include <mgba/script.h>
#include <mgba/script/macros.h>
#include <mgba/script/types.h>
struct Test { struct Test {
int32_t a; int32_t a;