Tue, 01 May 2007 02:34:22 +0000
Remove the const-c and const-xs stuff and replace it with real constants
exposed to perl.
| 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 |
|
6520
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
8 | #include <XSUB.h> |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
9 | #include <EXTERN.h> |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
10 | #include <perl.h> |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
11 | |
| 12872 | 12 | #include "plugin.h" |
|
6566
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
13 | #include "value.h" |
|
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
14 | |
| 6508 | 15 | #define is_hvref(o) \ |
| 16 | ((o) && SvROK(o) && SvRV(o) && (SvTYPE(SvRV(o)) == SVt_PVHV)) | |
| 17 | ||
| 18 | #define hvref(o) \ | |
| 19 | (is_hvref(o) ? (HV *)SvRV(o) : NULL); | |
| 20 | ||
| 15884 | 21 | #define PURPLE_PERL_BOOT_PROTO(x) \ |
| 22 | void boot_Purple__##x(pTHX_ CV *cv); | |
|
12419
745d9e5460ea
[gaim-migrate @ 14726]
Richard Laager <rlaager@pidgin.im>
parents:
11170
diff
changeset
|
23 | |
| 15884 | 24 | #define PURPLE_PERL_BOOT(x) \ |
| 25 | purple_perl_callXS(boot_Purple__##x, cv, mark) | |
| 6508 | 26 | |
| 12872 | 27 | typedef struct |
| 28 | { | |
| 15884 | 29 | PurplePlugin *plugin; |
| 12872 | 30 | char *package; |
| 31 | char *load_sub; | |
| 32 | char *unload_sub; | |
| 33 | char *prefs_sub; | |
| 15884 | 34 | #ifdef PURPLE_GTKPERL |
| 12872 | 35 | char *gtk_prefs_sub; |
|
14426
8d4f164c4979
[gaim-migrate @ 17070]
Daniel Atallah <datallah@pidgin.im>
parents:
14254
diff
changeset
|
36 | #endif |
| 12988 | 37 | char *plugin_action_sub; |
| 15884 | 38 | } PurplePerlScript; |
| 12872 | 39 | |
| 15884 | 40 | void purple_perl_normalize_script_name(char *name); |
| 11170 | 41 | |
|
6566
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
42 | SV *newSVGChar(const char *str); |
|
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
43 | |
| 15884 | 44 | void purple_perl_callXS(void (*subaddr)(pTHX_ CV *cv), CV *cv, SV **mark); |
| 45 | void purple_perl_bless_plain(const char *stash, void *object); | |
| 46 | SV *purple_perl_bless_object(void *object, const char *stash); | |
| 47 | gboolean purple_perl_is_ref_object(SV *o); | |
| 48 | void *purple_perl_ref_object(SV *o); | |
| 6508 | 49 | |
|
6520
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
50 | int execute_perl(const char *function, int argc, char **args); |
|
5386692555c9
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
51 | |
|
6566
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
52 | #if 0 |
| 15884 | 53 | gboolean purple_perl_value_from_sv(PurpleValue *value, SV *sv); |
| 54 | SV *purple_perl_sv_from_value(const PurpleValue *value); | |
|
6566
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
55 | #endif |
|
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
56 | |
| 15884 | 57 | void *purple_perl_data_from_sv(PurpleValue *value, SV *sv); |
| 58 | SV *purple_perl_sv_from_vargs(const PurpleValue *value, va_list *args, | |
| 12871 | 59 | void ***copy_arg); |
|
6566
61eb35202526
[gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
60 | |
| 15884 | 61 | #endif /* _PURPLE_PERL_COMMON_H_ */ |