| 365 | } |
| 366 | |
| 367 | static void parse_xml_file(const char *filepath, int once) |
| 368 | { |
| 369 | char *data = acl_vstream_loadfile(filepath); |
| 370 | ACL_VSTREAM *fp; |
| 371 | char *ptr; |
| 372 | ACL_XML *xml; |
| 373 | struct timeval begin, end; |
| 374 | |
| 375 | if (data == NULL) |
| 376 | return; |
| 377 | |
| 378 | gettimeofday(&begin, NULL); |
| 379 | |
| 380 | /* ���� xml ���� */ |
| 381 | xml = acl_xml_alloc(); |
| 382 | |
| 383 | ptr = data; |
| 384 | |
| 385 | if (once) { |
| 386 | /* һ���Եط������� xml ���� */ |
| 387 | acl_xml_parse(xml, ptr); |
| 388 | } else { |
| 389 | /* ÿ�ν�����һ���ֽ������� xml ���� */ |
| 390 | while (*ptr) { |
| 391 | char ch2[2]; |
| 392 | |
| 393 | ch2[0] = *ptr; |
| 394 | ch2[1] = 0; |
| 395 | acl_xml_parse(xml, ch2); |
| 396 | ptr++; |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | gettimeofday(&end, NULL); |
| 401 | |
| 402 | printf("------ok, time: %ld seconds, %ld microseconds -------\r\n", |
| 403 | (long) end.tv_sec - (long) begin.tv_sec, |
| 404 | (long) end.tv_usec - (long) begin.tv_usec); |
| 405 | |
| 406 | |
| 407 | fp = acl_vstream_fopen("dump.txt", O_RDWR | O_CREAT | O_TRUNC, 0600, 4096); |
| 408 | |
| 409 | /* �� xml ����ת����ָ������ */ |
| 410 | acl_xml_dump(xml, fp); |
| 411 | |
| 412 | acl_vstream_fclose(fp); |
| 413 | acl_xml_free(xml); |
| 414 | acl_myfree(data); |
| 415 | } |
| 416 | |
| 417 | static void build_xml2(void) |
| 418 | { |
no test coverage detected
searching dependent graphs…