File: test_open_account.c

package info (click to toggle)
modest 3.90.4-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,400 kB
  • ctags: 8,562
  • sloc: ansic: 88,775; makefile: 959; xml: 122; sh: 57
file content (38 lines) | stat: -rw-r--r-- 807 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <libmodest-dbus-client/libmodest-dbus-client.h>
#include <stdio.h>

int
main (int argc, char *argv[])
{
	osso_context_t *osso_context;
	const char *url = NULL;
      	gboolean ret;

	osso_context = osso_initialize ("test_open_account",
					"0.0.1",
					TRUE,
					NULL);

	if (osso_context == NULL) {
		g_printerr ("osso_initialize() failed.\n");
	    return -1;
	}

	if (argc == 2) {
		url = argv[1];
	} else {
		g_printerr ("No account ID argument supplied on the command line.\n");
		return -1;
	}

	g_print ("Trying to open msg: %s\n", url);
	ret = libmodest_dbus_client_open_account (osso_context, url);

	if (!ret) {
		g_printerr ("libmodest_dbus_client_open_account () failed.\n");
	} else {
		g_print ("libmodest_dbus_client_open_account () succeeded.\n");
	}

    return ret ? 0 : -1;
}