Index: kernel/generic/include/printf/printf_core.h
===================================================================
--- kernel/generic/include/printf/printf_core.h	(revision 696b405386c8f231d8955f78acc39dd81137ea5c)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kernel_generic
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_PRINTF_CORE_H_
-#define KERN_PRINTF_CORE_H_
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <uchar.h>
-
-/** Structure for specifying output methods for different printf clones. */
-typedef struct {
-	/* String output function, returns number of printed characters or EOF */
-	int (*str_write)(const char *, size_t, void *);
-
-	/* Wide string output function, returns number of printed characters or EOF */
-	int (*wstr_write)(const char32_t *, size_t, void *);
-
-	/* User data - output stream specification, state, locks, etc. */
-	void *data;
-} printf_spec_t;
-
-extern int printf_core(const char *fmt, printf_spec_t *ps, va_list ap);
-
-#endif
-
-/** @}
- */
Index: kernel/generic/meson.build
===================================================================
--- kernel/generic/meson.build	(revision 696b405386c8f231d8955f78acc39dd81137ea5c)
+++ kernel/generic/meson.build	(revision 45adeeb6f146353989d5501fff8cf3e780e5dbea)
@@ -40,9 +40,11 @@
 	'common/adt/list.c',
 	'common/adt/odict.c',
+	'common/gsort.c',
 	'common/printf/printf_core.c',
 	'common/stdc/calloc.c',
 	'common/stdc/ctype.c',
 	'common/stdc/mem.c',
-	'common/gsort.c',
+	'common/stdc/snprintf.c',
+	'common/stdc/vsnprintf.c',
 	'common/str.c',
 	'common/str_error.c',
@@ -96,7 +98,5 @@
 	'src/mm/reserve.c',
 	'src/printf/printf.c',
-	'src/printf/snprintf.c',
 	'src/printf/vprintf.c',
-	'src/printf/vsnprintf.c',
 	'src/proc/program.c',
 	'src/proc/scheduler.c',
Index: kernel/generic/src/log/log.c
===================================================================
--- kernel/generic/src/log/log.c	(revision 696b405386c8f231d8955f78acc39dd81137ea5c)
+++ kernel/generic/src/log/log.c	(revision 45adeeb6f146353989d5501fff8cf3e780e5dbea)
@@ -33,25 +33,25 @@
  */
 
-#include <sysinfo/sysinfo.h>
-#include <synch/spinlock.h>
-#include <typedefs.h>
+#include <abi/log.h>
+#include <arch.h>
+#include <atomic.h>
+#include <console/console.h>
+#include <ddi/ddi.h>
 #include <ddi/irq.h>
-#include <ddi/ddi.h>
+#include <errno.h>
 #include <ipc/event.h>
 #include <ipc/irq.h>
-#include <arch.h>
+#include <log.h>
 #include <panic.h>
+#include <print.h>
+#include <printf_core.h>
 #include <putchar.h>
-#include <atomic.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <str.h>
+#include <synch/spinlock.h>
 #include <syscall/copy.h>
-#include <errno.h>
-#include <str.h>
-#include <print.h>
-#include <printf/printf_core.h>
-#include <stdarg.h>
-#include <log.h>
-#include <console/console.h>
-#include <abi/log.h>
-#include <stdlib.h>
+#include <sysinfo/sysinfo.h>
+#include <typedefs.h>
 
 #define LOG_PAGES    8
@@ -204,35 +204,11 @@
 {
 	size_t offset = 0;
-	size_t chars = 0;
-
-	while (offset < size) {
+
+	while (offset < size)
 		kio_push_char(str_decode(str, &offset, size));
-		chars++;
-	}
 
 	log_append((const uint8_t *)str, size);
 
-	return chars;
-}
-
-static int log_printf_wstr_write(const char32_t *wstr, size_t size, void *data)
-{
-	char buffer[16];
-	size_t offset = 0;
-	size_t chars = 0;
-
-	for (offset = 0; offset < size; offset += sizeof(char32_t), chars++) {
-		kio_push_char(wstr[chars]);
-
-		size_t buffer_offset = 0;
-		errno_t rc = chr_encode(wstr[chars], buffer, &buffer_offset, 16);
-		if (rc != EOK) {
-			return EOF;
-		}
-
-		log_append((const uint8_t *)buffer, buffer_offset);
-	}
-
-	return chars;
+	return EOK;
 }
 
@@ -243,15 +219,10 @@
 int log_vprintf(const char *fmt, va_list args)
 {
-	int ret;
-
 	printf_spec_t ps = {
 		log_printf_str_write,
-		log_printf_wstr_write,
 		NULL
 	};
 
-	ret = printf_core(fmt, &ps, args);
-
-	return ret;
+	return printf_core(fmt, &ps, args);
 }
 
