MCPcopy Create free account
hub / github.com/defold/defold / Callback_AddMount

Function Callback_AddMount

engine/liveupdate/src/script_liveupdate.cpp:104–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102 // *********************
103
104 static void Callback_AddMount(dmhash_t name_hash, const char* uri, int result, void* _cbk)
105 {
106 dmScript::LuaCallbackInfo* cbk = (dmScript::LuaCallbackInfo*)_cbk;
107
108 if (!dmScript::IsCallbackValid(cbk))
109 return;
110
111 lua_State* L = dmScript::GetCallbackLuaContext(cbk);
112 DM_LUA_STACK_CHECK(L, 0)
113
114 if (!dmScript::SetupCallback(cbk))
115 {
116 dmLogError("Failed to setup callback");
117 return;
118 }
119
120 dmScript::PushHash(L, name_hash);
121 lua_pushstring(L, uri);
122 lua_pushinteger(L, result);
123
124 dmScript::PCall(L, 4, 0); // instance + 3
125
126 dmScript::TeardownCallback(cbk);
127 dmScript::DestroyCallback(cbk);
128 }
129
130 static int Resource_AddMount(lua_State* L)
131 {

Callers

nothing calls this directly

Calls 9

IsCallbackValidFunction · 0.85
GetCallbackLuaContextFunction · 0.85
SetupCallbackFunction · 0.85
PushHashFunction · 0.85
lua_pushstringFunction · 0.85
lua_pushintegerFunction · 0.85
PCallFunction · 0.85
TeardownCallbackFunction · 0.85
DestroyCallbackFunction · 0.85

Tested by

no test coverage detected