| 186 | |
| 187 | |
| 188 | int 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 |
nothing calls this directly
no test coverage detected