aboutsummaryrefslogtreecommitdiffstats
path: root/missing
diff options
context:
space:
mode:
Diffstat (limited to 'missing')
-rw-r--r--missing/strerror.c41
-rw-r--r--missing/strftime.c20
-rw-r--r--missing/strtod.c7
-rw-r--r--missing/system.c39
4 files changed, 49 insertions, 58 deletions
diff --git a/missing/strerror.c b/missing/strerror.c
index e49fdb65..6a725995 100644
--- a/missing/strerror.c
+++ b/missing/strerror.c
@@ -1,27 +1,20 @@
-/*
- * strerror.c --- ANSI C compatible system error routine
- */
-
-/*
- * Copyright (C) 1986, 1988, 1989, 1991 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
+/* strerror.c --- ANSI C compatible system error routine
+
+ Copyright (C) 1986, 1988, 1989, 1991 the Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if 0
#include <stdio.h>
diff --git a/missing/strftime.c b/missing/strftime.c
index 1e16868c..18a6a7bf 100644
--- a/missing/strftime.c
+++ b/missing/strftime.c
@@ -92,23 +92,25 @@
#ifndef __STDC__
#define const /**/
-extern void *malloc();
-extern void *realloc();
extern void tzset();
-extern char *strchr();
-extern char *getenv();
static int weeknumber();
adddecl(static int iso8601wknum();)
#else
-extern void *malloc(unsigned count);
-extern void *realloc(void *ptr, unsigned count);
extern void tzset(void);
-extern char *strchr(const char *str, int ch);
-extern char *getenv(const char *v);
static int weeknumber(const struct tm *timeptr, int firstweekday);
adddecl(static int iso8601wknum(const struct tm *timeptr);)
#endif
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <string.h>
+#else
+extern void *malloc();
+extern void *realloc();
+extern char *getenv();
+extern char *strchr();
+#endif
+
#ifdef __GNUC__
#define inline __inline__
#else
@@ -504,7 +506,7 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
#ifdef VMS_EXT
case 'v': /* date as dd-bbb-YYYY */
- sprintf(tbuf, "%02d-%3.3s-%4d",
+ sprintf(tbuf, "%2d-%3.3s-%4d",
range(1, timeptr->tm_mday, 31),
months_a[range(0, timeptr->tm_mon, 11)],
timeptr->tm_year + 1900);
diff --git a/missing/strtod.c b/missing/strtod.c
index 746a5da9..7e6cc0c4 100644
--- a/missing/strtod.c
+++ b/missing/strtod.c
@@ -28,7 +28,7 @@
extern double atof();
double
-strtod (s, ptr)
+strtod(s, ptr)
register char *s;
register char **ptr;
{
@@ -105,7 +105,8 @@ out:
}
#ifdef TEST
-main (argc, argv)
+int
+main(argc, argv)
int argc;
char **argv;
{
@@ -116,5 +117,7 @@ char **argv;
d = strtod (*argv, & p);
printf ("%lf [%s]\n", d, p);
}
+
+ return 0;
}
#endif
diff --git a/missing/system.c b/missing/system.c
index 8e613a3a..11db9925 100644
--- a/missing/system.c
+++ b/missing/system.c
@@ -1,27 +1,20 @@
-/*
- * system.c --- replacement system() for systems missing one
- */
+/* system.c --- replacement system() for systems missing one
-/*
- * Copyright (C) 1986, 1988, 1989, 1991 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
+ Copyright (C) 1986, 1988, 1989, 1991 the Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern void fatal();