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