X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FPOSIX%2FPOSIX.pm;h=b94de210306fe77b7609a87f7c3a3e5d5e0c04ff;hb=6e21dc912fff1c74f60032b406b7b96bd0c3ee86;hp=93366709ac2a86a7e25d70fa059495e2c74fcc9b;hpb=83f427f7167a4592d110171dc3016bab01e4e106;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm index 9336670..b94de21 100644 --- a/ext/POSIX/POSIX.pm +++ b/ext/POSIX/POSIX.pm @@ -6,7 +6,7 @@ use AutoLoader; use XSLoader (); -our $VERSION = "1.04" ; +our $VERSION = "1.05" ; # Grandfather old foo_h form to new :foo_h form my $loaded; @@ -20,6 +20,8 @@ sub import { } sub croak { require Carp; goto &Carp::croak } +# declare usage to assist AutoLoad +sub usage; XSLoader::load 'POSIX', $VERSION; @@ -49,34 +51,29 @@ sub AUTOLOAD { goto &$AUTOLOAD; } -sub usage { +sub POSIX::SigAction::new { + bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0}, $_[0]; +} + +1; +__END__ + +sub usage { my ($mess) = @_; croak "Usage: POSIX::$mess"; } -sub redef { +sub redef { my ($mess) = @_; croak "Use method $mess instead"; } -sub unimpl { +sub unimpl { my ($mess) = @_; $mess =~ s/xxx//; croak "Unimplemented: POSIX::$mess"; } -############################ -package POSIX::SigAction; - -sub new { - bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0}, $_[0]; -} - -############################ -package POSIX; # return to package POSIX so AutoSplit is happy -1; -__END__ - sub assert { usage "assert(expr)" if @_ != 1; if (!$_[0]) { @@ -744,7 +741,7 @@ sub load_imports { ctype_h => [qw(isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper)], - dirent_h => [qw()], + dirent_h => [], errno_h => [qw(E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF EBUSY ECHILD ECONNABORTED @@ -781,7 +778,7 @@ sub load_imports { LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP)], - grp_h => [qw()], + grp_h => [], limits_h => [qw( ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON @@ -801,7 +798,7 @@ sub load_imports { math_h => [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod frexp ldexp log10 modf pow sinh tan tanh)], - pwd_h => [qw()], + pwd_h => [], setjmp_h => [qw(longjmp setjmp siglongjmp sigsetjmp)], @@ -813,7 +810,7 @@ sub load_imports { SIG_IGN SIG_SETMASK SIG_UNBLOCK raise sigaction signal sigpending sigprocmask sigsuspend)], - stdarg_h => [qw()], + stdarg_h => [], stddef_h => [qw(NULL offsetof)], @@ -842,9 +839,9 @@ sub load_imports { S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR fstat mkfifo)], - sys_times_h => [qw()], + sys_times_h => [], - sys_types_h => [qw()], + sys_types_h => [], sys_utsname_h => [qw(uname)], @@ -874,7 +871,7 @@ sub load_imports { _POSIX_JOB_CONTROL _POSIX_NO_TRUNC _POSIX_SAVED_IDS _POSIX_VDISABLE _POSIX_VERSION _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL - _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_SAVED_IDS + _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION _exit access ctermid cuserid dup2 dup execl execle execlp execv execve execvp @@ -882,7 +879,7 @@ sub load_imports { getpid getuid isatty lseek pathconf pause setgid setpgid setsid setuid sysconf tcgetpgrp tcsetpgrp ttyname)], - utime_h => [qw()], + utime_h => [], ); @@ -892,22 +889,61 @@ for (values %EXPORT_TAGS) { } @EXPORT_OK = qw( - closedir opendir readdir rewinddir - fcntl open - getgrgid getgrnam - atan2 cos exp log sin sqrt - getpwnam getpwuid - kill - fileno getc printf rename sprintf - abs exit rand srand system - chmod mkdir stat umask - times - wait waitpid - gmtime localtime time - alarm chdir chown close fork getlogin getppid getpgrp link - pipe read rmdir sleep unlink write - utime - nice + abs + alarm + atan2 + chdir + chmod + chown + close + closedir + cos + exit + exp + fcntl + fileno + fork + getc + getgrgid + getgrnam + getlogin + getpgrp + getppid + getpwnam + getpwuid + gmtime + isatty + kill + link + localtime + log + mkdir + nice + open + opendir + pipe + printf + rand + read + readdir + rename + rewinddir + rmdir + sin + sleep + sprintf + sqrt + srand + stat + system + time + times + umask + unlink + utime + wait + waitpid + write ); require Exporter;