comparison libpurple/protocols/myspace/message.h @ 17264:ddcf9ef2ccec

Add MsimMessage implementation (sending only).
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Thu, 31 May 2007 02:29:50 +0000
parents
children 793301c04e3a
comparison
equal deleted inserted replaced
17263:0409947da92f 17264:ddcf9ef2ccec
1 /** MySpaceIM protocol messages
2 *
3 * \author Jeff Connelly
4 *
5 * Copyright (C) 2007, Jeff Connelly <jeff2@homing.pidgin.im>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22 #ifndef _MYSPACE_MESSAGE_H
23 #define _MYSPACE_MESSAGE_H
24
25 #include "myspace.h"
26
27 /* Types */
28 #define MsimMessage GList /* #define instead of typedef to avoid casting */
29 typedef struct _MsimMessageElement
30 {
31 gchar *name; /**< Textual name of element. */
32 guint type; /**< MSIM_TYPE_* code. */
33 gpointer data; /**< Pointer to data, or GUINT_TO_POINTER for int/bool. */
34 } MsimMessageElement;
35
36 typedef gchar MsimMessageType;
37
38 /* Protocol field types */
39 #define MSIM_TYPE_INTEGER 'i'
40 #define MSIM_TYPE_STRING 's'
41 #define MSIM_TYPE_BINARY 'b'
42 #define MSIM_TYPE_BOOLEAN 'f'
43 #define MSIM_TYPE_DICTIONARY 'd'
44 #define MSIM_TYPE_LIST 'l'
45
46 MsimMessage *msim_msg_new(void);
47 void msim_msg_free(MsimMessage *msg);
48 MsimMessage *msim_msg_append(MsimMessage *msg, gchar *name, MsimMessageType type, gpointer data);
49 gchar *msim_msg_debug_string(MsimMessage *msg);
50 gchar *msim_msg_pack(MsimMessage *msg);
51 gboolean msim_msg_send(MsimSession *session, MsimMessage *msg);
52
53 #endif /* _MYSPACE_MESSAGE_H */