summaryrefslogtreecommitdiff
path: root/ext/Fcntl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-10-18 21:31:10 +0200
committerNicholas Clark <nick@ccl4.org>2010-10-18 21:31:10 +0200
commitb8a48bdd395a3c363c75c2dd88f351ca033b3455 (patch)
tree3867382a5b293404dcd0db79a50a4e4e751123be /ext/Fcntl
parent923cc1bb816922fc7e3d923ecac3b09efc7690cc (diff)
downloadperl-b8a48bdd395a3c363c75c2dd88f351ca033b3455.tar.gz
Express @Fcntl::EXPORT_OK in terms of %Fcntl::EXPORT_TAGS.
This reduces quite a lot of repetition of symbol names. Note that '&SUBNAME' and 'SUBNAME' are interchangeable to Exporter.
Diffstat (limited to 'ext/Fcntl')
-rw-r--r--ext/Fcntl/Fcntl.pm71
1 files changed, 22 insertions, 49 deletions
diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm
index 834d7ec205..4aede8c222 100644
--- a/ext/Fcntl/Fcntl.pm
+++ b/ext/Fcntl/Fcntl.pm
@@ -65,6 +65,26 @@ $VERSION = '1.09';
XSLoader::load();
+# Named groups of exports
+%EXPORT_TAGS = (
+ 'flock' => [qw(LOCK_SH LOCK_EX LOCK_NB LOCK_UN)],
+ 'Fcompat' => [qw(FAPPEND FASYNC FCREAT FDEFER FDSYNC FEXCL FLARGEFILE
+ FNDELAY FNONBLOCK FRSYNC FSYNC FTRUNC)],
+ 'seek' => [qw(SEEK_SET SEEK_CUR SEEK_END)],
+ 'mode' => [qw(S_ISUID S_ISGID S_ISVTX S_ISTXT
+ _S_IFMT S_IFREG S_IFDIR S_IFLNK
+ S_IFSOCK S_IFBLK S_IFCHR S_IFIFO S_IFWHT S_ENFMT
+ S_IRUSR S_IWUSR S_IXUSR S_IRWXU
+ S_IRGRP S_IWGRP S_IXGRP S_IRWXG
+ S_IROTH S_IWOTH S_IXOTH S_IRWXO
+ S_IREAD S_IWRITE S_IEXEC
+ S_ISREG S_ISDIR S_ISLNK S_ISSOCK
+ S_ISBLK S_ISCHR S_ISFIFO
+ S_ISWHT S_ISENFMT
+ S_IFMT S_IMODE
+ )],
+);
+
# Items to export into callers namespace by default
# (move infrequently used names to @EXPORT_OK below)
@EXPORT =
@@ -140,7 +160,7 @@ XSLoader::load();
);
# Other items we are prepared to export if requested
-@EXPORT_OK = qw(
+@EXPORT_OK = (qw(
DN_ACCESS
DN_ATTRIB
DN_CREATE
@@ -148,67 +168,20 @@ XSLoader::load();
DN_MODIFY
DN_MULTISHOT
DN_RENAME
- FAPPEND
- FASYNC
- FCREAT
- FDEFER
- FDSYNC
- FEXCL
- FLARGEFILE
- FNDELAY
- FNONBLOCK
- FRSYNC
- FSYNC
- FTRUNC
F_GETLEASE
F_GETSIG
F_NOTIFY
F_SETLEASE
F_SETSIG
- LOCK_EX
LOCK_MAND
- LOCK_NB
LOCK_READ
LOCK_RW
- LOCK_SH
- LOCK_UN
LOCK_WRITE
O_IGNORE_CTTY
O_NOATIME
O_NOLINK
O_NOTRANS
- SEEK_CUR
- SEEK_END
- SEEK_SET
- S_IFSOCK S_IFBLK S_IFCHR S_IFIFO S_IFWHT S_ENFMT
- S_IREAD S_IWRITE S_IEXEC
- S_IRGRP S_IWGRP S_IXGRP S_IRWXG
- S_IROTH S_IWOTH S_IXOTH S_IRWXO
- S_IRUSR S_IWUSR S_IXUSR S_IRWXU
- S_ISUID S_ISGID S_ISVTX S_ISTXT
- _S_IFMT S_IFREG S_IFDIR S_IFLNK
- &S_ISREG &S_ISDIR &S_ISLNK &S_ISSOCK &S_ISBLK &S_ISCHR &S_ISFIFO
- &S_ISWHT &S_ISENFMT &S_IFMT &S_IMODE
-);
-# Named groups of exports
-%EXPORT_TAGS = (
- 'flock' => [qw(LOCK_SH LOCK_EX LOCK_NB LOCK_UN)],
- 'Fcompat' => [qw(FAPPEND FASYNC FCREAT FDEFER FDSYNC FEXCL FLARGEFILE
- FNDELAY FNONBLOCK FRSYNC FSYNC FTRUNC)],
- 'seek' => [qw(SEEK_SET SEEK_CUR SEEK_END)],
- 'mode' => [qw(S_ISUID S_ISGID S_ISVTX S_ISTXT
- _S_IFMT S_IFREG S_IFDIR S_IFLNK
- S_IFSOCK S_IFBLK S_IFCHR S_IFIFO S_IFWHT S_ENFMT
- S_IRUSR S_IWUSR S_IXUSR S_IRWXU
- S_IRGRP S_IWGRP S_IXGRP S_IRWXG
- S_IROTH S_IWOTH S_IXOTH S_IRWXO
- S_IREAD S_IWRITE S_IEXEC
- S_ISREG S_ISDIR S_ISLNK S_ISSOCK
- S_ISBLK S_ISCHR S_ISFIFO
- S_ISWHT S_ISENFMT
- S_IFMT S_IMODE
- )],
-);
+), map {@{$_}} values %EXPORT_TAGS);
sub AUTOLOAD {
(my $constname = $AUTOLOAD) =~ s/.*:://;