comparison src/perl.c @ 3395:c731327dbc47

[gaim-migrate @ 3414] Thanks to Timothy Lee and Dan Colascione for gettiing perl 5.8 to work. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Fri, 16 Aug 2002 01:18:01 +0000
parents c98c1e0281ff
children 8fa61405af2b
comparison
equal deleted inserted replaced
3394:bc71eb7428ef 3395:c731327dbc47
32 #endif 32 #endif
33 #undef PACKAGE 33 #undef PACKAGE
34 34
35 #ifdef USE_PERL 35 #ifdef USE_PERL
36 36
37 #define group perl_group
38
37 #include <EXTERN.h> 39 #include <EXTERN.h>
38 #ifndef _SEM_SEMUN_UNDEFINED 40 #ifndef _SEM_SEMUN_UNDEFINED
39 #define HAS_UNION_SEMUN 41 #define HAS_UNION_SEMUN
40 #endif 42 #endif
41 #include <perl.h> 43 #include <perl.h>
47 #undef PACKAGE 49 #undef PACKAGE
48 #include <stdio.h> 50 #include <stdio.h>
49 #include <dirent.h> 51 #include <dirent.h>
50 #include <string.h> 52 #include <string.h>
51 53
54 #undef group
52 55
53 /* perl module support */ 56 /* perl module support */
54 extern void xs_init _((void)); 57 extern void xs_init _((void));
55 extern void boot_DynaLoader _((CV * cv)); /* perl is so wacky */ 58 extern void boot_DynaLoader _((CV * cv)); /* perl is so wacky */
56 59
173 176
174 void perl_autoload() 177 void perl_autoload()
175 { 178 {
176 DIR *dir; 179 DIR *dir;
177 struct dirent *ent; 180 struct dirent *ent;
181 struct dirent dirent_buf;
178 char *buf; 182 char *buf;
179 char *path; 183 char *path;
180 184
181 path = gaim_user_dir(); 185 path = gaim_user_dir();
182 dir = opendir(path); 186 dir = opendir(path);
183 if (dir) { 187 if (dir) {
184 while ((ent = readdir(dir))) { 188 while ((readdir_r(dir,&dirent_buf,&ent),ent)) {
185 if (strcmp(ent->d_name, ".") && strcmp(ent->d_name, "..")) { 189 if (strcmp(ent->d_name, ".") && strcmp(ent->d_name, "..")) {
186 if (is_pl_file(ent->d_name)) { 190 if (is_pl_file(ent->d_name)) {
187 buf = g_malloc(strlen(path) + strlen(ent->d_name) + 2); 191 buf = g_malloc(strlen(path) + strlen(ent->d_name) + 2);
188 sprintf(buf, "%s/%s", path, ent->d_name); 192 sprintf(buf, "%s/%s", path, ent->d_name);
189 perl_load_file(buf); 193 perl_load_file(buf);