Mercurial > pidgin
annotate plugins/perl/perl-common.h @ 6520:2e2593d95121
[gaim-migrate @ 7037]
Added timeout handler support to perl. It may not work. Probably should,
but who knows.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 20 Aug 2003 10:25:58 +0000 |
parents | cbd24b37350d |
children | 7c42b8ca3222 |
rev | line source |
---|---|
6508 | 1 #ifndef _GAIM_PERL_COMMON_H_ |
2 #define _GAIM_PERL_COMMON_H_ | |
3 | |
6520
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
4 #include <XSUB.h> |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
5 #include <EXTERN.h> |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
6 #include <perl.h> |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
7 #include <glib.h> |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
8 |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
9 |
6508 | 10 //#define plain_bless(object, stash) \ |
11 // sv_bless(sv_setref_pv(newRV((object)))) | |
12 | |
13 //#define plain_bless(object, stash) \ | |
14 // ((object) == NULL ? &PL_sv_undef : \ | |
15 // gaim_perl_bless_plain((stash), (object))) | |
16 | |
17 #define is_hvref(o) \ | |
18 ((o) && SvROK(o) && SvRV(o) && (SvTYPE(SvRV(o)) == SVt_PVHV)) | |
19 | |
20 #define hvref(o) \ | |
21 (is_hvref(o) ? (HV *)SvRV(o) : NULL); | |
22 | |
23 #define GAIM_PERL_BOOT(x) \ | |
24 { \ | |
25 extern void boot_Gaim__##x(pTHX_ CV *cv); \ | |
26 gaim_perl_callXS(boot_Gaim__##x, cv, mark); \ | |
27 } | |
28 | |
29 void gaim_perl_callXS(void (*subaddr)(pTHX_ CV *cv), CV *cv, SV **mark); | |
30 void gaim_perl_bless_plain(const char *stash, void *object); | |
31 SV *gaim_perl_bless_object(void *object, const char *stash); | |
32 gboolean gaim_perl_is_ref_object(SV *o); | |
33 void *gaim_perl_ref_object(SV *o); | |
34 | |
6520
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
35 int execute_perl(const char *function, int argc, char **args); |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
36 |
6508 | 37 #endif /* _GAIM_PERL_COMMON_H_ */ |