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

Function DumpConstants

depends/lua/src/ldump.c:98–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96static void DumpFunction(const Proto *f, TString *psource, DumpState *D);
97
98static void DumpConstants (const Proto *f, DumpState *D) {
99 int i;
100 int n = f->sizek;
101 DumpInt(n, D);
102 for (i = 0; i < n; i++) {
103 const TValue *o = &f->k[i];
104 DumpByte(ttype(o), D);
105 switch (ttype(o)) {
106 case LUA_TNIL:
107 break;
108 case LUA_TBOOLEAN:
109 DumpByte(bvalue(o), D);
110 break;
111 case LUA_TNUMFLT:
112 DumpNumber(fltvalue(o), D);
113 break;
114 case LUA_TNUMINT:
115 DumpInteger(ivalue(o), D);
116 break;
117 case LUA_TSHRSTR:
118 case LUA_TLNGSTR:
119 DumpString(tsvalue(o), D);
120 break;
121 default:
122 lua_assert(0);
123 }
124 }
125}
126
127
128static void DumpProtos (const Proto *f, DumpState *D) {

Callers 1

DumpFunctionFunction · 0.85

Calls 5

DumpIntFunction · 0.85
DumpByteFunction · 0.85
DumpNumberFunction · 0.85
DumpIntegerFunction · 0.85
DumpStringFunction · 0.85

Tested by

no test coverage detected