Mercurial > pidgin
annotate libpurple/plugins/perl/common/Prpl.xs @ 31772:d5a00aa868f3
Fix up several Tcl loader string copies to use g_strlcpy().
Thanks to the Electronic Frontier Foundation (https://www.eff.org/)
for the foundation of this patch.
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Sun, 17 Jul 2011 17:34:55 +0000 |
parents | 1e5b69e67677 |
children |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 #include "module.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
3 MODULE = Purple::Prpl PACKAGE = Purple::Find PREFIX = purple_find_ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4 PROTOTYPES: ENABLE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
6 Purple::Plugin |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
7 purple_find_prpl(id) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 const char *id |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
10 MODULE = Purple::Prpl PACKAGE = Purple::Prpl PREFIX = purple_prpl_ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 PROTOTYPES: ENABLE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
14 purple_prpl_change_account_status(account, old_status, new_status) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
15 Purple::Account account |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
16 Purple::Status old_status |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
17 Purple::Status new_status |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
20 purple_prpl_get_statuses(account, presence) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
21 Purple::Account account |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
22 Purple::Presence presence |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 PREINIT: |
21776
4b33d4185342
A couple more similar leak fixes though some of these still leak if the
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
24 GList *l, *ll; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 PPCODE: |
21776
4b33d4185342
A couple more similar leak fixes though some of these still leak if the
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
26 ll = purple_prpl_get_statuses(account,presence); |
4b33d4185342
A couple more similar leak fixes though some of these still leak if the
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
27 for (l = ll; l != NULL; l = l->next) { |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
28 XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Status"))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 } |
21776
4b33d4185342
A couple more similar leak fixes though some of these still leak if the
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
30 /* We can free the list here but the script needs to free the |
4b33d4185342
A couple more similar leak fixes though some of these still leak if the
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
31 * Purple::Status 'objects' itself. */ |
4b33d4185342
A couple more similar leak fixes though some of these still leak if the
Etan Reisner <pidgin@unreliablesource.net>
parents:
15833
diff
changeset
|
32 g_list_free(ll); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
35 purple_prpl_got_account_idle(account, idle, idle_time) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
36 Purple::Account account |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 gboolean idle |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 time_t idle_time |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
41 purple_prpl_got_account_login_time(account, login_time) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
42 Purple::Account account |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 time_t login_time |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
46 purple_prpl_got_user_idle(account, name, idle, idle_time) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
47 Purple::Account account |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 gboolean idle |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 time_t idle_time |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
53 purple_prpl_got_user_login_time(account, name, login_time) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
54 Purple::Account account |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 const char *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 time_t login_time |
21844
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
57 |
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
58 int |
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
59 purple_prpl_send_raw(gc, str) |
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
60 Purple::Connection gc |
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
61 const char *str |
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
62 PREINIT: |
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
63 PurplePluginProtocolInfo *prpl_info; |
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
64 CODE: |
28340
1e5b69e67677
Don't crash when $gc is undefined in a call to Purple::Prpl::send_raw.
Paul Aurich <paul@darkrain42.org>
parents:
21844
diff
changeset
|
65 if (!gc) |
21844
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
66 RETVAL = 0; |
28340
1e5b69e67677
Don't crash when $gc is undefined in a call to Purple::Prpl::send_raw.
Paul Aurich <paul@darkrain42.org>
parents:
21844
diff
changeset
|
67 else { |
1e5b69e67677
Don't crash when $gc is undefined in a call to Purple::Prpl::send_raw.
Paul Aurich <paul@darkrain42.org>
parents:
21844
diff
changeset
|
68 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); |
1e5b69e67677
Don't crash when $gc is undefined in a call to Purple::Prpl::send_raw.
Paul Aurich <paul@darkrain42.org>
parents:
21844
diff
changeset
|
69 if (prpl_info && prpl_info->send_raw != NULL) { |
1e5b69e67677
Don't crash when $gc is undefined in a call to Purple::Prpl::send_raw.
Paul Aurich <paul@darkrain42.org>
parents:
21844
diff
changeset
|
70 RETVAL = prpl_info->send_raw(gc, str, strlen(str)); |
1e5b69e67677
Don't crash when $gc is undefined in a call to Purple::Prpl::send_raw.
Paul Aurich <paul@darkrain42.org>
parents:
21844
diff
changeset
|
71 } else { |
1e5b69e67677
Don't crash when $gc is undefined in a call to Purple::Prpl::send_raw.
Paul Aurich <paul@darkrain42.org>
parents:
21844
diff
changeset
|
72 RETVAL = 0; |
1e5b69e67677
Don't crash when $gc is undefined in a call to Purple::Prpl::send_raw.
Paul Aurich <paul@darkrain42.org>
parents:
21844
diff
changeset
|
73 } |
21844
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
74 } |
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
75 OUTPUT: |
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
76 RETVAL |
ced3eaff3465
Add send_raw to Perl bindings. Patch from martijn. Fixes #3505
Sean Egan <seanegan@gmail.com>
parents:
21776
diff
changeset
|
77 |