2 * @file sipe-core-private.h
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
;
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
{
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
;
46 gchar
*server_version
;
49 /* SIPE protocol information */
58 /* Scheduling system */
65 struct sipe_media_call_private
*media_call
;
67 /* the original data structure*/
68 struct sipe_account_data
*temporary
;
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