| 280 | |
| 281 | |
| 282 | int main(int argc, char * argv[]) |
| 283 | { |
| 284 | // Open the dump file: |
| 285 | cFile f("memdump.xml", cFile::fmRead); |
| 286 | if (!f.IsOpen()) |
| 287 | { |
| 288 | printf("Cannot open memdump.xml\n"); |
| 289 | return 1; |
| 290 | } |
| 291 | |
| 292 | // Create the XML parser: |
| 293 | XML_Parser Parser = XML_ParserCreate(NULL); |
| 294 | XML_SetElementHandler(Parser, OnStartElement, OnEndElement); |
| 295 | |
| 296 | // Feed the file through XML parser: |
| 297 | char Buffer[512 KiB]; |
| 298 | while (true) |
| 299 | { |
| 300 | int NumBytes = f.Read(Buffer, sizeof(Buffer)); |
| 301 | if (NumBytes <= 0) |
| 302 | { |
| 303 | break; |
| 304 | } |
| 305 | XML_Parse(Parser, Buffer, NumBytes, false); |
| 306 | putc('.', stdout); |
| 307 | } |
| 308 | XML_Parse(Parser, "", 0, true); |
| 309 | f.Close(); |
| 310 | |
| 311 | // Output the statistics |
| 312 | WriteSizeStatistics(); |
| 313 | WriteCountStatistics(); |
| 314 | WriteDotGraph(); |
| 315 | |
| 316 | return 0; |
| 317 | } |
| 318 | |
| 319 | |
| 320 |
nothing calls this directly
no test coverage detected