Mercurial > pidgin
annotate libpurple/protocols/myspace/session.h @ 21173:726f91be55ed
merge of '8f4d756b61b5688ce770c469c3a7095dbe6c271d'
and 'b8fa91b64c41d38520d7944d70d627007e271158'
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Thu, 08 Nov 2007 19:50:22 +0000 |
parents | 1141d47b162c |
children | fae699fece1f |
rev | line source |
---|---|
20257
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
1 /* MySpaceIM Protocol Plugin, session |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
2 * |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
3 * Copyright (C) 2007, Jeff Connelly <jeff2@soc.pidgin.im> |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
4 * |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
7 * the Free Software Foundation; either version 2 of the License, or |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
8 * (at your option) any later version. |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
9 * |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
13 * GNU General Public License for more details. |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
14 * |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
15 * You should have received a copy of the GNU General Public License |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
16 * along with this program; if not, write to the Free Software |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
18 */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
19 |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
20 #ifndef _MYSPACE_SESSION_H |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
21 #define _MYSPACE_SESSION_H |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
22 |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
23 /* Random number in every MsimSession, to ensure it is valid. */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
24 #define MSIM_SESSION_STRUCT_MAGIC 0xe4a6752b |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
25 |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
26 /* Everything needed to keep track of a session (proto_data field in PurpleConnection) */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
27 typedef struct _MsimSession |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
28 { |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
29 guint magic; /**< MSIM_SESSION_STRUCT_MAGIC */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
30 PurpleAccount *account; |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
31 PurpleConnection *gc; |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
32 guint sesskey; /**< Session key from server */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
33 guint userid; /**< This user's numeric user ID */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
34 gchar *username; /**< This user's unique username */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
35 gint fd; /**< File descriptor to/from server */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
36 |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
37 /* TODO: Remove. */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
38 GHashTable *user_lookup_cb; /**< Username -> userid lookup callback */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
39 GHashTable *user_lookup_cb_data; /**< Username -> userid lookup callback data */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
40 |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
41 MsimMessage *server_info; /**< Parameters from server */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
42 |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
43 gchar *rxbuf; /**< Receive buffer */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
44 guint rxoff; /**< Receive buffer offset */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
45 guint next_rid; /**< Next request/response ID */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
46 time_t last_comm; /**< Time received last communication */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
47 guint inbox_status; /**< Bit field of inbox notifications */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
48 } MsimSession; |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
49 |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
50 /* Check if an MsimSession is valid */ |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
51 #define MSIM_SESSION_VALID(s) (session != NULL && session->magic == MSIM_SESSION_STRUCT_MAGIC) |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
52 |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
53 |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
54 MsimSession *msim_session_new(PurpleAccount *acct); |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
55 void msim_session_destroy(MsimSession *session); |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
56 |
1141d47b162c
Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
57 #endif /* !_MYSPACE_SESSION_H */ |