aboutsummaryrefslogtreecommitdiff
path: root/common/stdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/stdio.c')
-rw-r--r--common/stdio.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/common/stdio.c b/common/stdio.c
index 2d94385..73acbb3 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -4,14 +4,14 @@
#include "string.h"
#include "stdio.h"
-#include <arc.h>
+#include <prom.h>
#include <stdarg.h>
-static FILE arc_stdin = ARC_STDIN;
-FILE *stdin = &arc_stdin;
+static FILE stdin_file = STDIN_FILENO;
+FILE *stdin = &stdin_file;
-static FILE arc_stdout = ARC_STDOUT;
-FILE *stdout = &arc_stdout;
+static FILE stdout_file = STDOUT_FILENO;
+FILE *stdout = &stdout_file;
int fputs(const char *s, FILE * stream)
@@ -20,8 +20,8 @@ int fputs(const char *s, FILE * stream)
unsigned long count;
if (strlen(s) > 0) {
- status = ArcWrite(*stream, (char *) s, strlen(s), &count);
- if ((status != ESUCCESS) || (count != strlen(s)))
+ status = prom_write(*stream, (char *) s, strlen(s), &count);
+ if ((status != 0) || (count != strlen(s)))
return EOF;
}
return 0;
@@ -44,8 +44,8 @@ int fgetc(FILE * stream)
char ch;
unsigned long count;
- status = ArcRead(*stream, &ch, sizeof(CHAR), &count);
- if ((status != ESUCCESS) || (count != sizeof(CHAR)))
+ status = prom_read(*stream, &ch, sizeof(char), &count);
+ if ((status != 0) || (count != sizeof(char)))
return EOF;
return (int) ch;
}
@@ -86,15 +86,15 @@ int vfprintf(FILE * stream, const char *format, va_list ap)
break;
} else {
if (format < str) {
- LONG status;
- ULONG count;
- ULONG len = str - format;
+ long status;
+ unsigned long count;
+ unsigned long len = str - format;
status =
- ArcWrite(*stream,
+ prom_write(*stream,
(char *) format, len,
&count);
- if ((status != ESUCCESS)
+ if ((status != 0)
|| (count != len))
return EOF;
count += len;
@@ -207,7 +207,7 @@ int vsprintf(char* string, const char *format, va_list ap)
break;
} else {
if (format < str) {
- ULONG len = str - format;
+ unsigned long len = str - format;
strncpy(&string[count],
(char *) format, len);