Added headers for missing function prototypes.

This commit is contained in:
jshepher
2004-12-04 00:54:21 +00:00
parent 6a0d455dd0
commit 37223e0cb9
3 changed files with 30 additions and 27 deletions
+1
View File
@@ -1,4 +1,5 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
void __eprintf(const char *format,...) /* for asserts */ void __eprintf(const char *format,...) /* for asserts */
+28 -27
View File
@@ -1,37 +1,38 @@
#include <proto/dos.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <proto/dos.h>
#include <errno.h> #include <errno.h>
#include <string.h>
int readlink(const char *path, char *buf, int bufsiz) { int readlink(const char *path, char *buf, int bufsiz)
struct DevProc *dp = NULL; {
BPTR lock = NULL; struct DevProc *dp = NULL;
int retval = -1; BPTR lock = NULL;
int retval = -1;
lock = Open(path, MODE_OLDFILE); lock = Open(path, MODE_OLDFILE);
if (lock == NULL) { if (lock == NULL) {
errno = ENOENT; errno = ENOENT;
goto done; goto done;
} }
dp = GetDeviceProc(path, NULL); dp = GetDeviceProc(path, NULL);
if (dp == NULL) { if (dp == NULL) {
errno = EINVAL; errno = EINVAL;
goto done; goto done;
} }
retval = ReadLink(dp->dvp_Port, lock, path, buf, bufsiz);
retval = ReadLink(dp->dvp_Port, lock, path, buf, bufsiz); if (retval == TRUE)
if (retval == TRUE) retval = strlen(buf);
retval = strlen(buf); else
else retval = -1;
retval = -1;
done: done:
if (dp != NULL) if (dp != NULL)
FreeDeviceProc(dp); FreeDeviceProc(dp);
if (lock != NULL) if (lock != NULL)
UnLock(lock); UnLock(lock);
return retval; return retval;
} }
+1
View File
@@ -1,3 +1,4 @@
#include <stdlib.h>
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>