diff --git a/repos/gems/src/app/decorator/config.h b/repos/gems/src/app/decorator/config.h index bc296d0281..0d7be2b15c 100644 --- a/repos/gems/src/app/decorator/config.h +++ b/repos/gems/src/app/decorator/config.h @@ -17,6 +17,7 @@ /* Genode includes */ #include #include +#include #include /* decorator includes */ @@ -81,40 +82,9 @@ class Decorator::Config private: - struct Buffered_xml - { - Allocator &_alloc; - char const * const _ptr; /* pointer to dynamically allocated buffer */ - Xml_node const _xml; /* referring to buffer of '_ptr' */ - - /** - * \throw Allocator::Out_of_memory - */ - static char const *_init_ptr(Allocator &alloc, Xml_node node) - { - char *ptr = (char *)alloc.alloc(node.size()); - Genode::memcpy(ptr, node.addr(), node.size()); - return ptr; - } - - /** - * Constructor - * - * \throw Allocator::Out_of_memory - */ - Buffered_xml(Allocator &alloc, Xml_node node) - : - _alloc(alloc), _ptr(_init_ptr(alloc, node)), _xml(_ptr, node.size()) - { } - - ~Buffered_xml() { _alloc.free(const_cast(_ptr), _xml.size()); } - - Xml_node xml() const { return _xml; } - }; - Genode::Allocator &_alloc; - Reconstructible _buffered_config; + Reconstructible _buffered_config; /** * Maximum number of configured window controls diff --git a/repos/gems/src/app/launcher/panel_dialog.h b/repos/gems/src/app/launcher/panel_dialog.h index 75cf9a1026..8ab3195bfb 100644 --- a/repos/gems/src/app/launcher/panel_dialog.h +++ b/repos/gems/src/app/launcher/panel_dialog.h @@ -16,6 +16,7 @@ /* Genode includes */ #include +#include /* local includes */ #include @@ -50,37 +51,6 @@ class Launcher::Panel_dialog : Input_event_handler, Dialog_generator, Genode::Allocator &_alloc; - struct Buffered_xml - { - Allocator &_alloc; - char const * const _ptr; /* pointer to dynamically allocated buffer */ - Xml_node const _xml; /* referring to buffer of '_ptr' */ - - /** - * \throw Allocator::Out_of_memory - */ - static char const *_init_ptr(Allocator &alloc, Xml_node node) - { - char *ptr = (char *)alloc.alloc(node.size()); - Genode::memcpy(ptr, node.addr(), node.size()); - return ptr; - } - - /** - * Constructor - * - * \throw Allocator::Out_of_memory - */ - Buffered_xml(Allocator &alloc, Xml_node node) - : - _alloc(alloc), _ptr(_init_ptr(alloc, node)), _xml(_ptr, node.size()) - { } - - ~Buffered_xml() { _alloc.free(const_cast(_ptr), _xml.size()); } - - Xml_node xml() const { return _xml; } - }; - Constructible _config; List _elements; diff --git a/repos/os/src/init/buffered_xml.h b/repos/os/include/os/buffered_xml.h similarity index 87% rename from repos/os/src/init/buffered_xml.h rename to repos/os/include/os/buffered_xml.h index 0b8d0e9c21..3b65be00ed 100644 --- a/repos/os/src/init/buffered_xml.h +++ b/repos/os/include/os/buffered_xml.h @@ -11,16 +11,16 @@ * under the terms of the GNU Affero General Public License version 3. */ -#ifndef _SRC__INIT__BUFFERED_XML_H_ -#define _SRC__INIT__BUFFERED_XML_H_ +#ifndef _OS__BUFFERED_XML_H_ +#define _OS__BUFFERED_XML_H_ /* Genode includes */ #include -namespace Init { class Buffered_xml; } +namespace Genode { class Buffered_xml; } -class Init::Buffered_xml +class Genode::Buffered_xml { private: @@ -61,4 +61,4 @@ class Init::Buffered_xml Xml_node xml() const { return _xml; } }; -#endif /* _SRC__INIT__BUFFERED_XML_H_ */ +#endif /* _OS__BUFFERED_XML_H_ */ diff --git a/repos/os/src/init/child.h b/repos/os/src/init/child.h index 91fc5454c5..888d8b49f9 100644 --- a/repos/os/src/init/child.h +++ b/repos/os/src/init/child.h @@ -19,12 +19,12 @@ #include #include #include +#include /* local includes */ #include #include #include -#include #include #include #include diff --git a/repos/os/src/init/server.h b/repos/os/src/init/server.h index a90a407961..26f8a032fb 100644 --- a/repos/os/src/init/server.h +++ b/repos/os/src/init/server.h @@ -16,11 +16,11 @@ /* Genode includes */ #include +#include /* local includes */ #include "types.h" #include "service.h" -#include "buffered_xml.h" #include "state_reporter.h" namespace Init { class Server; }