aboutsummaryrefslogtreecommitdiff
path: root/src/tools.h
blob: 95324ee80d5fc233717201212535c5a0738fa140 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once

#include "threading.h"
#include "deep.h"

#include "macros_and_utils.h"

// forwards
struct Universe;

// ################################################################################################

#ifdef _DEBUG
void luaG_dump( lua_State* L);
#endif // _DEBUG

// ################################################################################################

void push_registry_subtable_mode( lua_State* L, UniqueKey key_, const char* mode_);
void push_registry_subtable( lua_State* L, UniqueKey key_);

enum e_vt
{
    VT_NORMAL,
    VT_KEY,
    VT_METATABLE
};
bool inter_copy_one(Universe* U, lua_State* L2, int L2_cache_i, lua_State* L, int i, enum e_vt vt, LookupMode mode_, char const* upName_);

// ################################################################################################

int luaG_inter_copy_package( Universe* U, lua_State* L, lua_State* L2, int package_idx_, LookupMode mode_);

int luaG_inter_copy(Universe* U, lua_State* L, lua_State* L2, int n, LookupMode mode_);
int luaG_inter_move(Universe* U, lua_State* L, lua_State* L2, int n, LookupMode mode_);

int luaG_nameof( lua_State* L);

void populate_func_lookup_table( lua_State* L, int _i, char const* _name);
void initialize_allocator_function( Universe* U, lua_State* L);
void cleanup_allocator_function( Universe* U, lua_State* L);

// ################################################################################################

// crc64/we of string "CONFIG_REGKEY" generated at http://www.nitrxgen.net/hashgen/
static constexpr UniqueKey CONFIG_REGKEY{ 0x31cd24894eae8624ull }; // registry key to access the configuration

// crc64/we of string "LOOKUP_REGKEY" generated at http://www.nitrxgen.net/hashgen/
static constexpr UniqueKey LOOKUP_REGKEY{ 0x5051ed67ee7b51a1ull }; // registry key to access the lookup database