libpurple/plugins/perl/common/Connection.xs

Wed, 13 May 2009 20:29:03 +0000

author
Marcus Lundblad <malu@pidgin.im>
date
Wed, 13 May 2009 20:29:03 +0000
changeset 27110
05ca719b901b
parent 23987
3d41ccd1f8bf
child 32155
a9cddca725ce
permissions
-rw-r--r--

Support custom smileys in MUCs (when all participants support BoB and a maximum
of 10 participants are in the chat).
Always announce support for BoB, since disable custom smileys will still turn
off fetching them, and BoB can be used for other purposes further on.

6584
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 #include "module.h"
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
3 MODULE = Purple::Connection PACKAGE = Purple::Connection PREFIX = purple_connection_
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
4 PROTOTYPES: ENABLE
6584
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5
16773
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
6 BOOT:
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
7 {
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
8 HV *stash = gv_stashpv("Purple::Connection::State", 1);
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
9
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
10 static const constiv *civ, const_iv[] = {
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
11 #define const_iv(name) {#name, (IV)PURPLE_##name}
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
12 const_iv(DISCONNECTED),
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
13 const_iv(CONNECTED),
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
14 const_iv(CONNECTING),
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
15 };
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
16
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
17 for (civ = const_iv + sizeof(const_iv) / sizeof(const_iv[0]); civ-- > const_iv; )
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
18 newCONSTSUB(stash, (char *)civ->name, newSViv(civ->iv));
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
19 }
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
20
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
21 Purple::Account
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
22 purple_connection_get_account(gc)
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
23 Purple::Connection gc
6584
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 const char *
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
26 purple_connection_get_password(gc)
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
27 Purple::Connection gc
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
28
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
29 const char *
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
30 purple_connection_get_display_name(gc)
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
31 Purple::Connection gc
6584
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32
12787
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
33 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
34 purple_connection_notice(gc, text)
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
35 Purple::Connection gc
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
36 const char *text
6584
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37
12787
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
38 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
39 purple_connection_error(gc, reason)
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
40 Purple::Connection gc
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
41 const char *reason
6584
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42
12787
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
43 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
44 purple_connection_destroy(gc)
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
45 Purple::Connection gc
12787
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
46
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
47 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
48 purple_connection_set_state(gc, state)
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
49 Purple::Connection gc
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
50 Purple::ConnectionState state
12787
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
51
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
52 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
53 purple_connection_set_account(gc, account)
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
54 Purple::Connection gc
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
55 Purple::Account account
12787
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
56
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
57 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
58 purple_connection_set_display_name(gc, name)
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
59 Purple::Connection gc
12787
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
60 const char *name
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
61
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
62 Purple::ConnectionState
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
63 purple_connection_get_state(gc)
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
64 Purple::Connection gc
12787
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
65
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
66 MODULE = Purple::Connection PACKAGE = Purple::Connections PREFIX = purple_connections_
12787
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
67 PROTOTYPES: ENABLE
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
68
5a9252acf655 [gaim-migrate @ 15134]
Etan Reisner <deryni@pidgin.im>
parents: 11290
diff changeset
69 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
70 purple_connections_disconnect_all()
6584
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
72 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
73 purple_connections_get_all()
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
74 PREINIT:
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
75 GList *l;
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
76 PPCODE:
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
77 for (l = purple_connections_get_all(); l != NULL; l = l->next) {
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
78 XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Connection")));
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
79 }
6584
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
82 purple_connections_get_connecting()
6584
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 PREINIT:
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 GList *l;
9785a533d08e [gaim-migrate @ 7106]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 PPCODE:
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
86 for (l = purple_connections_get_connecting(); l != NULL; l = l->next) {
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
87 XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Connection")));
11118
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
88 }
36db35a9da56 [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents: 6584
diff changeset
89
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
90 Purple::Handle
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
91 purple_connections_get_handle()

mercurial