MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / LoadString

Function LoadString

libraries/AP_Scripting/lua/src/lundump.c:95–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94
95static TString *LoadString (LoadState *S) {
96 size_t size = LoadByte(S);
97 if (size == 0xFF)
98 LoadVar(S, size);
99 if (size == 0)
100 return NULL;
101 else if (--size <= LUAI_MAXSHORTLEN) { /* short string? */
102 char buff[LUAI_MAXSHORTLEN];
103 LoadVector(S, buff, size);
104 return luaS_newlstr(S->L, buff, size);
105 }
106 else { /* long string */
107 TString *ts = luaS_createlngstrobj(S->L, size);
108 LoadVector(S, getstr(ts), size); /* load directly in final place */
109 return ts;
110 }
111}
112
113
114static void LoadCode (LoadState *S, Proto *f) {

Callers 3

LoadConstantsFunction · 0.85
LoadDebugFunction · 0.85
LoadFunctionFunction · 0.85

Calls 3

LoadByteFunction · 0.85
luaS_newlstrFunction · 0.85
luaS_createlngstrobjFunction · 0.85

Tested by

no test coverage detected