Mercurial > pidgin.yaz
annotate plugins/perl/common/Cmds.xs @ 13381:d1b29fb3b6d0
[gaim-migrate @ 15754]
peer_connection->conn appears to be NULL in certain situations, it is preferable not to crash when this happens.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 02 Mar 2006 22:55:12 +0000 |
parents | 3ab3e68df807 |
children |
rev | line source |
---|---|
11118 | 1 #include "module.h" |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
2 #include "../perl-handlers.h" |
11118 | 3 |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
4 MODULE = Gaim::Cmd PACKAGE = Gaim::Cmd PREFIX = gaim_cmd_ |
11118 | 5 PROTOTYPES: ENABLE |
6 | |
7 void | |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
8 gaim_cmd_help(conv, command) |
11118 | 9 Gaim::Conversation conv |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
10 const gchar *command |
11118 | 11 PREINIT: |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
12 GList *l; |
11118 | 13 PPCODE: |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
14 for (l = gaim_cmd_help(conv, command); l != NULL; l = l->next) { |
12892
3ab3e68df807
[gaim-migrate @ 15245]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12882
diff
changeset
|
15 XPUSHs(sv_2mortal(newSVpv(l->data, 0))); |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
16 } |
11118 | 17 |
18 void | |
19 gaim_cmd_list(conv) | |
20 Gaim::Conversation conv | |
21 PREINIT: | |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
22 GList *l; |
11118 | 23 PPCODE: |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
24 for (l = gaim_cmd_list(conv); l != NULL; l = l->next) { |
12892
3ab3e68df807
[gaim-migrate @ 15245]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12882
diff
changeset
|
25 XPUSHs(sv_2mortal(newSVpv(l->data, 0))); |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
26 } |
11118 | 27 |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
28 Gaim::Cmd::Id |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
29 gaim_cmd_register(plugin, command, args, priority, flag, prpl_id, func, helpstr, data = 0) |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
30 Gaim::Plugin plugin |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
31 const gchar *command |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
32 const gchar *args |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
33 Gaim::Cmd::Priority priority |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
34 Gaim::Cmd::Flag flag |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
35 const gchar *prpl_id |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
36 SV *func |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
37 const gchar *helpstr |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
38 SV *data |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
39 CODE: |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
40 RETVAL = gaim_perl_cmd_register(plugin, command, args, priority, flag, |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
41 prpl_id, func, helpstr, data); |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
42 OUTPUT: |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
43 RETVAL |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
44 |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
45 void |
11118 | 46 gaim_cmd_unregister(id) |
12882
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
47 Gaim::Cmd::Id id |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
48 CODE: |
e1603fd610fa
[gaim-migrate @ 15234]
Etan Reisner <pidgin@unreliablesource.net>
parents:
11290
diff
changeset
|
49 gaim_perl_cmd_unregister(id); |