home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / Perl / Non-RPC / !Perl / lib / zip / Errno.pm < prev    next >
Text File  |  1999-04-05  |  6KB  |  223 lines

  1. #
  2. # This file is auto-generated. ***ANY*** changes here will be lost
  3. #
  4.  
  5. package Errno;
  6. use vars qw(@EXPORT_OK %EXPORT_TAGS @ISA $VERSION %errno $AUTOLOAD);
  7. use Exporter ();
  8. use Config;
  9. use strict;
  10.  
  11. $Config{'myarchname'} eq "arm-riscos" or
  12.     die "Errno architecture (arm-riscos) does not match executable architecture ($Config{'myarchname'})";
  13.  
  14. $VERSION = "1.111";
  15. @ISA = qw(Exporter);
  16.  
  17. @EXPORT_OK = qw(EFAULT ENOSYS ENETDOWN EBACKGROUND EAFNOSUPPORT
  18.     ENOEXEC EALREADY EMSGSIZE ENOENT ECHILD EDEADLK ENOTBLK EISCONN EEXIST
  19.     ERANGE ECONNABORTED EUSERS EAUTH EDESTADDRREQ EXDEV ESTALE ELOOP
  20.     EISDIR ERPCMISMATCH ENODEV ESHUTDOWN ECONNREFUSED ENOTTY
  21.     ESOCKTNOSUPPORT EADDRINUSE ENOTEMPTY ESPIPE E2BIG ENOPROTOOPT ED
  22.     EGREGIOUS EIEIO EFTYPE EREMOTE ENETUNREACH EPIPE ENOTDIR ECONNRESET
  23.     EPROCLIM EDIED EFBIG EIO EADDRNOTAVAIL EROFS EINVAL ENOTCONN EACCES
  24.     EAGAIN ENAMETOOLONG ENOSPC EHOSTUNREACH ENOBUFS EMFILE EBADF ETXTBSY
  25.     ENFILE ENEEDAUTH EPFNOSUPPORT EWOULDBLOCK ENOLCK EGRATUITOUS EMLINK
  26.     ENOMEM EINTR ENXIO EOPSYS EDOM ENOTSOCK EBUSY ESIG EPROCUNAVAIL
  27.     EPROGUNAVAIL ENETRESET ETIMEDOUT EINPROGRESS EBADRPC EDQUOT
  28.     EPROTONOSUPPORT EPROGMISMATCH ESRCH EPERM EHOSTDOWN EPROTOTYPE
  29.     ETOOMANYREFS EOPNOTSUPP);
  30.  
  31. %EXPORT_TAGS = (
  32.     POSIX => [qw(
  33.     E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY
  34.     EBADF EBUSY ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK
  35.     EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH
  36.     EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK
  37.     EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS
  38.     ENODEV ENOENT ENOEXEC ENOLCK ENOMEM ENOPROTOOPT ENOSPC ENOSYS ENOTBLK
  39.     ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM
  40.     EPFNOSUPPORT EPIPE EPROCLIM EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE
  41.     EROFS ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT
  42.     ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV
  43.     )]
  44. );
  45.  
  46. sub EPERM () { 1 }
  47. sub ENOENT () { 2 }
  48. sub ESRCH () { 3 }
  49. sub EINTR () { 4 }
  50. sub EIO () { 5 }
  51. sub ENXIO () { 6 }
  52. sub E2BIG () { 7 }
  53. sub ENOEXEC () { 8 }
  54. sub EBADF () { 9 }
  55. sub ECHILD () { 10 }
  56. sub EDEADLK () { 11 }
  57. sub ENOMEM () { 12 }
  58. sub EACCES () { 13 }
  59. sub EFAULT () { 14 }
  60. sub ENOTBLK () { 15 }
  61. sub EBUSY () { 16 }
  62. sub EEXIST () { 17 }
  63. sub EXDEV () { 18 }
  64. sub ENODEV () { 19 }
  65. sub ENOTDIR () { 20 }
  66. sub EISDIR () { 21 }
  67. sub EINVAL () { 22 }
  68. sub ENFILE () { 23 }
  69. sub EMFILE () { 24 }
  70. sub ENOTTY () { 25 }
  71. sub ETXTBSY () { 26 }
  72. sub EFBIG () { 27 }
  73. sub ENOSPC () { 28 }
  74. sub ESPIPE () { 29 }
  75. sub EROFS () { 30 }
  76. sub EMLINK () { 31 }
  77. sub EPIPE () { 32 }
  78. sub EDOM () { 33 }
  79. sub ERANGE () { 34 }
  80. sub EWOULDBLOCK () { 35 }
  81. sub EINPROGRESS () { 36 }
  82. sub EALREADY () { 37 }
  83. sub ENOTSOCK () { 38 }
  84. sub EDESTADDRREQ () { 39 }
  85. sub EMSGSIZE () { 40 }
  86. sub EPROTOTYPE () { 41 }
  87. sub ENOPROTOOPT () { 42 }
  88. sub EPROTONOSUPPORT () { 43 }
  89. sub ESOCKTNOSUPPORT () { 44 }
  90. sub EOPNOTSUPP () { 45 }
  91. sub EPFNOSUPPORT () { 46 }
  92. sub EAFNOSUPPORT () { 47 }
  93. sub EADDRINUSE () { 48 }
  94. sub EADDRNOTAVAIL () { 49 }
  95. sub ENETDOWN () { 50 }
  96. sub ENETUNREACH () { 51 }
  97. sub ENETRESET () { 52 }
  98. sub ECONNABORTED () { 53 }
  99. sub ECONNRESET () { 54 }
  100. sub ENOBUFS () { 55 }
  101. sub EISCONN () { 56 }
  102. sub ENOTCONN () { 57 }
  103. sub ESHUTDOWN () { 58 }
  104. sub ETOOMANYREFS () { 59 }
  105. sub ETIMEDOUT () { 60 }
  106. sub ECONNREFUSED () { 61 }
  107. sub ELOOP () { 62 }
  108. sub ENAMETOOLONG () { 63 }
  109. sub EHOSTDOWN () { 64 }
  110. sub EHOSTUNREACH () { 65 }
  111. sub ENOTEMPTY () { 66 }
  112. sub EPROCLIM () { 67 }
  113. sub EUSERS () { 68 }
  114. sub EDQUOT () { 69 }
  115. sub ESTALE () { 70 }
  116. sub EREMOTE () { 71 }
  117. sub EBADRPC () { 72 }
  118. sub ERPCMISMATCH () { 73 }
  119. sub EPROGUNAVAIL () { 74 }
  120. sub EPROGMISMATCH () { 75 }
  121. sub EPROCUNAVAIL () { 76 }
  122. sub ENOLCK () { 77 }
  123. sub ENOSYS () { 78 }
  124. sub EFTYPE () { 79 }
  125. sub EAUTH () { 80 }
  126. sub ENEEDAUTH () { 81 }
  127. sub EAGAIN () { 82 }
  128. sub EBACKGROUND () { 100 }
  129. sub EDIED () { 101 }
  130. sub ED () { 102 }
  131. sub EGREGIOUS () { 103 }
  132. sub EIEIO () { 104 }
  133. sub EGRATUITOUS () { 105 }
  134. sub EOPSYS () { 106 }
  135. sub ESIG () { 107 }
  136.  
  137. sub TIEHASH { bless [] }
  138.  
  139. sub FETCH {
  140.     my ($self, $errname) = @_;
  141.     my $proto = prototype("Errno::$errname");
  142.     if (defined($proto) && $proto eq "") {
  143.     no strict 'refs';
  144.         return $! == &$errname;
  145.     }
  146.     require Carp;
  147.     Carp::confess("No errno $errname");
  148.  
  149. sub STORE {
  150.     require Carp;
  151.     Carp::confess("ERRNO hash is read only!");
  152. }
  153.  
  154. *CLEAR = \&STORE;
  155. *DELETE = \&STORE;
  156.  
  157. sub NEXTKEY {
  158.     my($k,$v);
  159.     while(($k,$v) = each %Errno::) {
  160.     my $proto = prototype("Errno::$k");
  161.     last if (defined($proto) && $proto eq "");
  162.     
  163.     }
  164.     $k
  165. }
  166.  
  167. sub FIRSTKEY {
  168.     my $s = scalar keys %Errno::;
  169.     goto &NEXTKEY;
  170. }
  171.  
  172. sub EXISTS {
  173.     my ($self, $errname) = @_;
  174.     my $proto = prototype($errname);
  175.     defined($proto) && $proto eq "";
  176. }
  177.  
  178. tie %!, __PACKAGE__;
  179.  
  180. 1;
  181. __END__
  182.  
  183. =head1 NAME
  184.  
  185. Errno - System errno constants
  186.  
  187. =head1 SYNOPSIS
  188.  
  189.     use Errno qw(EINTR EIO :POSIX);
  190.  
  191. =head1 DESCRIPTION
  192.  
  193. C<Errno> defines and conditionally exports all the error constants
  194. defined in your system C<errno.h> include file. It has a single export
  195. tag, C<:POSIX>, which will export all POSIX defined error numbers.
  196.  
  197. C<Errno> also makes C<%!> magic such that each element of C<%!> has a non-zero
  198. value only if C<$!> is set to that value, eg
  199.  
  200.     use Errno;
  201.     
  202.     unless (open(FH, "/fangorn/spouse")) {
  203.         if ($!{ENOENT}) {
  204.             warn "Get a wife!\n";
  205.         } else {
  206.             warn "This path is barred: $!";
  207.         } 
  208.     } 
  209.  
  210. =head1 AUTHOR
  211.  
  212. Graham Barr <gbarr@pobox.com>
  213.  
  214. =head1 COPYRIGHT
  215.  
  216. Copyright (c) 1997-8 Graham Barr. All rights reserved.
  217. This program is free software; you can redistribute it and/or modify it
  218. under the same terms as Perl itself.
  219.  
  220. =cut
  221.  
  222.