demo: remove use of format strings from mini_c lib

The implementations of snprintf and vsnprintf are not needed for the
loading of png images by the demo applications. So we can avoid the
dependency from the format library hosted in the libports repository.

Issue #2064
This commit is contained in:
Norman Feske 2023-03-10 10:23:41 +01:00 committed by Christian Helmuth
parent 2c32e9ee18
commit d0f4791413
6 changed files with 9 additions and 62 deletions

View File

@ -1,8 +1,5 @@
SRC_CC = snprintf.cc vsnprintf.cc atol.cc strtol.cc strtod.cc \
malloc_free.cc memcmp.cc strlen.cc memset.cc abort.cc \
mini_c.cc
LIBS += format
SRC_CC = atol.cc strtol.cc strtod.cc malloc_free.cc memcmp.cc strlen.cc \
memset.cc abort.cc mini_c.cc
STDINC = yes

View File

@ -1,7 +1,6 @@
base
os
blit
format
nitpicker_gfx
timer_session
input_session

View File

@ -1,10 +1,5 @@
Mini C library
This library only provides the libc support for libz, libpng,
and DOpE. Most functions are not implemented. The implemented
functions might be slightly incompatible to a real libc.
Please use this library with caution!
If you require libc support that goes beyond simple string
functions for your application, please consider porting a
real libc to Genode instead of enhancing mini_c.
This library only provides the libc support for libz and libpng.
Most functions are not implemented. The implemented functions might be
slightly incompatible to a real libc. Please use this library with caution!

View File

@ -51,6 +51,10 @@ int puts(const char *s)
{ Genode::log("%s", s); return 1; }
int putchar(int c)
{ Genode::log("%c", c); return c; }
int vsnprintf(char *, size_t, const char *, va_list)
{ NOT_IMPLEMENTED; return 0; }
int snprintf(char *, size_t, const char *, ...)
{ NOT_IMPLEMENTED; return 0; }
#include <stdlib.h>

View File

@ -1,27 +0,0 @@
/*
* \brief Mini C snprintf()
* \author Christian Helmuth
* \date 2008-07-24
*/
/*
* Copyright (C) 2008-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#include <format/snprintf.h>
#include <stdio.h>
extern "C" int snprintf(char *dst, Format::size_t dst_len, const char *format, ...)
{
va_list list;
va_start(list, format);
Format::String_console sc(dst, dst_len);
sc.vprintf(format, list);
va_end(list);
return (int)sc.len();
}

View File

@ -1,21 +0,0 @@
/*
* \brief Mini C vsnprintf()
* \author Christian Helmuth
* \date 2008-07-24
*/
/*
* Copyright (C) 2008-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#include <format/snprintf.h>
extern "C" int vsnprintf(char *dst, Format::size_t dst_len, const char *format, va_list list)
{
Format::String_console sc(dst, dst_len);
sc.vprintf(format, list);
return (int)sc.len();
}