From: Nicholas Clark Date: Wed, 13 Jun 2001 00:04:30 +0000 (+0100) Subject: Re: ext/ + -Wall X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a290f2384a92c4c0c351e74a4ac9cc083281dcb2;p=p5sagit%2Fp5-mst-13.2.git Re: ext/ + -Wall Message-ID: <20010613000430.M5901@plum.flirble.org> p4raw-id: //depot/perl@10541 --- diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm index 918b2a0..bdbf1d4 100644 --- a/ext/POSIX/POSIX.pm +++ b/ext/POSIX/POSIX.pm @@ -23,8 +23,9 @@ sub croak { require Carp; goto &Carp::croak } XSLoader::load 'POSIX', $VERSION; -my $EINVAL = constant("EINVAL", 0); -my $EAGAIN = constant("EAGAIN", 0); +my %NON_CONSTS = (map {($_,1)} + qw(S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG WEXITSTATUS + WIFEXITED WIFSIGNALED WIFSTOPPED WSTOPSIG WTERMSIG)); sub AUTOLOAD { if ($AUTOLOAD =~ /::(_?[a-z])/) { @@ -35,19 +36,15 @@ sub AUTOLOAD { local $! = 0; my $constname = $AUTOLOAD; $constname =~ s/.*:://; - my $val = constant($constname, @_ ? $_[0] : 0); - if ($! == 0) { + if ($NON_CONSTS{$constname}) { + my ($val, $error) = &int_macro_int($constname, $_[0]); + croak $error if $error; + *$AUTOLOAD = sub { &int_macro_int($constname, $_[0]) }; + } else { + my ($error, $val) = constant($constname); + croak $error if $error; *$AUTOLOAD = sub { $val }; } - elsif ($! == $EAGAIN) { # Not really a constant, so always call. - *$AUTOLOAD = sub { constant($constname, $_[0]) }; - } - elsif ($! == $EINVAL) { - croak "$constname is not a valid POSIX macro"; - } - else { - croak "Your vendor has not defined POSIX macro $constname, used"; - } goto &$AUTOLOAD; } diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index fe4acda..b324cfc 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -335,2222 +335,4052 @@ not_here(char *s) return -1; } -static -NV -constant(char *name, int arg) -{ - errno = 0; - switch (*name) { - case 'A': - if (strEQ(name, "ARG_MAX")) -#ifdef ARG_MAX - return ARG_MAX; +#define PERL_constant_NOTFOUND 1 +#define PERL_constant_NOTDEF 2 +#define PERL_constant_ISIV 3 +#define PERL_constant_ISNO 4 +#define PERL_constant_ISNV 5 +#define PERL_constant_ISPV 6 +#define PERL_constant_ISPVN 7 +#define PERL_constant_ISUNDEF 8 +#define PERL_constant_ISUV 9 +#define PERL_constant_ISYES 10 + +/* These were implemented in the old "constant" subroutine. They are actually + macros that take an integer argument and return an integer result. */ +static int +int_macro_int (const char *name, STRLEN len, IV *arg_result) { + /* Initially switch on the length of the name. */ + /* This code has been edited from a "constant" function generated by: + +use ExtUtils::Constant qw (constant_types C_constant XS_constant); + +my $types = {map {($_, 1)} qw(IV)}; +my @names = (qw(S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG WEXITSTATUS WIFEXITED + WIFSIGNALED WIFSTOPPED WSTOPSIG WTERMSIG)); + +print constant_types(); # macro defs +foreach (C_constant ("POSIX", 'int_macro_int', 'IV', $types, undef, 5, @names) ) { + print $_, "\n"; # C constant subs +} +print "#### XS Section:\n"; +print XS_constant ("POSIX", $types); +__END__ + */ + + switch (len) { + case 7: + /* Names all of length 7. */ + /* S_ISBLK S_ISCHR S_ISDIR S_ISREG */ + /* Offset 5 gives the best switch position. */ + switch (name[5]) { + case 'E': + if (memEQ(name, "S_ISREG", 7)) { + /* ^ */ +#ifdef S_ISREG + *arg_result = S_ISREG(*arg_result); + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'B': - if (strEQ(name, "BUFSIZ")) -#ifdef BUFSIZ - return BUFSIZ; + } + break; + case 'H': + if (memEQ(name, "S_ISCHR", 7)) { + /* ^ */ +#ifdef S_ISCHR + *arg_result = S_ISCHR(*arg_result); + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "BRKINT")) -#ifdef BRKINT - return BRKINT; + } + break; + case 'I': + if (memEQ(name, "S_ISDIR", 7)) { + /* ^ */ +#ifdef S_ISDIR + *arg_result = S_ISDIR(*arg_result); + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B9600")) -#ifdef B9600 - return B9600; + } + break; + case 'L': + if (memEQ(name, "S_ISBLK", 7)) { + /* ^ */ +#ifdef S_ISBLK + *arg_result = S_ISBLK(*arg_result); + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B19200")) -#ifdef B19200 - return B19200; + } + break; + } + break; + case 8: + /* Names all of length 8. */ + /* S_ISFIFO WSTOPSIG WTERMSIG */ + /* Offset 3 gives the best switch position. */ + switch (name[3]) { + case 'O': + if (memEQ(name, "WSTOPSIG", 8)) { + /* ^ */ +#ifdef WSTOPSIG + *arg_result = WSTOPSIG(*arg_result); + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B38400")) -#ifdef B38400 - return B38400; + } + break; + case 'R': + if (memEQ(name, "WTERMSIG", 8)) { + /* ^ */ +#ifdef WTERMSIG + *arg_result = WTERMSIG(*arg_result); + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B0")) -#ifdef B0 - return B0; + } + break; + case 'S': + if (memEQ(name, "S_ISFIFO", 8)) { + /* ^ */ +#ifdef S_ISFIFO + *arg_result = S_ISFIFO(*arg_result); + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B110")) -#ifdef B110 - return B110; + } + break; + } + break; + case 9: + if (memEQ(name, "WIFEXITED", 9)) { +#ifdef WIFEXITED + *arg_result = WIFEXITED(*arg_result); + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B1200")) -#ifdef B1200 - return B1200; + } + break; + case 10: + if (memEQ(name, "WIFSTOPPED", 10)) { +#ifdef WIFSTOPPED + *arg_result = WIFSTOPPED(*arg_result); + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B134")) -#ifdef B134 - return B134; + } + break; + case 11: + /* Names all of length 11. */ + /* WEXITSTATUS WIFSIGNALED */ + /* Offset 1 gives the best switch position. */ + switch (name[1]) { + case 'E': + if (memEQ(name, "WEXITSTATUS", 11)) { + /* ^ */ +#ifdef WEXITSTATUS + *arg_result = WEXITSTATUS(*arg_result); + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B150")) -#ifdef B150 - return B150; + } + break; + case 'I': + if (memEQ(name, "WIFSIGNALED", 11)) { + /* ^ */ +#ifdef WIFSIGNALED + *arg_result = WIFSIGNALED(*arg_result); + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B1800")) -#ifdef B1800 - return B1800; + } + break; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_3 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + B50 B75 CS5 CS6 CS7 CS8 EIO EOF */ + /* Offset 2 gives the best switch position. */ + switch (name[2]) { + case '0': + if (memEQ(name, "B50", 3)) { + /* ^ */ +#ifdef B50 + *iv_return = B50; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B200")) -#ifdef B200 - return B200; + } + break; + case '5': + if (memEQ(name, "B75", 3)) { + /* ^ */ +#ifdef B75 + *iv_return = B75; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B2400")) -#ifdef B2400 - return B2400; + } + if (memEQ(name, "CS5", 3)) { + /* ^ */ +#ifdef CS5 + *iv_return = CS5; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B300")) -#ifdef B300 - return B300; + } + break; + case '6': + if (memEQ(name, "CS6", 3)) { + /* ^ */ +#ifdef CS6 + *iv_return = CS6; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B4800")) -#ifdef B4800 - return B4800; + } + break; + case '7': + if (memEQ(name, "CS7", 3)) { + /* ^ */ +#ifdef CS7 + *iv_return = CS7; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B50")) -#ifdef B50 - return B50; + } + break; + case '8': + if (memEQ(name, "CS8", 3)) { + /* ^ */ +#ifdef CS8 + *iv_return = CS8; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B600")) -#ifdef B600 - return B600; + } + break; + case 'F': + if (memEQ(name, "EOF", 3)) { + /* ^ */ +#ifdef EOF + *iv_return = EOF; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "B75")) -#ifdef B75 - return B75; + } + break; + case 'O': + if (memEQ(name, "EIO", 3)) { + /* ^ */ +#ifdef EIO + *iv_return = EIO; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'C': - if (strEQ(name, "CHAR_BIT")) -#ifdef CHAR_BIT - return CHAR_BIT; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_4 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + B110 B134 B150 B200 B300 B600 ECHO EDOM F_OK ISIG IXON NCCS NULL R_OK VEOF + VEOL VMIN W_OK X_OK */ + /* Offset 1 gives the best switch position. */ + switch (name[1]) { + case '1': + if (memEQ(name, "B110", 4)) { + /* ^ */ +#ifdef B110 + *iv_return = B110; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CHAR_MAX")) -#ifdef CHAR_MAX - return CHAR_MAX; + } + if (memEQ(name, "B134", 4)) { + /* ^ */ +#ifdef B134 + *iv_return = B134; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CHAR_MIN")) -#ifdef CHAR_MIN - return CHAR_MIN; + } + if (memEQ(name, "B150", 4)) { + /* ^ */ +#ifdef B150 + *iv_return = B150; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CHILD_MAX")) -#ifdef CHILD_MAX - return CHILD_MAX; + } + break; + case '2': + if (memEQ(name, "B200", 4)) { + /* ^ */ +#ifdef B200 + *iv_return = B200; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CLK_TCK")) -#ifdef CLK_TCK - return CLK_TCK; + } + break; + case '3': + if (memEQ(name, "B300", 4)) { + /* ^ */ +#ifdef B300 + *iv_return = B300; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CLOCAL")) -#ifdef CLOCAL - return CLOCAL; + } + break; + case '6': + if (memEQ(name, "B600", 4)) { + /* ^ */ +#ifdef B600 + *iv_return = B600; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CLOCKS_PER_SEC")) -#ifdef CLOCKS_PER_SEC - return CLOCKS_PER_SEC; + } + break; + case 'C': + if (memEQ(name, "ECHO", 4)) { + /* ^ */ +#ifdef ECHO + *iv_return = ECHO; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CREAD")) -#ifdef CREAD - return CREAD; + } + if (memEQ(name, "NCCS", 4)) { + /* ^ */ +#ifdef NCCS + *iv_return = NCCS; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CS5")) -#ifdef CS5 - return CS5; + } + break; + case 'D': + if (memEQ(name, "EDOM", 4)) { + /* ^ */ +#ifdef EDOM + *iv_return = EDOM; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CS6")) -#ifdef CS6 - return CS6; + } + break; + case 'E': + if (memEQ(name, "VEOF", 4)) { + /* ^ */ +#ifdef VEOF + *iv_return = VEOF; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CS7")) -#ifdef CS7 - return CS7; + } + if (memEQ(name, "VEOL", 4)) { + /* ^ */ +#ifdef VEOL + *iv_return = VEOL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CS8")) -#ifdef CS8 - return CS8; + } + break; + case 'M': + if (memEQ(name, "VMIN", 4)) { + /* ^ */ +#ifdef VMIN + *iv_return = VMIN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CSIZE")) -#ifdef CSIZE - return CSIZE; + } + break; + case 'S': + if (memEQ(name, "ISIG", 4)) { + /* ^ */ +#ifdef ISIG + *iv_return = ISIG; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "CSTOPB")) -#ifdef CSTOPB - return CSTOPB; + } + break; + case 'U': + if (memEQ(name, "NULL", 4)) { + /* ^ */ +#ifdef NULL + *iv_return = 0; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'D': - if (strEQ(name, "DBL_MAX")) -#ifdef DBL_MAX - return DBL_MAX; + } + break; + case 'X': + if (memEQ(name, "IXON", 4)) { + /* ^ */ +#ifdef IXON + *iv_return = IXON; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "DBL_MIN")) -#ifdef DBL_MIN - return DBL_MIN; + } + break; + case '_': + if (memEQ(name, "F_OK", 4)) { + /* ^ */ +#ifdef F_OK + *iv_return = F_OK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "DBL_DIG")) -#ifdef DBL_DIG - return DBL_DIG; + } + if (memEQ(name, "R_OK", 4)) { + /* ^ */ +#ifdef R_OK + *iv_return = R_OK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "DBL_EPSILON")) -#ifdef DBL_EPSILON - return DBL_EPSILON; + } + if (memEQ(name, "W_OK", 4)) { + /* ^ */ +#ifdef W_OK + *iv_return = W_OK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "DBL_MANT_DIG")) -#ifdef DBL_MANT_DIG - return DBL_MANT_DIG; + } + if (memEQ(name, "X_OK", 4)) { + /* ^ */ +#ifdef X_OK + *iv_return = X_OK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "DBL_MAX_10_EXP")) -#ifdef DBL_MAX_10_EXP - return DBL_MAX_10_EXP; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_5 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + B1200 B1800 B2400 B4800 B9600 CREAD CSIZE E2BIG EBADF EBUSY ECHOE ECHOK + EFBIG EINTR ELOOP ENXIO EPERM EPIPE EROFS ESRCH EXDEV HUPCL ICRNL IGNCR + INLCR INPCK IXOFF OPOST TCION TCOON VINTR VKILL VQUIT VSTOP VSUSP VTIME */ + /* Offset 1 gives the best switch position. */ + switch (name[1]) { + case '1': + if (memEQ(name, "B1200", 5)) { + /* ^ */ +#ifdef B1200 + *iv_return = B1200; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "DBL_MAX_EXP")) -#ifdef DBL_MAX_EXP - return DBL_MAX_EXP; + } + if (memEQ(name, "B1800", 5)) { + /* ^ */ +#ifdef B1800 + *iv_return = B1800; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "DBL_MIN_10_EXP")) -#ifdef DBL_MIN_10_EXP - return DBL_MIN_10_EXP; + } + break; + case '2': + if (memEQ(name, "B2400", 5)) { + /* ^ */ +#ifdef B2400 + *iv_return = B2400; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "DBL_MIN_EXP")) -#ifdef DBL_MIN_EXP - return DBL_MIN_EXP; + } + if (memEQ(name, "E2BIG", 5)) { + /* ^ */ +#ifdef E2BIG + *iv_return = E2BIG; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'E': - switch (name[1]) { - case 'A': - if (strEQ(name, "EACCES")) -#ifdef EACCES - return EACCES; + } + break; + case '4': + if (memEQ(name, "B4800", 5)) { + /* ^ */ +#ifdef B4800 + *iv_return = B4800; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EADDRINUSE")) -#ifdef EADDRINUSE - return EADDRINUSE; + } + break; + case '9': + if (memEQ(name, "B9600", 5)) { + /* ^ */ +#ifdef B9600 + *iv_return = B9600; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EADDRNOTAVAIL")) -#ifdef EADDRNOTAVAIL - return EADDRNOTAVAIL; + } + break; + case 'B': + if (memEQ(name, "EBADF", 5)) { + /* ^ */ +#ifdef EBADF + *iv_return = EBADF; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EAFNOSUPPORT")) -#ifdef EAFNOSUPPORT - return EAFNOSUPPORT; + } + if (memEQ(name, "EBUSY", 5)) { + /* ^ */ +#ifdef EBUSY + *iv_return = EBUSY; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EAGAIN")) -#ifdef EAGAIN - return EAGAIN; + } + break; + case 'C': + if (memEQ(name, "ECHOE", 5)) { + /* ^ */ +#ifdef ECHOE + *iv_return = ECHOE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EALREADY")) -#ifdef EALREADY - return EALREADY; + } + if (memEQ(name, "ECHOK", 5)) { + /* ^ */ +#ifdef ECHOK + *iv_return = ECHOK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'B': - if (strEQ(name, "EBADF")) -#ifdef EBADF - return EBADF; + } + if (memEQ(name, "ICRNL", 5)) { + /* ^ */ +#ifdef ICRNL + *iv_return = ICRNL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EBUSY")) -#ifdef EBUSY - return EBUSY; + } + if (memEQ(name, "TCION", 5)) { + /* ^ */ +#ifdef TCION + *iv_return = TCION; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'C': - if (strEQ(name, "ECHILD")) -#ifdef ECHILD - return ECHILD; + } + if (memEQ(name, "TCOON", 5)) { + /* ^ */ +#ifdef TCOON + *iv_return = TCOON; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ECHO")) -#ifdef ECHO - return ECHO; + } + break; + case 'F': + if (memEQ(name, "EFBIG", 5)) { + /* ^ */ +#ifdef EFBIG + *iv_return = EFBIG; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ECHOE")) -#ifdef ECHOE - return ECHOE; + } + break; + case 'G': + if (memEQ(name, "IGNCR", 5)) { + /* ^ */ +#ifdef IGNCR + *iv_return = IGNCR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ECHOK")) -#ifdef ECHOK - return ECHOK; + } + break; + case 'I': + if (memEQ(name, "EINTR", 5)) { + /* ^ */ +#ifdef EINTR + *iv_return = EINTR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ECHONL")) -#ifdef ECHONL - return ECHONL; + } + if (memEQ(name, "VINTR", 5)) { + /* ^ */ +#ifdef VINTR + *iv_return = VINTR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ECONNABORTED")) -#ifdef ECONNABORTED - return ECONNABORTED; + } + break; + case 'K': + if (memEQ(name, "VKILL", 5)) { + /* ^ */ +#ifdef VKILL + *iv_return = VKILL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ECONNREFUSED")) -#ifdef ECONNREFUSED - return ECONNREFUSED; + } + break; + case 'L': + if (memEQ(name, "ELOOP", 5)) { + /* ^ */ +#ifdef ELOOP + *iv_return = ELOOP; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ECONNRESET")) -#ifdef ECONNRESET - return ECONNRESET; + } + break; + case 'N': + if (memEQ(name, "ENXIO", 5)) { + /* ^ */ +#ifdef ENXIO + *iv_return = ENXIO; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'D': - if (strEQ(name, "EDEADLK")) -#ifdef EDEADLK - return EDEADLK; + } + if (memEQ(name, "INLCR", 5)) { + /* ^ */ +#ifdef INLCR + *iv_return = INLCR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EDESTADDRREQ")) -#ifdef EDESTADDRREQ - return EDESTADDRREQ; + } + if (memEQ(name, "INPCK", 5)) { + /* ^ */ +#ifdef INPCK + *iv_return = INPCK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EDOM")) -#ifdef EDOM - return EDOM; + } + break; + case 'P': + if (memEQ(name, "EPERM", 5)) { + /* ^ */ +#ifdef EPERM + *iv_return = EPERM; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EDQUOT")) -#ifdef EDQUOT - return EDQUOT; + } + if (memEQ(name, "EPIPE", 5)) { + /* ^ */ +#ifdef EPIPE + *iv_return = EPIPE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'E': - if (strEQ(name, "EEXIST")) -#ifdef EEXIST - return EEXIST; + } + if (memEQ(name, "OPOST", 5)) { + /* ^ */ +#ifdef OPOST + *iv_return = OPOST; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'F': - if (strEQ(name, "EFAULT")) -#ifdef EFAULT - return EFAULT; + } + break; + case 'Q': + if (memEQ(name, "VQUIT", 5)) { + /* ^ */ +#ifdef VQUIT + *iv_return = VQUIT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EFBIG")) -#ifdef EFBIG - return EFBIG; + } + break; + case 'R': + if (memEQ(name, "CREAD", 5)) { + /* ^ */ +#ifdef CREAD + *iv_return = CREAD; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'H': - if (strEQ(name, "EHOSTDOWN")) -#ifdef EHOSTDOWN - return EHOSTDOWN; + } + if (memEQ(name, "EROFS", 5)) { + /* ^ */ +#ifdef EROFS + *iv_return = EROFS; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EHOSTUNREACH")) -#ifdef EHOSTUNREACH - return EHOSTUNREACH; + } + break; + case 'S': + if (memEQ(name, "CSIZE", 5)) { + /* ^ */ +#ifdef CSIZE + *iv_return = CSIZE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'I': - if (strEQ(name, "EINPROGRESS")) -#ifdef EINPROGRESS - return EINPROGRESS; + } + if (memEQ(name, "ESRCH", 5)) { + /* ^ */ +#ifdef ESRCH + *iv_return = ESRCH; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EINTR")) -#ifdef EINTR - return EINTR; + } + if (memEQ(name, "VSTOP", 5)) { + /* ^ */ +#ifdef VSTOP + *iv_return = VSTOP; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EINVAL")) -#ifdef EINVAL - return EINVAL; + } + if (memEQ(name, "VSUSP", 5)) { + /* ^ */ +#ifdef VSUSP + *iv_return = VSUSP; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EIO")) -#ifdef EIO - return EIO; + } + break; + case 'T': + if (memEQ(name, "VTIME", 5)) { + /* ^ */ +#ifdef VTIME + *iv_return = VTIME; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EISCONN")) -#ifdef EISCONN - return EISCONN; + } + break; + case 'U': + if (memEQ(name, "HUPCL", 5)) { + /* ^ */ +#ifdef HUPCL + *iv_return = HUPCL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EISDIR")) -#ifdef EISDIR - return EISDIR; + } + break; + case 'X': + if (memEQ(name, "EXDEV", 5)) { + /* ^ */ +#ifdef EXDEV + *iv_return = EXDEV; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'L': - if (strEQ(name, "ELOOP")) -#ifdef ELOOP - return ELOOP; + } + if (memEQ(name, "IXOFF", 5)) { + /* ^ */ +#ifdef IXOFF + *iv_return = IXOFF; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'M': - if (strEQ(name, "EMFILE")) -#ifdef EMFILE - return EMFILE; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_6 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + B19200 B38400 BRKINT BUFSIZ CLOCAL CSTOPB EACCES EAGAIN ECHILD ECHONL + EDQUOT EEXIST EFAULT EINVAL EISDIR EMFILE EMLINK ENFILE ENODEV ENOENT + ENOLCK ENOMEM ENOSPC ENOSYS ENOTTY ERANGE ESPIPE ESTALE EUSERS ICANON + IEXTEN IGNBRK IGNPAR ISTRIP LC_ALL NOFLSH O_EXCL O_RDWR PARENB PARMRK + PARODD SIGFPE SIGHUP SIGILL SIGINT TCIOFF TCOOFF TOSTOP VERASE VSTART */ + /* Offset 3 gives the best switch position. */ + switch (name[3]) { + case '2': + if (memEQ(name, "B19200", 6)) { + /* ^ */ +#ifdef B19200 + *iv_return = B19200; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EMLINK")) -#ifdef EMLINK - return EMLINK; + } + break; + case '4': + if (memEQ(name, "B38400", 6)) { + /* ^ */ +#ifdef B38400 + *iv_return = B38400; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EMSGSIZE")) -#ifdef EMSGSIZE - return EMSGSIZE; + } + break; + case 'A': + if (memEQ(name, "EAGAIN", 6)) { + /* ^ */ +#ifdef EAGAIN + *iv_return = EAGAIN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'N': - if (strEQ(name, "ENETDOWN")) -#ifdef ENETDOWN - return ENETDOWN; + } + if (memEQ(name, "ESTALE", 6)) { + /* ^ */ +#ifdef ESTALE + *iv_return = ESTALE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENETRESET")) -#ifdef ENETRESET - return ENETRESET; -#else - goto not_there; -#endif - if (strEQ(name, "ENETUNREACH")) -#ifdef ENETUNREACH - return ENETUNREACH; + } + if (memEQ(name, "LC_ALL", 6)) { + /* ^ */ +#ifdef LC_ALL + *iv_return = LC_ALL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOBUFS")) -#ifdef ENOBUFS - return ENOBUFS; + } + if (memEQ(name, "VERASE", 6)) { + /* ^ */ +#ifdef VERASE + *iv_return = VERASE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOEXEC")) -#ifdef ENOEXEC - return ENOEXEC; + } + if (memEQ(name, "VSTART", 6)) { + /* ^ */ +#ifdef VSTART + *iv_return = VSTART; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOMEM")) -#ifdef ENOMEM - return ENOMEM; + } + break; + case 'B': + if (memEQ(name, "IGNBRK", 6)) { + /* ^ */ +#ifdef IGNBRK + *iv_return = IGNBRK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOPROTOOPT")) -#ifdef ENOPROTOOPT - return ENOPROTOOPT; + } + break; + case 'C': + if (memEQ(name, "CLOCAL", 6)) { + /* ^ */ +#ifdef CLOCAL + *iv_return = CLOCAL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOSPC")) -#ifdef ENOSPC - return ENOSPC; + } + if (memEQ(name, "EACCES", 6)) { + /* ^ */ +#ifdef EACCES + *iv_return = EACCES; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOTBLK")) -#ifdef ENOTBLK - return ENOTBLK; + } + break; + case 'D': + if (memEQ(name, "EISDIR", 6)) { + /* ^ */ +#ifdef EISDIR + *iv_return = EISDIR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOTCONN")) -#ifdef ENOTCONN - return ENOTCONN; + } + if (memEQ(name, "ENODEV", 6)) { + /* ^ */ +#ifdef ENODEV + *iv_return = ENODEV; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOTDIR")) -#ifdef ENOTDIR - return ENOTDIR; + } + if (memEQ(name, "O_RDWR", 6)) { + /* ^ */ +#ifdef O_RDWR + *iv_return = O_RDWR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOTEMPTY")) -#ifdef ENOTEMPTY - return ENOTEMPTY; + } + break; + case 'E': + if (memEQ(name, "ENOENT", 6)) { + /* ^ */ +#ifdef ENOENT + *iv_return = ENOENT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOTSOCK")) -#ifdef ENOTSOCK - return ENOTSOCK; + } + if (memEQ(name, "EUSERS", 6)) { + /* ^ */ +#ifdef EUSERS + *iv_return = EUSERS; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOTTY")) -#ifdef ENOTTY - return ENOTTY; + } + if (memEQ(name, "PARENB", 6)) { + /* ^ */ +#ifdef PARENB + *iv_return = PARENB; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENFILE")) -#ifdef ENFILE - return ENFILE; + } + break; + case 'F': + if (memEQ(name, "SIGFPE", 6)) { + /* ^ */ +#ifdef SIGFPE + *iv_return = SIGFPE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENODEV")) -#ifdef ENODEV - return ENODEV; + } + break; + case 'H': + if (memEQ(name, "SIGHUP", 6)) { + /* ^ */ +#ifdef SIGHUP + *iv_return = SIGHUP; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOENT")) -#ifdef ENOENT - return ENOENT; + } + break; + case 'I': + if (memEQ(name, "BRKINT", 6)) { + /* ^ */ +#ifdef BRKINT + *iv_return = BRKINT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOLCK")) -#ifdef ENOLCK - return ENOLCK; + } + if (memEQ(name, "ECHILD", 6)) { + /* ^ */ +#ifdef ECHILD + *iv_return = ECHILD; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENOSYS")) -#ifdef ENOSYS - return ENOSYS; + } + if (memEQ(name, "EEXIST", 6)) { + /* ^ */ +#ifdef EEXIST + *iv_return = EEXIST; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENXIO")) -#ifdef ENXIO - return ENXIO; + } + if (memEQ(name, "EMFILE", 6)) { + /* ^ */ +#ifdef EMFILE + *iv_return = EMFILE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ENAMETOOLONG")) -#ifdef ENAMETOOLONG - return ENAMETOOLONG; + } + if (memEQ(name, "EMLINK", 6)) { + /* ^ */ +#ifdef EMLINK + *iv_return = EMLINK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'O': - if (strEQ(name, "EOF")) -#ifdef EOF - return EOF; + } + if (memEQ(name, "ENFILE", 6)) { + /* ^ */ +#ifdef ENFILE + *iv_return = ENFILE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EOPNOTSUPP")) -#ifdef EOPNOTSUPP - return EOPNOTSUPP; + } + if (memEQ(name, "ESPIPE", 6)) { + /* ^ */ +#ifdef ESPIPE + *iv_return = ESPIPE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'P': - if (strEQ(name, "EPERM")) -#ifdef EPERM - return EPERM; + } + if (memEQ(name, "SIGILL", 6)) { + /* ^ */ +#ifdef SIGILL + *iv_return = SIGILL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EPFNOSUPPORT")) -#ifdef EPFNOSUPPORT - return EPFNOSUPPORT; + } + if (memEQ(name, "SIGINT", 6)) { + /* ^ */ +#ifdef SIGINT + *iv_return = SIGINT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EPIPE")) -#ifdef EPIPE - return EPIPE; + } + break; + case 'L': + if (memEQ(name, "ENOLCK", 6)) { + /* ^ */ +#ifdef ENOLCK + *iv_return = ENOLCK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EPROCLIM")) -#ifdef EPROCLIM - return EPROCLIM; + } + if (memEQ(name, "NOFLSH", 6)) { + /* ^ */ +#ifdef NOFLSH + *iv_return = NOFLSH; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EPROTONOSUPPORT")) -#ifdef EPROTONOSUPPORT - return EPROTONOSUPPORT; + } + break; + case 'M': + if (memEQ(name, "ENOMEM", 6)) { + /* ^ */ +#ifdef ENOMEM + *iv_return = ENOMEM; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EPROTOTYPE")) -#ifdef EPROTOTYPE - return EPROTOTYPE; + } + if (memEQ(name, "PARMRK", 6)) { + /* ^ */ +#ifdef PARMRK + *iv_return = PARMRK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'R': - if (strEQ(name, "ERANGE")) + } + break; + case 'N': + if (memEQ(name, "ERANGE", 6)) { + /* ^ */ #ifdef ERANGE - return ERANGE; + *iv_return = ERANGE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EREMOTE")) -#ifdef EREMOTE - return EREMOTE; + } + if (memEQ(name, "ICANON", 6)) { + /* ^ */ +#ifdef ICANON + *iv_return = ICANON; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ERESTART")) -#ifdef ERESTART - return ERESTART; + } + break; + case 'O': + if (memEQ(name, "CSTOPB", 6)) { + /* ^ */ +#ifdef CSTOPB + *iv_return = CSTOPB; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EROFS")) -#ifdef EROFS - return EROFS; + } + if (memEQ(name, "ECHONL", 6)) { + /* ^ */ +#ifdef ECHONL + *iv_return = ECHONL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'S': - if (strEQ(name, "ESHUTDOWN")) -#ifdef ESHUTDOWN - return ESHUTDOWN; + } + if (memEQ(name, "PARODD", 6)) { + /* ^ */ +#ifdef PARODD + *iv_return = PARODD; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ESOCKTNOSUPPORT")) -#ifdef ESOCKTNOSUPPORT - return ESOCKTNOSUPPORT; + } + if (memEQ(name, "TCIOFF", 6)) { + /* ^ */ +#ifdef TCIOFF + *iv_return = TCIOFF; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ESPIPE")) -#ifdef ESPIPE - return ESPIPE; + } + if (memEQ(name, "TCOOFF", 6)) { + /* ^ */ +#ifdef TCOOFF + *iv_return = TCOOFF; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ESRCH")) -#ifdef ESRCH - return ESRCH; + } + break; + case 'P': + if (memEQ(name, "IGNPAR", 6)) { + /* ^ */ +#ifdef IGNPAR + *iv_return = IGNPAR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ESTALE")) -#ifdef ESTALE - return ESTALE; + } + break; + case 'R': + if (memEQ(name, "ISTRIP", 6)) { + /* ^ */ +#ifdef ISTRIP + *iv_return = ISTRIP; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'T': - if (strEQ(name, "ETIMEDOUT")) -#ifdef ETIMEDOUT - return ETIMEDOUT; + } + break; + case 'S': + if (memEQ(name, "BUFSIZ", 6)) { + /* ^ */ +#ifdef BUFSIZ + *iv_return = BUFSIZ; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ETOOMANYREFS")) -#ifdef ETOOMANYREFS - return ETOOMANYREFS; + } + if (memEQ(name, "ENOSPC", 6)) { + /* ^ */ +#ifdef ENOSPC + *iv_return = ENOSPC; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ETXTBSY")) -#ifdef ETXTBSY - return ETXTBSY; + } + if (memEQ(name, "ENOSYS", 6)) { + /* ^ */ +#ifdef ENOSYS + *iv_return = ENOSYS; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'U': - if (strEQ(name, "EUSERS")) -#ifdef EUSERS - return EUSERS; + } + break; + case 'T': + if (memEQ(name, "ENOTTY", 6)) { + /* ^ */ +#ifdef ENOTTY + *iv_return = ENOTTY; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'W': - if (strEQ(name, "EWOULDBLOCK")) -#ifdef EWOULDBLOCK - return EWOULDBLOCK; + } + if (memEQ(name, "IEXTEN", 6)) { + /* ^ */ +#ifdef IEXTEN + *iv_return = IEXTEN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'X': - if (strEQ(name, "EXIT_FAILURE")) -#ifdef EXIT_FAILURE - return EXIT_FAILURE; + } + if (memEQ(name, "TOSTOP", 6)) { + /* ^ */ +#ifdef TOSTOP + *iv_return = TOSTOP; + return PERL_constant_ISIV; #else - return 1; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EXIT_SUCCESS")) -#ifdef EXIT_SUCCESS - return EXIT_SUCCESS; + } + break; + case 'U': + if (memEQ(name, "EDQUOT", 6)) { + /* ^ */ +#ifdef EDQUOT + *iv_return = EDQUOT; + return PERL_constant_ISIV; #else - return 0; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "EXDEV")) -#ifdef EXDEV - return EXDEV; + } + if (memEQ(name, "EFAULT", 6)) { + /* ^ */ +#ifdef EFAULT + *iv_return = EFAULT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } - if (strEQ(name, "E2BIG")) -#ifdef E2BIG - return E2BIG; + } + break; + case 'V': + if (memEQ(name, "EINVAL", 6)) { + /* ^ */ +#ifdef EINVAL + *iv_return = EINVAL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'F': - if (strnEQ(name, "FLT_", 4)) { - if (strEQ(name, "FLT_MAX")) -#ifdef FLT_MAX - return FLT_MAX; + } + break; + case 'X': + if (memEQ(name, "O_EXCL", 6)) { + /* ^ */ +#ifdef O_EXCL + *iv_return = O_EXCL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "FLT_MIN")) -#ifdef FLT_MIN - return FLT_MIN; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_7 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + ARG_MAX CLK_TCK DBL_DIG DBL_MAX DBL_MIN EDEADLK EISCONN ENOBUFS ENOEXEC + ENOTBLK ENOTDIR EREMOTE ETXTBSY FLT_DIG FLT_MAX FLT_MIN F_DUPFD F_GETFD + F_GETFL F_GETLK F_RDLCK F_SETFD F_SETFL F_SETLK F_UNLCK F_WRLCK INT_MAX + INT_MIN LC_TIME O_CREAT O_TRUNC SIGABRT SIGALRM SIGCHLD SIGCONT SIGKILL + SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU SIGUSR1 + SIGUSR2 SIG_DFL SIG_ERR SIG_IGN S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO + S_IRWXU S_ISGID S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR + TCSANOW TMP_MAX WNOHANG */ + /* Offset 6 gives the best switch position. */ + switch (name[6]) { + case '1': + if (memEQ(name, "SIGUSR1", 7)) { + /* ^ */ +#ifdef SIGUSR1 + *iv_return = SIGUSR1; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "FLT_ROUNDS")) -#ifdef FLT_ROUNDS - return FLT_ROUNDS; + } + break; + case '2': + if (memEQ(name, "SIGUSR2", 7)) { + /* ^ */ +#ifdef SIGUSR2 + *iv_return = SIGUSR2; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "FLT_DIG")) -#ifdef FLT_DIG - return FLT_DIG; + } + break; + case 'C': + if (memEQ(name, "ENOEXEC", 7)) { + /* ^ */ +#ifdef ENOEXEC + *iv_return = ENOEXEC; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "FLT_EPSILON")) -#ifdef FLT_EPSILON - return FLT_EPSILON; + } + if (memEQ(name, "O_TRUNC", 7)) { + /* ^ */ +#ifdef O_TRUNC + *iv_return = O_TRUNC; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "FLT_MANT_DIG")) -#ifdef FLT_MANT_DIG - return FLT_MANT_DIG; + } + break; + case 'D': + if (memEQ(name, "F_DUPFD", 7)) { + /* ^ */ +#ifdef F_DUPFD + *iv_return = F_DUPFD; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "FLT_MAX_10_EXP")) -#ifdef FLT_MAX_10_EXP - return FLT_MAX_10_EXP; + } + if (memEQ(name, "F_GETFD", 7)) { + /* ^ */ +#ifdef F_GETFD + *iv_return = F_GETFD; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "FLT_MAX_EXP")) -#ifdef FLT_MAX_EXP - return FLT_MAX_EXP; + } + if (memEQ(name, "F_SETFD", 7)) { + /* ^ */ +#ifdef F_SETFD + *iv_return = F_SETFD; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "FLT_MIN_10_EXP")) -#ifdef FLT_MIN_10_EXP - return FLT_MIN_10_EXP; + } + if (memEQ(name, "SIGCHLD", 7)) { + /* ^ */ +#ifdef SIGCHLD + *iv_return = SIGCHLD; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "FLT_MIN_EXP")) -#ifdef FLT_MIN_EXP - return FLT_MIN_EXP; + } + if (memEQ(name, "S_ISGID", 7)) { + /* ^ */ +#ifdef S_ISGID + *iv_return = S_ISGID; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "FLT_RADIX")) -#ifdef FLT_RADIX - return FLT_RADIX; + } + if (memEQ(name, "S_ISUID", 7)) { + /* ^ */ +#ifdef S_ISUID + *iv_return = S_ISUID; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } - if (strnEQ(name, "F_", 2)) { - if (strEQ(name, "F_DUPFD")) -#ifdef F_DUPFD - return F_DUPFD; + } + break; + case 'E': + if (memEQ(name, "EREMOTE", 7)) { + /* ^ */ +#ifdef EREMOTE + *iv_return = EREMOTE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "F_GETFD")) -#ifdef F_GETFD - return F_GETFD; + } + if (memEQ(name, "LC_TIME", 7)) { + /* ^ */ +#ifdef LC_TIME + *iv_return = LC_TIME; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "F_GETFL")) -#ifdef F_GETFL - return F_GETFL; + } + if (memEQ(name, "SIGPIPE", 7)) { + /* ^ */ +#ifdef SIGPIPE + *iv_return = SIGPIPE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "F_GETLK")) -#ifdef F_GETLK - return F_GETLK; + } + break; + case 'G': + if (memEQ(name, "DBL_DIG", 7)) { + /* ^ */ +#ifdef DBL_DIG + *nv_return = DBL_DIG; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "F_OK")) -#ifdef F_OK - return F_OK; + } + if (memEQ(name, "FLT_DIG", 7)) { + /* ^ */ +#ifdef FLT_DIG + *nv_return = FLT_DIG; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "F_RDLCK")) -#ifdef F_RDLCK - return F_RDLCK; + } + if (memEQ(name, "S_IRWXG", 7)) { + /* ^ */ +#ifdef S_IRWXG + *iv_return = S_IRWXG; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "F_SETFD")) -#ifdef F_SETFD - return F_SETFD; + } + if (memEQ(name, "WNOHANG", 7)) { + /* ^ */ +#ifdef WNOHANG + *iv_return = WNOHANG; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "F_SETFL")) -#ifdef F_SETFL - return F_SETFL; + } + break; + case 'H': + if (memEQ(name, "S_IROTH", 7)) { + /* ^ */ +#ifdef S_IROTH + *iv_return = S_IROTH; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "F_SETLK")) -#ifdef F_SETLK - return F_SETLK; + } + if (memEQ(name, "S_IWOTH", 7)) { + /* ^ */ +#ifdef S_IWOTH + *iv_return = S_IWOTH; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "F_SETLKW")) -#ifdef F_SETLKW - return F_SETLKW; + } + if (memEQ(name, "S_IXOTH", 7)) { + /* ^ */ +#ifdef S_IXOTH + *iv_return = S_IXOTH; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "F_UNLCK")) -#ifdef F_UNLCK - return F_UNLCK; + } + break; + case 'K': + if (memEQ(name, "CLK_TCK", 7)) { + /* ^ */ +#ifdef CLK_TCK + *iv_return = CLK_TCK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "F_WRLCK")) -#ifdef F_WRLCK - return F_WRLCK; + } + if (memEQ(name, "EDEADLK", 7)) { + /* ^ */ +#ifdef EDEADLK + *iv_return = EDEADLK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } - if (strEQ(name, "FD_CLOEXEC")) -#ifdef FD_CLOEXEC - return FD_CLOEXEC; + } + if (memEQ(name, "ENOTBLK", 7)) { + /* ^ */ +#ifdef ENOTBLK + *iv_return = ENOTBLK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "FILENAME_MAX")) -#ifdef FILENAME_MAX - return FILENAME_MAX; + } + if (memEQ(name, "F_GETLK", 7)) { + /* ^ */ +#ifdef F_GETLK + *iv_return = F_GETLK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'H': - if (strEQ(name, "HUGE_VAL")) -#if defined(USE_LONG_DOUBLE) && defined(HUGE_VALL) - /* HUGE_VALL is admittedly non-POSIX but if we are using long doubles - * we might as well use long doubles. --jhi */ - return HUGE_VALL; -#endif -#ifdef HUGE_VAL - return HUGE_VAL; + } + if (memEQ(name, "F_RDLCK", 7)) { + /* ^ */ +#ifdef F_RDLCK + *iv_return = F_RDLCK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "HUPCL")) -#ifdef HUPCL - return HUPCL; + } + if (memEQ(name, "F_SETLK", 7)) { + /* ^ */ +#ifdef F_SETLK + *iv_return = F_SETLK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'I': - if (strEQ(name, "INT_MAX")) -#ifdef INT_MAX - return INT_MAX; + } + if (memEQ(name, "F_UNLCK", 7)) { + /* ^ */ +#ifdef F_UNLCK + *iv_return = F_UNLCK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "INT_MIN")) -#ifdef INT_MIN - return INT_MIN; + } + if (memEQ(name, "F_WRLCK", 7)) { + /* ^ */ +#ifdef F_WRLCK + *iv_return = F_WRLCK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ICANON")) -#ifdef ICANON - return ICANON; + } + break; + case 'L': + if (memEQ(name, "F_GETFL", 7)) { + /* ^ */ +#ifdef F_GETFL + *iv_return = F_GETFL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ICRNL")) -#ifdef ICRNL - return ICRNL; + } + if (memEQ(name, "F_SETFL", 7)) { + /* ^ */ +#ifdef F_SETFL + *iv_return = F_SETFL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "IEXTEN")) -#ifdef IEXTEN - return IEXTEN; + } + if (memEQ(name, "SIGKILL", 7)) { + /* ^ */ +#ifdef SIGKILL + *iv_return = SIGKILL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "IGNBRK")) -#ifdef IGNBRK - return IGNBRK; + } + if (memEQ(name, "SIG_DFL", 7)) { + /* ^ */ +#ifdef SIG_DFL + *iv_return = (IV)SIG_DFL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "IGNCR")) -#ifdef IGNCR - return IGNCR; + } + break; + case 'M': + if (memEQ(name, "SIGALRM", 7)) { + /* ^ */ +#ifdef SIGALRM + *iv_return = SIGALRM; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "IGNPAR")) -#ifdef IGNPAR - return IGNPAR; + } + if (memEQ(name, "SIGTERM", 7)) { + /* ^ */ +#ifdef SIGTERM + *iv_return = SIGTERM; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "INLCR")) -#ifdef INLCR - return INLCR; + } + break; + case 'N': + if (memEQ(name, "DBL_MIN", 7)) { + /* ^ */ +#ifdef DBL_MIN + *nv_return = DBL_MIN; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "INPCK")) -#ifdef INPCK - return INPCK; + } + if (memEQ(name, "EISCONN", 7)) { + /* ^ */ +#ifdef EISCONN + *iv_return = EISCONN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ISIG")) -#ifdef ISIG - return ISIG; + } + if (memEQ(name, "FLT_MIN", 7)) { + /* ^ */ +#ifdef FLT_MIN + *nv_return = FLT_MIN; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ISTRIP")) -#ifdef ISTRIP - return ISTRIP; + } + if (memEQ(name, "INT_MIN", 7)) { + /* ^ */ +#ifdef INT_MIN + *iv_return = INT_MIN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "IXOFF")) -#ifdef IXOFF - return IXOFF; + } + if (memEQ(name, "SIGTTIN", 7)) { + /* ^ */ +#ifdef SIGTTIN + *iv_return = SIGTTIN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "IXON")) -#ifdef IXON - return IXON; + } + if (memEQ(name, "SIG_IGN", 7)) { + /* ^ */ +#ifdef SIG_IGN + *iv_return = (IV)SIG_IGN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'L': - if (strnEQ(name, "LC_", 3)) { - if (strEQ(name, "LC_ALL")) -#ifdef LC_ALL - return LC_ALL; + } + break; + case 'O': + if (memEQ(name, "S_IRWXO", 7)) { + /* ^ */ +#ifdef S_IRWXO + *iv_return = S_IRWXO; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LC_COLLATE")) -#ifdef LC_COLLATE - return LC_COLLATE; + } + break; + case 'P': + if (memEQ(name, "SIGSTOP", 7)) { + /* ^ */ +#ifdef SIGSTOP + *iv_return = SIGSTOP; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LC_CTYPE")) -#ifdef LC_CTYPE - return LC_CTYPE; + } + if (memEQ(name, "SIGTSTP", 7)) { + /* ^ */ +#ifdef SIGTSTP + *iv_return = SIGTSTP; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LC_MONETARY")) -#ifdef LC_MONETARY - return LC_MONETARY; + } + if (memEQ(name, "S_IRGRP", 7)) { + /* ^ */ +#ifdef S_IRGRP + *iv_return = S_IRGRP; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LC_NUMERIC")) -#ifdef LC_NUMERIC - return LC_NUMERIC; + } + if (memEQ(name, "S_IWGRP", 7)) { + /* ^ */ +#ifdef S_IWGRP + *iv_return = S_IWGRP; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LC_TIME")) -#ifdef LC_TIME - return LC_TIME; + } + if (memEQ(name, "S_IXGRP", 7)) { + /* ^ */ +#ifdef S_IXGRP + *iv_return = S_IXGRP; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } - if (strnEQ(name, "LDBL_", 5)) { - if (strEQ(name, "LDBL_MAX")) -#ifdef LDBL_MAX - return LDBL_MAX; + } + break; + case 'R': + if (memEQ(name, "ENOTDIR", 7)) { + /* ^ */ +#ifdef ENOTDIR + *iv_return = ENOTDIR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LDBL_MIN")) -#ifdef LDBL_MIN - return LDBL_MIN; + } + if (memEQ(name, "SIG_ERR", 7)) { + /* ^ */ +#ifdef SIG_ERR + *iv_return = (IV)SIG_ERR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LDBL_DIG")) -#ifdef LDBL_DIG - return LDBL_DIG; + } + if (memEQ(name, "S_IRUSR", 7)) { + /* ^ */ +#ifdef S_IRUSR + *iv_return = S_IRUSR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LDBL_EPSILON")) -#ifdef LDBL_EPSILON - return LDBL_EPSILON; + } + if (memEQ(name, "S_IWUSR", 7)) { + /* ^ */ +#ifdef S_IWUSR + *iv_return = S_IWUSR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LDBL_MANT_DIG")) -#ifdef LDBL_MANT_DIG - return LDBL_MANT_DIG; + } + if (memEQ(name, "S_IXUSR", 7)) { + /* ^ */ +#ifdef S_IXUSR + *iv_return = S_IXUSR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LDBL_MAX_10_EXP")) -#ifdef LDBL_MAX_10_EXP - return LDBL_MAX_10_EXP; + } + break; + case 'S': + if (memEQ(name, "ENOBUFS", 7)) { + /* ^ */ +#ifdef ENOBUFS + *iv_return = ENOBUFS; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LDBL_MAX_EXP")) -#ifdef LDBL_MAX_EXP - return LDBL_MAX_EXP; + } + break; + case 'T': + if (memEQ(name, "O_CREAT", 7)) { + /* ^ */ +#ifdef O_CREAT + *iv_return = O_CREAT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LDBL_MIN_10_EXP")) -#ifdef LDBL_MIN_10_EXP - return LDBL_MIN_10_EXP; + } + if (memEQ(name, "SIGABRT", 7)) { + /* ^ */ +#ifdef SIGABRT + *iv_return = SIGABRT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LDBL_MIN_EXP")) -#ifdef LDBL_MIN_EXP - return LDBL_MIN_EXP; + } + if (memEQ(name, "SIGCONT", 7)) { + /* ^ */ +#ifdef SIGCONT + *iv_return = SIGCONT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } - if (strnEQ(name, "L_", 2)) { - if (strEQ(name, "L_ctermid")) -#ifdef L_ctermid - return L_ctermid; + } + if (memEQ(name, "SIGQUIT", 7)) { + /* ^ */ +#ifdef SIGQUIT + *iv_return = SIGQUIT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "L_cuserid")) -#ifdef L_cuserid - return L_cuserid; + } + break; + case 'U': + if (memEQ(name, "SIGTTOU", 7)) { + /* ^ */ +#ifdef SIGTTOU + *iv_return = SIGTTOU; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - /* L_tmpnam[e] was a typo--retained for compatibility */ - if (strEQ(name, "L_tmpname") || strEQ(name, "L_tmpnam")) -#ifdef L_tmpnam - return L_tmpnam; + } + if (memEQ(name, "S_IRWXU", 7)) { + /* ^ */ +#ifdef S_IRWXU + *iv_return = S_IRWXU; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } - if (strEQ(name, "LONG_MAX")) -#ifdef LONG_MAX - return LONG_MAX; + } + break; + case 'V': + if (memEQ(name, "SIGSEGV", 7)) { + /* ^ */ +#ifdef SIGSEGV + *iv_return = SIGSEGV; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LONG_MIN")) -#ifdef LONG_MIN - return LONG_MIN; + } + break; + case 'W': + if (memEQ(name, "TCSANOW", 7)) { + /* ^ */ +#ifdef TCSANOW + *iv_return = TCSANOW; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "LINK_MAX")) -#ifdef LINK_MAX - return LINK_MAX; + } + break; + case 'X': + if (memEQ(name, "ARG_MAX", 7)) { + /* ^ */ +#ifdef ARG_MAX + *iv_return = ARG_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'M': - if (strEQ(name, "MAX_CANON")) -#ifdef MAX_CANON - return MAX_CANON; + } + if (memEQ(name, "DBL_MAX", 7)) { + /* ^ */ +#ifdef DBL_MAX + *nv_return = DBL_MAX; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "MAX_INPUT")) -#ifdef MAX_INPUT - return MAX_INPUT; + } + if (memEQ(name, "FLT_MAX", 7)) { + /* ^ */ +#ifdef FLT_MAX + *nv_return = FLT_MAX; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "MB_CUR_MAX")) -#ifdef MB_CUR_MAX - return MB_CUR_MAX; + } + if (memEQ(name, "INT_MAX", 7)) { + /* ^ */ +#ifdef INT_MAX + *iv_return = INT_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "MB_LEN_MAX")) -#ifdef MB_LEN_MAX - return MB_LEN_MAX; + } + if (memEQ(name, "TMP_MAX", 7)) { + /* ^ */ +#ifdef TMP_MAX + *iv_return = TMP_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'N': - if (strEQ(name, "NULL")) return 0; - if (strEQ(name, "NAME_MAX")) -#ifdef NAME_MAX - return NAME_MAX; + } + break; + case 'Y': + if (memEQ(name, "ETXTBSY", 7)) { + /* ^ */ +#ifdef ETXTBSY + *iv_return = ETXTBSY; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "NCCS")) -#ifdef NCCS - return NCCS; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_8 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + CHAR_BIT CHAR_MAX CHAR_MIN EALREADY EMSGSIZE ENETDOWN ENOTCONN ENOTSOCK + EPROCLIM ERESTART F_SETLKW HUGE_VAL LC_CTYPE LDBL_DIG LDBL_MAX LDBL_MIN + LINK_MAX LONG_MAX LONG_MIN L_tmpnam NAME_MAX OPEN_MAX O_APPEND O_NOCTTY + O_RDONLY O_WRONLY PATH_MAX PIPE_BUF RAND_MAX SEEK_CUR SEEK_END SEEK_SET + SHRT_MAX SHRT_MIN TCIFLUSH TCOFLUSH UINT_MAX */ + /* Offset 2 gives the best switch position. */ + switch (name[2]) { + case 'A': + if (memEQ(name, "CHAR_BIT", 8)) { + /* ^ */ +#ifdef CHAR_BIT + *iv_return = CHAR_BIT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "NGROUPS_MAX")) -#ifdef NGROUPS_MAX - return NGROUPS_MAX; + } + if (memEQ(name, "CHAR_MAX", 8)) { + /* ^ */ +#ifdef CHAR_MAX + *iv_return = CHAR_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "NOFLSH")) -#ifdef NOFLSH - return NOFLSH; + } + if (memEQ(name, "CHAR_MIN", 8)) { + /* ^ */ +#ifdef CHAR_MIN + *iv_return = CHAR_MIN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'O': - if (strnEQ(name, "O_", 2)) { - if (strEQ(name, "O_APPEND")) + } + if (memEQ(name, "O_APPEND", 8)) { + /* ^ */ #ifdef O_APPEND - return O_APPEND; + *iv_return = O_APPEND; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "O_CREAT")) -#ifdef O_CREAT - return O_CREAT; + } + break; + case 'B': + if (memEQ(name, "LDBL_DIG", 8)) { + /* ^ */ +#ifdef LDBL_DIG + *nv_return = LDBL_DIG; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "O_TRUNC")) -#ifdef O_TRUNC - return O_TRUNC; + } + if (memEQ(name, "LDBL_MAX", 8)) { + /* ^ */ +#ifdef LDBL_MAX + *nv_return = LDBL_MAX; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "O_RDONLY")) -#ifdef O_RDONLY - return O_RDONLY; + } + if (memEQ(name, "LDBL_MIN", 8)) { + /* ^ */ +#ifdef LDBL_MIN + *nv_return = LDBL_MIN; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "O_RDWR")) -#ifdef O_RDWR - return O_RDWR; + } + break; + case 'E': + if (memEQ(name, "ENETDOWN", 8)) { + /* ^ */ +#ifdef ENETDOWN + *iv_return = ENETDOWN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "O_WRONLY")) -#ifdef O_WRONLY - return O_WRONLY; + } + if (memEQ(name, "ERESTART", 8)) { + /* ^ */ +#ifdef ERESTART + *iv_return = ERESTART; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "O_EXCL")) -#ifdef O_EXCL - return O_EXCL; + } + if (memEQ(name, "OPEN_MAX", 8)) { + /* ^ */ +#ifdef OPEN_MAX + *iv_return = OPEN_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "O_NOCTTY")) -#ifdef O_NOCTTY - return O_NOCTTY; + } + if (memEQ(name, "SEEK_CUR", 8)) { + /* ^ */ +#ifdef SEEK_CUR + *iv_return = SEEK_CUR; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "O_NONBLOCK")) -#ifdef O_NONBLOCK - return O_NONBLOCK; + } + if (memEQ(name, "SEEK_END", 8)) { + /* ^ */ +#ifdef SEEK_END + *iv_return = SEEK_END; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "O_ACCMODE")) -#ifdef O_ACCMODE - return O_ACCMODE; + } + if (memEQ(name, "SEEK_SET", 8)) { + /* ^ */ +#ifdef SEEK_SET + *iv_return = SEEK_SET; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } - if (strEQ(name, "OPEN_MAX")) -#ifdef OPEN_MAX - return OPEN_MAX; + } + break; + case 'G': + if (memEQ(name, "HUGE_VAL", 8)) { + /* ^ */ +#if (defined(USE_LONG_DOUBLE) && defined(HUGE_VALL)) || defined(HUGE_VAL) + /* HUGE_VALL is admittedly non-POSIX but if we are using long doubles + * we might as well use long doubles. --jhi */ + *nv_return = +#if defined(USE_LONG_DOUBLE) && defined(HUGE_VALL) + HUGE_VALL #else - goto not_there; + HUGE_VAL #endif - if (strEQ(name, "OPOST")) -#ifdef OPOST - return OPOST; + ; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'P': - if (strEQ(name, "PATH_MAX")) -#ifdef PATH_MAX - return PATH_MAX; + } + break; + case 'I': + if (memEQ(name, "TCIFLUSH", 8)) { + /* ^ */ +#ifdef TCIFLUSH + *iv_return = TCIFLUSH; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "PARENB")) -#ifdef PARENB - return PARENB; + } + break; + case 'L': + if (memEQ(name, "EALREADY", 8)) { + /* ^ */ +#ifdef EALREADY + *iv_return = EALREADY; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "PARMRK")) -#ifdef PARMRK - return PARMRK; + } + break; + case 'M': + if (memEQ(name, "NAME_MAX", 8)) { + /* ^ */ +#ifdef NAME_MAX + *iv_return = NAME_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "PARODD")) -#ifdef PARODD - return PARODD; + } + break; + case 'N': + if (memEQ(name, "LINK_MAX", 8)) { + /* ^ */ +#ifdef LINK_MAX + *iv_return = LINK_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "PIPE_BUF")) -#ifdef PIPE_BUF - return PIPE_BUF; + } + if (memEQ(name, "LONG_MAX", 8)) { + /* ^ */ +#ifdef LONG_MAX + *iv_return = LONG_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'R': - if (strEQ(name, "RAND_MAX")) -#ifdef RAND_MAX - return RAND_MAX; + } + if (memEQ(name, "LONG_MIN", 8)) { + /* ^ */ +#ifdef LONG_MIN + *iv_return = LONG_MIN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "R_OK")) -#ifdef R_OK - return R_OK; + } + if (memEQ(name, "O_NOCTTY", 8)) { + /* ^ */ +#ifdef O_NOCTTY + *iv_return = O_NOCTTY; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'S': - if (strnEQ(name, "SIG", 3)) { - if (name[3] == '_') { - if (strEQ(name, "SIG_BLOCK")) -#ifdef SIG_BLOCK - return SIG_BLOCK; + } + if (memEQ(name, "RAND_MAX", 8)) { + /* ^ */ +#ifdef RAND_MAX + *iv_return = RAND_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif -#ifdef SIG_DFL - if (strEQ(name, "SIG_DFL")) return (IV)SIG_DFL; + } + if (memEQ(name, "UINT_MAX", 8)) { + /* ^ */ +#ifdef UINT_MAX + *iv_return = (IV) UINT_MAX; + return PERL_constant_ISUV; +#else + return PERL_constant_NOTDEF; #endif -#ifdef SIG_ERR - if (strEQ(name, "SIG_ERR")) return (IV)SIG_ERR; + } + break; + case 'O': + if (memEQ(name, "ENOTCONN", 8)) { + /* ^ */ +#ifdef ENOTCONN + *iv_return = ENOTCONN; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; #endif -#ifdef SIG_IGN - if (strEQ(name, "SIG_IGN")) return (IV)SIG_IGN; + } + if (memEQ(name, "ENOTSOCK", 8)) { + /* ^ */ +#ifdef ENOTSOCK + *iv_return = ENOTSOCK; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIG_SETMASK")) -#ifdef SIG_SETMASK - return SIG_SETMASK; + } + if (memEQ(name, "TCOFLUSH", 8)) { + /* ^ */ +#ifdef TCOFLUSH + *iv_return = TCOFLUSH; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIG_UNBLOCK")) -#ifdef SIG_UNBLOCK - return SIG_UNBLOCK; + } + break; + case 'P': + if (memEQ(name, "PIPE_BUF", 8)) { + /* ^ */ +#ifdef PIPE_BUF + *iv_return = PIPE_BUF; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } - if (strEQ(name, "SIGABRT")) -#ifdef SIGABRT - return SIGABRT; + } + break; + case 'R': + if (memEQ(name, "EPROCLIM", 8)) { + /* ^ */ +#ifdef EPROCLIM + *iv_return = EPROCLIM; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGALRM")) -#ifdef SIGALRM - return SIGALRM; + } + if (memEQ(name, "O_RDONLY", 8)) { + /* ^ */ +#ifdef O_RDONLY + *iv_return = O_RDONLY; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGCHLD")) -#ifdef SIGCHLD - return SIGCHLD; + } + if (memEQ(name, "SHRT_MAX", 8)) { + /* ^ */ +#ifdef SHRT_MAX + *iv_return = SHRT_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGCONT")) -#ifdef SIGCONT - return SIGCONT; + } + if (memEQ(name, "SHRT_MIN", 8)) { + /* ^ */ +#ifdef SHRT_MIN + *iv_return = SHRT_MIN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGFPE")) -#ifdef SIGFPE - return SIGFPE; + } + break; + case 'S': + if (memEQ(name, "EMSGSIZE", 8)) { + /* ^ */ +#ifdef EMSGSIZE + *iv_return = EMSGSIZE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGHUP")) -#ifdef SIGHUP - return SIGHUP; + } + if (memEQ(name, "F_SETLKW", 8)) { + /* ^ */ +#ifdef F_SETLKW + *iv_return = F_SETLKW; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGILL")) -#ifdef SIGILL - return SIGILL; + } + break; + case 'T': + if (memEQ(name, "PATH_MAX", 8)) { + /* ^ */ +#ifdef PATH_MAX + *iv_return = PATH_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGINT")) -#ifdef SIGINT - return SIGINT; + } + break; + case 'W': + if (memEQ(name, "O_WRONLY", 8)) { + /* ^ */ +#ifdef O_WRONLY + *iv_return = O_WRONLY; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGKILL")) -#ifdef SIGKILL - return SIGKILL; + } + break; + case '_': + if (memEQ(name, "LC_CTYPE", 8)) { + /* ^ */ +#ifdef LC_CTYPE + *iv_return = LC_CTYPE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGPIPE")) -#ifdef SIGPIPE - return SIGPIPE; + } + break; + case 't': + if (memEQ(name, "L_tmpnam", 8)) { + /* ^ */ +#ifdef L_tmpnam + *iv_return = L_tmpnam; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGQUIT")) -#ifdef SIGQUIT - return SIGQUIT; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_9 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + CHILD_MAX EHOSTDOWN ENETRESET ENOTEMPTY ESHUTDOWN ETIMEDOUT FLT_RADIX + L_ctermid L_cuserid L_tmpname MAX_CANON MAX_INPUT O_ACCMODE SCHAR_MAX + SCHAR_MIN SIG_BLOCK SSIZE_MAX TCIOFLUSH TCSADRAIN TCSAFLUSH UCHAR_MAX + ULONG_MAX USHRT_MAX WUNTRACED */ + /* Offset 3 gives the best switch position. */ + switch (name[3]) { + case 'A': + if (memEQ(name, "SCHAR_MAX", 9)) { + /* ^ */ +#ifdef SCHAR_MAX + *iv_return = SCHAR_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGSEGV")) -#ifdef SIGSEGV - return SIGSEGV; + } + if (memEQ(name, "SCHAR_MIN", 9)) { + /* ^ */ +#ifdef SCHAR_MIN + *iv_return = SCHAR_MIN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGSTOP")) -#ifdef SIGSTOP - return SIGSTOP; + } + if (memEQ(name, "TCSADRAIN", 9)) { + /* ^ */ +#ifdef TCSADRAIN + *iv_return = TCSADRAIN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGTERM")) -#ifdef SIGTERM - return SIGTERM; + } + if (memEQ(name, "TCSAFLUSH", 9)) { + /* ^ */ +#ifdef TCSAFLUSH + *iv_return = TCSAFLUSH; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGTSTP")) -#ifdef SIGTSTP - return SIGTSTP; + } + if (memEQ(name, "UCHAR_MAX", 9)) { + /* ^ */ +#ifdef UCHAR_MAX + *iv_return = (IV) UCHAR_MAX; + return PERL_constant_ISUV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGTTIN")) -#ifdef SIGTTIN - return SIGTTIN; + } + break; + case 'C': + if (memEQ(name, "O_ACCMODE", 9)) { + /* ^ */ +#ifdef O_ACCMODE + *iv_return = O_ACCMODE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGTTOU")) -#ifdef SIGTTOU - return SIGTTOU; + } + break; + case 'L': + if (memEQ(name, "CHILD_MAX", 9)) { + /* ^ */ +#ifdef CHILD_MAX + *iv_return = CHILD_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGUSR1")) -#ifdef SIGUSR1 - return SIGUSR1; + } + break; + case 'M': + if (memEQ(name, "ETIMEDOUT", 9)) { + /* ^ */ +#ifdef ETIMEDOUT + *iv_return = ETIMEDOUT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SIGUSR2")) -#ifdef SIGUSR2 - return SIGUSR2; + } + break; + case 'N': + if (memEQ(name, "ULONG_MAX", 9)) { + /* ^ */ +#ifdef ULONG_MAX + *iv_return = (IV) ULONG_MAX; + return PERL_constant_ISUV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } - if (name[1] == '_') { - if (strEQ(name, "S_ISGID")) -#ifdef S_ISGID - return S_ISGID; + } + break; + case 'O': + if (memEQ(name, "TCIOFLUSH", 9)) { + /* ^ */ +#ifdef TCIOFLUSH + *iv_return = TCIOFLUSH; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_ISUID")) -#ifdef S_ISUID - return S_ISUID; + } + break; + case 'R': + if (memEQ(name, "USHRT_MAX", 9)) { + /* ^ */ +#ifdef USHRT_MAX + *iv_return = (IV) USHRT_MAX; + return PERL_constant_ISUV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IRGRP")) -#ifdef S_IRGRP - return S_IRGRP; + } + break; + case 'S': + if (memEQ(name, "EHOSTDOWN", 9)) { + /* ^ */ +#ifdef EHOSTDOWN + *iv_return = EHOSTDOWN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IROTH")) -#ifdef S_IROTH - return S_IROTH; + } + break; + case 'T': + if (memEQ(name, "ENETRESET", 9)) { + /* ^ */ +#ifdef ENETRESET + *iv_return = ENETRESET; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IRUSR")) -#ifdef S_IRUSR - return S_IRUSR; + } + if (memEQ(name, "ENOTEMPTY", 9)) { + /* ^ */ +#ifdef ENOTEMPTY + *iv_return = ENOTEMPTY; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IRWXG")) -#ifdef S_IRWXG - return S_IRWXG; + } + if (memEQ(name, "WUNTRACED", 9)) { + /* ^ */ +#ifdef WUNTRACED + *iv_return = WUNTRACED; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IRWXO")) -#ifdef S_IRWXO - return S_IRWXO; + } + break; + case 'U': + if (memEQ(name, "ESHUTDOWN", 9)) { + /* ^ */ +#ifdef ESHUTDOWN + *iv_return = ESHUTDOWN; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IRWXU")) -#ifdef S_IRWXU - return S_IRWXU; + } + break; + case 'Z': + if (memEQ(name, "SSIZE_MAX", 9)) { + /* ^ */ +#ifdef SSIZE_MAX + *iv_return = SSIZE_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IWGRP")) -#ifdef S_IWGRP - return S_IWGRP; + } + break; + case '_': + if (memEQ(name, "FLT_RADIX", 9)) { + /* ^ */ +#ifdef FLT_RADIX + *nv_return = FLT_RADIX; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IWOTH")) -#ifdef S_IWOTH - return S_IWOTH; + } + if (memEQ(name, "MAX_CANON", 9)) { + /* ^ */ +#ifdef MAX_CANON + *iv_return = MAX_CANON; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IWUSR")) -#ifdef S_IWUSR - return S_IWUSR; + } + if (memEQ(name, "MAX_INPUT", 9)) { + /* ^ */ +#ifdef MAX_INPUT + *iv_return = MAX_INPUT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IXGRP")) -#ifdef S_IXGRP - return S_IXGRP; + } + if (memEQ(name, "SIG_BLOCK", 9)) { + /* ^ */ +#ifdef SIG_BLOCK + *iv_return = SIG_BLOCK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IXOTH")) -#ifdef S_IXOTH - return S_IXOTH; + } + break; + case 'm': + if (memEQ(name, "L_tmpname", 9)) { + /* ^ */ +#ifdef L_tmpname + *iv_return = L_tmpnam; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "S_IXUSR")) -#ifdef S_IXUSR - return S_IXUSR; + } + break; + case 't': + if (memEQ(name, "L_ctermid", 9)) { + /* ^ */ +#ifdef L_ctermid + *iv_return = L_ctermid; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - errno = EAGAIN; /* the following aren't constants */ -#ifdef S_ISBLK - if (strEQ(name, "S_ISBLK")) return S_ISBLK(arg); + } + break; + case 'u': + if (memEQ(name, "L_cuserid", 9)) { + /* ^ */ +#ifdef L_cuserid + *iv_return = L_cuserid; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; #endif -#ifdef S_ISCHR - if (strEQ(name, "S_ISCHR")) return S_ISCHR(arg); + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_10 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + EADDRINUSE ECONNRESET EOPNOTSUPP EPROTOTYPE FD_CLOEXEC FLT_ROUNDS + LC_COLLATE LC_NUMERIC MB_CUR_MAX MB_LEN_MAX O_NONBLOCK SA_NODEFER + SA_ONSTACK SA_RESTART SA_SIGINFO STREAM_MAX TZNAME_MAX */ + /* Offset 5 gives the best switch position. */ + switch (name[5]) { + case 'B': + if (memEQ(name, "O_NONBLOCK", 10)) { + /* ^ */ +#ifdef O_NONBLOCK + *iv_return = O_NONBLOCK; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; #endif -#ifdef S_ISDIR - if (strEQ(name, "S_ISDIR")) return S_ISDIR(arg); + } + break; + case 'D': + if (memEQ(name, "SA_NODEFER", 10)) { + /* ^ */ +#ifdef SA_NODEFER + *iv_return = (IV) SA_NODEFER; + return PERL_constant_ISUV; +#else + return PERL_constant_NOTDEF; #endif -#ifdef S_ISFIFO - if (strEQ(name, "S_ISFIFO")) return S_ISFIFO(arg); + } + break; + case 'E': + if (memEQ(name, "TZNAME_MAX", 10)) { + /* ^ */ +#ifdef TZNAME_MAX + *iv_return = TZNAME_MAX; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; #endif -#ifdef S_ISREG - if (strEQ(name, "S_ISREG")) return S_ISREG(arg); + } + break; + case 'G': + if (memEQ(name, "SA_SIGINFO", 10)) { + /* ^ */ +#ifdef SA_SIGINFO + *iv_return = (IV) SA_SIGINFO; + return PERL_constant_ISUV; +#else + return PERL_constant_NOTDEF; #endif - break; - } - if (strEQ(name, "SEEK_CUR")) -#ifdef SEEK_CUR - return SEEK_CUR; + } + break; + case 'I': + if (memEQ(name, "EADDRINUSE", 10)) { + /* ^ */ +#ifdef EADDRINUSE + *iv_return = EADDRINUSE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SEEK_END")) -#ifdef SEEK_END - return SEEK_END; + } + break; + case 'L': + if (memEQ(name, "LC_COLLATE", 10)) { + /* ^ */ +#ifdef LC_COLLATE + *iv_return = LC_COLLATE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SEEK_SET")) -#ifdef SEEK_SET - return SEEK_SET; + } + break; + case 'M': + if (memEQ(name, "LC_NUMERIC", 10)) { + /* ^ */ +#ifdef LC_NUMERIC + *iv_return = LC_NUMERIC; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "STREAM_MAX")) + } + if (memEQ(name, "STREAM_MAX", 10)) { + /* ^ */ #ifdef STREAM_MAX - return STREAM_MAX; + *iv_return = STREAM_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SHRT_MAX")) -#ifdef SHRT_MAX - return SHRT_MAX; + } + break; + case 'N': + if (memEQ(name, "MB_LEN_MAX", 10)) { + /* ^ */ +#ifdef MB_LEN_MAX + *iv_return = MB_LEN_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SHRT_MIN")) -#ifdef SHRT_MIN - return SHRT_MIN; + } + break; + case 'O': + if (memEQ(name, "EPROTOTYPE", 10)) { + /* ^ */ +#ifdef EPROTOTYPE + *iv_return = EPROTOTYPE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strnEQ(name, "SA_", 3)) { - if (strEQ(name, "SA_NOCLDSTOP")) -#ifdef SA_NOCLDSTOP - return SA_NOCLDSTOP; + } + if (memEQ(name, "FD_CLOEXEC", 10)) { + /* ^ */ +#ifdef FD_CLOEXEC + *iv_return = FD_CLOEXEC; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SA_NOCLDWAIT")) -#ifdef SA_NOCLDWAIT - return SA_NOCLDWAIT; + } + if (memEQ(name, "FLT_ROUNDS", 10)) { + /* ^ */ +#ifdef FLT_ROUNDS + *nv_return = FLT_ROUNDS; + return PERL_constant_ISNV; +#else + return PERL_constant_NOTDEF; +#endif + } + break; + case 'R': + if (memEQ(name, "ECONNRESET", 10)) { + /* ^ */ +#ifdef ECONNRESET + *iv_return = ECONNRESET; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; +#endif + } + if (memEQ(name, "MB_CUR_MAX", 10)) { + /* ^ */ +#ifdef MB_CUR_MAX + *iv_return = MB_CUR_MAX; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; +#endif + } + break; + case 'S': + if (memEQ(name, "SA_ONSTACK", 10)) { + /* ^ */ +#ifdef SA_ONSTACK + *iv_return = (IV) SA_ONSTACK; + return PERL_constant_ISUV; +#else + return PERL_constant_NOTDEF; +#endif + } + if (memEQ(name, "SA_RESTART", 10)) { + /* ^ */ +#ifdef SA_RESTART + *iv_return = (IV) SA_RESTART; + return PERL_constant_ISUV; +#else + return PERL_constant_NOTDEF; +#endif + } + break; + case 'T': + if (memEQ(name, "EOPNOTSUPP", 10)) { + /* ^ */ +#ifdef EOPNOTSUPP + *iv_return = EOPNOTSUPP; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; +#endif + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_11 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + DBL_EPSILON DBL_MAX_EXP DBL_MIN_EXP EINPROGRESS ENETUNREACH ENOPROTOOPT + EWOULDBLOCK FLT_EPSILON FLT_MAX_EXP FLT_MIN_EXP LC_MESSAGES LC_MONETARY + NGROUPS_MAX SIG_SETMASK SIG_UNBLOCK _SC_ARG_MAX _SC_CLK_TCK _SC_VERSION */ + /* Offset 5 gives the best switch position. */ + switch (name[5]) { + case 'A': + if (memEQ(name, "DBL_MAX_EXP", 11)) { + /* ^ */ +#ifdef DBL_MAX_EXP + *nv_return = DBL_MAX_EXP; + return PERL_constant_ISNV; +#else + return PERL_constant_NOTDEF; +#endif + } + if (memEQ(name, "FLT_MAX_EXP", 11)) { + /* ^ */ +#ifdef FLT_MAX_EXP + *nv_return = FLT_MAX_EXP; + return PERL_constant_ISNV; +#else + return PERL_constant_NOTDEF; +#endif + } + break; + case 'D': + if (memEQ(name, "EWOULDBLOCK", 11)) { + /* ^ */ +#ifdef EWOULDBLOCK + *iv_return = EWOULDBLOCK; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; +#endif + } + break; + case 'E': + if (memEQ(name, "SIG_SETMASK", 11)) { + /* ^ */ +#ifdef SIG_SETMASK + *iv_return = SIG_SETMASK; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; +#endif + } + if (memEQ(name, "_SC_VERSION", 11)) { + /* ^ */ +#ifdef _SC_VERSION + *iv_return = _SC_VERSION; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; +#endif + } + break; + case 'I': + if (memEQ(name, "DBL_MIN_EXP", 11)) { + /* ^ */ +#ifdef DBL_MIN_EXP + *nv_return = DBL_MIN_EXP; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SA_NODEFER")) -#ifdef SA_NODEFER - return SA_NODEFER; + } + if (memEQ(name, "FLT_MIN_EXP", 11)) { + /* ^ */ +#ifdef FLT_MIN_EXP + *nv_return = FLT_MIN_EXP; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SA_ONSTACK")) -#ifdef SA_ONSTACK - return SA_ONSTACK; + } + break; + case 'L': + if (memEQ(name, "_SC_CLK_TCK", 11)) { + /* ^ */ +#ifdef _SC_CLK_TCK + *iv_return = _SC_CLK_TCK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SA_RESETHAND")) -#ifdef SA_RESETHAND - return SA_RESETHAND; + } + break; + case 'N': + if (memEQ(name, "ENETUNREACH", 11)) { + /* ^ */ +#ifdef ENETUNREACH + *iv_return = ENETUNREACH; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SA_RESTART")) -#ifdef SA_RESTART - return SA_RESTART; + } + if (memEQ(name, "LC_MONETARY", 11)) { + /* ^ */ +#ifdef LC_MONETARY + *iv_return = LC_MONETARY; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SA_SIGINFO")) -#ifdef SA_SIGINFO - return SA_SIGINFO; + } + if (memEQ(name, "SIG_UNBLOCK", 11)) { + /* ^ */ +#ifdef SIG_UNBLOCK + *iv_return = SIG_UNBLOCK; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } - if (strEQ(name, "SCHAR_MAX")) -#ifdef SCHAR_MAX - return SCHAR_MAX; + } + break; + case 'O': + if (memEQ(name, "EINPROGRESS", 11)) { + /* ^ */ +#ifdef EINPROGRESS + *iv_return = EINPROGRESS; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SCHAR_MIN")) -#ifdef SCHAR_MIN - return SCHAR_MIN; + } + if (memEQ(name, "ENOPROTOOPT", 11)) { + /* ^ */ +#ifdef ENOPROTOOPT + *iv_return = ENOPROTOOPT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "SSIZE_MAX")) -#ifdef SSIZE_MAX - return SSIZE_MAX; + } + break; + case 'P': + if (memEQ(name, "DBL_EPSILON", 11)) { + /* ^ */ +#ifdef DBL_EPSILON + *nv_return = DBL_EPSILON; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "STDIN_FILENO")) -#ifdef STDIN_FILENO - return STDIN_FILENO; + } + if (memEQ(name, "FLT_EPSILON", 11)) { + /* ^ */ +#ifdef FLT_EPSILON + *nv_return = FLT_EPSILON; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "STDOUT_FILENO")) -#ifdef STDOUT_FILENO - return STDOUT_FILENO; + } + if (memEQ(name, "NGROUPS_MAX", 11)) { + /* ^ */ +#ifdef NGROUPS_MAX + *iv_return = NGROUPS_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "STDERR_FILENO")) -#ifdef STDERR_FILENO - return STDERR_FILENO; + } + break; + case 'R': + if (memEQ(name, "_SC_ARG_MAX", 11)) { + /* ^ */ +#ifdef _SC_ARG_MAX + *iv_return = _SC_ARG_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'T': - if (strEQ(name, "TCIFLUSH")) -#ifdef TCIFLUSH - return TCIFLUSH; + } + break; + case 'S': + if (memEQ(name, "LC_MESSAGES", 11)) { + /* ^ */ +#ifdef LC_MESSAGES + *iv_return = LC_MESSAGES; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "TCIOFF")) -#ifdef TCIOFF - return TCIOFF; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_12 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + DBL_MANT_DIG EAFNOSUPPORT ECONNABORTED ECONNREFUSED EDESTADDRREQ + EHOSTUNREACH ENAMETOOLONG EPFNOSUPPORT ETOOMANYREFS EXIT_FAILURE + EXIT_SUCCESS FILENAME_MAX FLT_MANT_DIG LDBL_EPSILON LDBL_MAX_EXP + LDBL_MIN_EXP SA_NOCLDSTOP SA_NOCLDWAIT SA_RESETHAND STDIN_FILENO + _PC_LINK_MAX _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF + _PC_VDISABLE _SC_OPEN_MAX */ + /* Offset 7 gives the best switch position. */ + switch (name[7]) { + case 'C': + if (memEQ(name, "EXIT_SUCCESS", 12)) { + /* ^ */ +#ifdef EXIT_SUCCESS + *iv_return = EXIT_SUCCESS; + return PERL_constant_ISIV; #else - goto not_there; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "TCIOFLUSH")) -#ifdef TCIOFLUSH - return TCIOFLUSH; + } + break; + case 'D': + if (memEQ(name, "EDESTADDRREQ", 12)) { + /* ^ */ +#ifdef EDESTADDRREQ + *iv_return = EDESTADDRREQ; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "TCION")) -#ifdef TCION - return TCION; + } + if (memEQ(name, "SA_NOCLDSTOP", 12)) { + /* ^ */ +#ifdef SA_NOCLDSTOP + *iv_return = (IV) SA_NOCLDSTOP; + return PERL_constant_ISUV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "TCOFLUSH")) -#ifdef TCOFLUSH - return TCOFLUSH; + } + if (memEQ(name, "SA_NOCLDWAIT", 12)) { + /* ^ */ +#ifdef SA_NOCLDWAIT + *iv_return = (IV) SA_NOCLDWAIT; + return PERL_constant_ISUV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "TCOOFF")) -#ifdef TCOOFF - return TCOOFF; + } + break; + case 'E': + if (memEQ(name, "FILENAME_MAX", 12)) { + /* ^ */ +#ifdef FILENAME_MAX + *iv_return = FILENAME_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "TCOON")) -#ifdef TCOON - return TCOON; + } + if (memEQ(name, "_PC_NAME_MAX", 12)) { + /* ^ */ +#ifdef _PC_NAME_MAX + *iv_return = _PC_NAME_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "TCSADRAIN")) -#ifdef TCSADRAIN - return TCSADRAIN; + } + if (memEQ(name, "_PC_PIPE_BUF", 12)) { + /* ^ */ +#ifdef _PC_PIPE_BUF + *iv_return = _PC_PIPE_BUF; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "TCSAFLUSH")) -#ifdef TCSAFLUSH - return TCSAFLUSH; + } + break; + case 'F': + if (memEQ(name, "ECONNREFUSED", 12)) { + /* ^ */ +#ifdef ECONNREFUSED + *iv_return = ECONNREFUSED; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "TCSANOW")) -#ifdef TCSANOW - return TCSANOW; + } + break; + case 'H': + if (memEQ(name, "_PC_PATH_MAX", 12)) { + /* ^ */ +#ifdef _PC_PATH_MAX + *iv_return = _PC_PATH_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "TMP_MAX")) -#ifdef TMP_MAX - return TMP_MAX; + } + break; + case 'I': + if (memEQ(name, "EXIT_FAILURE", 12)) { + /* ^ */ +#ifdef EXIT_FAILURE + *iv_return = EXIT_FAILURE; + return PERL_constant_ISIV; #else - goto not_there; + *iv_return = 1; + return PERL_constant_ISIV; #endif - if (strEQ(name, "TOSTOP")) -#ifdef TOSTOP - return TOSTOP; + } + if (memEQ(name, "STDIN_FILENO", 12)) { + /* ^ */ +#ifdef STDIN_FILENO + *iv_return = STDIN_FILENO; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "TZNAME_MAX")) -#ifdef TZNAME_MAX - return TZNAME_MAX; + } + break; + case 'K': + if (memEQ(name, "_PC_LINK_MAX", 12)) { + /* ^ */ +#ifdef _PC_LINK_MAX + *iv_return = _PC_LINK_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'U': - if (strEQ(name, "UCHAR_MAX")) -#ifdef UCHAR_MAX - return UCHAR_MAX; + } + break; + case 'N': + if (memEQ(name, "LDBL_MIN_EXP", 12)) { + /* ^ */ +#ifdef LDBL_MIN_EXP + *nv_return = LDBL_MIN_EXP; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "UINT_MAX")) -#ifdef UINT_MAX - return UINT_MAX; + } + if (memEQ(name, "_SC_OPEN_MAX", 12)) { + /* ^ */ +#ifdef _SC_OPEN_MAX + *iv_return = _SC_OPEN_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "ULONG_MAX")) -#ifdef ULONG_MAX - return ULONG_MAX; + } + break; + case 'O': + if (memEQ(name, "ECONNABORTED", 12)) { + /* ^ */ +#ifdef ECONNABORTED + *iv_return = ECONNABORTED; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "USHRT_MAX")) -#ifdef USHRT_MAX - return USHRT_MAX; + } + if (memEQ(name, "ENAMETOOLONG", 12)) { + /* ^ */ +#ifdef ENAMETOOLONG + *iv_return = ENAMETOOLONG; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'V': - if (strEQ(name, "VEOF")) -#ifdef VEOF - return VEOF; + } + break; + case 'P': + if (memEQ(name, "EAFNOSUPPORT", 12)) { + /* ^ */ +#ifdef EAFNOSUPPORT + *iv_return = EAFNOSUPPORT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "VEOL")) -#ifdef VEOL - return VEOL; + } + if (memEQ(name, "EPFNOSUPPORT", 12)) { + /* ^ */ +#ifdef EPFNOSUPPORT + *iv_return = EPFNOSUPPORT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "VERASE")) -#ifdef VERASE - return VERASE; + } + break; + case 'R': + if (memEQ(name, "EHOSTUNREACH", 12)) { + /* ^ */ +#ifdef EHOSTUNREACH + *iv_return = EHOSTUNREACH; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "VINTR")) -#ifdef VINTR - return VINTR; + } + break; + case 'S': + if (memEQ(name, "LDBL_EPSILON", 12)) { + /* ^ */ +#ifdef LDBL_EPSILON + *nv_return = LDBL_EPSILON; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "VKILL")) -#ifdef VKILL - return VKILL; + } + if (memEQ(name, "_PC_VDISABLE", 12)) { + /* ^ */ +#ifdef _PC_VDISABLE + *iv_return = _PC_VDISABLE; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "VMIN")) -#ifdef VMIN - return VMIN; + } + break; + case 'T': + if (memEQ(name, "DBL_MANT_DIG", 12)) { + /* ^ */ +#ifdef DBL_MANT_DIG + *nv_return = DBL_MANT_DIG; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "VQUIT")) -#ifdef VQUIT - return VQUIT; + } + if (memEQ(name, "FLT_MANT_DIG", 12)) { + /* ^ */ +#ifdef FLT_MANT_DIG + *nv_return = FLT_MANT_DIG; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "VSTART")) -#ifdef VSTART - return VSTART; + } + if (memEQ(name, "SA_RESETHAND", 12)) { + /* ^ */ +#ifdef SA_RESETHAND + *iv_return = (IV) SA_RESETHAND; + return PERL_constant_ISUV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "VSTOP")) -#ifdef VSTOP - return VSTOP; + } + if (memEQ(name, "_PC_NO_TRUNC", 12)) { + /* ^ */ +#ifdef _PC_NO_TRUNC + *iv_return = _PC_NO_TRUNC; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "VSUSP")) -#ifdef VSUSP - return VSUSP; + } + break; + case 'X': + if (memEQ(name, "LDBL_MAX_EXP", 12)) { + /* ^ */ +#ifdef LDBL_MAX_EXP + *nv_return = LDBL_MAX_EXP; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "VTIME")) -#ifdef VTIME - return VTIME; + } + break; + case 'Y': + if (memEQ(name, "ETOOMANYREFS", 12)) { + /* ^ */ +#ifdef ETOOMANYREFS + *iv_return = ETOOMANYREFS; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case 'W': - if (strEQ(name, "W_OK")) -#ifdef W_OK - return W_OK; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_13 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + EADDRNOTAVAIL LDBL_MANT_DIG STDERR_FILENO STDOUT_FILENO _PC_MAX_CANON + _PC_MAX_INPUT _SC_CHILD_MAX _SC_SAVED_IDS */ + /* Offset 10 gives the best switch position. */ + switch (name[10]) { + case 'A': + if (memEQ(name, "EADDRNOTAVAIL", 13)) { + /* ^ */ +#ifdef EADDRNOTAVAIL + *iv_return = EADDRNOTAVAIL; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "WNOHANG")) -#ifdef WNOHANG - return WNOHANG; + } + break; + case 'D': + if (memEQ(name, "LDBL_MANT_DIG", 13)) { + /* ^ */ +#ifdef LDBL_MANT_DIG + *nv_return = LDBL_MANT_DIG; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "WUNTRACED")) -#ifdef WUNTRACED - return WUNTRACED; + } + break; + case 'E': + if (memEQ(name, "STDERR_FILENO", 13)) { + /* ^ */ +#ifdef STDERR_FILENO + *iv_return = STDERR_FILENO; + return PERL_constant_ISIV; #else - goto not_there; -#endif - errno = EAGAIN; /* the following aren't constants */ -#ifdef WEXITSTATUS - if (strEQ(name, "WEXITSTATUS")) return WEXITSTATUS(arg); -#endif -#ifdef WIFEXITED - if (strEQ(name, "WIFEXITED")) return WIFEXITED(arg); + return PERL_constant_NOTDEF; #endif -#ifdef WIFSIGNALED - if (strEQ(name, "WIFSIGNALED")) return WIFSIGNALED(arg); -#endif -#ifdef WIFSTOPPED - if (strEQ(name, "WIFSTOPPED")) return WIFSTOPPED(arg); -#endif -#ifdef WSTOPSIG - if (strEQ(name, "WSTOPSIG")) return WSTOPSIG(arg); -#endif -#ifdef WTERMSIG - if (strEQ(name, "WTERMSIG")) return WTERMSIG(arg); + } + if (memEQ(name, "STDOUT_FILENO", 13)) { + /* ^ */ +#ifdef STDOUT_FILENO + *iv_return = STDOUT_FILENO; + return PERL_constant_ISIV; +#else + return PERL_constant_NOTDEF; #endif - break; - case 'X': - if (strEQ(name, "X_OK")) -#ifdef X_OK - return X_OK; + } + break; + case 'I': + if (memEQ(name, "_SC_SAVED_IDS", 13)) { + /* ^ */ +#ifdef _SC_SAVED_IDS + *iv_return = _SC_SAVED_IDS; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - case '_': - if (strnEQ(name, "_PC_", 4)) { - if (strEQ(name, "_PC_CHOWN_RESTRICTED")) -#if defined(_PC_CHOWN_RESTRICTED) || HINT_SC_EXIST - return _PC_CHOWN_RESTRICTED; + } + break; + case 'M': + if (memEQ(name, "_SC_CHILD_MAX", 13)) { + /* ^ */ +#ifdef _SC_CHILD_MAX + *iv_return = _SC_CHILD_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_PC_LINK_MAX")) -#if defined(_PC_LINK_MAX) || HINT_SC_EXIST - return _PC_LINK_MAX; + } + break; + case 'N': + if (memEQ(name, "_PC_MAX_CANON", 13)) { + /* ^ */ +#ifdef _PC_MAX_CANON + *iv_return = _PC_MAX_CANON; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_PC_MAX_CANON")) -#if defined(_PC_MAX_CANON) || HINT_SC_EXIST - return _PC_MAX_CANON; + } + break; + case 'P': + if (memEQ(name, "_PC_MAX_INPUT", 13)) { + /* ^ */ +#ifdef _PC_MAX_INPUT + *iv_return = _PC_MAX_INPUT; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_PC_MAX_INPUT")) -#if defined(_PC_MAX_INPUT) || HINT_SC_EXIST - return _PC_MAX_INPUT; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_14 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + CLOCKS_PER_SEC DBL_MAX_10_EXP DBL_MIN_10_EXP FLT_MAX_10_EXP FLT_MIN_10_EXP + _POSIX_ARG_MAX _POSIX_VERSION _SC_STREAM_MAX _SC_TZNAME_MAX */ + /* Offset 5 gives the best switch position. */ + switch (name[5]) { + case 'A': + if (memEQ(name, "DBL_MAX_10_EXP", 14)) { + /* ^ */ +#ifdef DBL_MAX_10_EXP + *nv_return = DBL_MAX_10_EXP; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_PC_NAME_MAX")) -#if defined(_PC_NAME_MAX) || HINT_SC_EXIST - return _PC_NAME_MAX; + } + if (memEQ(name, "FLT_MAX_10_EXP", 14)) { + /* ^ */ +#ifdef FLT_MAX_10_EXP + *nv_return = FLT_MAX_10_EXP; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_PC_NO_TRUNC")) -#if defined(_PC_NO_TRUNC) || HINT_SC_EXIST - return _PC_NO_TRUNC; + } + break; + case 'I': + if (memEQ(name, "DBL_MIN_10_EXP", 14)) { + /* ^ */ +#ifdef DBL_MIN_10_EXP + *nv_return = DBL_MIN_10_EXP; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_PC_PATH_MAX")) -#if defined(_PC_PATH_MAX) || HINT_SC_EXIST - return _PC_PATH_MAX; + } + if (memEQ(name, "FLT_MIN_10_EXP", 14)) { + /* ^ */ +#ifdef FLT_MIN_10_EXP + *nv_return = FLT_MIN_10_EXP; + return PERL_constant_ISNV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_PC_PIPE_BUF")) -#if defined(_PC_PIPE_BUF) || HINT_SC_EXIST - return _PC_PIPE_BUF; + } + break; + case 'S': + if (memEQ(name, "CLOCKS_PER_SEC", 14)) { + /* ^ */ +#ifdef CLOCKS_PER_SEC + *iv_return = CLOCKS_PER_SEC; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_PC_VDISABLE")) -#if defined(_PC_VDISABLE) || HINT_SC_EXIST - return _PC_VDISABLE; + } + break; + case 'T': + if (memEQ(name, "_SC_STREAM_MAX", 14)) { + /* ^ */ +#ifdef _SC_STREAM_MAX + *iv_return = _SC_STREAM_MAX; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } - if (strnEQ(name, "_POSIX_", 7)) { - if (strEQ(name, "_POSIX_ARG_MAX")) + } + break; + case 'X': + if (memEQ(name, "_POSIX_ARG_MAX", 14)) { + /* ^ */ #ifdef _POSIX_ARG_MAX - return _POSIX_ARG_MAX; + *iv_return = _POSIX_ARG_MAX; + return PERL_constant_ISIV; #else - return 0; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_POSIX_CHILD_MAX")) -#ifdef _POSIX_CHILD_MAX - return _POSIX_CHILD_MAX; + } + if (memEQ(name, "_POSIX_VERSION", 14)) { + /* ^ */ +#ifdef _POSIX_VERSION + *iv_return = _POSIX_VERSION; + return PERL_constant_ISIV; #else - return 0; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_POSIX_CHOWN_RESTRICTED")) -#ifdef _POSIX_CHOWN_RESTRICTED - return _POSIX_CHOWN_RESTRICTED; + } + break; + case 'Z': + if (memEQ(name, "_SC_TZNAME_MAX", 14)) { + /* ^ */ +#ifdef _SC_TZNAME_MAX + *iv_return = _SC_TZNAME_MAX; + return PERL_constant_ISIV; #else - return 0; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_POSIX_JOB_CONTROL")) -#ifdef _POSIX_JOB_CONTROL - return _POSIX_JOB_CONTROL; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_15 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + EPROTONOSUPPORT ESOCKTNOSUPPORT LDBL_MAX_10_EXP LDBL_MIN_10_EXP + _POSIX_LINK_MAX _POSIX_NAME_MAX _POSIX_NO_TRUNC _POSIX_OPEN_MAX + _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_VDISABLE _SC_JOB_CONTROL + _SC_NGROUPS_MAX */ + /* Offset 9 gives the best switch position. */ + switch (name[9]) { + case '1': + if (memEQ(name, "LDBL_MAX_10_EXP", 15)) { + /* ^ */ +#ifdef LDBL_MAX_10_EXP + *nv_return = LDBL_MAX_10_EXP; + return PERL_constant_ISNV; #else - return 0; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_POSIX_LINK_MAX")) -#ifdef _POSIX_LINK_MAX - return _POSIX_LINK_MAX; + } + if (memEQ(name, "LDBL_MIN_10_EXP", 15)) { + /* ^ */ +#ifdef LDBL_MIN_10_EXP + *nv_return = LDBL_MIN_10_EXP; + return PERL_constant_ISNV; #else - return 0; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_POSIX_MAX_CANON")) -#ifdef _POSIX_MAX_CANON - return _POSIX_MAX_CANON; + } + break; + case 'E': + if (memEQ(name, "_POSIX_OPEN_MAX", 15)) { + /* ^ */ +#ifdef _POSIX_OPEN_MAX + *iv_return = _POSIX_OPEN_MAX; + return PERL_constant_ISIV; #else - return 0; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_POSIX_MAX_INPUT")) -#ifdef _POSIX_MAX_INPUT - return _POSIX_MAX_INPUT; + } + break; + case 'I': + if (memEQ(name, "_POSIX_VDISABLE", 15)) { + /* ^ */ +#ifdef _POSIX_VDISABLE + *iv_return = _POSIX_VDISABLE; + return PERL_constant_ISIV; #else - return 0; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_POSIX_NAME_MAX")) + } + break; + case 'M': + if (memEQ(name, "_POSIX_NAME_MAX", 15)) { + /* ^ */ #ifdef _POSIX_NAME_MAX - return _POSIX_NAME_MAX; -#else - return 0; -#endif - if (strEQ(name, "_POSIX_NGROUPS_MAX")) -#ifdef _POSIX_NGROUPS_MAX - return _POSIX_NGROUPS_MAX; -#else - return 0; -#endif - if (strEQ(name, "_POSIX_NO_TRUNC")) -#ifdef _POSIX_NO_TRUNC - return _POSIX_NO_TRUNC; + *iv_return = _POSIX_NAME_MAX; + return PERL_constant_ISIV; #else - return 0; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_POSIX_OPEN_MAX")) -#ifdef _POSIX_OPEN_MAX - return _POSIX_OPEN_MAX; + } + break; + case 'N': + if (memEQ(name, "_POSIX_LINK_MAX", 15)) { + /* ^ */ +#ifdef _POSIX_LINK_MAX + *iv_return = _POSIX_LINK_MAX; + return PERL_constant_ISIV; #else - return 0; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_POSIX_PATH_MAX")) -#ifdef _POSIX_PATH_MAX - return _POSIX_PATH_MAX; + } + break; + case 'O': + if (memEQ(name, "_SC_JOB_CONTROL", 15)) { + /* ^ */ +#ifdef _SC_JOB_CONTROL + *iv_return = _SC_JOB_CONTROL; + return PERL_constant_ISIV; #else - return 0; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_POSIX_PIPE_BUF")) + } + break; + case 'P': + if (memEQ(name, "_POSIX_PIPE_BUF", 15)) { + /* ^ */ #ifdef _POSIX_PIPE_BUF - return _POSIX_PIPE_BUF; + *iv_return = _POSIX_PIPE_BUF; + return PERL_constant_ISIV; #else - return 0; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_POSIX_SAVED_IDS")) -#ifdef _POSIX_SAVED_IDS - return _POSIX_SAVED_IDS; + } + if (memEQ(name, "_SC_NGROUPS_MAX", 15)) { + /* ^ */ +#ifdef _SC_NGROUPS_MAX + *iv_return = _SC_NGROUPS_MAX; + return PERL_constant_ISIV; #else - return 0; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_POSIX_SSIZE_MAX")) -#ifdef _POSIX_SSIZE_MAX - return _POSIX_SSIZE_MAX; + } + break; + case 'T': + if (memEQ(name, "_POSIX_PATH_MAX", 15)) { + /* ^ */ +#ifdef _POSIX_PATH_MAX + *iv_return = _POSIX_PATH_MAX; + return PERL_constant_ISIV; #else - return 0; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_POSIX_STREAM_MAX")) -#ifdef _POSIX_STREAM_MAX - return _POSIX_STREAM_MAX; + } + break; + case 'U': + if (memEQ(name, "EPROTONOSUPPORT", 15)) { + /* ^ */ +#ifdef EPROTONOSUPPORT + *iv_return = EPROTONOSUPPORT; + return PERL_constant_ISIV; #else - return 0; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_POSIX_TZNAME_MAX")) -#ifdef _POSIX_TZNAME_MAX - return _POSIX_TZNAME_MAX; + } + if (memEQ(name, "ESOCKTNOSUPPORT", 15)) { + /* ^ */ +#ifdef ESOCKTNOSUPPORT + *iv_return = ESOCKTNOSUPPORT; + return PERL_constant_ISIV; #else - return 0; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_POSIX_VDISABLE")) -#ifdef _POSIX_VDISABLE - return _POSIX_VDISABLE; + } + break; + case '_': + if (memEQ(name, "_POSIX_NO_TRUNC", 15)) { + /* ^ */ +#ifdef _POSIX_NO_TRUNC + *iv_return = _POSIX_NO_TRUNC; + return PERL_constant_ISIV; #else - return 0; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_POSIX_VERSION")) -#ifdef _POSIX_VERSION - return _POSIX_VERSION; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant_16 (const char *name, IV *iv_return, NV *nv_return) { + /* When generated this function returned values for the list of names given + here. However, subsequent manual editing may have added or removed some. + _POSIX_CHILD_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_SAVED_IDS + _POSIX_SSIZE_MAX */ + /* Offset 11 gives the best switch position. */ + switch (name[11]) { + case 'C': + if (memEQ(name, "_POSIX_MAX_CANON", 16)) { + /* ^ */ +#ifdef _POSIX_MAX_CANON + *iv_return = _POSIX_MAX_CANON; + return PERL_constant_ISIV; #else - return 0; + *iv_return = 0; + return PERL_constant_ISIV; #endif - break; - } - if (strnEQ(name, "_SC_", 4)) { - if (strEQ(name, "_SC_ARG_MAX")) -#if defined(_SC_ARG_MAX) || HINT_SC_EXIST - return _SC_ARG_MAX; + } + break; + case 'D': + if (memEQ(name, "_POSIX_CHILD_MAX", 16)) { + /* ^ */ +#ifdef _POSIX_CHILD_MAX + *iv_return = _POSIX_CHILD_MAX; + return PERL_constant_ISIV; #else - goto not_there; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_SC_CHILD_MAX")) -#if defined(_SC_CHILD_MAX) || HINT_SC_EXIST - return _SC_CHILD_MAX; + } + if (memEQ(name, "_POSIX_SAVED_IDS", 16)) { + /* ^ */ +#ifdef _POSIX_SAVED_IDS + *iv_return = 1; + return PERL_constant_ISIV; #else - goto not_there; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_SC_CLK_TCK")) -#if defined(_SC_CLK_TCK) || HINT_SC_EXIST - return _SC_CLK_TCK; + } + break; + case 'E': + if (memEQ(name, "_POSIX_SSIZE_MAX", 16)) { + /* ^ */ +#ifdef _POSIX_SSIZE_MAX + *iv_return = _POSIX_SSIZE_MAX; + return PERL_constant_ISIV; #else - goto not_there; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_SC_JOB_CONTROL")) -#if defined(_SC_JOB_CONTROL) || HINT_SC_EXIST - return _SC_JOB_CONTROL; + } + break; + case 'I': + if (memEQ(name, "_POSIX_MAX_INPUT", 16)) { + /* ^ */ +#ifdef _POSIX_MAX_INPUT + *iv_return = _POSIX_MAX_INPUT; + return PERL_constant_ISIV; #else - goto not_there; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_SC_NGROUPS_MAX")) -#if defined(_SC_NGROUPS_MAX) || HINT_SC_EXIST - return _SC_NGROUPS_MAX; + } + break; + } + return PERL_constant_NOTFOUND; +} + +static int +constant (const char *name, STRLEN len, IV *iv_return, NV *nv_return) { + /* Initially switch on the length of the name. */ + /* When generated this function returned values for the list of names given + in this section of perl code. Rather than manually editing these functions + to add or remove constants, which would result in this comment and section + of code becoming inaccurate, we recommend that you edit this section of + code, and use it to regenerate a new set of constant functions which you + then use to replace the originals. + + Regenerate these constant functions by feeding this entire source file to + perl -x + +#!../../perl -w +use ExtUtils::Constant qw (constant_types C_constant XS_constant); + +my $types = {map {($_, 1)} qw(IV NV UV)}; +my @names = (qw(ARG_MAX B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400 B300 + B38400 B4800 B50 B600 B75 B9600 BRKINT BUFSIZ CHAR_BIT CHAR_MAX + CHAR_MIN CHILD_MAX CLK_TCK CLOCAL CLOCKS_PER_SEC CREAD CS5 CS6 + CS7 CS8 CSIZE CSTOPB E2BIG EACCES EADDRINUSE EADDRNOTAVAIL + EAFNOSUPPORT EAGAIN EALREADY EBADF EBUSY ECHILD ECHO ECHOE ECHOK + ECHONL ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ + EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH + EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK + EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE + ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM ENOPROTOOPT ENOSPC + ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO + EOF EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROTONOSUPPORT + EPROTOTYPE ERANGE EREMOTE ERESTART EROFS ESHUTDOWN + ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS + ETXTBSY EUSERS EWOULDBLOCK EXDEV FD_CLOEXEC FILENAME_MAX F_DUPFD + F_GETFD F_GETFL F_GETLK F_OK F_RDLCK F_SETFD F_SETFL F_SETLK + F_SETLKW F_UNLCK F_WRLCK HUPCL ICANON ICRNL IEXTEN IGNBRK IGNCR + IGNPAR INLCR INPCK INT_MAX INT_MIN ISIG ISTRIP IXOFF IXON LC_ALL + LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME + LINK_MAX LONG_MAX LONG_MIN L_ctermid L_cuserid L_tmpnam + MAX_CANON MAX_INPUT MB_CUR_MAX MB_LEN_MAX NAME_MAX NCCS + NGROUPS_MAX NOFLSH OPEN_MAX OPOST O_ACCMODE O_APPEND O_CREAT + O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC O_WRONLY + PARENB PARMRK PARODD PATH_MAX PIPE_BUF RAND_MAX R_OK SCHAR_MAX + SCHAR_MIN SEEK_CUR SEEK_END SEEK_SET SHRT_MAX SHRT_MIN SIGABRT + SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL + SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU + SIGUSR1 SIGUSR2 SIG_BLOCK SIG_SETMASK SIG_UNBLOCK SSIZE_MAX + STDERR_FILENO STDIN_FILENO STDOUT_FILENO STREAM_MAX S_IRGRP + S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID S_IWGRP + S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR TCIFLUSH TCIOFF + TCIOFLUSH TCION TCOFLUSH TCOOFF TCOON TCSADRAIN TCSAFLUSH + TCSANOW TMP_MAX TOSTOP TZNAME_MAX VEOF VEOL VERASE VINTR VKILL + VMIN VQUIT VSTART VSTOP VSUSP VTIME WNOHANG WUNTRACED W_OK X_OK + _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT + _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF _PC_VDISABLE + _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL + _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_SAVED_IDS _SC_STREAM_MAX + _SC_TZNAME_MAX _SC_VERSION), + {name=>"DBL_DIG", type=>"NV"}, + {name=>"DBL_EPSILON", type=>"NV"}, + {name=>"DBL_MANT_DIG", type=>"NV"}, + {name=>"DBL_MAX", type=>"NV"}, + {name=>"DBL_MAX_10_EXP", type=>"NV"}, + {name=>"DBL_MAX_EXP", type=>"NV"}, + {name=>"DBL_MIN", type=>"NV"}, + {name=>"DBL_MIN_10_EXP", type=>"NV"}, + {name=>"DBL_MIN_EXP", type=>"NV"}, + {name=>"EXIT_FAILURE", type=>"IV", default=>["IV", "1"]}, + {name=>"EXIT_SUCCESS", type=>"IV", default=>["IV", "0"]}, + {name=>"FLT_DIG", type=>"NV"}, + {name=>"FLT_EPSILON", type=>"NV"}, + {name=>"FLT_MANT_DIG", type=>"NV"}, + {name=>"FLT_MAX", type=>"NV"}, + {name=>"FLT_MAX_10_EXP", type=>"NV"}, + {name=>"FLT_MAX_EXP", type=>"NV"}, + {name=>"FLT_MIN", type=>"NV"}, + {name=>"FLT_MIN_10_EXP", type=>"NV"}, + {name=>"FLT_MIN_EXP", type=>"NV"}, + {name=>"FLT_RADIX", type=>"NV"}, + {name=>"FLT_ROUNDS", type=>"NV"}, + {name=>"HUGE_VAL", type=>"NV", macro=>["#if (defined(USE_LONG_DOUBLE) && defined(HUGE_VALL)) || defined(HUGE_VAL)\n\t/" . "* HUGE_VALL is admittedly non-POSIX but if we are using long doubles\n\t * we might as well use long doubles. --jhi *" . "/\n", "#endif\n"], value=>"\n#if defined(USE_LONG_DOUBLE) && defined(HUGE_VALL)\n HUGE_VALL\n#else\n HUGE_VAL\n#endif\n "}, + {name=>"LDBL_DIG", type=>"NV"}, + {name=>"LDBL_EPSILON", type=>"NV"}, + {name=>"LDBL_MANT_DIG", type=>"NV"}, + {name=>"LDBL_MAX", type=>"NV"}, + {name=>"LDBL_MAX_10_EXP", type=>"NV"}, + {name=>"LDBL_MAX_EXP", type=>"NV"}, + {name=>"LDBL_MIN", type=>"NV"}, + {name=>"LDBL_MIN_10_EXP", type=>"NV"}, + {name=>"LDBL_MIN_EXP", type=>"NV"}, + {name=>"L_tmpname", type=>"IV", value=>"L_tmpnam"}, + {name=>"NULL", type=>"IV", value=>"0"}, + {name=>"SA_NOCLDSTOP", type=>"UV"}, + {name=>"SA_NOCLDWAIT", type=>"UV"}, + {name=>"SA_NODEFER", type=>"UV"}, + {name=>"SA_ONSTACK", type=>"UV"}, + {name=>"SA_RESETHAND", type=>"UV"}, + {name=>"SA_RESTART", type=>"UV"}, + {name=>"SA_SIGINFO", type=>"UV"}, + {name=>"SIG_DFL", type=>"IV", value=>"(IV)SIG_DFL"}, + {name=>"SIG_ERR", type=>"IV", value=>"(IV)SIG_ERR"}, + {name=>"SIG_IGN", type=>"IV", value=>"(IV)SIG_IGN"}, + {name=>"UCHAR_MAX", type=>"UV"}, + {name=>"UINT_MAX", type=>"UV"}, + {name=>"ULONG_MAX", type=>"UV"}, + {name=>"USHRT_MAX", type=>"UV"}, + {name=>"_POSIX_ARG_MAX", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_CHILD_MAX", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_CHOWN_RESTRICTED", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_JOB_CONTROL", type=>"IV", value=>"1", default=>["IV", "0"]}, + {name=>"_POSIX_LINK_MAX", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_MAX_CANON", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_MAX_INPUT", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_NAME_MAX", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_NGROUPS_MAX", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_NO_TRUNC", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_OPEN_MAX", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_PATH_MAX", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_PIPE_BUF", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_SAVED_IDS", type=>"IV", value=>"1", default=>["IV", "0"]}, + {name=>"_POSIX_SSIZE_MAX", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_STREAM_MAX", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_TZNAME_MAX", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_VDISABLE", type=>"IV", default=>["IV", "0"]}, + {name=>"_POSIX_VERSION", type=>"IV", default=>["IV", "0"]}); + +print constant_types(); # macro defs +foreach (C_constant ("POSIX", 'constant', 'IV', $types, undef, 3, @names) ) { + print $_, "\n"; # C constant subs +} +print "#### XS Section:\n"; +print XS_constant ("POSIX", $types); +__END__ + */ + + switch (len) { + case 2: + if (memEQ(name, "B0", 2)) { +#ifdef B0 + *iv_return = B0; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - if (strEQ(name, "_SC_OPEN_MAX")) -#if defined(_SC_OPEN_MAX) || HINT_SC_EXIST - return _SC_OPEN_MAX; + } + break; + case 3: + return constant_3 (name, iv_return, nv_return); + break; + case 4: + return constant_4 (name, iv_return, nv_return); + break; + case 5: + return constant_5 (name, iv_return, nv_return); + break; + case 6: + return constant_6 (name, iv_return, nv_return); + break; + case 7: + return constant_7 (name, iv_return, nv_return); + break; + case 8: + return constant_8 (name, iv_return, nv_return); + break; + case 9: + return constant_9 (name, iv_return, nv_return); + break; + case 10: + return constant_10 (name, iv_return, nv_return); + break; + case 11: + return constant_11 (name, iv_return, nv_return); + break; + case 12: + return constant_12 (name, iv_return, nv_return); + break; + case 13: + return constant_13 (name, iv_return, nv_return); + break; + case 14: + return constant_14 (name, iv_return, nv_return); + break; + case 15: + return constant_15 (name, iv_return, nv_return); + break; + case 16: + return constant_16 (name, iv_return, nv_return); + break; + case 17: + /* Names all of length 17. */ + /* _POSIX_STREAM_MAX _POSIX_TZNAME_MAX */ + /* Offset 7 gives the best switch position. */ + switch (name[7]) { + case 'S': + if (memEQ(name, "_POSIX_STREAM_MAX", 17)) { + /* ^ */ +#ifdef _POSIX_STREAM_MAX + *iv_return = _POSIX_STREAM_MAX; + return PERL_constant_ISIV; #else - goto not_there; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_SC_SAVED_IDS")) -#if defined(_SC_SAVED_IDS) || HINT_SC_EXIST - return _SC_SAVED_IDS; + } + break; + case 'T': + if (memEQ(name, "_POSIX_TZNAME_MAX", 17)) { + /* ^ */ +#ifdef _POSIX_TZNAME_MAX + *iv_return = _POSIX_TZNAME_MAX; + return PERL_constant_ISIV; #else - goto not_there; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_SC_STREAM_MAX")) -#if defined(_SC_STREAM_MAX) || HINT_SC_EXIST - return _SC_STREAM_MAX; + } + break; + } + break; + case 18: + /* Names all of length 18. */ + /* _POSIX_JOB_CONTROL _POSIX_NGROUPS_MAX */ + /* Offset 12 gives the best switch position. */ + switch (name[12]) { + case 'O': + if (memEQ(name, "_POSIX_JOB_CONTROL", 18)) { + /* ^ */ +#ifdef _POSIX_JOB_CONTROL + *iv_return = 1; + return PERL_constant_ISIV; #else - goto not_there; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_SC_TZNAME_MAX")) -#if defined(_SC_TZNAME_MAX) || HINT_SC_EXIST - return _SC_TZNAME_MAX; + } + break; + case 'P': + if (memEQ(name, "_POSIX_NGROUPS_MAX", 18)) { + /* ^ */ +#ifdef _POSIX_NGROUPS_MAX + *iv_return = _POSIX_NGROUPS_MAX; + return PERL_constant_ISIV; #else - goto not_there; + *iv_return = 0; + return PERL_constant_ISIV; #endif - if (strEQ(name, "_SC_VERSION")) -#if defined(_SC_VERSION) || HINT_SC_EXIST - return _SC_VERSION; + } + break; + } + break; + case 20: + if (memEQ(name, "_PC_CHOWN_RESTRICTED", 20)) { +#ifdef _PC_CHOWN_RESTRICTED + *iv_return = _PC_CHOWN_RESTRICTED; + return PERL_constant_ISIV; #else - goto not_there; + return PERL_constant_NOTDEF; #endif - break; - } } - errno = EINVAL; - return 0; - - if (0) { - not_here(""); /* -Wall */ + break; + case 23: + if (memEQ(name, "_POSIX_CHOWN_RESTRICTED", 23)) { +#ifdef _POSIX_CHOWN_RESTRICTED + *iv_return = _POSIX_CHOWN_RESTRICTED; + return PERL_constant_ISIV; +#else + *iv_return = 0; + return PERL_constant_ISIV; +#endif } - -not_there: - errno = ENOENT; - return 0; + break; + } + return PERL_constant_NOTFOUND; } static void @@ -2803,10 +4633,110 @@ setcc(termios_ref, ccix, cc) MODULE = POSIX PACKAGE = POSIX -NV -constant(name,arg) - char * name - int arg +void +constant(sv) + PREINIT: + dXSTARG; + STRLEN len; + int type; + IV iv; + NV nv; + /* const char *pv; Uncomment this if you need to return PVs */ + INPUT: + SV * sv; + const char * s = SvPV(sv, len); + PPCODE: + type = constant(s, len, &iv, &nv); + /* Return 1 or 2 items. First is error message, or undef if no error. + Second, if present, is found value */ + switch (type) { + case PERL_constant_NOTFOUND: + sv = sv_2mortal(newSVpvf("%s is not a valid POSIX macro", s)); + PUSHs(sv); + break; + case PERL_constant_NOTDEF: + sv = sv_2mortal(newSVpvf( + "Your vendor has not defined POSIX macro %s, used", s)); + PUSHs(sv); + break; + case PERL_constant_ISIV: + EXTEND(SP, 1); + PUSHs(&PL_sv_undef); + PUSHi(iv); + break; + /* Uncomment this if you need to return NOs + case PERL_constant_ISNO: + EXTEND(SP, 1); + PUSHs(&PL_sv_undef); + PUSHs(&PL_sv_no); + break; */ + case PERL_constant_ISNV: + EXTEND(SP, 1); + PUSHs(&PL_sv_undef); + PUSHn(nv); + break; + /* Uncomment this if you need to return UNDEFs + case PERL_constant_ISUNDEF: + break; */ + case PERL_constant_ISUV: + EXTEND(SP, 1); + PUSHs(&PL_sv_undef); + PUSHu((UV)iv); + break; + /* Uncomment this if you need to return YESs + case PERL_constant_ISYES: + EXTEND(SP, 1); + PUSHs(&PL_sv_undef); + PUSHs(&PL_sv_yes); + break; */ + default: + sv = sv_2mortal(newSVpvf( + "Unexpected return type %d while processing POSIX macro %s, used", + type, s)); + PUSHs(sv); + } + +void +int_macro_int(sv, iv) + PREINIT: + dXSTARG; + STRLEN len; + int type; + INPUT: + SV * sv; + const char * s = SvPV(sv, len); + IV iv; + PPCODE: + /* Change this to int_macro_int(s, len, &iv, &nv); + if you need to return both NVs and IVs */ + type = int_macro_int(s, len, &iv); + /* Return 1 or 2 items. First is error message, or undef if no error. + Second, if present, is found value */ + switch (type) { + case PERL_constant_NOTFOUND: + sv = sv_2mortal(newSVpvf("%s is not a valid POSIX macro", s)); + EXTEND(SP, 1); + PUSHs(&PL_sv_undef); + PUSHs(sv); + break; + case PERL_constant_NOTDEF: + sv = sv_2mortal(newSVpvf( + "Your vendor has not defined POSIX macro %s, used", s)); + EXTEND(SP, 1); + PUSHs(&PL_sv_undef); + PUSHs(sv); + break; + case PERL_constant_ISIV: + PUSHi(iv); + break; + default: + sv = sv_2mortal(newSVpvf( + "Unexpected return type %d while processing POSIX macro %s, used", + type, s)); + EXTEND(SP, 1); + PUSHs(&PL_sv_undef); + PUSHs(sv); + } int isalnum(charstring)