Index: kernel/generic/src/printf/snprintf.c
===================================================================
--- kernel/generic/src/printf/snprintf.c	(revision 696b405386c8f231d8955f78acc39dd81137ea5c)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kernel_generic
- * @{
- */
-/** @file
- */
-
-#include <print.h>
-#include <printf/printf_core.h>
-
-int snprintf(char *str, size_t size, const char *fmt, ...)
-{
-	int ret;
-	va_list args;
-
-	va_start(args, fmt);
-	ret = vsnprintf(str, size, fmt, args);
-
-	va_end(args);
-
-	return ret;
-}
-
-/** @}
- */
Index: kernel/generic/src/printf/vprintf.c
===================================================================
--- kernel/generic/src/printf/vprintf.c	(revision 696b405386c8f231d8955f78acc39dd81137ea5c)
+++ kernel/generic/src/printf/vprintf.c	(revision 45adeeb6f146353989d5501fff8cf3e780e5dbea)
@@ -36,5 +36,5 @@
 #include <console/console.h>
 #include <print.h>
-#include <printf/printf_core.h>
+#include <printf_core.h>
 #include <putchar.h>
 #include <str.h>
@@ -42,29 +42,12 @@
 #include <typedefs.h>
 
-static int vprintf_str_write(const char *str, size_t size, void *data)
+static errno_t vprintf_str_write(const char *str, size_t size, void *data)
 {
 	size_t offset = 0;
-	size_t chars = 0;
 
-	while (offset < size) {
+	while (offset < size)
 		putuchar(str_decode(str, &offset, size));
-		chars++;
-	}
 
-	return chars;
-}
-
-static int vprintf_wstr_write(const char32_t *str, size_t size, void *data)
-{
-	size_t offset = 0;
-	size_t chars = 0;
-
-	while (offset < size) {
-		putuchar(str[chars]);
-		chars++;
-		offset += sizeof(char32_t);
-	}
-
-	return chars;
+	return EOK;
 }
 
@@ -92,5 +75,4 @@
 	printf_spec_t ps = {
 		vprintf_str_write,
-		vprintf_wstr_write,
 		NULL
 	};
Index: kernel/generic/src/printf/vsnprintf.c
===================================================================
--- kernel/generic/src/printf/vsnprintf.c	(revision 696b405386c8f231d8955f78acc39dd81137ea5c)
+++ 	(revision )
@@ -1,192 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kernel_generic
- * @{
- */
-/** @file
- */
-
-#include <print.h>
-#include <printf/printf_core.h>
-#include <str.h>
-#include <memw.h>
-#include <errno.h>
-
-typedef struct {
-	size_t size;    /* Total size of the buffer (in bytes) */
-	size_t len;     /* Number of already used bytes */
-	char *dst;      /* Destination */
-} vsnprintf_data_t;
-
-/** Write string to given buffer.
- *
- * Write at most data->size plain characters including trailing zero.
- * According to C99, snprintf() has to return number of characters that
- * would have been written if enough space had been available. Hence
- * the return value is not the number of actually printed characters
- * but size of the input string.
- *
- * @param str  Source string to print.
- * @param size Number of plain characters in str.
- * @param data Structure describing destination string, counter
- *             of used space and total string size.
- *
- * @return Number of characters to print (not characters actually
- *         printed).
- *
- */
-static int vsnprintf_str_write(const char *str, size_t size, vsnprintf_data_t *data)
-{
-	size_t left = data->size - data->len;
-
-	if (left == 0)
-		return ((int) size);
-
-	if (left == 1) {
-		/*
-		 * We have only one free byte left in buffer
-		 * -> store trailing zero
-		 */
-		data->dst[data->size - 1] = 0;
-		data->len = data->size;
-		return ((int) size);
-	}
-
-	if (left <= size) {
-		/*
-		 * We do not have enough space for the whole string
-		 * with the trailing zero => print only a part
-		 * of string
-		 */
-		size_t index = 0;
-
-		while (index < size) {
-			char32_t uc = str_decode(str, &index, size);
-
-			if (chr_encode(uc, data->dst, &data->len, data->size - 1) != EOK)
-				break;
-		}
-
-		/*
-		 * Put trailing zero at end, but not count it
-		 * into data->len so it could be rewritten next time
-		 */
-		data->dst[data->len] = 0;
-
-		return ((int) size);
-	}
-
-	/* Buffer is big enough to print the whole string */
-	memcpy((void *)(data->dst + data->len), (void *) str, size);
-	data->len += size;
-
-	/*
-	 * Put trailing zero at end, but not count it
-	 * into data->len so it could be rewritten next time
-	 */
-	data->dst[data->len] = 0;
-
-	return ((int) size);
-}
-
-/** Write wide string to given buffer.
- *
- * Write at most data->size plain characters including trailing zero.
- * According to C99, snprintf() has to return number of characters that
- * would have been written if enough space had been available. Hence
- * the return value is not the number of actually printed characters
- * but size of the input string.
- *
- * @param str  Source wide string to print.
- * @param size Number of bytes in str.
- * @param data Structure describing destination string, counter
- *             of used space and total string size.
- *
- * @return Number of wide characters to print (not characters actually
- *         printed).
- *
- */
-static int vsnprintf_wstr_write(const char32_t *str, size_t size, vsnprintf_data_t *data)
-{
-	size_t index = 0;
-
-	while (index < (size / sizeof(char32_t))) {
-		size_t left = data->size - data->len;
-
-		if (left == 0)
-			return ((int) size);
-
-		if (left == 1) {
-			/*
-			 * We have only one free byte left in buffer
-			 * -> store trailing zero
-			 */
-			data->dst[data->size - 1] = 0;
-			data->len = data->size;
-			return ((int) size);
-		}
-
-		if (chr_encode(str[index], data->dst, &data->len, data->size - 1) != EOK)
-			break;
-
-		index++;
-	}
-
-	/*
-	 * Put trailing zero at end, but not count it
-	 * into data->len so it could be rewritten next time
-	 */
-	data->dst[data->len] = 0;
-
-	return ((int) size);
-}
-
-int vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
-{
-	vsnprintf_data_t data = {
-		size,
-		0,
-		str
-	};
-	printf_spec_t ps = {
-		(int (*) (const char *, size_t, void *)) vsnprintf_str_write,
-		(int (*) (const char32_t *, size_t, void *)) vsnprintf_wstr_write,
-		&data
-	};
-
-	/* Print 0 at end of string - fix the case that nothing will be printed */
-	if (size > 0)
-		str[0] = 0;
-
-	/* vsnprintf_write ensures that str will be terminated by zero. */
-	return printf_core(fmt, &ps, ap);
-}
-
-/** @}
- */
