~ubuntu-branches/ubuntu/maverick/obexd/maverick

« back to all changes in this revision

Viewing changes to plugins/phonebook-dummy.c

  • Committer: Bazaar Package Importer
  • Author(s): Nobuhiro Iwamatsu
  • Date: 2010-04-27 04:17:15 UTC
  • mfrom: (0.1.3 sid) (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100427041715-9dv1jqg73bs6xxr9
Tags: 0.23-1
* New upstream release (Closes: #558710).
* Update debian/control.
  - Remove Filippo Giunchedi <filippo@debian.org> from uploaders.
  - Add Nobuhiro Iwamatsu to Uploaders (Closes: #564570).
  - Bumped standards-version to 3.8.4.
  - Update description (Closes: #541880).
* Add debian/source/format.
  Set source format to "1.0". 

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <config.h>
27
27
#endif
28
28
 
 
29
#include <string.h>
29
30
#include <glib.h>
30
31
 
31
 
#include <openobex/obex.h>
32
 
#include <openobex/obex_const.h>
33
 
 
 
32
#include "logging.h"
34
33
#include "phonebook.h"
35
34
 
36
 
int phonebook_pullphonebook(obex_t *obex, obex_object_t *obj,
37
 
                                struct apparam_field params)
38
 
{
39
 
        return 0;
40
 
}
41
 
 
42
 
int phonebook_pullvcardlisting(obex_t *obex, obex_object_t *obj,
43
 
                                struct apparam_field params)
44
 
{
45
 
        return 0;
46
 
}
47
 
 
48
 
int phonebook_pullvcardentry(obex_t *obex, obex_object_t *obj,
49
 
                                struct apparam_field params)
50
 
{
 
35
#define VCARD0                          \
 
36
        "BEGIN:VCARD\n"                 \
 
37
        "VERSION:3.0\n"                 \
 
38
        "N:Klaus;Santa\n"               \
 
39
        "FN:\n"                         \
 
40
        "TEL:+001122334455\n"           \
 
41
        "END:VCARD\n"
 
42
 
 
43
struct dummy_data {
 
44
        phonebook_cb    cb;
 
45
        gpointer        user_data;
 
46
        const struct apparam_field *apparams;
 
47
};
 
48
 
 
49
int phonebook_init(void)
 
50
{
 
51
        return 0;
 
52
}
 
53
 
 
54
void phonebook_exit(void)
 
55
{
 
56
}
 
57
 
 
58
static gboolean dummy_result(gpointer data)
 
59
{
 
60
        struct dummy_data *dummy = data;
 
61
 
 
62
        dummy->cb(VCARD0, strlen(VCARD0), 1, 0, dummy->user_data);
 
63
 
 
64
        return FALSE;
 
65
}
 
66
 
 
67
int phonebook_set_folder(const gchar *current_folder,
 
68
                const gchar *new_folder, guint8 flags)
 
69
{
 
70
        return 0;
 
71
}
 
72
 
 
73
int phonebook_pull(const gchar *name, const struct apparam_field *params,
 
74
                phonebook_cb cb, gpointer user_data)
 
75
{
 
76
        struct dummy_data *dummy;
 
77
 
 
78
        dummy = g_new0(struct dummy_data, 1);
 
79
        dummy->cb = cb;
 
80
        dummy->user_data = user_data;
 
81
        dummy->apparams = params;
 
82
 
 
83
        g_idle_add_full(G_PRIORITY_DEFAULT_IDLE,
 
84
                        dummy_result, dummy, g_free);
51
85
        return 0;
52
86
}