MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / makeDirData

Function makeDirData

common/script/checkpoint_api.cpp:127–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 };
126
127 dirData* makeDirData(const std::vector<std::string>& names)
128 {
129 ScriptHeap& heap = ScriptHeap::get();
130 dirData* ret = (dirData*)heap.alloc(sizeof(dirData));
131 if (ret) {
132 ret->count = (int)names.size();
133 ret->files = names.empty() ? nullptr : (char**)heap.alloc(sizeof(char*) * names.size());
134 if (ret->files) {
135 for (size_t i = 0; i < names.size(); i++) {
136 ret->files[i] = (char*)strToRet(names[i]);
137 }
138 }
139 else {
140 ret->count = 0;
141 }
142 }
143 return ret;
144 }
145}
146
147/* ---- titles ---------------------------------------------------------- */

Callers 2

ckpt_read_directoryFunction · 0.85
ckpt_sav_listFunction · 0.85

Calls 5

getFunction · 0.85
strToRetFunction · 0.85
allocMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected