diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1996-08-19 10:12:16 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1996-08-19 10:12:16 +0000 |
commit | 4ca3e266c706ed297103a44ccc16432c7ee32c58 (patch) | |
tree | 1e912d427613081bd1631e6a9ca30ded8f45072d /gnu/usr.bin/perl/ext | |
parent | b3042d539dbdc7bd375d96ed164f7c49c055696b (diff) |
Import of Perl 5.003 into the tree. Makefile.bsd-wrapper and
config.sh.OpenBSD are the only local changes.
Diffstat (limited to 'gnu/usr.bin/perl/ext')
-rw-r--r-- | gnu/usr.bin/perl/ext/Fcntl/Makefile.PL | 39 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/NDBM_File/NDBM_File.xs | 141 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/ODBM_File/typemap | 47 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/POSIX/Makefile.PL | 126 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/POSIX/typemap | 21 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/SDBM_File/SDBM_File.xs | 109 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/SDBM_File/sdbm/README | 28 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/SDBM_File/sdbm/README.too | 7 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/SDBM_File/sdbm/biblio | 2 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/SDBM_File/sdbm/dba.c | 31 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbd.c | 37 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbe.c | 40 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbu.c | 39 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/SDBM_File/sdbm/hash.c | 9 | ||||
-rw-r--r-- | gnu/usr.bin/perl/ext/SDBM_File/sdbm/util.c | 13 |
15 files changed, 164 insertions, 525 deletions
diff --git a/gnu/usr.bin/perl/ext/Fcntl/Makefile.PL b/gnu/usr.bin/perl/ext/Fcntl/Makefile.PL index cb8a8e67882..66a6df6060d 100644 --- a/gnu/usr.bin/perl/ext/Fcntl/Makefile.PL +++ b/gnu/usr.bin/perl/ext/Fcntl/Makefile.PL @@ -1,45 +1,8 @@ use ExtUtils::MakeMaker; -use ExtUtils::Constant 0.23 'WriteConstants'; WriteMakefile( NAME => 'Fcntl', + MAN3PODS => ' ', # Pods will be built by installman. XSPROTOARG => '-noprototypes', # XXX remove later? VERSION_FROM => 'Fcntl.pm', - realclean => {FILES=> 'const-c.inc const-xs.inc'}, ); -my @names = (qw( - DN_ACCESS DN_MODIFY DN_CREATE DN_DELETE DN_RENAME - DN_ATTRIB DN_MULTISHOT FAPPEND FASYNC FCREAT FDEFER - FDSYNC FD_CLOEXEC FEXCL FLARGEFILE FNDELAY FNONBLOCK - FRSYNC FSYNC FTRUNC F_ALLOCSP F_ALLOCSP64 F_COMPAT - F_DUP2FD F_DUPFD F_EXLCK F_FREESP F_FREESP64 F_FSYNC - F_FSYNC64 F_GETFD F_GETFL F_GETLEASE F_GETLK F_GETLK64 - F_GETOWN F_GETSIG F_NODNY F_NOTIFY F_POSIX F_RDACC - F_RDDNY F_RDLCK F_RWACC F_RWDNY F_SETFD F_SETFL - F_SETLEASE F_SETLK F_SETLK64 F_SETLKW F_SETLKW64 - F_SETOWN F_SETSIG F_SHARE F_SHLCK F_UNLCK F_UNSHARE - F_WRACC F_WRDNY F_WRLCK LOCK_MAND LOCK_READ LOCK_WRITE - LOCK_RW O_ACCMODE O_ALIAS O_APPEND O_ASYNC O_BINARY - O_CREAT O_DEFER O_DIRECT O_DIRECTORY O_DSYNC O_EXCL - O_EXLOCK O_IGNORE_CTTY O_LARGEFILE O_NDELAY O_NOATIME - O_NOCTTY O_NOFOLLOW O_NOINHERIT O_NOLINK O_NONBLOCK - O_NOTRANS O_RANDOM O_RAW O_RDONLY O_RDWR O_RSRC O_RSYNC - O_SEQUENTIAL O_SHLOCK O_SYNC O_TEMPORARY O_TEXT O_TRUNC - O_WRONLY S_ENFMT S_IEXEC S_IFBLK S_IFCHR S_IFDIR - S_IFIFO S_IFLNK S_IFREG S_IFSOCK S_IFWHT S_IREAD - S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID - S_ISTXT S_ISUID S_ISVTX S_IWGRP S_IWOTH S_IWRITE - S_IWUSR S_IXGRP S_IXOTH S_IXUSR), - {name=>"LOCK_SH", default=>["IV", "1"]}, - {name=>"LOCK_EX", default=>["IV", "2"]}, - {name=>"LOCK_NB", default=>["IV", "4"]}, - {name=>"LOCK_UN", default=>["IV", "8"]}, - {name=>"SEEK_SET", default=>["IV", "0"]}, - {name=>"SEEK_CUR", default=>["IV", "1"]}, - {name=>"SEEK_END", default=>["IV", "2"]}, - {name=>"_S_IFMT", macro=>"S_IFMT", value=>"S_IFMT"}); -WriteConstants( - PROXYSUBS => {autoload => 1}, - NAME => 'Fcntl', - NAMES => \@names, -); diff --git a/gnu/usr.bin/perl/ext/NDBM_File/NDBM_File.xs b/gnu/usr.bin/perl/ext/NDBM_File/NDBM_File.xs index 52e60fc88b3..d129a9c4905 100644 --- a/gnu/usr.bin/perl/ext/NDBM_File/NDBM_File.xs +++ b/gnu/usr.bin/perl/ext/NDBM_File/NDBM_File.xs @@ -1,108 +1,41 @@ -#define PERL_NO_GET_CONTEXT - #include "EXTERN.h" #include "perl.h" #include "XSUB.h" -#undef NDBM_HEADER_USES_PROTOTYPES -#if defined(I_GDBM_NDBM) -# ifdef GDBM_NDBM_H_USES_PROTOTYPES -# define NDBM_HEADER_USES_PROTOTYPES -START_EXTERN_C -# endif -# include <gdbm-ndbm.h> /* Debian compatibility version */ -#elif defined(I_GDBMNDBM) -# ifdef GDBMNDBM_H_USES_PROTOTYPES -# define NDBM_HEADER_USES_PROTOTYPES -START_EXTERN_C -# endif -# include <gdbm/ndbm.h> /* RedHat compatibility version */ -#elif defined(I_NDBM) -# ifdef NDBM_H_USES_PROTOTYPES -# define NDBM_HEADER_USES_PROTOTYPES -START_EXTERN_C -# endif -# include <ndbm.h> -#endif -#ifdef NDBM_HEADER_USES_PROTOTYPES -END_EXTERN_C -#endif - -#define fetch_key 0 -#define store_key 1 -#define fetch_value 2 -#define store_value 3 - -typedef struct { - DBM * dbp ; - SV * filter[4]; - int filtering ; - } NDBM_File_type; +#include <ndbm.h> -typedef NDBM_File_type * NDBM_File ; -typedef datum datum_key ; -typedef datum datum_value ; +typedef DBM* NDBM_File; +#define dbm_TIEHASH(dbtype,filename,flags,mode) dbm_open(filename,flags,mode) +#define dbm_FETCH(db,key) dbm_fetch(db,key) +#define dbm_STORE(db,key,value,flags) dbm_store(db,key,value,flags) +#define dbm_DELETE(db,key) dbm_delete(db,key) +#define dbm_FIRSTKEY(db) dbm_firstkey(db) +#define dbm_NEXTKEY(db,key) dbm_nextkey(db) - -#if defined(__cplusplus) && !defined(NDBM_HEADER_USES_PROTOTYPES) -/* gdbm's header file used for compatibility with gdbm */ -/* isn't compatible to C++ syntax, so we need these */ -/* declarations to make everyone happy. */ -EXTERN_C DBM *dbm_open(const char *, int, mode_t); -EXTERN_C void dbm_close(DBM *); -EXTERN_C datum dbm_fetch(DBM *, datum); -EXTERN_C int dbm_store(DBM *, datum, datum, int); -EXTERN_C int dbm_delete(DBM *, datum); -EXTERN_C datum dbm_firstkey(DBM *); -EXTERN_C datum dbm_nextkey(DBM *); -#endif - -MODULE = NDBM_File PACKAGE = NDBM_File PREFIX = ndbm_ +MODULE = NDBM_File PACKAGE = NDBM_File PREFIX = dbm_ NDBM_File -ndbm_TIEHASH(dbtype, filename, flags, mode) +dbm_TIEHASH(dbtype, filename, flags, mode) char * dbtype char * filename int flags int mode - CODE: - { - DBM * dbp ; - - RETVAL = NULL ; - if ((dbp = dbm_open(filename, flags, mode))) { - RETVAL = (NDBM_File)safecalloc(1, sizeof(NDBM_File_type)); - RETVAL->dbp = dbp ; - } - - } - OUTPUT: - RETVAL void -ndbm_DESTROY(db) +dbm_DESTROY(db) NDBM_File db - PREINIT: - int i = store_value; CODE: - dbm_close(db->dbp); - do { - if (db->filter[i]) - SvREFCNT_dec(db->filter[i]); - } while (i-- > 0); - safefree(db); + dbm_close(db); -#define ndbm_FETCH(db,key) dbm_fetch(db->dbp,key) -datum_value -ndbm_FETCH(db, key) +datum +dbm_FETCH(db, key) NDBM_File db - datum_key key + datum key -#define ndbm_STORE(db,key,value,flags) dbm_store(db->dbp,key,value,flags) int -ndbm_STORE(db, key, value, flags = DBM_REPLACE) +dbm_STORE(db, key, value, flags = DBM_REPLACE) NDBM_File db - datum_key key - datum_value value + datum key + datum value int flags CLEANUP: if (RETVAL) { @@ -110,46 +43,28 @@ ndbm_STORE(db, key, value, flags = DBM_REPLACE) croak("No write permission to ndbm file"); croak("ndbm store returned %d, errno %d, key \"%s\"", RETVAL,errno,key.dptr); - dbm_clearerr(db->dbp); + dbm_clearerr(db); } -#define ndbm_DELETE(db,key) dbm_delete(db->dbp,key) int -ndbm_DELETE(db, key) +dbm_DELETE(db, key) NDBM_File db - datum_key key + datum key -#define ndbm_FIRSTKEY(db) dbm_firstkey(db->dbp) -datum_key -ndbm_FIRSTKEY(db) +datum +dbm_FIRSTKEY(db) NDBM_File db -#define ndbm_NEXTKEY(db,key) dbm_nextkey(db->dbp) -datum_key -ndbm_NEXTKEY(db, key) +datum +dbm_NEXTKEY(db, key) NDBM_File db - datum_key key = NO_INIT + datum key -#define ndbm_error(db) dbm_error(db->dbp) int -ndbm_error(db) +dbm_error(db) NDBM_File db -#define ndbm_clearerr(db) dbm_clearerr(db->dbp) void -ndbm_clearerr(db) +dbm_clearerr(db) NDBM_File db - -SV * -filter_fetch_key(db, code) - NDBM_File db - SV * code - SV * RETVAL = &PL_sv_undef ; - ALIAS: - NDBM_File::filter_fetch_key = fetch_key - NDBM_File::filter_store_key = store_key - NDBM_File::filter_fetch_value = fetch_value - NDBM_File::filter_store_value = store_value - CODE: - DBM_setFilter(db->filter[ix], code); diff --git a/gnu/usr.bin/perl/ext/ODBM_File/typemap b/gnu/usr.bin/perl/ext/ODBM_File/typemap index 8aed61c8c50..a6b0e5faa86 100644 --- a/gnu/usr.bin/perl/ext/ODBM_File/typemap +++ b/gnu/usr.bin/perl/ext/ODBM_File/typemap @@ -2,9 +2,7 @@ #################################### DBM SECTION # -datum_key T_DATUM_K -datum_key_copy T_DATUM_K_C -datum_value T_DATUM_V +datum T_DATUM gdatum T_GDATUM NDBM_File T_PTROBJ GDBM_File T_PTROBJ @@ -12,49 +10,16 @@ SDBM_File T_PTROBJ ODBM_File T_PTROBJ DB_File T_PTROBJ DBZ_File T_PTROBJ +FATALFUNC T_OPAQUEPTR INPUT -T_DATUM_K - { - STRLEN len; - DBM_ckFilter($arg, filter[store_key], \"filter_store_key\"); - $var.dptr = SvPVbyte($arg, len); - $var.dsize = (int)len; - } -T_DATUM_K_C - { - SV * tmpSV ; - STRLEN len; - if (db->filter[store_key]){ - tmpSV = sv_2mortal(newSVsv($arg)); - DBM_ckFilter(tmpSV, filter[store_key], \"filter_store_key\"); - } - else - tmpSV = $arg; - $var.dptr = SvPVbyte(tmpSV, len); - $var.dsize = (int)len; - } -T_DATUM_V - DBM_ckFilter($arg, filter[store_value], \"filter_store_value\"); - if (SvOK($arg)) { - STRLEN len; - $var.dptr = SvPVbyte($arg, len); - $var.dsize = (int)len; - } - else { - $var.dptr = \"\"; - $var.dsize = 0; - } +T_DATUM + $var.dptr = SvPV($arg, na); + $var.dsize = (int)na; T_GDATUM UNIMPLEMENTED OUTPUT -T_DATUM_K +T_DATUM sv_setpvn($arg, $var.dptr, $var.dsize); - DBM_ckFilter($arg, filter[fetch_key],\"filter_fetch_key\"); -T_DATUM_V - sv_setpvn($arg, $var.dptr, $var.dsize); - DBM_ckFilter($arg, filter[fetch_value],\"filter_fetch_value\"); T_GDATUM sv_usepvn($arg, $var.dptr, $var.dsize); -T_PTROBJ - sv_setref_pv($arg, dbtype, (void*)$var); diff --git a/gnu/usr.bin/perl/ext/POSIX/Makefile.PL b/gnu/usr.bin/perl/ext/POSIX/Makefile.PL index 77ebae7d5af..3359d1742c3 100644 --- a/gnu/usr.bin/perl/ext/POSIX/Makefile.PL +++ b/gnu/usr.bin/perl/ext/POSIX/Makefile.PL @@ -1,126 +1,8 @@ -# Expect this line to be read by t/posix.t, don't change it use ExtUtils::MakeMaker; -use ExtUtils::Constant 0.23 'WriteConstants'; -use Config; -my $rt_signals; -if ($Config{sig_name} =~ /\bRTMIN\b/ && $Config{sig_name} =~ /\bRTMAX\b/) { - # Yes, it really has them. (Some systems define the C pre-processor - # symbols, but they depend on other macros that are only defined during - # kernel compilation - $rt_signals++; -} - -my @libs; -if ($^O ne 'MSWin32' && $^O ne 'freemint') { - @libs = ('LIBS' => ["-lm -lposix -lcposix"]); -} WriteMakefile( NAME => 'POSIX', - @libs, - XSPROTOARG => '-noprototypes', # XXX remove later? - VERSION_FROM => 'lib/POSIX.pm', - ABSTRACT_FROM => 'lib/POSIX.pod', - realclean => {FILES=> 'const-c.inc const-xs.inc'}, -); - -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 - CLOCAL CLOCKS_PER_SEC CREAD CS5 CS6 CS7 CS8 CSIZE CSTOPB E2BIG - EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG - EBUSY ECANCELED ECHILD ECHO ECHOE ECHOK ECHONL ECONNABORTED ECONNREFUSED - ECONNRESET EDEADLK EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN - EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR - ELOOP EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH - ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG - ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY - ENOTRECOVERABLE ENOTSOCK ENOTSUP ENOTTY ENXIO EOF EOPNOTSUPP EOTHER - EOVERFLOW EOWNERDEAD EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROTO - EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE ERESTART EROFS ESHUTDOWN - ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY - EUSERS EWOULDBLOCK EXDEV FILENAME_MAX F_OK 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_LEN_MAX MSG_CTRUNC MSG_DONTROUTE MSG_EOR MSG_OOB MSG_PEEK - MSG_TRUNC MSG_WAITALL NAME_MAX NCCS NGROUPS_MAX NOFLSH OPEN_MAX OPOST - PARENB PARMRK PARODD PATH_MAX PIPE_BUF RAND_MAX R_OK SCHAR_MAX - SCHAR_MIN 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 - SIGBUS SIGPOLL SIGPROF SIGSYS SIGTRAP SIGURG SIGVTALRM SIGXCPU SIGXFSZ - STDERR_FILENO STDIN_FILENO STDOUT_FILENO STREAM_MAX 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_PAGESIZE _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX - _SC_VERSION EAI_AGAIN EAI_BADFLAGS EAI_FAIL EAI_FAMILY EAI_MEMORY EAI_NONAME - EAI_SERVICE EAI_SOCKTYPE EAI_SYSTEM EAI_OVERFLOW), - {name=>"CLK_TCK", not_constant=>1}, - {name=>"MB_CUR_MAX", not_constant=>1}, - {name=>"EXIT_FAILURE", default=>["IV", "1"]}, - {name=>"EXIT_SUCCESS", default=>["IV", "0"]}, - {name=>"SIG_DFL", value=>"PTR2IV(SIG_DFL)", not_constant=>1}, - {name=>"SIG_ERR", value=>"PTR2IV(SIG_ERR)", not_constant=>1}, - {name=>"SIG_IGN", value=>"PTR2IV(SIG_IGN)", not_constant=>1}, - # L_tmpnam[e] was a typo--retained for compatibility - {name=>"L_tmpname", value=>"L_tmpnam"}, - {name=>"NULL", value=>"0"}, - {name=>"_POSIX_JOB_CONTROL", type=>"YES", default=>["IV", "0"]}, - {name=>"_POSIX_SAVED_IDS", type=>"YES", default=>["IV", "0"]}, - {name=>'FLT_ROUNDS', type=>"NV", not_constant=>1}, - {name=>"HUGE_VAL", type=>"NV", not_constant=>1, - macro=>[<<'END', "#endif\n"], -#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 */ -END - value=>' -#if defined(USE_LONG_DOUBLE) && defined(HUGE_VALL) - HUGE_VALL -#else - HUGE_VAL -#endif - '}); - -push @names, {name=>$_, type=>"UV"} - foreach (qw(SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK SA_RESETHAND - SA_RESTART SA_SIGINFO UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX)); -push @names, {name=>$_, type=>"NV", not_constant=>1} - foreach (qw(DBL_MAX FLT_MAX LDBL_MAX LDBL_MIN LDBL_EPSILON - DBL_EPSILON DBL_MIN FLT_EPSILON FLT_MIN)); - -push @names, {name=>$_, type=>"NV"} - foreach (qw(DBL_DIG DBL_MANT_DIG DBL_MAX_10_EXP DBL_MAX_EXP DBL_MIN_10_EXP - DBL_MIN_EXP FLT_DIG FLT_MANT_DIG FLT_MAX_10_EXP FLT_MAX_EXP - FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX LDBL_DIG LDBL_MANT_DIG - LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN_10_EXP LDBL_MIN_EXP)); - -push @names, {name=>$_, type=>"IV", default=>["IV", "0"]} - foreach (qw(_POSIX_ARG_MAX _POSIX_CHILD_MAX _POSIX_CHOWN_RESTRICTED - _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX - _POSIX_NGROUPS_MAX _POSIX_NO_TRUNC _POSIX_OPEN_MAX - _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SSIZE_MAX - _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VDISABLE _POSIX_VERSION - )); - -if ($rt_signals) { - push @names, {name=>"SIGRTMAX", not_constant=>1}, - {name=>"SIGRTMIN", not_constant=>1}, -} else { - # Well, it seems that your vendor has defined them, but not in a way that - # would actually compile. - push @names, {name=>"SIGRTMAX", macro=>0}, - {name=>"SIGRTMIN", macro=>0}, -} - -WriteConstants( - PROXYSUBS => {croak_on_error => 1}, - NAME => 'POSIX', - NAMES => \@names, + LIBS => ["-lm -lposix -lcposix"], + MAN3PODS => ' ', # Pods will be built by installman. + XSPROTOARG => '-noprototypes', # XXX remove later? + VERSION_FROM => 'POSIX.pm', ); diff --git a/gnu/usr.bin/perl/ext/POSIX/typemap b/gnu/usr.bin/perl/ext/POSIX/typemap index e6a82dc3840..45e0862ff0f 100644 --- a/gnu/usr.bin/perl/ext/POSIX/typemap +++ b/gnu/usr.bin/perl/ext/POSIX/typemap @@ -3,28 +3,11 @@ pid_t T_NV Uid_t T_NV Time_t T_NV Gid_t T_NV -Uid_t T_NV Off_t T_NV -Dev_t T_NV -NV T_NV fd T_IV speed_t T_IV tcflag_t T_IV cc_t T_IV -POSIX::SigSet T_OPAQUEPTROBJ -POSIX::Termios T_OPAQUEPTROBJ +POSIX::SigSet T_PTROBJ +POSIX::Termios T_PTROBJ POSIX::SigAction T_HVREF - -INPUT -T_OPAQUEPTROBJ - if (SvROK($arg) && sv_derived_from($arg, \"${ntype}\")) { - $var = ($type)SvPV_nolen(SvRV($arg)); - } - else - Perl_croak(aTHX_ \"%s: %s is not of type %s\", - ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, - \"$var\", \"$ntype\") - -OUTPUT -T_OPAQUEPTROBJ - sv_setref_pvn($arg, \"${ntype}\", (const char*)$var, sizeof(*$var)); diff --git a/gnu/usr.bin/perl/ext/SDBM_File/SDBM_File.xs b/gnu/usr.bin/perl/ext/SDBM_File/SDBM_File.xs index 070f0745adb..38eaebf5c5e 100644 --- a/gnu/usr.bin/perl/ext/SDBM_File/SDBM_File.xs +++ b/gnu/usr.bin/perl/ext/SDBM_File/SDBM_File.xs @@ -1,85 +1,42 @@ -#define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "sdbm/sdbm.h" -#define fetch_key 0 -#define store_key 1 -#define fetch_value 2 -#define store_value 3 - -typedef struct { - DBM * dbp ; - SV * filter[4]; - int filtering ; - } SDBM_File_type; - -typedef SDBM_File_type * SDBM_File ; -typedef datum datum_key ; -typedef datum datum_value ; - -#define sdbm_FETCH(db,key) sdbm_fetch(db->dbp,key) -#define sdbm_STORE(db,key,value,flags) sdbm_store(db->dbp,key,value,flags) -#define sdbm_DELETE(db,key) sdbm_delete(db->dbp,key) -#define sdbm_EXISTS(db,key) sdbm_exists(db->dbp,key) -#define sdbm_FIRSTKEY(db) sdbm_firstkey(db->dbp) -#define sdbm_NEXTKEY(db,key) sdbm_nextkey(db->dbp) +typedef DBM* SDBM_File; +#define sdbm_TIEHASH(dbtype,filename,flags,mode) sdbm_open(filename,flags,mode) +#define sdbm_FETCH(db,key) sdbm_fetch(db,key) +#define sdbm_STORE(db,key,value,flags) sdbm_store(db,key,value,flags) +#define sdbm_DELETE(db,key) sdbm_delete(db,key) +#define sdbm_FIRSTKEY(db) sdbm_firstkey(db) +#define sdbm_NEXTKEY(db,key) sdbm_nextkey(db) MODULE = SDBM_File PACKAGE = SDBM_File PREFIX = sdbm_ SDBM_File -sdbm_TIEHASH(dbtype, filename, flags, mode, pagname=NULL) +sdbm_TIEHASH(dbtype, filename, flags, mode) char * dbtype char * filename int flags int mode - char * pagname - CODE: - { - DBM * dbp ; - - RETVAL = NULL ; - if (pagname == NULL) { - dbp = sdbm_open(filename, flags, mode); - } - else { - dbp = sdbm_prep(filename, pagname, flags, mode); - } - if (dbp) { - RETVAL = (SDBM_File)safecalloc(1, sizeof(SDBM_File_type)); - RETVAL->dbp = dbp ; - } - - } - OUTPUT: - RETVAL void sdbm_DESTROY(db) SDBM_File db CODE: - if (db) { - int i = store_value; - sdbm_close(db->dbp); - do { - if (db->filter[i]) - SvREFCNT_dec(db->filter[i]); - } while (i-- > 0); - safefree(db) ; - } + sdbm_close(db); -datum_value +datum sdbm_FETCH(db, key) SDBM_File db - datum_key key + datum key int sdbm_STORE(db, key, value, flags = DBM_REPLACE) SDBM_File db - datum_key key - datum_value value + datum key + datum value int flags CLEANUP: if (RETVAL) { @@ -87,54 +44,28 @@ sdbm_STORE(db, key, value, flags = DBM_REPLACE) croak("No write permission to sdbm file"); croak("sdbm store returned %d, errno %d, key \"%s\"", RETVAL,errno,key.dptr); - sdbm_clearerr(db->dbp); + sdbm_clearerr(db); } int sdbm_DELETE(db, key) SDBM_File db - datum_key key + datum key -int -sdbm_EXISTS(db,key) - SDBM_File db - datum_key key - -datum_key +datum sdbm_FIRSTKEY(db) SDBM_File db -datum_key +datum sdbm_NEXTKEY(db, key) SDBM_File db + datum key int sdbm_error(db) SDBM_File db - ALIAS: - sdbm_clearerr = 1 - CODE: - RETVAL = ix ? sdbm_clearerr(db->dbp) : sdbm_error(db->dbp); - OUTPUT: - RETVAL -SV * -filter_fetch_key(db, code) +int +sdbm_clearerr(db) SDBM_File db - SV * code - SV * RETVAL = &PL_sv_undef ; - ALIAS: - SDBM_File::filter_fetch_key = fetch_key - SDBM_File::filter_store_key = store_key - SDBM_File::filter_fetch_value = fetch_value - SDBM_File::filter_store_value = store_value - CODE: - DBM_setFilter(db->filter[ix], code); -BOOT: - { - HV *stash = gv_stashpvs("SDBM_File", 1); - newCONSTSUB(stash, "PAGFEXT", newSVpvs(PAGFEXT)); - newCONSTSUB(stash, "DIRFEXT", newSVpvs(DIRFEXT)); - newCONSTSUB(stash, "PAIRMAX", newSVuv(PAIRMAX)); - } diff --git a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/README b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/README index a5a23e00d3c..cd7312cc575 100644 --- a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/README +++ b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/README @@ -32,7 +32,7 @@ derived from any licensed, proprietary or copyrighted software. The sdbm implementation is based on a 1978 algorithm -[Lar78] by P.-A. (Paul) Larson known as "Dynamic Hashing". +[Lar78] by P.-A. (Paul) Larson known as ``Dynamic Hashing''. In the course of searching for a substitute for ndbm, I pro- totyped three different external-hashing algorithms [Lar78, Fag79, Lit80] and ultimately chose Larson's algorithm as a @@ -70,7 +70,7 @@ _________________________ - 2 - -store operation will not "wander away" trying to split its +store operation will not ``wander away'' trying to split its data pages to insert a datum that cannot (due to elaborate worst-case situations) be inserted. (It will fail after a pre-defined number of attempts.) @@ -233,7 +233,7 @@ various inputs: */ long dbm_hash(char *str, int len) { - unsigned long n = 0; + register unsigned long n = 0; while (len--) n = n * 65599 + *str++; @@ -298,30 +298,30 @@ References [Lar78] - P.-A. Larson, "Dynamic Hashing", BIT, vol. 18, pp. + P.-A. Larson, ``Dynamic Hashing'', BIT, vol. 18, pp. 184-201, 1978. [Tho90] Ken Thompson, private communication, Nov. 1990 [Lit80] - W. Litwin, "Linear Hashing: A new tool for file and - table addressing", Proceedings of the 6th Conference on + W. Litwin, `` Linear Hashing: A new tool for file and + table addressing'', Proceedings of the 6th Conference on Very Large Dabatases (Montreal), pp. 212-223, Very Large Database Foundation, Saratoga, Calif., 1980. [Fag79] R. Fagin, J. Nievergelt, N. Pippinger, and H. R. - Strong, "Extendible Hashing - A Fast Access Method for - Dynamic Files", ACM Trans. Database Syst., vol. 4, + Strong, ``Extendible Hashing - A Fast Access Method for + Dynamic Files'', ACM Trans. Database Syst., vol. 4, no.3, pp. 315-344, Sept. 1979. [Wal84] - Rich Wales, "Discussion of 'dbm' data base system", + Rich Wales, ``Discussion of "dbm" data base system'', USENET newsgroup unix.wizards, Jan. 1984. [Tor87] - Chris Torek, "Re: dbm.a and ndbm.a archives", + Chris Torek, ``Re: dbm.a and ndbm.a archives'', @@ -337,13 +337,13 @@ References USENET newsgroup comp.unix, 1987. [Mar79] - G. N. Martin, "Spiral Storage: Incrementally Augment- - able Hash Addressed Storage", Technical Report #27, + G. N. Martin, ``Spiral Storage: Incrementally Augment- + able Hash Addressed Storage'', Technical Report #27, University of Varwick, Coventry, U.K., 1979. [Enb88] - R. J. Enbody and H. C. Du, "Dynamic Hashing - Schemes",ACM Computing Surveys, vol. 20, no. 2, pp. + R. J. Enbody and H. C. Du, ``Dynamic Hashing + Schemes'',ACM Computing Surveys, vol. 20, no. 2, pp. 85-113, June 1988. diff --git a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/README.too b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/README.too index cc86fb4dd54..c2d095944da 100644 --- a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/README.too +++ b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/README.too @@ -6,9 +6,4 @@ the bad() macro redefined to allow a zero-length key.) Fri Apr 15 10:15:30 EDT 1994. Additional portability/configuration changes for libsdbm by Andy Dougherty -doughera@lafayette.edu. - - -Mon Mar 22 03:24:47 PST 1999. - -sdbm_exists added to the library by Russ Allbery <rra@stanford.edu>. +doughera@lafcol.lafayette.edu. diff --git a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/biblio b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/biblio index f2880dc4903..0be09fa005b 100644 --- a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/biblio +++ b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/biblio @@ -52,7 +52,7 @@ %K torek %A Rich Wales -%T Discussion of "dbm" data base system +%T Discusson of "dbm" data base system %B USENET newsgroup unix.wizards %D Jan. 1984 %K rich diff --git a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dba.c b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dba.c index b27c3e66a47..4f227e52456 100644 --- a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dba.c +++ b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dba.c @@ -4,14 +4,14 @@ #include <stdio.h> #include <sys/file.h> -#include "EXTERN.h" #include "sdbm.h" char *progname; extern void oops(); int -main(int argc, char **argv) +main(argc, argv) +char **argv; { int n; char *p; @@ -22,9 +22,6 @@ main(int argc, char **argv) if (p = argv[1]) { name = (char *) malloc((n = strlen(p)) + 5); - if (!name) - oops("cannot get memory"); - strcpy(name, p); strcpy(name + n, ".pag"); @@ -39,14 +36,14 @@ main(int argc, char **argv) return 0; } -void -sdump(int pagf) +sdump(pagf) +int pagf; { - int b; - int n = 0; - int t = 0; - int o = 0; - int e; + register b; + register n = 0; + register t = 0; + register o = 0; + register e; char pag[PBLKSIZ]; while ((b = read(pagf, pag, PBLKSIZ)) > 0) { @@ -69,12 +66,12 @@ sdump(int pagf) oops("read failed: block %d", n); } -int -pagestat(char *pag) +pagestat(pag) +char *pag; { - int n; - int free; - short *ino = (short *) pag; + register n; + register free; + register short *ino = (short *) pag; if (!(n = ino[0])) printf("no entries.\n"); diff --git a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbd.c b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbd.c index df27d174a80..697a5475977 100644 --- a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbd.c +++ b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbd.c @@ -4,7 +4,6 @@ #include <stdio.h> #include <sys/file.h> -#include "EXTERN.h" #include "sdbm.h" char *progname; @@ -14,7 +13,8 @@ extern void oops(); #define empty(page) (((short *) page)[0] == 0) int -main(int argc, char **argv) +main(argc, argv) +char **argv; { int n; char *p; @@ -25,9 +25,6 @@ main(int argc, char **argv) if (p = argv[1]) { name = (char *) malloc((n = strlen(p)) + 5); - if (!name) - oops("cannot get memory"); - strcpy(name, p); strcpy(name + n, ".pag"); @@ -41,12 +38,12 @@ main(int argc, char **argv) return 0; } -void -sdump(int pagf) +sdump(pagf) +int pagf; { - int r; - int n = 0; - int o = 0; + register r; + register n = 0; + register o = 0; char pag[PBLKSIZ]; while ((r = read(pagf, pag, PBLKSIZ)) > 0) { @@ -67,12 +64,12 @@ sdump(int pagf) #ifdef OLD -int -dispage(char *pag) +dispage(pag) +char *pag; { - int i, n; - int off; - int short *ino = (short *) pag; + register i, n; + register off; + register short *ino = (short *) pag; off = PBLKSIZ; for (i = 1; i < ino[0]; i += 2) { @@ -89,12 +86,12 @@ dispage(char *pag) } } #else -void -dispage(char *pag) +dispage(pag) +char *pag; { - int i, n; - int off; - short *ino = (short *) pag; + register i, n; + register off; + register short *ino = (short *) pag; off = PBLKSIZ; for (i = 1; i < ino[0]; i += 2) { diff --git a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbe.c b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbe.c index 18ce54677e8..2a306f276ec 100644 --- a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbe.c +++ b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbe.c @@ -52,10 +52,13 @@ char *optarg; /* Global argument pointer. */ #endif char -getopt(int argc, char **argv, char *optstring) +getopt(argc, argv, optstring) +int argc; +char **argv; +char *optstring; { - int c; - char *place; + register int c; + register char *place; extern char *index(); static int optind = 0; static char *scan = NULL; @@ -128,13 +131,14 @@ getopt(int argc, char **argv, char *optstring) void -print_datum(datum db) +print_datum(db) +datum db; { int i; putchar('"'); for (i = 0; i < db.dsize; i++) { - if (isprint((unsigned char)db.dptr[i])) + if (isprint(db.dptr[i])) putchar(db.dptr[i]); else { putchar('\\'); @@ -148,7 +152,8 @@ print_datum(datum db) datum -read_datum(char *s) +read_datum(s) +char *s; { datum db; char *p; @@ -156,9 +161,6 @@ read_datum(char *s) db.dsize = 0; db.dptr = (char *) malloc(strlen(s) * sizeof(char)); - if (!db.dptr) - oops("cannot get memory"); - for (p = db.dptr; *s != '\0'; p++, db.dsize++, s++) { if (*s == '\\') { if (*++s == 'n') @@ -169,10 +171,7 @@ read_datum(char *s) *p = '\f'; else if (*s == 't') *p = '\t'; - else if (isdigit((unsigned char)*s) - && isdigit((unsigned char)*(s + 1)) - && isdigit((unsigned char)*(s + 2))) - { + else if (isdigit(*s) && isdigit(*(s + 1)) && isdigit(*(s + 2))) { i = (*s++ - '0') << 6; i |= (*s++ - '0') << 3; i |= *s - '0'; @@ -192,21 +191,22 @@ read_datum(char *s) char * -key2s(datum db) +key2s(db) +datum db; { char *buf; char *p1, *p2; buf = (char *) malloc((db.dsize + 1) * sizeof(char)); - if (!buf) - oops("cannot get memory"); for (p1 = buf, p2 = db.dptr; *p2 != '\0'; *p1++ = *p2++); *p1 = '\0'; return buf; } -int -main(int argc, char **argv) + +main(argc, argv) +int argc; +char **argv; { typedef enum { YOW, FETCH, STORE, DELETE, SCAN, REGEXP @@ -285,8 +285,8 @@ main(int argc, char **argv) } } - if (giveusage || what == YOW || argn < 1) { - fprintf(stderr, "Usage: %s database [-m r|w|rw] [-crtx] -a|-d|-f|-F|-s [key [content]]\n", argv[0]); + if (giveusage | what == YOW | argn < 1) { + fprintf(stderr, "Usage: %s databse [-m r|w|rw] [-crtx] -a|-d|-f|-F|-s [key [content]]\n", argv[0]); exit(-1); } diff --git a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbu.c b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbu.c index d861c0f1b19..106262872e2 100644 --- a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbu.c +++ b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/dbu.c @@ -1,7 +1,6 @@ #include <stdio.h> #include <sys/file.h> #ifdef SDBM -#include "EXTERN.h" #include "sdbm.h" #else #include <ndbm.h> @@ -65,10 +64,12 @@ static cmd *parse(); static void badk(), doit(), prdatum(); int -main(int argc, char **argv) +main(argc, argv) +int argc; +char *argv[]; { int c; - cmd *act; + register cmd *act; extern int optind; extern char *optarg; @@ -96,13 +97,15 @@ main(int argc, char **argv) } static void -doit(cmd *act, char *file) +doit(act, file) +register cmd *act; +char *file; { datum key; datum val; - DBM *db; - char *op; - int n; + register DBM *db; + register char *op; + register int n; char *line; #ifdef TIME long start; @@ -193,9 +196,10 @@ doit(cmd *act, char *file) } static void -badk(char *word) +badk(word) +char *word; { - int i; + register int i; if (progname) fprintf(stderr, "%s: ", progname); @@ -209,10 +213,11 @@ badk(char *word) } static cmd * -parse(char *str) +parse(str) +register char *str; { - int i = CTABSIZ; - cmd *p; + register int i = CTABSIZ; + register cmd *p; for (p = cmds; i--; p++) if (strcmp(p->sname, str) == 0) @@ -221,11 +226,13 @@ parse(char *str) } static void -prdatum(FILE *stream, datum d) +prdatum(stream, d) +FILE *stream; +datum d; { - int c; - char *p = d.dptr; - int n = d.dsize; + register int c; + register char *p = d.dptr; + register int n = d.dsize; while (n--) { c = *p++ & 0377; diff --git a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/hash.c b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/hash.c index f0115baa545..eb585ac1025 100644 --- a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/hash.c +++ b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/hash.c @@ -8,7 +8,6 @@ */ #include "config.h" -#include "EXTERN.h" #include "sdbm.h" /* * polynomial conversion ignoring overflows @@ -18,16 +17,18 @@ * 65587 even better. */ long -sdbm_hash(const char *str, int len) +sdbm_hash(str, len) +register char *str; +register int len; { - unsigned long n = 0; + register unsigned long n = 0; #ifdef DUFF #define HASHC n = *str++ + 65599 * n if (len > 0) { - int loop = (len + 8 - 1) >> 3; + register int loop = (len + 8 - 1) >> 3; switch(len & (8 - 1)) { case 0: do { diff --git a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/util.c b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/util.c index a58085d559a..4b03d89f09a 100644 --- a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/util.c +++ b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/util.c @@ -6,7 +6,9 @@ #endif void -oops(char *s1, char *s2) +oops(s1, s2) +register char *s1; +register char *s2; { extern int errno, sys_nerr; extern char *sys_errlist[]; @@ -22,11 +24,12 @@ oops(char *s1, char *s2) } int -okpage(char *pag) +okpage(pag) +char *pag; { - unsigned n; - int off; - short *ino = (short *) pag; + register unsigned n; + register off; + register short *ino = (short *) pag; if ((n = ino[0]) > PBLKSIZ / sizeof(short)) return 0; |