Mercurial > pidgin
annotate src/protocols/msn/page.c @ 9125:668ffb8fec00
[gaim-migrate @ 9902]
(12:53:05) nosnilmot: LSchiere: not majorly important, but the pref changes
listed in the ChangeLog are out of sync
committer: Tailor Script <tailor@pidgin.im>
| author | Luke Schierer <lschiere@pidgin.im> |
|---|---|
| date | Sun, 30 May 2004 16:54:40 +0000 |
| parents | 9e5a709c30a8 |
| children | ab6636c5a136 |
| rev | line source |
|---|---|
| 5370 | 1 /** |
| 2 * @file page.c Paging functions | |
| 3 * | |
| 4 * gaim | |
| 5 * | |
|
8475
06f57183e29f
[gaim-migrate @ 9208]
Christian Hammond <chipx86@chipx86.com>
parents:
7468
diff
changeset
|
6 * Copyright (C) 2003-2004 Christian Hammond <chipx86@gnupdate.org> |
|
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5370
diff
changeset
|
7 * |
| 5370 | 8 * This program is free software; you can redistribute it and/or modify |
| 9 * it under the terms of the GNU General Public License as published by | |
| 10 * the Free Software Foundation; either version 2 of the License, or | |
| 11 * (at your option) any later version. | |
| 12 * | |
| 13 * This program is distributed in the hope that it will be useful, | |
| 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 * GNU General Public License for more details. | |
| 17 * | |
| 18 * You should have received a copy of the GNU General Public License | |
| 19 * along with this program; if not, write to the Free Software | |
| 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 */ | |
| 22 #include "msn.h" | |
| 23 #include "page.h" | |
| 24 | |
| 25 MsnPage * | |
| 26 msn_page_new(void) | |
| 27 { | |
| 28 MsnPage *page; | |
| 29 | |
| 30 page = g_new0(MsnPage, 1); | |
| 31 | |
| 32 return page; | |
| 33 } | |
| 34 | |
| 35 void | |
| 36 msn_page_destroy(MsnPage *page) | |
| 37 { | |
| 38 g_return_if_fail(page != NULL); | |
| 39 | |
| 40 if (page->body != NULL) | |
| 41 g_free(page->body); | |
| 42 | |
| 43 if (page->from_location != NULL) | |
| 44 g_free(page->from_location); | |
| 45 | |
| 46 if (page->from_phone != NULL) | |
| 47 g_free(page->from_phone); | |
| 48 | |
| 49 g_free(page); | |
| 50 } | |
| 51 | |
| 52 char * | |
|
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
53 msn_page_gen_payload(const MsnPage *page, size_t *ret_size) |
| 5370 | 54 { |
| 55 char *str; | |
| 56 | |
| 57 g_return_val_if_fail(page != NULL, NULL); | |
| 58 | |
|
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
59 str = |
|
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
60 g_strdup_printf("<TEXT xml:space=\"preserve\" enc=\"utf-8\">%s</TEXT>", |
|
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
61 msn_page_get_body(page)); |
| 5370 | 62 |
|
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
63 if (ret_size != NULL) |
|
9092
9e5a709c30a8
[gaim-migrate @ 9869]
Christian Hammond <chipx86@chipx86.com>
parents:
8646
diff
changeset
|
64 *ret_size = strlen(str); |
| 5370 | 65 |
| 66 return str; | |
| 67 } | |
| 68 | |
| 69 void | |
| 70 msn_page_set_body(MsnPage *page, const char *body) | |
| 71 { | |
| 72 g_return_if_fail(page != NULL); | |
| 73 g_return_if_fail(body != NULL); | |
| 74 | |
|
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
75 if (page->body != NULL) |
| 5370 | 76 g_free(page->body); |
| 77 | |
| 78 page->body = g_strdup(body); | |
| 79 } | |
| 80 | |
| 81 const char * | |
| 82 msn_page_get_body(const MsnPage *page) | |
| 83 { | |
| 84 g_return_val_if_fail(page != NULL, NULL); | |
| 85 | |
| 86 return page->body; | |
| 87 } |
