aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--posix/ChangeLog8
-rw-r--r--posix/gawkmisc.c63
2 files changed, 33 insertions, 38 deletions
diff --git a/posix/ChangeLog b/posix/ChangeLog
index ddd40114..e2d787e9 100644
--- a/posix/ChangeLog
+++ b/posix/ChangeLog
@@ -1,3 +1,11 @@
+Mon Jan 24 22:21:08 2011 Arnold D. Robbins <arnold@skeeve.com>
+
+ Everything: Move to ANSI headers on the function definitions.
+
+Mon Jan 24 22:20:43 2011 Corinna Vinschen <vinschen@redhat.com>
+
+ * gawkmisc.c: Update CYGWIN code.
+
Wed Nov 24 17:26:24 2010 Arnold D. Robbins <arnold@skeeve.com>
* gawkmisc.c (os_close_on_exec): After discussion on the Bash
diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c
index 6032fcdf..8388212f 100644
--- a/posix/gawkmisc.c
+++ b/posix/gawkmisc.c
@@ -16,6 +16,12 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+#ifdef __CYGWIN__
+#include <stdio.h>
+#include <sys/cygwin.h>
+#include <io.h>
+#endif
+
char quote = '\'';
char *defpath = DEFPATH;
char envsep = ':';
@@ -28,8 +34,7 @@ char envsep = ':';
/* gawk_name --- pull out the "gawk" part from how the OS called us */
char *
-gawk_name(filespec)
-const char *filespec;
+gawk_name(const char *filespec)
{
char *p;
@@ -41,9 +46,7 @@ const char *filespec;
/* os_arg_fixup --- fixup the command line */
void
-os_arg_fixup(argcp, argvp)
-int *argcp;
-char ***argvp;
+os_arg_fixup(int *argcp, char ***argvp)
{
/* no-op */
return;
@@ -52,9 +55,7 @@ char ***argvp;
/* os_devopen --- open special per-OS devices */
int
-os_devopen(name, flag)
-const char *name;
-int flag;
+os_devopen(const char *name, int flag)
{
/* no-op */
return INVALID_HANDLE;
@@ -85,9 +86,7 @@ int flag;
*/
size_t
-optimal_bufsize(fd, stb)
-int fd;
-struct stat *stb;
+optimal_bufsize(int fd, struct stat *stb)
{
char *val;
static size_t env_val = 0;
@@ -143,8 +142,7 @@ struct stat *stb;
/* ispath --- return true if path has directory components */
int
-ispath(file)
-const char *file;
+ispath(const char *file)
{
return (strchr(file, '/') != NULL);
}
@@ -152,8 +150,7 @@ const char *file;
/* isdirpunct --- return true if char is a directory separator */
int
-isdirpunct(c)
-int c;
+isdirpunct(int c)
{
return (c == '/');
}
@@ -161,9 +158,7 @@ int c;
/* os_close_on_exec --- set close on exec flag, print warning if fails */
void
-os_close_on_exec(fd, name, what, dir)
-int fd;
-const char *name, *what, *dir;
+os_close_on_exec(int fd, const char *name, const char *what, const char *dir)
{
int curflags = 0;
@@ -199,8 +194,7 @@ const char *name, *what, *dir;
#endif
int
-os_isdir(fd)
-int fd;
+os_isdir(int fd)
{
struct stat sbuf;
@@ -223,8 +217,7 @@ os_is_setuid()
/* os_setbinmode --- set binary mode on file */
int
-os_setbinmode(fd, mode)
-int fd, mode;
+os_setbinmode(int fd, int mode)
{
#ifdef __CYGWIN__
setmode (fd, mode);
@@ -235,8 +228,7 @@ int fd, mode;
/* os_restore_mode --- restore the original mode of the console device */
void
-os_restore_mode (fd)
-int fd;
+os_restore_mode(int fd)
{
/* no-op */
return;
@@ -251,25 +243,20 @@ files_are_same(struct stat *f1, struct stat *f2)
}
#ifdef __CYGWIN__
-#include <stdio.h>
-#include <sys/cygwin.h>
-
-extern int _fmode;
void
-cygwin_premain0 (int argc, char **argv, void *myself)
+cygwin_premain0(int argc, char **argv, void *myself)
{
- static struct __cygwin_perfile pf[] =
- {
- {"", O_RDONLY | O_TEXT},
- /*{"", O_WRONLY | O_BINARY},*/
- {NULL, 0}
- };
- cygwin_internal (CW_PERFILE, pf);
+ static struct __cygwin_perfile pf[] = {
+ { "", O_RDONLY | O_TEXT },
+ /*{ "", O_WRONLY | O_BINARY },*/
+ { NULL, 0 }
+ };
+ cygwin_internal(CW_PERFILE, pf);
}
void
-cygwin_premain2 (int argc, char **argv, void *myself)
+cygwin_premain2(int argc, char **argv, void *myself)
{
- setmode (fileno (stdin), O_TEXT);
+ setmode(fileno (stdin), O_TEXT);
}
#endif