Mercurial > pidgin.yaz
annotate libpurple/plugins/perl/perl-common.h @ 20613:87d559926330
Making pidgin_dialogs_about _with_parent, but using void * parent (for now)
author | Gabriel Schulhof <nix@go-nix.ca> |
---|---|
date | Sat, 22 Sep 2007 20:40:11 +0000 |
parents | 4b1e2aefeb9d |
children | 3a41eb457605 |
rev | line source |
---|---|
15823 | 1 #ifndef _PURPLE_PERL_COMMON_H_ |
2 #define _PURPLE_PERL_COMMON_H_ | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4 #include <glib.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 #ifdef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6 #undef pipe |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 #include <XSUB.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 #include <EXTERN.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 #include <perl.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 |
18210
b8572b937c09
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
12 /* XXX: perl defines it's own _ but I think it's safe to undef it */ |
b8572b937c09
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
13 #undef _ |
18448
4b1e2aefeb9d
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18210
diff
changeset
|
14 /* Dirty hack to prevent the win32 libc compat stuff from interfering with the Perl internal stuff */ |
4b1e2aefeb9d
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18210
diff
changeset
|
15 #ifdef _WIN32 |
4b1e2aefeb9d
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18210
diff
changeset
|
16 #define _WIN32DEP_H_ |
4b1e2aefeb9d
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18210
diff
changeset
|
17 #endif |
18210
b8572b937c09
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <stu@nosnilmot.com>
parents:
15823
diff
changeset
|
18 #include "internal.h" |
18448
4b1e2aefeb9d
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18210
diff
changeset
|
19 #ifdef _WIN32 |
4b1e2aefeb9d
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18210
diff
changeset
|
20 #undef _WIN32DEP_H_ |
4b1e2aefeb9d
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18210
diff
changeset
|
21 #endif |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 #include "plugin.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 #include "value.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 #define is_hvref(o) \ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 ((o) && SvROK(o) && SvRV(o) && (SvTYPE(SvRV(o)) == SVt_PVHV)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 #define hvref(o) \ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 (is_hvref(o) ? (HV *)SvRV(o) : NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 |
15823 | 31 #define PURPLE_PERL_BOOT_PROTO(x) \ |
32 void boot_Purple__##x(pTHX_ CV *cv); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 |
15823 | 34 #define PURPLE_PERL_BOOT(x) \ |
35 purple_perl_callXS(boot_Purple__##x, cv, mark) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 { |
15823 | 39 PurplePlugin *plugin; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 char *package; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 char *load_sub; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 char *unload_sub; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 char *prefs_sub; |
15823 | 44 #ifdef PURPLE_GTKPERL |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 char *gtk_prefs_sub; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 char *plugin_action_sub; |
15823 | 48 } PurplePerlScript; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 |
15823 | 50 void purple_perl_normalize_script_name(char *name); |
15374
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 SV *newSVGChar(const char *str); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 |
15823 | 54 void purple_perl_callXS(void (*subaddr)(pTHX_ CV *cv), CV *cv, SV **mark); |
55 void purple_perl_bless_plain(const char *stash, void *object); | |
56 SV *purple_perl_bless_object(void *object, const char *stash); | |
57 gboolean purple_perl_is_ref_object(SV *o); | |
58 void *purple_perl_ref_object(SV *o); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 int execute_perl(const char *function, int argc, char **args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 #if 0 |
15823 | 63 gboolean purple_perl_value_from_sv(PurpleValue *value, SV *sv); |
64 SV *purple_perl_sv_from_value(const PurpleValue *value); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 |
15823 | 67 void *purple_perl_data_from_sv(PurpleValue *value, SV *sv); |
68 SV *purple_perl_sv_from_vargs(const PurpleValue *value, va_list *args, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 void ***copy_arg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 |
15823 | 71 #endif /* _PURPLE_PERL_COMMON_H_ */ |