Mercurial > pidgin
comparison src/html.c @ 6514:64d952098596
[gaim-migrate @ 7031]
Nathan Poznick implemented yahoo info :-)
please test and submit patches for bugs
committer: Tailor Script <tailor@pidgin.im>
| author | Luke Schierer <lschiere@pidgin.im> |
|---|---|
| date | Wed, 20 Aug 2003 01:35:03 +0000 |
| parents | 3de23c9ca1e4 |
| children | 7c14b35bc984 |
comparison
equal
deleted
inserted
replaced
| 6513:63c449a1022f | 6514:64d952098596 |
|---|---|
| 626 if(plain_out) | 626 if(plain_out) |
| 627 *plain_out = g_strdup(plain->str); | 627 *plain_out = g_strdup(plain->str); |
| 628 g_string_free(xhtml, TRUE); | 628 g_string_free(xhtml, TRUE); |
| 629 g_string_free(plain, TRUE); | 629 g_string_free(plain, TRUE); |
| 630 } | 630 } |
| 631 | |
| 632 int info_extract_field(char *original, char *add_to, char *start_tok, | |
| 633 int skip, char *end_tok, char check_value, char *no_value_tok, | |
| 634 char *display_name, int islink, char *link_prefix) | |
| 635 { | |
| 636 char *p, *q; | |
| 637 char buf[1024]; | |
| 638 if (!original || !add_to || !start_tok || | |
| 639 !end_tok || !display_name) | |
| 640 return 0; | |
| 641 p = strstr(original, start_tok); | |
| 642 if (p) { | |
| 643 p += strlen(start_tok) + skip; | |
| 644 if (!check_value || (*p != check_value)) { | |
| 645 q = strstr(p, end_tok); | |
| 646 if (q && (!no_value_tok || | |
| 647 (no_value_tok && strncmp(p, no_value_tok, strlen(no_value_tok))))) { | |
| 648 strcat(add_to, "<b>"); | |
| 649 strcat(add_to, display_name); | |
| 650 strcat(add_to, ":</b> "); | |
| 651 if (islink) { | |
| 652 strcat(add_to, "<br><a href=\""); | |
| 653 memcpy(buf, p, q-p); | |
| 654 buf[q-p] = '\0'; | |
| 655 if (link_prefix) | |
| 656 strcat(add_to, link_prefix); | |
| 657 strcat(add_to, buf); | |
| 658 strcat(add_to, "\">"); | |
| 659 if (link_prefix) | |
| 660 strcat(add_to, link_prefix); | |
| 661 strcat(add_to, buf); | |
| 662 strcat(add_to, "</a>"); | |
| 663 } else { | |
| 664 memcpy(buf, p, q-p); | |
| 665 buf[q-p] = '\0'; | |
| 666 strcat(add_to, buf); | |
| 667 } | |
| 668 strcat(add_to, "<br>\n"); | |
| 669 return 1; | |
| 670 } else | |
| 671 return 0; | |
| 672 } else | |
| 673 return 0; | |
| 674 } else | |
| 675 return 0; | |
| 676 } |
