Changeset 2128
- Timestamp:
- 04/15/08 10:04:58 (1 month ago)
- Files:
-
- libswish3/trunk/src/libswish3/parser.c (modified) (54 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libswish3/trunk/src/libswish3/parser.c
r2116 r2128 18 18 */ 19 19 20 #define TEST_SAX 021 22 20 /* 23 21 * parse XML doc from memory using libxml2 SAX2 based on tutorial at … … 159 157 void *data, 160 158 const xmlChar *tag, 161 constxmlChar **atts159 xmlChar **atts 162 160 ); 163 161 static void close_tag( … … 231 229 ); 232 230 233 #if TEST_SAX234 #include "testsax.c"235 #endif236 237 231 swish_Parser * 238 232 swish_init_parser( … … 255 249 */ 256 250 get_env_vars(); 257 251 258 252 if (SWISH_DEBUG & SWISH_DEBUG_MEMORY) { 259 253 SWISH_DEBUG_MSG("parser ptr 0x%x", (int)p); … … 291 285 ) 292 286 { 293 int i, is_html_tag; 294 xmlChar *swishtag, *alias, *metaname, *metacontent; 287 int i, j, is_html_tag, size; 288 xmlChar *swishtag, *attr_lower, *attr_val_lower, *alias, *metaname, *metacontent; 289 swish_StringList *strlist; 290 291 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) { 292 SWISH_DEBUG_MSG(" tag: %s (%s) ", tag, parser_data->tag); 293 if (atts != NULL) { 294 SWISH_DEBUG_MSG(" has attributes [%d]", xmlStrlen((xmlChar*)atts)); 295 for (i = 0; (atts[i] != NULL); i+=2) { 296 SWISH_DEBUG_MSG(" att: %s=", atts[i]); 297 if (atts[i+1] != NULL) { 298 SWISH_DEBUG_MSG(" '%s'", atts[i+1]); 299 } 300 } 301 } 302 } 295 303 296 304 metaname = NULL; … … 307 315 if (parser_data->is_html) { 308 316 317 /* 318 TODO config features about img tags and a/href tags 319 */ 309 320 if (xmlStrEqual(swishtag, (xmlChar *)"br") 310 321 || xmlStrEqual(swishtag, (xmlChar *)"img")) { … … 360 371 if (metaname != NULL && metacontent != NULL) { 361 372 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 362 SWISH_DEBUG_MSG("found HTML meta: %s => %s", metaname, 363 metacontent); 373 SWISH_DEBUG_MSG("found HTML meta: %s => %s", metaname, metacontent); 364 374 365 375 /* … … 387 397 parser_data->bump_word = 1; 388 398 389 } 390 391 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) { 392 fprintf(stderr, " >>> build_tag (%s (%s) ", tag, parser_data->tag); 393 if (atts != 0) { 394 for (i = 0; (atts[i] != 0); i++) { 395 fprintf(stderr, ", %s='", atts[i++]); 396 if (atts[i] != 0) { 397 fprintf(stderr, "%s'", atts[i]); 399 if (atts != NULL 400 && swish_hash_exists(parser_data->s3->config->stringlists, 401 (xmlChar *)SWISH_CLASS_ATTRIBUTES)) { 402 strlist = 403 swish_hash_fetch(parser_data->s3->config->stringlists, 404 (xmlChar *)SWISH_CLASS_ATTRIBUTES); 405 406 407 408 for (i = 0; (atts[i] != NULL); i += 2) { 409 410 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 411 SWISH_DEBUG_MSG(" %d XML attr: %s=%s [%d]", i, atts[i], atts[i + 1], 412 xmlStrlen(atts[i + 1])); 413 414 attr_lower = swish_str_tolower(atts[i]); 415 attr_val_lower = swish_str_tolower(atts[i + 1]); 416 417 /* 418 is it one of ours? 419 */ 420 for (j = 0; j < strlist->n; j++) { 421 if (xmlStrEqual(strlist->word[j], attr_lower)) { 422 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 423 SWISH_DEBUG_MSG("found %s: %s", attr_lower, attr_val_lower); 424 425 // eligible attribute name 426 size = xmlStrlen(swishtag) + xmlStrlen(attr_val_lower) + 2; // dot + NULL 427 metaname = swish_xmalloc(size + 1); 428 snprintf((char *)metaname, size, "%s.%s", (char *)swishtag, 429 (char *)attr_val_lower); 430 431 swish_xfree(swishtag); 432 swishtag = metaname; 433 } 398 434 } 435 436 swish_xfree(attr_lower); 437 swish_xfree(attr_val_lower); 438 399 439 } 400 440 } 401 fprintf(stderr, ")\n"); 441 402 442 } 403 443 … … 415 455 } 416 456 457 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) { 458 SWISH_DEBUG_MSG(" swishtag = %s", swishtag); 459 } 460 417 461 return swishtag; 418 419 462 } 420 463 … … 430 473 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 431 474 SWISH_DEBUG_MSG("buffer is >>%s<< before flush, word_pos = %d", 432 xmlBufferContent(parser_data->meta_buf), 433 parser_data->word_pos); 434 435 /* 436 * since we only flush the buffer when metaname changes, and * we do 437 * not want to match across metanames, bump the word_pos here * before 475 xmlBufferContent(parser_data->meta_buf), parser_data->word_pos); 476 477 /* 478 * since we only flush the buffer when metaname changes, and we do 479 * not want to match across metanames, bump the word_pos here before 438 480 * parsing the string and making the tmp wordlist 439 481 */ … … 449 491 (xmlChar *)SWISH_META_CONNECTOR, 0, 1); 450 492 451 if (parser_data->context_as_meta) { 493 /* 494 * add to every metaname on the stack. 495 * Disabling this for now, as it ought to be up the handler() to decide 496 * to index a token under multiple metanames, and we associate context 497 * with the WordList 498 */ 499 500 if (parser_data->s3->config->flags->context_as_meta) { 452 501 for (s->temp = s->head; s->temp != NULL; s->temp = s->temp->next) { 453 if (xmlStrEqual(s->temp->name, metaname)) / * just added * above */502 if (xmlStrEqual(s->temp->name, metaname)) // already added 454 503 continue; 455 504 456 505 swish_add_buf_to_nb(parser_data->metanames, s->temp->name, 457 parser_data->meta_buf, 458 (xmlChar *)SWISH_META_CONNECTOR, 0,1);506 parser_data->meta_buf, (xmlChar *)SWISH_META_CONNECTOR, 0, 507 1); 459 508 } 460 509 } 461 510 462 511 if (parser_data->s3->analyzer->tokenize) { 463 464 tokenize(parser_data, 465 (xmlChar *)xmlBufferContent(parser_data->meta_buf), 512 tokenize(parser_data, (xmlChar *)xmlBufferContent(parser_data->meta_buf), 466 513 xmlBufferLength(parser_data->meta_buf), metaname, context); 467 514 } … … 519 566 ) 520 567 { 521 open_tag(data, name, atts);568 open_tag(data, name, (xmlChar **)atts); 522 569 } 523 570 … … 550 597 ) 551 598 { 552 open_tag(data, localname, attributes); 599 int i, j, len; 600 xmlChar **atts; 601 atts = NULL; 602 603 if (nb_attributes > 0) { 604 atts = swish_xmalloc(((nb_attributes * 2) + 1) * sizeof(xmlChar *)); 605 j=0; 606 for (i = 0; i < nb_attributes * 5; i += 5) { 607 atts[j] = (xmlChar *)attributes[i]; 608 len = (int)(attributes[i + 4] - attributes[i + 3]); 609 if (len > 0) { 610 atts[j+1] = xmlStrsub(attributes[i + 3], 0, len); 611 } 612 else { 613 atts[j] = NULL; 614 } 615 j+=2; 616 } 617 atts[j] = NULL; 618 } 619 620 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) { 621 SWISH_DEBUG_MSG(" tag: %s nb_attributes %d", localname, nb_attributes); 622 if (atts != NULL) { 623 for (i = 0; (atts[i] != NULL); i+=2) { 624 SWISH_DEBUG_MSG(" att: %s=%s", atts[i], atts[i + 1]); 625 //SWISH_DEBUG_MSG(" att: %s=", atts[i++], atts[i] || ""); 626 } 627 } 628 } 629 630 open_tag(data, localname, atts); 631 632 if (atts != NULL) { 633 swish_xfree(atts); 634 } 553 635 } 554 636 … … 571 653 void *data, 572 654 const xmlChar *tag, 573 const xmlChar **atts 574 ) 575 { 576 swish_ParserData *parser_data = (swish_ParserData *)data; 655 xmlChar **atts 656 ) 657 { 658 swish_ParserData *parser_data; 659 parser_data = (swish_ParserData *)data; 577 660 578 661 if (parser_data->tag != NULL) … … 582 665 583 666 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 584 SWISH_DEBUG_MSG("checking config for '%s' in watched tags", 585 parser_data->tag); 667 SWISH_DEBUG_MSG("checking config for '%s' in watched tags", parser_data->tag); 586 668 587 669 /* 588 670 * set property if this tag is configured for it 589 671 */ 590 if (swish_hash_exists 591 (parser_data->s3->config->properties, parser_data->tag)) { 672 if (swish_hash_exists(parser_data->s3->config->properties, parser_data->tag)) { 592 673 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 593 674 SWISH_DEBUG_MSG(" %s = new property", parser_data->tag); … … 596 677 xmlBufferEmpty(parser_data->prop_buf); 597 678 598 parser_data->propstack = 599 push_tag_stack(parser_data->propstack, parser_data->tag); 679 parser_data->propstack = push_tag_stack(parser_data->propstack, parser_data->tag); 600 680 601 681 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) … … 613 693 parser_data->metastack->flat); 614 694 615 parser_data->metastack = 616 push_tag_stack(parser_data->metastack, parser_data->tag); 695 parser_data->metastack = push_tag_stack(parser_data->metastack, parser_data->tag); 617 696 } 618 697 … … 643 722 644 723 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 645 SWISH_DEBUG_MSG(" endElement(%s) (%s)", (xmlChar *)tag, 646 parser_data->tag); 724 SWISH_DEBUG_MSG(" endElement(%s) (%s)", (xmlChar *)tag, parser_data->tag); 647 725 648 726 if ((context = 649 pop_tag_stack_on_match(parser_data->propstack, 650 parser_data->tag)) != NULL) { 727 pop_tag_stack_on_match(parser_data->propstack, parser_data->tag)) != NULL) { 651 728 652 729 /* … … 659 736 660 737 if ((context = 661 pop_tag_stack_on_match(parser_data->metastack, 662 parser_data->tag)) != NULL) { 738 pop_tag_stack_on_match(parser_data->metastack, parser_data->tag)) != NULL) { 663 739 664 740 /* … … 885 961 886 962 if (!size && !xmlStrlen(buffer) && !parser_data->docinfo->size) { 887 SWISH_WARN("%s appears to be empty -- can't parse it", 888 parser_data->docinfo->uri); 963 SWISH_WARN("%s appears to be empty -- can't parse it", parser_data->docinfo->uri); 889 964 890 965 return 1; … … 892 967 893 968 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 894 SWISH_DEBUG_MSG("%s -- using %s parser", parser_data->docinfo->uri, 895 parser); 969 SWISH_DEBUG_MSG("%s -- using %s parser", parser_data->docinfo->uri, parser); 896 970 897 971 /* … … 899 973 */ 900 974 if (filename && !buffer) { 901 buffer = 902 swish_slurp_file_len(filename, (long)parser_data->docinfo->size); 975 buffer = swish_slurp_file_len(filename, (long)parser_data->docinfo->size); 903 976 size = parser_data->docinfo->size; 904 977 } … … 910 983 911 984 else if (parser[0] == 'X') 912 #if TEST_SAX913 ret =914 xmlSAXUserParseMemory(debugSAX2Handler, NULL, (const char *)buffer,915 size);916 #else917 985 ret = xml_parser(my_parser_ptr, parser_data, buffer, size); 918 #endif919 986 920 987 else if (parser[0] == 'T') … … 945 1012 SWISH_DEBUG_MSG("init parser_data"); 946 1013 947 swish_ParserData *ptr = 948 (swish_ParserData *)swish_xmalloc(sizeof(swish_ParserData)); 1014 swish_ParserData *ptr = (swish_ParserData *)swish_xmalloc(sizeof(swish_ParserData)); 949 1015 950 1016 ptr->s3 = s3; … … 971 1037 ptr->metastack->flat = NULL; 972 1038 ptr->metastack->count = 0; 973 ptr->metastack = 974 push_tag_stack(ptr->metastack, (xmlChar *)SWISH_DEFAULT_METANAME); 1039 ptr->metastack = push_tag_stack(ptr->metastack, (xmlChar *)SWISH_DEFAULT_METANAME); 975 1040 976 1041 ptr->propstack = (swish_TagStack *)swish_xmalloc(sizeof(swish_TagStack)); … … 1012 1077 1013 1078 /* 1014 * TODO make this configurable1015 */1016 ptr->context_as_meta = 1;1017 1018 /*1019 1079 * pointer to the xmlParserCtxt since we want to free it only after 1020 1080 * we're completely done with it. NOTE this is a change per libxml2 … … 1112 1172 else { 1113 1173 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 1114 SWISH_DEBUG_MSG 1115 ("swish_ParserData libxml2 parser ctxt already freed"); 1174 SWISH_DEBUG_MSG("swish_ParserData libxml2 parser ctxt already freed"); 1116 1175 1117 1176 } … … 1267 1326 1268 1327 if (!val) 1269 SWISH_WARN("Failed to parse Content-Location header '%s'", 1328 SWISH_WARN("Failed to parse Content-Location header '%s'", line); 1329 1330 if (!*val) 1331 SWISH_WARN("Failed to find path name in Content-Location header '%s'", 1270 1332 line); 1271 1272 if (!*val)1273 SWISH_WARN1274 ("Failed to find path name in Content-Location header '%s'",1275 line);1276 1333 1277 1334 if (info->uri != NULL) … … 1289 1346 1290 1347 if (!*val) 1291 SWISH_WARN("Failed to find path name in Path-Name header '%s'", 1292 line); 1348 SWISH_WARN("Failed to find path name in Path-Name header '%s'", line); 1293 1349 1294 1350 if (info->uri != NULL) … … 1306 1362 1307 1363 if (!*val) 1308 SWISH_WARN 1309 ("Failed to find path name in Document-Type header '%s'", 1310 line); 1364 SWISH_WARN("Failed to find path name in Document-Type header '%s'", line); 1311 1365 1312 1366 if (info->parser != NULL) … … 1322 1376 1323 1377 if (!*val) 1324 SWISH_WARN 1325 ("Failed to find path name in Parser-Type header '%s'", 1326 line); 1378 SWISH_WARN("Failed to find path name in Parser-Type header '%s'", line); 1327 1379 1328 1380 if (info->parser != NULL) … … 1338 1390 1339 1391 if (!*val) 1340 SWISH_WARN 1341 ("Failed to find path name in Content-Type header '%s'", 1342 line); 1392 SWISH_WARN("Failed to find path name in Content-Type header '%s'", line); 1343 1393 1344 1394 /* … … 1357 1407 1358 1408 if (!val) 1359 SWISH_WARN("Failed to parse Encoding or Charset header '%s'", 1409 SWISH_WARN("Failed to parse Encoding or Charset header '%s'", line); 1410 1411 if (!*val) 1412 SWISH_WARN("Failed to find value in Encoding or Charset header '%s'", 1360 1413 line); 1361 1362 if (!*val)1363 SWISH_WARN1364 ("Failed to find value in Encoding or Charset header '%s'",1365 line);1366 1414 1367 1415 if (info->encoding != NULL) … … 1382 1430 1383 1431 if (!*val) 1384 SWISH_WARN("Failed to find value in Update-Mode header '%s'", 1385 line); 1432 SWISH_WARN("Failed to find value in Update-Mode header '%s'", line); 1386 1433 1387 1434 if (info->update != NULL) … … 1417 1464 1418 1465 setenv("SWISH_PARSER_ERROR", "0", 0); 1419 SWISH_PARSER_ERROR = 1420 (int)strtol(getenv("SWISH_PARSER_ERROR"), (char **)NULL, 10); 1466 SWISH_PARSER_ERROR = (int)strtol(getenv("SWISH_PARSER_ERROR"), (char **)NULL, 10); 1421 1467 1422 1468 setenv("SWISH_PARSER_WARNING", "0", 0); 1423 SWISH_PARSER_WARNING = 1424 (int)strtol(getenv("SWISH_PARSER_WARNING"), (char **)NULL, 10); 1469 SWISH_PARSER_WARNING = (int)strtol(getenv("SWISH_PARSER_WARNING"), (char **)NULL, 10); 1425 1470 1426 1471 setenv("SWISH_PARSER_FATAL", "0", 0); 1427 SWISH_PARSER_FATAL = 1428 (int)strtol(getenv("SWISH_PARSER_FATAL"), (char **)NULL, 10); 1472 SWISH_PARSER_FATAL = (int)strtol(getenv("SWISH_PARSER_FATAL"), (char **)NULL, 10); 1429 1473 1430 1474 if (SWISH_DEBUG) { … … 1466 1510 ln = swish_xmalloc(SWISH_MAXSTRLEN + 1); 1467 1511 head_buf = 1468 xmlBufferCreateSize((SWISH_MAX_HEADERS * SWISH_MAXSTRLEN) + 1469 SWISH_MAX_HEADERS); 1512 xmlBufferCreateSize((SWISH_MAX_HEADERS * SWISH_MAXSTRLEN) + SWISH_MAX_HEADERS); 1470 1513 1471 1514 /* … … 1516 1559 */ 1517 1560 xmlErr = 1518 docparser(parser_data, NULL, read_buffer, 1519 parser_data->docinfo->size); 1561 docparser(parser_data, NULL, read_buffer, parser_data->docinfo->size); 1520 1562 1521 1563 if (xmlErr) … … 1702 1744 parser_data->docinfo->ref_cnt++; 1703 1745 1704 if (!swish_docinfo_from_filesystem 1705 (filename, parser_data->docinfo, parser_data)) { 1746 if (!swish_docinfo_from_filesystem(filename, parser_data->docinfo, parser_data)) { 1706 1747 SWISH_WARN("Skipping %s", filename); 1707 1748 free_parser_data(parser_data); … … 1879 1920 1880 1921 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 1881 SWISH_DEBUG_MSG("txt parser encoding: %s", 1882 parser_data->docinfo->encoding); 1922 SWISH_DEBUG_MSG("txt parser encoding: %s", parser_data->docinfo->encoding); 1883 1923 1884 1924 if (parser_data->docinfo->encoding != (xmlChar *)SWISH_DEFAULT_ENCODING) { 1885 if (!xmlStrncasecmp 1886 (parser_data->docinfo->encoding, (xmlChar *)"iso-8859-1", 10)) { 1925 if (!xmlStrncasecmp(parser_data->docinfo->encoding, (xmlChar *)"iso-8859-1", 10)) { 1887 1926 out = swish_xmalloc(size * 2); 1888 1927 … … 1895 1934 } 1896 1935 1897 else if (xmlStrEqual 1898 (parser_data->docinfo->encoding, (xmlChar *)"unknown")) { 1936 else if (xmlStrEqual(parser_data->docinfo->encoding, (xmlChar *)"unknown")) { 1899 1937 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) 1900 1938 SWISH_DEBUG_MSG("default env encoding -> %s", enc); … … 1961 1999 1962 2000 if (xmlCheckUTF8((const xmlChar *)buffer) != 0) 1963 parser_data->docinfo->encoding = 1964 swish_xstrdup((xmlChar *)SWISH_DEFAULT_ENCODING); 2001 parser_data->docinfo->encoding = swish_xstrdup((xmlChar *)SWISH_DEFAULT_ENCODING); 1965 2002 else 1966 2003 parser_data->docinfo->encoding = swish_xstrdup((xmlChar *)"unknown"); … … 2023 2060 2024 2061 tmplist = 2025 swish_tokenize(parser_data->s3->analyzer, string, 2026 parser_data->offset, parser_data->word_pos, metaname, 2027 context); 2062 swish_tokenize(parser_data->s3->analyzer, string, parser_data->offset, 2063 parser_data->word_pos, metaname, context); 2028 2064 2029 2065 } … … 2035 2071 2036 2072 tmplist = 2037 (*parser_data->s3->analyzer->tokenizer) (parser_data->s3->analyzer, 2038 string, 2073 (*parser_data->s3->analyzer->tokenizer) (parser_data->s3->analyzer, string, 2039 2074 parser_data->offset, 2040 parser_data->word_pos, 2041 metaname,context);2075 parser_data->word_pos, metaname, 2076 context); 2042 2077 2043 2078 } … … 2095 2130 int i = 0; 2096 2131 2097 SWISH_DEBUG_MSG("%s '%s' stack->count: %d", stack->name, stack->flat, 2098 stack->count); 2099 2100 for (stack->temp = stack->head; stack->temp != NULL; 2101 stack->temp = stack->temp->next) { 2132 SWISH_DEBUG_MSG("%s '%s' stack->count: %d", stack->name, stack->flat, stack->count); 2133 2134 for (stack->temp = stack->head; stack->temp != NULL; stack->temp = stack->temp->next) { 2102 2135 SWISH_DEBUG_MSG(" %d: count %d tagstack: %s", i++, stack->temp->n, 2103 2136 stack->temp->name); … … 2106 2139 2107 2140 if (i != stack->count) { 2108 SWISH_WARN("stack count appears wrong (%d items, but count=%d)", i, 2109 stack->count); 2141 SWISH_WARN("stack count appears wrong (%d items, but count=%d)", i, stack->count); 2110 2142 2111 2143 } … … 2141 2173 2142 2174 for (; stack->temp != NULL; stack->temp = stack->temp->next) { 2143 size = 2144 ((xmlStrlen(flat) + 2145 (xmlStrlen(stack->temp->name)) * sizeof(xmlChar))) + 2; 2175 size = ((xmlStrlen(flat) + (xmlStrlen(stack->temp->name)) * sizeof(xmlChar))) + 2; 2146 2176 tmp = swish_xmalloc(size); 2147 if (sprintf 2148 ((char *)tmp, "%s %s", (char *)flat, 2149 (char *)stack->temp->name) > 0) { 2177 if (sprintf((char *)tmp, "%s %s", (char *)flat, (char *)stack->temp->name) > 0) { 2150 2178 if (flat != NULL) 2151 2179 swish_xfree(flat); … … 2154 2182 } 2155 2183 else { 2156 SWISH_CROAK("sprintf failed to concat %s -> %s", stack->temp->name, 2157 flat); 2184 SWISH_CROAK("sprintf failed to concat %s -> %s", stack->temp->name, flat); 2158 2185 } 2159 2186 … … 2202 2229 continue; 2203 2230 2204 swish_add_buf_to_nb(parser_data->properties, s->temp->name, 2205 parser_data->prop_buf, 2231 swish_add_buf_to_nb(parser_data->properties, s->temp->name, parser_data->prop_buf, 2206 2232 (xmlChar *)SWISH_PROP_CONNECTOR, cleanwsp, 0); 2207 2233 } … … 2249 2275 2250 2276 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) { 2251 SWISH_DEBUG_MSG 2252 (" >>> stack size: %d thistag count: %d current head tag = '%s'", 2253 stack->count, thistag->n, stack->head->name); 2277 SWISH_DEBUG_MSG(" >>> stack size: %d thistag count: %d current head tag = '%s'", 2278 stack->count, thistag->n, stack->head->name); 2254 2279 2255 2280 _debug_stack(stack); … … 2267 2292 2268 2293 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) { 2269 SWISH_DEBUG_MSG(" pop_tag_stack: %s from %s", stack->head->name, 2270 stack->name); 2294 SWISH_DEBUG_MSG(" pop_tag_stack: %s from %s", stack->head->name, stack->name); 2271 2295 _debug_stack(stack); 2272 2296 … … 2275 2299 if (stack->count > 1) { 2276 2300 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) { 2277 SWISH_DEBUG_MSG(" >>> %d: popping '%s' from tagstack <<<", 2278 stack->head->n , stack->head->name);2301 SWISH_DEBUG_MSG(" >>> %d: popping '%s' from tagstack <<<", stack->head->n, 2302 stack->head->name); 2279 2303 2280 2304 } … … 2324 2348 2325 2349 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) { 2326 SWISH_DEBUG_MSG(" >> stack size = %d head of stack = %s <<", 2327 stack-> count, stack->head->name);2350 SWISH_DEBUG_MSG(" >> stack size = %d head of stack = %s <<", stack->count, 2351 stack->head->name); 2328 2352 _debug_stack(stack); 2329 2353 } … … 2358 2382 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) { 2359 2383 SWISH_DEBUG_MSG 2360 (" >>>>>>>>>>>>>>>>>>> current tag = '%s' matches top of tagstack", 2361 tag); 2384 (" >>>>>>>>>>>>>>>>>>> current tag = '%s' matches top of tagstack", tag); 2362 2385 2363 2386 } … … 2369 2392 2370 2393 if (SWISH_DEBUG & SWISH_DEBUG_PARSER) { 2371 SWISH_DEBUG_MSG("stack popped. tag = %s stack->head = %s", 2372 tag,stack->head->name);2394 SWISH_DEBUG_MSG("stack popped. tag = %s stack->head = %s", tag, 2395 stack->head->name); 2373 2396 _debug_stack(stack); 2374 2397 }
