Implements a stripped-down version of standard I/O functions for Xinu.
More...
Defines |
#define | puts(s) fputs(CONSOLE, s) |
Functions |
syscall | kprintf (char *,...) |
syscall | kputc (device *, unsigned char) |
syscall | kcheckc (void) |
syscall | kgetc (void) |
syscall | kungetc (unsigned char) |
int | _doscan (register char *, register int **, int(*)(void), int(*)(char), int, int) |
int | sscanf (char *, char *, int) |
char * | fgets (int, char *, int) |
void | _doprnt (char *, va_list, int(*)(int, int), int) |
int | fprintf (int, char *,...) |
int | sprintf (char *, char *,...) |
int | fputs (int, char *) |
Detailed Description
Implements a stripped-down version of standard I/O functions for Xinu.
Function Documentation
char* fgets |
( |
int |
dev, |
|
|
char * |
s, |
|
|
int |
n |
|
) |
| |
Read a newline-terminated string from device (file) dev.
- Parameters:
-
dev | device to read from |
*s | buffer for result |
n | maximum read length |
int fprintf |
( |
int |
dev, |
|
|
char * |
fmt, |
|
|
|
... |
|
) |
| |
Print a formatted message on specified device (file)
- Parameters:
-
dev | device to write to |
*fmt | format string |
int fputs |
( |
int |
dev, |
|
|
char * |
s |
|
) |
| |
Write a null-terminated string to a device (file)
- Parameters:
-
dev | device to write to |
*s | string to write |
- Returns:
- result of last putc
kcheckc - check to see if a character is available.
- Returns:
- true if a character is available, false otherwise.
kgetc - perform a synchronous kernel read from the serial console, or from the local buffer if there are "ungotten" characters.
- Returns:
- c on success, SYSERR on failure.
syscall kprintf |
( |
char * |
fmt, |
|
|
|
... |
|
) |
| |
Kernel output (for debugging use only)
Kernel output (for debugging use only)
- Parameters:
-
*fmt | pointer to string being printed |
- Returns:
- OK on success
syscall kputc |
( |
device * |
pdev, |
|
|
unsigned char |
c |
|
) |
| |
kputc - perform a synchronous kernel write to the serial console
- Parameters:
-
*pdev | device pointer (unused for the synchronous driver) |
c | character to write |
- Returns:
- c on success, SYSERR on failure.
syscall kungetc |
( |
unsigned char |
c | ) |
|
kungetc - put a serial character "back" into a local buffer.
- Parameters:
-
- Returns:
- c on success, SYSERR on failure.
int sprintf |
( |
char * |
str, |
|
|
char * |
fmt, |
|
|
|
... |
|
) |
| |
Format arguments and place output in a string.
- Parameters:
-
*str | output string |
*fmt | format string |
int sscanf |
( |
char * |
str, |
|
|
char * |
fmt, |
|
|
int |
args |
|
) |
| |
Read from a string according to a format.
- Parameters:
-
*str | string to read from |
*fmt | format string |
args | number of arguments in format string |
- Returns:
- result of _doscan