MCPcopy Create free account
hub / github.com/DFHack/dfhack / DumpString

Function DumpString

depends/lua/src/ldump.c:73–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72
73static void DumpString (const TString *s, DumpState *D) {
74 if (s == NULL)
75 DumpByte(0, D);
76 else {
77 size_t size = tsslen(s) + 1; /* include trailing '\0' */
78 const char *str = getstr(s);
79 if (size < 0xFF)
80 DumpByte(cast_int(size), D);
81 else {
82 DumpByte(0xFF, D);
83 DumpVar(size, D);
84 }
85 DumpVector(str, size - 1, D); /* no need to save '\0' */
86 }
87}
88
89
90static void DumpCode (const Proto *f, DumpState *D) {

Callers 3

DumpConstantsFunction · 0.85
DumpDebugFunction · 0.85
DumpFunctionFunction · 0.85

Calls 1

DumpByteFunction · 0.85

Tested by

no test coverage detected