diff options
Diffstat (limited to 'io')
-rw-r--r-- | io/interrupt.h | 6 | ||||
-rw-r--r-- | io/log.c | 68 | ||||
-rw-r--r-- | io/log.h | 22 |
3 files changed, 0 insertions, 96 deletions
diff --git a/io/interrupt.h b/io/interrupt.h deleted file mode 100644 index 444ff01..0000000 --- a/io/interrupt.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef JOVE_IO_INTERRUPT_H -#define JOVE_IO_INTERRUPT_H 1 - - - -#endif diff --git a/io/log.c b/io/log.c deleted file mode 100644 index 14397a7..0000000 --- a/io/log.c +++ /dev/null @@ -1,68 +0,0 @@ -#include "log.h" -#include "lib/jove.h" -#include "lib/string.h" -#include "lib/format.h" - -static struct LogDevice *s_first_logdev = NULL; - -void -klog_newdev(struct LogDevice *dev) -{ - if(s_first_logdev == NULL) { - s_first_logdev = dev; - }else{ - dev->chain = s_first_logdev; - s_first_logdev = dev; - } -} - -static void -s_klogc(struct LogDevice *dev, char c) -{ - dev->out(&c, 1); - if(dev->chain != NULL) - s_klogc(dev->chain, c); -} - -void -klogc(char c) -{ - s_klogc(s_first_logdev, c); -} - -static void -s_klogs(struct LogDevice *dev, const char *s, size_t slen) -{ - dev->out(s, slen); - if(dev->chain != NULL) - s_klogs(dev->chain, s, slen); -} - -void -klogs(const char *s) -{ - size_t slen = strlen(s); - s_klogs(s_first_logdev, s, slen); -} - -void -klogsn(const char *s, size_t len) -{ - s_klogs(s_first_logdev, s, len); -} - -void -kvlogf(const char *fmt, va_list ap) -{ - char buffer[256]; - svfmt(buffer, 256, fmt, ap); - klogs(buffer); -} - -void klogf(const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - kvlogf(fmt, ap); - va_end(ap); -} diff --git a/io/log.h b/io/log.h deleted file mode 100644 index ad1526d..0000000 --- a/io/log.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef JOVE_IO_LOG_H -#define JOVE_IO_LOG_H 1 - -#include <stddef.h> - -struct LogDevice -{ - void (*out)(const char*, size_t); - struct LogDevice *chain; -}; - -void klog_newdev(struct LogDevice *dev); - -void klogc(char c); -void klogs(const char *s); -void klogsn(const char *s, size_t len); - -#include <stdarg.h> -void kvlogf(const char *fmt, va_list ap); -void klogf(const char *fmt, ...); - -#endif |