libpurple/protocols/gg/lib/message.h

Fri, 28 Feb 2014 17:29:00 +0100

author
Tomasz Wasilczyk <twasilczyk@pidgin.im>
date
Fri, 28 Feb 2014 17:29:00 +0100
branch
release-2.x.y
changeset 35617
c9069e0e3c36
parent 31609
d67fbc90b28a
child 35573
d9a333109990
permissions
-rw-r--r--

Update internal libgadu to 1.12.0-rc2

31609
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
1 /*
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
2 * (C) Copyright 2009 Wojtek Kaniewski <wojtekka@irc.pl>
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
3 *
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
5 * it under the terms of the GNU Lesser General Public License Version
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
6 * 2.1 as published by the Free Software Foundation.
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
7 *
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
8 * This program is distributed in the hope that it will be useful,
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
11 * GNU Lesser General Public License for more details.
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
12 *
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
13 * You should have received a copy of the GNU Lesser General Public
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
14 * License along with this program; if not, write to the Free Software
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
16 * USA.
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
17 */
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
18
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
19 #ifndef LIBGADU_MESSAGE_H
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
20 #define LIBGADU_MESSAGE_H
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
21
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
22 #include <sys/types.h>
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
23 #include "libgadu.h"
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
24
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
25 #if 0
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
26
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
27 struct gg_message {
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
28 uin_t *recipients;
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
29 size_t recipient_count;
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
30 char *text;
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
31 char *html;
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
32 char *attributes;
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
33 size_t attributes_length;
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
34 uint32_t msgclass;
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
35 uint32_t seq;
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
36
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
37 int auto_convert;
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
38 char *text_converted;
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
39 char *html_converted;
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
40 };
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
41
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
42 #define GG_MESSAGE_CHECK(gm, result) \
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
43 if ((gm) == NULL) { \
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
44 errno = EINVAL; \
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
45 return (result); \
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
46 }
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
47
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
48 int gg_message_init(gg_message_t *gm, int msgclass, int seq, uin_t *recipients, size_t recipient_count, char *text, char *xhtml, char *attributes, size_t attributes_length, int auto_convert);
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
49
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
50 #endif
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
51
35617
c9069e0e3c36 Update internal libgadu to 1.12.0-rc2
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 31609
diff changeset
52 size_t gg_message_html_to_text(char *dst, unsigned char *format, size_t *format_len, const char *html, gg_encoding_t encoding);
c9069e0e3c36 Update internal libgadu to 1.12.0-rc2
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 31609
diff changeset
53 size_t gg_message_text_to_html(char *dst, const char *src, gg_encoding_t encoding, const unsigned char *format, size_t format_len);
c9069e0e3c36 Update internal libgadu to 1.12.0-rc2
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 31609
diff changeset
54
c9069e0e3c36 Update internal libgadu to 1.12.0-rc2
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 31609
diff changeset
55 char * gg_message_html_to_text_110(const char *html);
c9069e0e3c36 Update internal libgadu to 1.12.0-rc2
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 31609
diff changeset
56 char * gg_message_text_to_html_110(const char *text, ssize_t text_len);
31609
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
57
d67fbc90b28a matekm and kkszysiu collaborated on this patch to update our internal libgadu
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
diff changeset
58 #endif /* LIBGADU_MESSAGE_H */

mercurial