Mercurial > pidgin
comparison src/perl.c @ 3630:9682c0e022c6
[gaim-migrate @ 3753]
Yeah this will probably break a lot of shit knowing my luck. But hey, I really don't care what people thnk.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Fri, 11 Oct 2002 03:14:01 +0000 |
parents | 163205125ee2 |
children | 31480901bf29 |
comparison
equal
deleted
inserted
replaced
3629:afc5bb164c5a | 3630:9682c0e022c6 |
---|---|
33 #undef PACKAGE | 33 #undef PACKAGE |
34 | 34 |
35 #ifdef USE_PERL | 35 #ifdef USE_PERL |
36 | 36 |
37 #define group perl_group | 37 #define group perl_group |
38 | 38 #ifdef _WIN32 |
39 /* This took me an age to figure out.. without this __declspec(dllimport) | |
40 * will be ignored. | |
41 */ | |
42 #define HASATTRIBUTE | |
43 #endif | |
39 #include <EXTERN.h> | 44 #include <EXTERN.h> |
40 #ifndef _SEM_SEMUN_UNDEFINED | 45 #ifndef _SEM_SEMUN_UNDEFINED |
41 #define HAS_UNION_SEMUN | 46 #define HAS_UNION_SEMUN |
42 #endif | 47 #endif |
43 #include <perl.h> | 48 #include <perl.h> |
44 #include <XSUB.h> | 49 #include <XSUB.h> |
50 #ifndef _WIN32 | |
45 #include <sys/mman.h> | 51 #include <sys/mman.h> |
52 #endif | |
46 #include <sys/types.h> | 53 #include <sys/types.h> |
47 #include <sys/stat.h> | 54 #include <sys/stat.h> |
48 #include <fcntl.h> | 55 #include <fcntl.h> |
49 #undef PACKAGE | 56 #undef PACKAGE |
50 #include <stdio.h> | 57 #include <stdio.h> |
58 #ifndef _WIN32 | |
51 #include <dirent.h> | 59 #include <dirent.h> |
60 #else | |
61 /* We're using perl's win32 port of this */ | |
62 #define dirent direct | |
63 #endif | |
52 #include <string.h> | 64 #include <string.h> |
53 | 65 |
54 #undef group | 66 #undef group |
55 | 67 |
56 /* perl module support */ | 68 /* perl module support */ |
58 extern void boot_DynaLoader _((CV * cv)); /* perl is so wacky */ | 70 extern void boot_DynaLoader _((CV * cv)); /* perl is so wacky */ |
59 | 71 |
60 #undef _ | 72 #undef _ |
61 #ifdef DEBUG | 73 #ifdef DEBUG |
62 #undef DEBUG | 74 #undef DEBUG |
75 #endif | |
76 #ifdef _WIN32 | |
77 #undef pipe | |
63 #endif | 78 #endif |
64 #include "gaim.h" | 79 #include "gaim.h" |
65 #include "prpl.h" | 80 #include "prpl.h" |
66 | 81 |
67 struct perlscript { | 82 struct perlscript { |
183 count = perl_call_argv(function, G_EVAL | G_SCALAR, perl_args); | 198 count = perl_call_argv(function, G_EVAL | G_SCALAR, perl_args); |
184 SPAGAIN; | 199 SPAGAIN; |
185 | 200 |
186 sv = GvSV(gv_fetchpv("@", TRUE, SVt_PV)); | 201 sv = GvSV(gv_fetchpv("@", TRUE, SVt_PV)); |
187 if (SvTRUE(sv)) { | 202 if (SvTRUE(sv)) { |
188 snprintf(buf, 512, "Perl error: %s\n", SvPV(sv, count)); | 203 g_snprintf(buf, 512, "Perl error: %s\n", SvPV(sv, count)); |
189 debug_printf(buf); | 204 debug_printf(buf); |
190 POPs; | 205 POPs; |
191 } else if (count != 1) { | 206 } else if (count != 1) { |
192 snprintf(buf, 512, "Perl error: expected 1 value from %s, " | 207 g_snprintf(buf, 512, "Perl error: expected 1 value from %s, " |
193 "got: %d\n", function, count); | 208 "got: %d\n", function, count); |
194 debug_printf(buf); | 209 debug_printf(buf); |
195 } else { | 210 } else { |
196 ret_value = POPi; | 211 ret_value = POPi; |
197 } | 212 } |