2 * @file sipe-ews-autodiscover.c
6 * Copyright (C) 2013 SIPE Project <http://sipe.sourceforge.net/>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "sipe-backend.h"
27 #include "sipe-core.h"
28 #include "sipe-core-private.h"
29 #include "sipe-ews-autodiscover.h"
31 struct sipe_ews_autodiscover_cb
{
32 sipe_ews_autodiscover_callback
*cb
;
36 struct sipe_ews_autodiscover
{
40 void sipe_ews_autodiscover_start(struct sipe_core_private
*sipe_private
,
41 sipe_ews_autodiscover_callback
*callback
,
42 gpointer callback_data
)
44 struct sipe_ews_autodiscover
*sea
= sipe_private
->ews_autodiscover
;
45 struct sipe_ews_autodiscover_cb
*sea_cb
= g_new(struct sipe_ews_autodiscover_cb
, 1);
46 sea_cb
->cb
= callback
;
47 sea_cb
->cb_data
= callback_data
;
48 sea
->callbacks
= g_slist_prepend(sea
->callbacks
, sea_cb
);
50 /* @TODO: start state machine */
51 SIPE_DEBUG_INFO_NOFORMAT("sipe_ews_autodiscover_start: triggered...");
54 void sipe_ews_autodiscover_init(struct sipe_core_private
*sipe_private
)
56 sipe_private
->ews_autodiscover
= g_new0(struct sipe_ews_autodiscover
, 1);
59 void sipe_ews_autodiscover_free(struct sipe_core_private
*sipe_private
)
61 struct sipe_ews_autodiscover
*sea
= sipe_private
->ews_autodiscover
;
62 GSList
*entry
= sea
->callbacks
;
65 struct sipe_ews_autodiscover_cb
*sea_cb
= entry
->data
;
66 sea_cb
->cb(sipe_private
, NULL
, sea_cb
->cb_data
);
70 g_slist_free(sea
->callbacks
);