Fix #3001523: Cancelling a long pending file transfer crashes Pidgin
[siplcs.git] / src / core / sipe-core-private.h
blob8373fd9d7226b82e87b4ea7f18d94b8de3e828d0
1 /**
2 * @file sipe-core-private.h
4 * pidgin-sipe
6 * Copyright (C) 2010 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* Forward declarations */
24 struct sipe_service_data;
25 struct sipe_media_call_private;
27 /**
28 * Private part of the Sipe data structure
30 * This part contains the information only needed by the core
32 struct sipe_account_data; /* to be removed... */
33 struct sipe_core_private {
34 /**
35 * The public part is the first item, i.e. a pointer to the
36 * public part can also be used as a pointer to the private part.
38 struct sipe_core_public public;
40 /* SIP transport information */
41 struct sipe_transport_connection *transport;
42 const struct sipe_service_data *service_data;
43 guint transport_type;
44 gchar *server_name;
45 guint server_port;
46 gchar *server_version;
47 GSList *transactions;
49 /* SIPE protocol information */
50 gchar *username;
51 gchar *contact;
52 gchar *epid;
53 GSList *sessions;
55 /* Buddies */
56 GHashTable *buddies;
58 /* Scheduling system */
59 GSList *timeouts;
61 /* misc. stuff */
62 gchar *useragent;
64 /* Voice call */
65 struct sipe_media_call_private *media_call;
67 /* the original data structure*/
68 struct sipe_account_data *temporary;
71 /**
72 * Flags - stored in sipe_core_public.flags but names not exported
74 #define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000 /* server is OCS2007+ */
76 #define SIPE_CORE_PUBLIC_FLAG_IS(flag) \
77 ((sipe_private->public.flags & SIPE_CORE_FLAG_ ## flag) == SIPE_CORE_FLAG_ ## flag)
78 #define SIPE_CORE_PUBLIC_FLAG_SET(flag) \
79 (sipe_private->public.flags |= SIPE_CORE_FLAG_ ## flag)
80 #define SIPE_CORE_PUBLIC_FLAG_UNSET(flag) \
81 (sipe_private->public.flags &= ~SIPE_CORE_FLAG_ ## flag)
82 #define SIPE_CORE_PRIVATE_FLAG_IS(flag) \
83 ((sipe_private->public.flags & SIPE_CORE_PRIVATE_FLAG_ ## flag) == SIPE_CORE_PRIVATE_FLAG_ ## flag)
84 #define SIPE_CORE_PRIVATE_FLAG_SET(flag) \
85 (sipe_private->public.flags |= SIPE_CORE_PRIVATE_FLAG_ ## flag)
86 #define SIPE_CORE_PRIVATE_FLAG_UNSET(flag) \
87 (sipe_private->public.flags &= ~SIPE_CORE_PRIVATE_FLAG_ ## flag)
89 /* Convenience macros */
90 #define SIPE_CORE_PRIVATE ((struct sipe_core_private *)sipe_public)
91 #define SIPE_CORE_PUBLIC ((struct sipe_core_public *)sipe_private)
93 /* Transition macros */
94 #define SIPE_ACCOUNT_DATA SIPE_CORE_PRIVATE->temporary
95 #define SIPE_ACCOUNT_DATA_PRIVATE sipe_private->temporary
98 Local Variables:
99 mode: c
100 c-file-style: "bsd"
101 indent-tabs-mode: t
102 tab-width: 8
103 End: