summaryrefslogtreecommitdiff
path: root/ext/Fcntl/Fcntl.xs
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1998-06-22 21:58:55 +0300
committerGurusamy Sarathy <gsar@cpan.org>1998-06-23 05:45:19 +0000
commit0fd60c2a37f9ab7161935b80b652d8ce226cce08 (patch)
tree189ab44f68b954c96beef1c6845c087356bd0000 /ext/Fcntl/Fcntl.xs
parent83e898de4c33570d7f7c201c6f693bc6bd7ed922 (diff)
downloadperl-0fd60c2a37f9ab7161935b80b652d8ce226cce08.tar.gz
5.004_67: Fcntl: add few constants, enhance maintainability
Message-Id: <199806221558.SAA18626@alpha.hut.fi> p4raw-id: //depot/perl@1196
Diffstat (limited to 'ext/Fcntl/Fcntl.xs')
-rw-r--r--ext/Fcntl/Fcntl.xs150
1 files changed, 90 insertions, 60 deletions
diff --git a/ext/Fcntl/Fcntl.xs b/ext/Fcntl/Fcntl.xs
index 251f3f4176..18a175f1c6 100644
--- a/ext/Fcntl/Fcntl.xs
+++ b/ext/Fcntl/Fcntl.xs
@@ -42,12 +42,24 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
+ if (strEQ(name, "F_EXLCK"))
+#ifdef F_EXLCK
+ return F_EXLCK;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "F_GETFD"))
#ifdef F_GETFD
return F_GETFD;
#else
goto not_there;
#endif
+ if (strEQ(name, "F_GETFL"))
+#ifdef F_GETFL
+ return F_GETFL;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "F_GETLK"))
#ifdef F_GETLK
return F_GETLK;
@@ -60,21 +72,21 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
- if (strEQ(name, "F_SETFD"))
-#ifdef F_SETFD
- return F_SETFD;
+ if (strEQ(name, "F_POSIX"))
+#ifdef F_POSIX
+ return F_POSIX;
#else
goto not_there;
#endif
- if (strEQ(name, "F_GETFL"))
-#ifdef F_GETFL
- return F_GETFL;
+ if (strEQ(name, "F_RDLCK"))
+#ifdef F_RDLCK
+ return F_RDLCK;
#else
goto not_there;
#endif
- if (strEQ(name, "F_POSIX"))
-#ifdef F_POSIX
- return F_POSIX;
+ if (strEQ(name, "F_SETFD"))
+#ifdef F_SETFD
+ return F_SETFD;
#else
goto not_there;
#endif
@@ -102,9 +114,9 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
- if (strEQ(name, "F_RDLCK"))
-#ifdef F_RDLCK
- return F_RDLCK;
+ if (strEQ(name, "F_SHLCK"))
+#ifdef F_SHLCK
+ return F_SHLCK;
#else
goto not_there;
#endif
@@ -147,6 +159,12 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
+ if (strEQ(name, "FDEFER"))
+#ifdef FDEFER
+ return FDEFER;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "FEXCL"))
#ifdef FEXCL
return FEXCL;
@@ -211,33 +229,69 @@ constant(char *name, int arg)
break;
case 'O':
if (strnEQ(name, "O_", 2)) {
+ if (strEQ(name, "O_ACCMODE"))
+#ifdef O_ACCMODE
+ return O_ACCMODE;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "O_APPEND"))
+#ifdef O_APPEND
+ return O_APPEND;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "O_ASYNC"))
+#ifdef O_ASYNC
+ return O_ASYNC;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "O_BINARY"))
+#ifdef O_BINARY
+ return O_BINARY;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "O_CREAT"))
#ifdef O_CREAT
return O_CREAT;
#else
goto not_there;
#endif
+ if (strEQ(name, "O_DEFER"))
+#ifdef O_DEFER
+ return O_DEFER;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "O_DSYNC"))
+#ifdef O_DSYNC
+ return O_DSYNC;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "O_EXCL"))
#ifdef O_EXCL
return O_EXCL;
#else
goto not_there;
#endif
- if (strEQ(name, "O_NOCTTY"))
-#ifdef O_NOCTTY
- return O_NOCTTY;
+ if (strEQ(name, "O_EXLOCK"))
+#ifdef O_EXLOCK
+ return O_EXLOCK;
#else
goto not_there;
#endif
- if (strEQ(name, "O_TRUNC"))
-#ifdef O_TRUNC
- return O_TRUNC;
+ if (strEQ(name, "O_NDELAY"))
+#ifdef O_NDELAY
+ return O_NDELAY;
#else
goto not_there;
#endif
- if (strEQ(name, "O_APPEND"))
-#ifdef O_APPEND
- return O_APPEND;
+ if (strEQ(name, "O_NOCTTY"))
+#ifdef O_NOCTTY
+ return O_NOCTTY;
#else
goto not_there;
#endif
@@ -247,12 +301,6 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
- if (strEQ(name, "O_NDELAY"))
-#ifdef O_NDELAY
- return O_NDELAY;
-#else
- goto not_there;
-#endif
if (strEQ(name, "O_RDONLY"))
#ifdef O_RDONLY
return O_RDONLY;
@@ -265,21 +313,9 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
- if (strEQ(name, "O_WRONLY"))
-#ifdef O_WRONLY
- return O_WRONLY;
-#else
- goto not_there;
-#endif
- if (strEQ(name, "O_BINARY"))
-#ifdef O_BINARY
- return O_BINARY;
-#else
- goto not_there;
-#endif
- if (strEQ(name, "O_EXLOCK"))
-#ifdef O_EXLOCK
- return O_EXLOCK;
+ if (strEQ(name, "O_RSYNC"))
+#ifdef O_RSYNC
+ return O_RSYNC;
#else
goto not_there;
#endif
@@ -289,33 +325,27 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
- if (strEQ(name, "O_ASYNC"))
-#ifdef O_ASYNC
- return O_ASYNC;
-#else
- goto not_there;
-#endif
- if (strEQ(name, "O_DSYNC"))
-#ifdef O_DSYNC
- return O_DSYNC;
+ if (strEQ(name, "O_SYNC"))
+#ifdef O_SYNC
+ return O_SYNC;
#else
goto not_there;
#endif
- if (strEQ(name, "O_RSYNC"))
-#ifdef O_RSYNC
- return O_RSYNC;
+ if (strEQ(name, "O_TEXT"))
+#ifdef O_TEXT
+ return O_TEXT;
#else
goto not_there;
#endif
- if (strEQ(name, "O_SYNC"))
-#ifdef O_SYNC
- return O_SYNC;
+ if (strEQ(name, "O_TRUNC"))
+#ifdef O_TRUNC
+ return O_TRUNC;
#else
goto not_there;
#endif
- if (strEQ(name, "O_DEFER"))
-#ifdef O_DEFER
- return O_DEFER;
+ if (strEQ(name, "O_WRONLY"))
+#ifdef O_WRONLY
+ return O_WRONLY;
#else
goto not_there;
#endif