annotate libpurple/protocols/myspace/session.h @ 24731:295464ae2d2a

No functionality change--just cleanup. * Remove stray whitespace * Make functions static that don't need to be public * Shuffling functions around so there is a general bottom-to-top logic flow * Remove foward declarations for functions that don't need them
author Mark Doliner <mark@kingant.net>
date Tue, 16 Dec 2008 03:35:22 +0000
parents 68cc1a8a0d21
children 8e75a1525156
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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: 19680
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: 19680
diff changeset
2 *
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
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: 19680
diff changeset
4 *
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
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: 19680
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: 19680
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: 19680
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: 19680
diff changeset
9 *
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
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: 19680
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: 19680
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: 19680
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: 19680
diff changeset
14 *
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
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: 19680
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: 19680
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: 19680
diff changeset
18 */
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
19
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
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: 19680
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: 19680
diff changeset
22
24721
68cc1a8a0d21 Shuffling things around, remove stray whitespace, remove some forward
Mark Doliner <mark@kingant.net>
parents: 24394
diff changeset
23 #include "account.h"
68cc1a8a0d21 Shuffling things around, remove stray whitespace, remove some forward
Mark Doliner <mark@kingant.net>
parents: 24394
diff changeset
24
20257
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
25 /* 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: 19680
diff changeset
26 #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: 19680
diff changeset
27
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
28 /* 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: 19680
diff changeset
29 typedef struct _MsimSession
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
30 {
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
31 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: 19680
diff changeset
32 PurpleAccount *account;
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
33 PurpleConnection *gc;
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
34 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: 19680
diff changeset
35 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: 19680
diff changeset
36 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: 19680
diff changeset
37 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: 19680
diff changeset
38
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
39 /* TODO: Remove. */
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
40 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: 19680
diff changeset
41 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: 19680
diff changeset
42
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
43 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: 19680
diff changeset
44
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
45 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: 19680
diff changeset
46 guint rxoff; /**< Receive buffer offset */
22162
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 21758
diff changeset
47 guint rxsize; /**< Receive buffer size */
20257
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
48 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: 19680
diff changeset
49 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: 19680
diff changeset
50 guint inbox_status; /**< Bit field of inbox notifications */
21758
430827922828 Avoid checking for new message in the inbox when not actually connected.
Kevin Stange <kevin@simguy.net>
parents: 20147
diff changeset
51 guint inbox_handle; /**< The handle for the mail check timer */
20257
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
52 } MsimSession;
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
53
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
54 /* 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: 19680
diff changeset
55 #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: 19680
diff changeset
56
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
57 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: 19680
diff changeset
58 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: 19680
diff changeset
59
1141d47b162c Kill CRLF line-endings to make sure this compiles on Solaris. This is a
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
60 #endif /* !_MYSPACE_SESSION_H */