summaryrefslogtreecommitdiffstats
path: root/contrib/libf2c/libU77/getcwd_.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libf2c/libU77/getcwd_.c')
-rw-r--r--contrib/libf2c/libU77/getcwd_.c69
1 files changed, 29 insertions, 40 deletions
diff --git a/contrib/libf2c/libU77/getcwd_.c b/contrib/libf2c/libU77/getcwd_.c
index e757803..75277af 100644
--- a/contrib/libf2c/libU77/getcwd_.c
+++ b/contrib/libf2c/libU77/getcwd_.c
@@ -34,26 +34,22 @@ Boston, MA 02111-1307, USA. */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#else
- extern char *getcwd ();
+extern char *getcwd ();
#endif
-#ifdef KR_headers
-extern void s_copy ();
-integer G77_getcwd_0 (str, Lstr)
- char *str; ftnlen Lstr;
-#else
-extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb);
-integer G77_getcwd_0 (char *str, const ftnlen Lstr)
-#endif
+extern void s_copy (register char *a, register char *b, ftnlen la, ftnlen lb);
+integer
+G77_getcwd_0 (char *str, const ftnlen Lstr)
{
- int i;
- char *ret;
+ int i;
+ char *ret;
- ret = getcwd (str, Lstr);
- if (ret == NULL) return errno;
- for (i=strlen(str); i<Lstr; i++)
- str[i] = ' ';
- return 0;
+ ret = getcwd (str, Lstr);
+ if (ret == NULL)
+ return errno;
+ for (i = strlen (str); i < Lstr; i++)
+ str[i] = ' ';
+ return 0;
}
#elif HAVE_GETWD /* HAVE_GETCWD */
@@ -61,37 +57,30 @@ integer G77_getcwd_0 (char *str, const ftnlen Lstr)
/* getwd usage taken from SunOS4 man */
# include <sys/param.h>
- extern char *getwd ();
-#ifdef KR_headers
-extern VOID s_copy ();
-integer G77_getcwd_0 (str, Lstr)
- char *str; ftnlen Lstr;
-#else
-extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb);
-integer G77_getcwd_0 (char *str, const ftnlen Lstr)
-#endif
+extern char *getwd ();
+extern void s_copy (register char *a, register char *b, ftnlen la, ftnlen lb);
+integer
+G77_getcwd_0 (char *str, const ftnlen Lstr)
{
char pathname[MAXPATHLEN];
size_t l;
- if (getwd (pathname) == NULL) {
- return errno;
- } else {
- s_copy (str, pathname, Lstr, strlen (str));
- return 0;
- }
+ if (getwd (pathname) == NULL)
+ {
+ return errno;
+ }
+ else
+ {
+ s_copy (str, pathname, Lstr, strlen (str));
+ return 0;
+ }
}
-#else /* !HAVE_GETWD && !HAVE_GETCWD */
+#else /* !HAVE_GETWD && !HAVE_GETCWD */
-#ifdef KR_headers
-extern VOID s_copy ();
-integer G77_getcwd_0 (str, Lstr)
- char *str; ftnlen Lstr;
-#else
-extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb);
-integer G77_getcwd_0 (char *str, const ftnlen Lstr)
-#endif
+extern void s_copy (register char *a, register char *b, ftnlen la, ftnlen lb);
+integer
+G77_getcwd_0 (char *str, const ftnlen Lstr)
{
return errno = ENOSYS;
}
OpenPOWER on IntegriCloud