ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/EV.xs
(Generate patch)

Comparing EV/EV.xs (file contents):
Revision 1.80 by root, Tue Nov 27 07:27:10 2007 UTC vs.
Revision 1.84 by root, Sat Dec 1 15:32:53 2007 UTC

77 *stash_watcher, 77 *stash_watcher,
78 *stash_io, 78 *stash_io,
79 *stash_timer, 79 *stash_timer,
80 *stash_periodic, 80 *stash_periodic,
81 *stash_signal, 81 *stash_signal,
82 *stash_child,
83 *stash_stat,
82 *stash_idle, 84 *stash_idle,
83 *stash_prepare, 85 *stash_prepare,
84 *stash_check, 86 *stash_check,
85 *stash_child,
86 *stash_embed, 87 *stash_embed,
87 *stash_stat; 88 *stash_fork;
88 89
89#ifndef SIG_SIZE 90#ifndef SIG_SIZE
90/* kudos to Slaven Rezic for the idea */ 91/* kudos to Slaven Rezic for the idea */
91static char sig_size [] = { SIG_NUM }; 92static char sig_size [] = { SIG_NUM };
92# define SIG_SIZE (sizeof (sig_size) + 1) 93# define SIG_SIZE (sizeof (sig_size) + 1)
215 else 216 else
216 sv_events_cache = sv_events; 217 sv_events_cache = sv_events;
217 218
218 if (SvTRUE (ERRSV)) 219 if (SvTRUE (ERRSV))
219 { 220 {
221 SPAGAIN;
220 PUSHMARK (SP); 222 PUSHMARK (SP);
221 PUTBACK; 223 PUTBACK;
222 call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR); 224 call_sv (get_sv ("EV::DIED", 1), G_DISCARD | G_VOID | G_EVAL | G_KEEPERR);
223 } 225 }
224 226
411 const_iv (EV, BACKEND_KQUEUE) 413 const_iv (EV, BACKEND_KQUEUE)
412 const_iv (EV, BACKEND_DEVPOLL) 414 const_iv (EV, BACKEND_DEVPOLL)
413 const_iv (EV, BACKEND_PORT) 415 const_iv (EV, BACKEND_PORT)
414 const_iv (EV, FLAG_AUTO) 416 const_iv (EV, FLAG_AUTO)
415 const_iv (EV, FLAG_NOENV) 417 const_iv (EV, FLAG_NOENV)
418 const_iv (EV, FLAG_FORKCHECK)
416 }; 419 };
417 420
418 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 421 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
419 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 422 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
420 423
984 RESET (stat, w, (w, SvPVbyte_nolen (w->fh), new_interval)); 987 RESET (stat, w, (w, SvPVbyte_nolen (w->fh), new_interval));
985} 988}
986 OUTPUT: 989 OUTPUT:
987 RETVAL 990 RETVAL
988 991
992void prev (ev_stat *w)
993 ALIAS:
994 stat = 1
995 attr = 2
996 PPCODE:
997{
998 ev_statdata *s = ix ? &w->attr : &w->prev;
999
1000 if (ix == 1)
1001 ev_stat_stat (w);
1002 else if (!s->st_nlink)
1003 errno = ENOENT;
1004
1005 PL_statcache.st_dev = s->st_nlink;
1006 PL_statcache.st_ino = s->st_ino;
1007 PL_statcache.st_mode = s->st_mode;
1008 PL_statcache.st_nlink = s->st_nlink;
1009 PL_statcache.st_uid = s->st_uid;
1010 PL_statcache.st_gid = s->st_gid;
1011 PL_statcache.st_rdev = s->st_rdev;
1012 PL_statcache.st_size = s->st_size;
1013 PL_statcache.st_atime = s->st_atime;
1014 PL_statcache.st_mtime = s->st_mtime;
1015 PL_statcache.st_ctime = s->st_ctime;
1016
1017 if (GIMME_V == G_SCALAR)
1018 XPUSHs (boolSV (s->st_nlink));
1019 else if (GIMME_V == G_ARRAY && s->st_nlink)
1020 {
1021 EXTEND (SP, 13);
1022 PUSHs (sv_2mortal (newSViv (s->st_dev)));
1023 PUSHs (sv_2mortal (newSViv (s->st_ino)));
1024 PUSHs (sv_2mortal (newSVuv (s->st_mode)));
1025 PUSHs (sv_2mortal (newSVuv (s->st_nlink)));
1026 PUSHs (sv_2mortal (newSViv (s->st_uid)));
1027 PUSHs (sv_2mortal (newSViv (s->st_gid)));
1028 PUSHs (sv_2mortal (newSViv (s->st_rdev)));
1029 PUSHs (sv_2mortal (newSVnv ((NV)s->st_size)));
1030 PUSHs (sv_2mortal (newSVnv (s->st_atime)));
1031 PUSHs (sv_2mortal (newSVnv (s->st_mtime)));
1032 PUSHs (sv_2mortal (newSVnv (s->st_ctime)));
1033 PUSHs (sv_2mortal (newSVuv (4096)));
1034 PUSHs (sv_2mortal (newSVnv ((NV)((s->st_size + 4095) / 4096))));
1035 }
1036}
1037
989#ifndef _WIN32 1038#ifndef _WIN32
990 1039
991MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_ 1040MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_
992 1041
993BOOT: 1042BOOT:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines