MCPcopy Create free account
hub / github.com/cuberite/cuberite / main

Function main

Tools/ToLuaDoxy/ToLuaDoxy.cpp:188–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186
187
188int main(int argc, char * argv[])
189{
190 AString BaseDir = (argc > 1) ? argv[1] : ".";
191 AString OutDir = (argc > 2) ? argv[2] : "Out";
192
193 // Create the output directory:
194 #ifdef _WIN32
195 CreateDirectory(OutDir.c_str(), NULL);
196 #else
197 mkdir(OutDir.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
198 #endif
199
200 // Parse the package file
201 AStrings CFiles;
202 AStrings DirectLines;
203 if (!ParsePackageFile(Printf("%s/AllToLua.pkg", BaseDir.c_str()), CFiles, DirectLines))
204 {
205 return 1;
206 }
207
208 // Process header files:
209 for (AStrings::const_iterator itr = CFiles.begin(), end = CFiles.end(); itr != end; ++itr)
210 {
211 static int cnt = 0;
212 AString In = Printf("%s/%s", BaseDir.c_str(), itr->c_str());
213 AString Out = Printf("%s/%04x.h", OutDir.c_str(), cnt++);
214 ProcessCFile(In, Out);
215 } // for itr - CFiles[]
216
217 return 0;
218}
219
220
221

Callers

nothing calls this directly

Calls 6

ParsePackageFileFunction · 0.85
PrintfFunction · 0.85
ProcessCFileFunction · 0.85
c_strMethod · 0.80
beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected