diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/vcons/vcons.c | 19 | ||||
-rw-r--r-- | sys/include/dev/vcons/vcons.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sys/dev/vcons/vcons.c b/sys/dev/vcons/vcons.c index 91ea906..cba0b85 100644 --- a/sys/dev/vcons/vcons.c +++ b/sys/dev/vcons/vcons.c @@ -197,6 +197,25 @@ vcons_putch(struct vcons_screen *scr, char c) return 0; } +/* + * Write out a string on the console. + * + * @s: String to write. + */ +int +vcons_putstr(struct vcons_screen *scr, const char *s) +{ + int status; + + while (*s != '\0') { + if ((status = vcons_putch(scr, *(s++))) != 0) { + return status; + } + } + + return 0; +} + void vcons_attach(struct vcons_screen *scr) { diff --git a/sys/include/dev/vcons/vcons.h b/sys/include/dev/vcons/vcons.h index 737651f..9deb656 100644 --- a/sys/include/dev/vcons/vcons.h +++ b/sys/include/dev/vcons/vcons.h @@ -67,6 +67,7 @@ struct vcons_screen { void vcons_attach(struct vcons_screen *scr); int vcons_putch(struct vcons_screen *scr, char c); +int vcons_putstr(struct vcons_screen *scr, const char *s); void vcons_update_cursor(struct vcons_screen *scr); #endif /* !_DEV_VCONS_H_ */ |