1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Added a nice Log::PrintData function to the kernel.

This allows writing binary data to the kernel log.
This commit is contained in:
Jonas 'Sortie' Termansen 2012-01-22 02:12:52 +01:00
parent 1f3f85b609
commit 16dd39e467

View file

@ -44,22 +44,31 @@ namespace Sortix
inline size_t Print(const char* str) inline size_t Print(const char* str)
{ {
if ( deviceCallback ) { return deviceCallback(devicePointer, str, Maxsi::String::Length(str)); } using namespace Maxsi;
return 0; if ( !deviceCallback ) { return 0; }
return deviceCallback(devicePointer, str, String::Length(str));
}
inline size_t PrintData(const void* ptr, size_t size)
{
if ( !deviceCallback ) { return 0; }
return deviceCallback(devicePointer, (const char*) ptr, size);
} }
inline size_t PrintF(const char* format, ...) inline size_t PrintF(const char* format, ...)
{ {
using namespace Maxsi;
va_list list; va_list list;
va_start(list, format); va_start(list, format);
size_t result = Maxsi::Format::Virtual(deviceCallback, devicePointer, format, list); size_t result = Format::Virtual(deviceCallback, devicePointer, format, list);
va_end(list); va_end(list);
return result; return result;
} }
inline size_t PrintFV(const char* format, va_list list) inline size_t PrintFV(const char* format, va_list list)
{ {
return Maxsi::Format::Virtual(deviceCallback, devicePointer, format, list); using namespace Maxsi;
return Format::Virtual(deviceCallback, devicePointer, format, list);
} }
} }
} }