Mon, 05 Jan 2015 01:48:13 +0530
Merged default branch
| 15884 | 1 | #ifndef _PURPLE_PERL_COMMON_H_ |
| 2 | #define _PURPLE_PERL_COMMON_H_ | |
| 6508 | 3 | |
|
6816
b14a3043ed09
[gaim-migrate @ 7356]
Herman Bloggs <herman@bluedigits.com>
parents:
6566
diff
changeset
|
4 | #include <glib.h> |
|
b14a3043ed09
[gaim-migrate @ 7356]
Herman Bloggs <herman@bluedigits.com>
parents:
6566
diff
changeset
|
5 | #ifdef _WIN32 |
|
b14a3043ed09
[gaim-migrate @ 7356]
Herman Bloggs <herman@bluedigits.com>
parents:
6566
diff
changeset
|
6 | #undef pipe |
|
b14a3043ed09
[gaim-migrate @ 7356]
Herman Bloggs <herman@bluedigits.com>
parents:
6566
diff
changeset
|
7 | #endif |
|
35981
e8c02ea0800b
Backport warning fixes for perl from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
29809
diff
changeset
|
8 | |
|
e8c02ea0800b
Backport warning fixes for perl from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
29809
diff
changeset
|
9 | #define SILENT_NO_TAINT_SUPPORT 0 |
|
e8c02ea0800b
Backport warning fixes for perl from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
29809
diff
changeset
|
10 | #define NO_TAINT_SUPPORT 0 |
|
e8c02ea0800b
Backport warning fixes for perl from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
29809
diff
changeset
|
11 | |
|
23916
76b2c63d074c
EXTERN.h should be included before perl.h
Daniel Atallah <datallah@pidgin.im>
parents:
23915
diff
changeset
|
12 | #include <EXTERN.h> |
|
23915
b62601fd6e7d
Update the Perl plugin loader to work with Perl 5.10.
Daniel Atallah <datallah@pidgin.im>
parents:
22839
diff
changeset
|
13 | #include <perl.h> |
|
6520
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
14 | #include <XSUB.h> |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
15 | |
|
18273
e61c53184c52
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
16 | /* XXX: perl defines it's own _ but I think it's safe to undef it */ |
|
e61c53184c52
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
17 | #undef _ |
|
18633
34ba43198355
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <datallah@pidgin.im>
parents:
18273
diff
changeset
|
18 | /* Dirty hack to prevent the win32 libc compat stuff from interfering with the Perl internal stuff */ |
|
34ba43198355
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <datallah@pidgin.im>
parents:
18273
diff
changeset
|
19 | #ifdef _WIN32 |
|
34ba43198355
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <datallah@pidgin.im>
parents:
18273
diff
changeset
|
20 | #define _WIN32DEP_H_ |
|
34ba43198355
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <datallah@pidgin.im>
parents:
18273
diff
changeset
|
21 | #endif |
|
18273
e61c53184c52
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
22 | #include "internal.h" |
|
18633
34ba43198355
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <datallah@pidgin.im>
parents:
18273
diff
changeset
|
23 | #ifdef _WIN32 |
|
34ba43198355
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <datallah@pidgin.im>
parents:
18273
diff
changeset
|
24 | #undef _WIN32DEP_H_ |
|
34ba43198355
Fix the win32 build. Thanks to Etan and Lee Roach. Fixes #1929.
Daniel Atallah <datallah@pidgin.im>
parents:
18273
diff
changeset
|
25 | #endif |
|
36367
891eea799578
Renamed plugin.[ch] to plugins.[ch], since we (will) no longer have a PurplePlugin structure.
Ankit Vani <a@nevitus.org>
parents:
34802
diff
changeset
|
26 | #include "plugins.h" |
|
6566
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
27 | |
| 6508 | 28 | #define is_hvref(o) \ |
| 29 | ((o) && SvROK(o) && SvRV(o) && (SvTYPE(SvRV(o)) == SVt_PVHV)) | |
| 30 | ||
| 31 | #define hvref(o) \ | |
| 32 | (is_hvref(o) ? (HV *)SvRV(o) : NULL); | |
| 33 | ||
| 15884 | 34 | #define PURPLE_PERL_BOOT_PROTO(x) \ |
| 35 | void boot_Purple__##x(pTHX_ CV *cv); | |
|
12419
745d9e5460ea
[gaim-migrate @ 14726]
Richard Laager <rlaager@pidgin.im>
parents:
11170
diff
changeset
|
36 | |
| 15884 | 37 | #define PURPLE_PERL_BOOT(x) \ |
| 38 | purple_perl_callXS(boot_Purple__##x, cv, mark) | |
| 6508 | 39 | |
|
34455
cdc53b913dd4
Clang warnings: gg prpl and perl's SvUPGRADE
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33906
diff
changeset
|
40 | #ifdef HAVE_NEW_SVUPGRADE |
|
cdc53b913dd4
Clang warnings: gg prpl and perl's SvUPGRADE
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33906
diff
changeset
|
41 | # define SvUPGRADE_common(a, b) SvUPGRADE(a, b) |
|
cdc53b913dd4
Clang warnings: gg prpl and perl's SvUPGRADE
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33906
diff
changeset
|
42 | #else |
|
cdc53b913dd4
Clang warnings: gg prpl and perl's SvUPGRADE
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33906
diff
changeset
|
43 | # define SvUPGRADE_common(a, b) if (!SvUPGRADE(a, b)) { croak("Cannot upgrade variable"); } |
|
cdc53b913dd4
Clang warnings: gg prpl and perl's SvUPGRADE
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33906
diff
changeset
|
44 | #endif |
|
cdc53b913dd4
Clang warnings: gg prpl and perl's SvUPGRADE
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33906
diff
changeset
|
45 | |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
29809
diff
changeset
|
46 | typedef struct _PurplePerlInfoStrings PurplePerlInfoStrings; |
|
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
29809
diff
changeset
|
47 | |
| 12872 | 48 | typedef struct |
| 49 | { | |
| 15884 | 50 | PurplePlugin *plugin; |
|
33906
dc870eacc2d0
Change char* to const char* in PurplePluginInfo
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
29809
diff
changeset
|
51 | PurplePerlInfoStrings *info_strings; |
| 12872 | 52 | char *package; |
| 53 | char *load_sub; | |
| 54 | char *unload_sub; | |
| 55 | char *prefs_sub; | |
| 15884 | 56 | #ifdef PURPLE_GTKPERL |
| 12872 | 57 | char *gtk_prefs_sub; |
|
14426
8d4f164c4979
[gaim-migrate @ 17070]
Daniel Atallah <datallah@pidgin.im>
parents:
14254
diff
changeset
|
58 | #endif |
| 12988 | 59 | char *plugin_action_sub; |
| 15884 | 60 | } PurplePerlScript; |
| 12872 | 61 | |
| 15884 | 62 | void purple_perl_normalize_script_name(char *name); |
| 11170 | 63 | |
|
6566
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
64 | SV *newSVGChar(const char *str); |
|
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
65 | |
| 15884 | 66 | void purple_perl_callXS(void (*subaddr)(pTHX_ CV *cv), CV *cv, SV **mark); |
| 67 | void purple_perl_bless_plain(const char *stash, void *object); | |
| 68 | SV *purple_perl_bless_object(void *object, const char *stash); | |
| 69 | gboolean purple_perl_is_ref_object(SV *o); | |
| 70 | void *purple_perl_ref_object(SV *o); | |
| 6508 | 71 | |
|
6520
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
72 | int execute_perl(const char *function, int argc, char **args); |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
73 | |
|
6566
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
74 | #if 0 |
| 15884 | 75 | gboolean purple_perl_value_from_sv(PurpleValue *value, SV *sv); |
| 76 | SV *purple_perl_sv_from_value(const PurpleValue *value); | |
|
6566
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
77 | #endif |
|
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
78 | |
|
34802
4ea5cddeefc4
Refactored perl-common to use GType instead of PurpleValue.
Ankit Vani <a@nevitus.org>
parents:
34799
diff
changeset
|
79 | void *purple_perl_data_from_sv(GType type, SV *sv); |
|
4ea5cddeefc4
Refactored perl-common to use GType instead of PurpleValue.
Ankit Vani <a@nevitus.org>
parents:
34799
diff
changeset
|
80 | SV *purple_perl_sv_from_vargs(GType type, va_list *args, void ***copy_arg); |
|
22839
3ee4247ebbbd
Use the same fix for Purple::Util::fetch_url (from 4b6378d5e) for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18633
diff
changeset
|
81 | SV *purple_perl_sv_from_fun(PurplePlugin *plugin, SV *callback); |
| 15884 | 82 | #endif /* _PURPLE_PERL_COMMON_H_ */ |