~ubuntu-branches/ubuntu/maverick/telepathy-glib/maverick

« back to all changes in this revision

Viewing changes to examples/future/call-cm/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Simon McVittie
  • Date: 2010-05-10 17:59:54 UTC
  • mfrom: (1.6.1 upstream) (27.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100510175954-bxvqq3xx0sy4itmp
Tags: 0.11.5-1
New upstream version with new API/ABI

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * main.c - entry point for an example Telepathy connection manager
 
3
 *
 
4
 * Copyright © 2007-2009 Collabora Ltd. <http://www.collabora.co.uk/>
 
5
 * Copyright © 2007-2009 Nokia Corporation
 
6
 *
 
7
 * This library is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU Lesser General Public
 
9
 * License as published by the Free Software Foundation; either
 
10
 * version 2.1 of the License, or (at your option) any later version.
 
11
 *
 
12
 * This library is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
 * Lesser General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU Lesser General Public
 
18
 * License along with this library; if not, write to the Free Software
 
19
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
20
 */
 
21
 
 
22
#include "config.h"
 
23
 
 
24
#include <telepathy-glib/debug.h>
 
25
#include <telepathy-glib/run.h>
 
26
 
 
27
#include "extensions/extensions.h"
 
28
 
 
29
#include "cm.h"
 
30
 
 
31
static TpBaseConnectionManager *
 
32
construct_cm (void)
 
33
{
 
34
  return (TpBaseConnectionManager *) g_object_new (
 
35
      EXAMPLE_TYPE_CALL_CONNECTION_MANAGER,
 
36
      NULL);
 
37
}
 
38
 
 
39
int
 
40
main (int argc,
 
41
      char **argv)
 
42
{
 
43
#ifdef ENABLE_DEBUG
 
44
  tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE"));
 
45
  tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG"));
 
46
 
 
47
  if (g_getenv ("EXAMPLE_TIMING") != NULL)
 
48
    g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL);
 
49
 
 
50
  if (g_getenv ("EXAMPLE_PERSIST") != NULL)
 
51
    tp_debug_set_persistent (TRUE);
 
52
#endif
 
53
 
 
54
  /* strictly speaking, this is only necessary for client code, but it's
 
55
   * harmless here */
 
56
  g_type_init ();
 
57
  future_cli_init ();
 
58
 
 
59
  return tp_run_connection_manager ("telepathy-example-cm-call",
 
60
      VERSION, construct_cm, argc, argv);
 
61
}