summaryrefslogtreecommitdiff
path: root/libpurple/plugins/perl/common/Connection.xs
blob: 473cd56bdb5df7c290cbcbea2abfe4b9712d8247 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include "module.h"

MODULE = Purple::Connection  PACKAGE = Purple::Connection  PREFIX = purple_connection_
PROTOTYPES: ENABLE

BOOT:
{
	HV *stash = gv_stashpv("Purple::Connection::State", 1);

	static const constiv *civ, const_iv[] = {
#define const_iv(name) {#name, (IV)PURPLE_##name}
		const_iv(DISCONNECTED),
		const_iv(CONNECTED),
		const_iv(CONNECTING),
	};

	for (civ = const_iv + sizeof(const_iv) / sizeof(const_iv[0]); civ-- > const_iv; )
		newCONSTSUB(stash, (char *)civ->name, newSViv(civ->iv));
}

Purple::Account
purple_connection_get_account(gc)
	Purple::Connection gc

const char *
purple_connection_get_password(gc)
	Purple::Connection gc

const char *
purple_connection_get_display_name(gc)
	Purple::Connection gc

void
purple_connection_notice(gc, text)
	Purple::Connection gc
	const char *text

void
purple_connection_destroy(gc)
	Purple::Connection gc

void
purple_connection_set_state(gc, state)
	Purple::Connection gc
	Purple::ConnectionState state

void
purple_connection_set_account(gc, account)
	Purple::Connection gc
	Purple::Account account

void
purple_connection_set_display_name(gc, name)
	Purple::Connection gc
	const char *name

Purple::ConnectionState
purple_connection_get_state(gc)
	Purple::Connection gc

MODULE = Purple::Connection  PACKAGE = Purple::Connections  PREFIX = purple_connections_
PROTOTYPES: ENABLE

void
purple_connections_disconnect_all()

void
purple_connections_get_all()
PREINIT:
	GList *l;
PPCODE:
	for (l = purple_connections_get_all(); l != NULL; l = l->next) {
		XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Connection")));
	}

void
purple_connections_get_connecting()
PREINIT:
	GList *l;
PPCODE:
	for (l = purple_connections_get_connecting(); l != NULL; l = l->next) {
		XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Connection")));
	}

Purple::Handle
purple_connections_get_handle()