Changeset 2178
- Timestamp:
- 09/26/08 23:59:57 (2 months ago)
- Files:
-
- libswish3/trunk/bindings/perl/XS/Property.xs (modified) (1 diff)
- libswish3/trunk/bindings/perl/t/20metanames.t (modified) (1 diff)
- libswish3/trunk/bindings/perl/xs_helpers.c (modified) (1 diff)
- libswish3/trunk/src/libswish3/config.c (modified) (3 diffs)
- libswish3/trunk/src/libswish3/libswish3.h (modified) (1 diff)
- libswish3/trunk/src/libswish3/namedbuffer.c (modified) (2 diffs)
- libswish3/trunk/src/libswish3/string.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libswish3/trunk/bindings/perl/XS/Property.xs
r2176 r2178 95 95 if (SWISH_DEBUG & SWISH_DEBUG_MEMORY) { 96 96 warn("DESTROYing swish_Property object %s [0x%x] [ref_cnt = %d]", 97 SvPV(ST(0), PL_na), ( int)self, self->ref_cnt);97 SvPV(ST(0), PL_na), (long int)self, self->ref_cnt); 98 98 } 99 99 libswish3/trunk/bindings/perl/t/20metanames.t
r2172 r2178 32 32 #diag(dump($data->metanames)); 33 33 34 #$data-> wordlist->debug;34 #$data->tokens->debug; 35 35 36 36 } libswish3/trunk/bindings/perl/xs_helpers.c
r2176 r2178 565 565 int bump = strlen(SWISH_TOKENPOS_BUMPER); 566 566 int len; 567 568 //warn("%s nb_content: '%s'\n", key, str); 567 569 568 570 /* analogous to @strings = split(/SWISH_TOKENPOS_BUMPER/, str) */ 569 571 while((tmp = xmlStrstr(str, (xmlChar*)SWISH_TOKENPOS_BUMPER)) != NULL) 570 572 { 573 //warn("%s split: '%s'\n", key, str); 571 574 len = tmp - str; 572 if(len )575 if(len && !swish_str_all_ws_len((xmlChar*)str, len)) { 573 576 av_push(strings, newSVpvn((char*)str, len)); 574 577 } 575 578 str = tmp + bump; /* move the pointer up */ 576 579 } 577 580 578 581 /* no match and/or last match */ 579 if (!xmlStrstr(str, (xmlChar*)SWISH_TOKENPOS_BUMPER)) { 582 if ( !xmlStrstr(str, (xmlChar*)SWISH_TOKENPOS_BUMPER) 583 && strlen((char*)str) 584 && !swish_str_all_ws((xmlChar*)str) 585 ) { 580 586 av_push(strings, newSVpvn((char*)str, strlen((char*)str))); 581 587 } libswish3/trunk/src/libswish3/config.c
r2141 r2178 155 155 if (SWISH_DEBUG & SWISH_DEBUG_MEMORY) { 156 156 SWISH_DEBUG_MSG("freeing config"); 157 SWISH_DEBUG_MSG("ptr addr: 0x%x %d", ( int)config, (int)config);157 SWISH_DEBUG_MSG("ptr addr: 0x%x %d", (long int)config, (long int)config); 158 158 swish_mem_debug(); 159 159 } … … 234 234 235 235 if (SWISH_DEBUG & SWISH_DEBUG_MEMORY) { 236 SWISH_DEBUG_MSG("config ptr 0x%x", ( int)config);236 SWISH_DEBUG_MSG("config ptr 0x%x", (long int)config); 237 237 } 238 238 … … 412 412 { 413 413 SWISH_DEBUG_MSG("config->ref_cnt = %d", config->ref_cnt); 414 SWISH_DEBUG_MSG("config->stash address = 0x%x %d", ( int)config->stash,415 ( int)config->stash);416 SWISH_DEBUG_MSG("ptr addr: 0x%x %d", ( int)config, (int)config);414 SWISH_DEBUG_MSG("config->stash address = 0x%x %d", (long int)config->stash, 415 (long int)config->stash); 416 SWISH_DEBUG_MSG("ptr addr: 0x%x %d", (long int)config, (long int)config); 417 417 418 418 xmlHashScan(config->misc, (xmlHashScanner)config_printer, "misc conf"); libswish3/trunk/src/libswish3/libswish3.h
r2176 r2178 468 468 xmlChar * swish_str_skip_ws(xmlChar *s); 469 469 void swish_str_trim_ws(xmlChar *string); 470 int swish_str_all_ws(xmlChar * s); 470 boolean swish_str_all_ws(xmlChar * s); 471 boolean swish_str_all_ws_len(xmlChar * s, int len); 471 472 void swish_debug_wchars( const wchar_t * widechars ); 472 473 int swish_wchar_t_comp(const void *s1, const void *s2); libswish3/trunk/src/libswish3/namedbuffer.c
r2150 r2178 171 171 xmlBufferPtr buf = swish_hash_fetch(nb->hash, name); 172 172 173 /* if the str is nothing but whitespace, skip it */ 174 if (swish_str_all_ws(str)) { 175 if (SWISH_DEBUG & SWISH_DEBUG_NAMEDBUFFER) 176 SWISH_DEBUG_MSG("skipping all whitespace string '%s'", str); 177 178 return; 179 } 180 173 181 if (!buf) { 174 182 if (autovivify) { … … 196 204 } 197 205 else { 198 /* SWISH_DEBUG_MSG("adding '%s' to buffer '%s'", str, name); */ 206 if (SWISH_DEBUG & SWISH_DEBUG_NAMEDBUFFER) 207 SWISH_DEBUG_MSG("adding '%s' to buffer '%s'", str, name); 199 208 swish_append_buffer(buf, str, len); 200 209 } libswish3/trunk/src/libswish3/string.c
r2141 r2178 541 541 } 542 542 543 int 543 boolean 544 544 swish_str_all_ws( 545 545 xmlChar *s 546 546 ) 547 547 { 548 int len, i; 549 len = xmlStrlen(s); 548 return swish_str_all_ws_len(s, xmlStrlen(s)); 549 } 550 551 boolean 552 swish_str_all_ws_len( 553 xmlChar * s, 554 int len 555 ) 556 { 557 int i; 550 558 for (i = 0; i < len; i++) { 551 559 if (!isspace((int)s[i])) { … … 555 563 return 1; 556 564 } 565 557 566 558 567 void
