1
#ifndef DBUS_API_SUBJECT_TO_CHANGE
2
#define DBUS_API_SUBJECT_TO_CHANGE
8
#include "purple-client.h"
11
This example demonstrates how to use libpurple-client to communicate
12
with purple. The names and signatures of functions provided by
13
libpurple-client are the same as those in purple. However, all
14
structures (such as PurpleAccount) are opaque, that is, you can only
15
use pointer to them. In fact, these pointers DO NOT actually point
16
to anything, they are just integer identifiers of assigned to these
17
structures by purple. So NEVER try to dereference these pointers.
18
Integer ids as disguised as pointers to provide type checking and
19
prevent mistakes such as passing an id of PurpleAccount when an id of
20
PurpleBuddy is expected. According to glib manual, this technique is
24
int main (int argc, char **argv)
30
alist = purple_accounts_get_all();
31
for (node = alist; node != NULL; node = node->next)
33
PurpleAccount *account = (PurpleAccount*) node->data;
34
char *name = purple_account_get_username(account);
35
g_print("Name: %s\n", name);