kfile_debug.c
Go to the documentation of this file.00001
00038 #include "kfile_debug.h"
00039
00040 #include <kern/kfile.h>
00041
00042 #include <string.h>
00043
00044
00045 static size_t kfiledebug_write(struct KFile *_fd, const void *buf, size_t size)
00046 {
00047 KFILEDEBUG_CAST(_fd);
00048
00049 kprintf("%.*s", size, (const char *)buf);
00050
00051 return size;
00052 }
00053
00054 void kfiledebug_init(KFileDebug *kd)
00055 {
00056 ASSERT(kd);
00057
00058 memset(kd, 0, sizeof(*kd));
00059
00060 kfile_init(&kd->fd);
00061 kd->fd.write = kfiledebug_write;
00062 DB(kd->fd._type = KFT_KFILEDEBUG);
00063 }