gems: coding style (avoid superfluous '()' pairs)

This commit is contained in:
Norman Feske 2024-03-26 16:53:52 +01:00 committed by Christian Helmuth
parent 6cabc85ac8
commit 4dc1014bfb
40 changed files with 392 additions and 392 deletions

View File

@ -134,7 +134,7 @@ class Depot_deploy::Child : public List_model<Child>::Element
Service::Name const &service_name)
{
if (service.type() == node_type)
xml.node("service", [&] () {
xml.node("service", [&] {
xml.attribute("name", service_name); });
}
@ -329,7 +329,7 @@ class Depot_deploy::Child : public List_model<Child>::Element
void gen_query(Xml_generator &xml) const
{
if (blueprint_needed())
xml.node("blueprint", [&] () {
xml.node("blueprint", [&] {
xml.attribute("pkg", _blueprint_pkg_path); });
}
@ -368,7 +368,7 @@ class Depot_deploy::Child : public List_model<Child>::Element
void gen_installation_entry(Xml_generator &xml) const
{
with_missing_pkg_path([&] (Archive::Path const &path) {
xml.node("archive", [&] () {
xml.node("archive", [&] {
xml.attribute("path", path);
xml.attribute("source", "no"); }); });
}
@ -416,7 +416,7 @@ void Depot_deploy::Child::gen_start_node(Xml_generator &xml,
Xml_node const start_xml = _start_xml->xml();
xml.node("start", [&] () {
xml.node("start", [&] {
xml.attribute("name", _name);
@ -473,14 +473,14 @@ void Depot_deploy::Child::gen_start_node(Xml_generator &xml,
Binary_name const binary = shim_reroute ? Binary_name("shim")
: _binary_name;
xml.node("binary", [&] () { xml.attribute("name", binary); });
xml.node("binary", [&] { xml.attribute("name", binary); });
Number_of_bytes ram = _pkg_ram_quota;
if (_defined_by_launcher())
ram = launcher_xml.attribute_value("ram", ram);
ram = start_xml.attribute_value("ram", ram);
xml.node("resource", [&] () {
xml.node("resource", [&] {
xml.attribute("name", "RAM");
xml.attribute("quantum", String<32>(ram));
});
@ -490,7 +490,7 @@ void Depot_deploy::Child::gen_start_node(Xml_generator &xml,
cpu_quota = launcher_xml.attribute_value("cpu", cpu_quota);
cpu_quota = start_xml.attribute_value("cpu", cpu_quota);
xml.node("resource", [&] () {
xml.node("resource", [&] {
xml.attribute("name", "CPU");
xml.attribute("quantum", cpu_quota);
});
@ -513,7 +513,7 @@ void Depot_deploy::Child::gen_start_node(Xml_generator &xml,
start_xml.with_optional_sub_node("affinity", [&] (Xml_node node) {
location = Affinity::Location::from_xml(affinity_space, node); });
xml.node("affinity", [&] () {
xml.node("affinity", [&] {
xml.attribute("xpos", location.xpos());
xml.attribute("ypos", location.ypos());
xml.attribute("width", location.width());
@ -552,7 +552,7 @@ void Depot_deploy::Child::gen_start_node(Xml_generator &xml,
* Declare services provided by the subsystem.
*/
if (runtime.has_sub_node("provides")) {
xml.node("provides", [&] () {
xml.node("provides", [&] {
runtime.sub_node("provides").for_each_sub_node([&] (Xml_node service) {
_gen_provides_sub_node(xml, service, "audio_in", "Audio_in");
_gen_provides_sub_node(xml, service, "audio_out", "Audio_out");
@ -579,14 +579,14 @@ void Depot_deploy::Child::gen_start_node(Xml_generator &xml,
});
}
xml.node("route", [&] () {
xml.node("route", [&] {
if (start_xml.has_sub_node("monitor")) {
xml.node("service", [&] () {
xml.node("service", [&] {
xml.attribute("name", "PD");
xml.node("local");
});
xml.node("service", [&] () {
xml.node("service", [&] {
xml.attribute("name", "CPU");
xml.node("local");
});
@ -614,7 +614,7 @@ void Depot_deploy::Child::gen_monitor_policy_node(Xml_generator &xml) const
if (start_xml.has_sub_node("monitor")) {
Xml_node const monitor = start_xml.sub_node("monitor");
xml.node("policy", [&] () {
xml.node("policy", [&] {
xml.attribute("label", _name);
xml.attribute("wait", monitor.attribute_value("wait", false));
xml.attribute("wx", monitor.attribute_value("wx", false));
@ -647,10 +647,10 @@ void Depot_deploy::Child::_gen_routes(Xml_generator &xml, Xml_node common,
if (service_name == "PD" || service_name == "CPU") {
route_binary_to_shim = true;
xml.node("service", [&] () {
xml.node("service", [&] {
xml.attribute("name", service_name);
xml.attribute("unscoped_label", _name);
xml.node("parent", [&] () { });
xml.node("parent", [&] { });
});
}
@ -665,10 +665,10 @@ void Depot_deploy::Child::_gen_routes(Xml_generator &xml, Xml_node common,
* If the subsystem is hosted under a shim, make the shim binary available
*/
if (route_binary_to_shim)
xml.node("service", [&] () {
xml.node("service", [&] {
xml.attribute("name", "ROM");
xml.attribute("unscoped_label", "shim");
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", "shim"); }); });
/*
@ -708,18 +708,18 @@ void Depot_deploy::Child::_gen_routes(Xml_generator &xml, Xml_node common,
return;
/* we found the <rom> node for the config ROM */
xml.node("service", [&] () {
xml.node("service", [&] {
xml.attribute("name", "ROM");
xml.attribute("label", "config");
typedef String<160> Path;
Path const path = rom.attribute_value("path", Path());
if (cached_depot_rom.valid())
xml.node("child", [&] () {
xml.node("child", [&] {
xml.attribute("name", rom_server(path));
xml.attribute("label", path); });
else
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", path); });
});
});
@ -745,7 +745,7 @@ void Depot_deploy::Child::_gen_routes(Xml_generator &xml, Xml_node common,
Label const label = rom.attribute_value("label", Label());
Label const as = rom.attribute_value("as", label);
xml.node("service", [&] () {
xml.node("service", [&] {
xml.attribute("name", "ROM");
if (route_binary_to_shim && label == _binary_name)
@ -754,12 +754,12 @@ void Depot_deploy::Child::_gen_routes(Xml_generator &xml, Xml_node common,
xml.attribute("label_last", as);
if (cached_depot_rom.valid()) {
xml.node("child", [&] () {
xml.node("child", [&] {
xml.attribute("name", rom_server(path));
xml.attribute("label", path);
});
} else {
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", path); });
}
});

View File

@ -142,7 +142,7 @@ struct Depot_deploy::Main
static_config.with_raw_content([&] (char const *start, size_t length) {
xml.append(start, length); });
},
[&] () { warning("config lacks <static> node"); });
[&] { warning("config lacks <static> node"); });
config.with_optional_sub_node("report", [&] (Xml_node const &report) {
@ -152,7 +152,7 @@ struct Depot_deploy::Main
xml.attribute(name, report.attribute_value(name, false));
};
auto copy_buffer_size_attribute = [&] ()
auto copy_buffer_size_attribute = [&]
{
auto const name = "buffer";
if (report.has_attribute(name))
@ -160,7 +160,7 @@ struct Depot_deploy::Main
};
size_t const delay_ms = report.attribute_value("delay_ms", 1000UL);
xml.node("report", [&] () {
xml.node("report", [&] {
xml.attribute("delay_ms", delay_ms);
/* attributes according to repos/os/src/lib/sandbox/report.h */
@ -180,7 +180,7 @@ struct Depot_deploy::Main
config.with_optional_sub_node("heartbeat", [&] (Xml_node const &heartbeat) {
size_t const rate_ms = heartbeat.attribute_value("rate_ms", 2000UL);
xml.node("heartbeat", [&] () {
xml.node("heartbeat", [&] {
xml.attribute("rate_ms", rate_ms);
});
});
@ -192,7 +192,7 @@ struct Depot_deploy::Main
_prio_levels, Affinity::Space(1, 1),
parent, parent);
},
[&] () { warning("config lacks <common_routes> node"); });
[&] { warning("config lacks <common_routes> node"); });
}
Main(Env &env) : _env(env)

View File

@ -485,25 +485,25 @@ struct Sculpt::Main : Input_event_handler,
xml.attribute("version", _query_version.value);
if (_software_tab_watches_depot() || _scan_rom.xml().has_type("empty"))
xml.node("scan", [&] () {
xml.node("scan", [&] {
xml.attribute("users", "yes"); });
if (_software_tab_watches_depot() || _image_index_rom.xml().has_type("empty"))
xml.node("index", [&] () {
xml.node("index", [&] {
xml.attribute("user", _index_user);
xml.attribute("version", _sculpt_version);
xml.attribute("content", "yes");
});
if (_software_tab_watches_depot() || _image_index_rom.xml().has_type("empty"))
xml.node("image_index", [&] () {
xml.node("image_index", [&] {
xml.attribute("os", "sculpt");
xml.attribute("board", _build_info.board);
xml.attribute("user", _image_index_user);
});
_runtime_state.with_construction([&] (Component const &component) {
xml.node("blueprint", [&] () {
xml.node("blueprint", [&] {
xml.attribute("pkg", component.path); }); });
/* update query for blueprints of all unconfigured start nodes */
@ -1596,13 +1596,13 @@ struct Sculpt::Main : Input_event_handler,
void generate(Xml_generator &xml) const
{
xml.node("earpiece", [&] () {
xml.node("earpiece", [&] {
xml.attribute("volume", earpiece ? 100 : 0);
});
xml.node("speaker", [&] () {
xml.node("speaker", [&] {
xml.attribute("volume", speaker ? audio_volume.value : 0);
});
xml.node("mic", [&] () {
xml.node("mic", [&] {
xml.attribute("volume", mic ? 80 : 0);
});
xml.node("codec", [&]() {
@ -2134,7 +2134,7 @@ void Sculpt::Main::_handle_window_layout()
auto gen_window = [&] (Xml_node win, Rect rect) {
if (rect.valid()) {
xml.node("window", [&] () {
xml.node("window", [&] {
xml.attribute("id", win.attribute_value("id", 0UL));
xml.attribute("xpos", rect.x1());
xml.attribute("ypos", rect.y1());
@ -2410,7 +2410,7 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
xml.attribute("prio_levels", _prio_levels.value);
xml.node("report", [&] () {
xml.node("report", [&] {
xml.attribute("init_ram", "yes");
xml.attribute("init_caps", "yes");
xml.attribute("child_ram", "yes");
@ -2419,9 +2419,9 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
xml.attribute("buffer", "1M");
});
xml.node("heartbeat", [&] () { xml.attribute("rate_ms", 2000); });
xml.node("heartbeat", [&] { xml.attribute("rate_ms", 2000); });
xml.node("parent-provides", [&] () {
xml.node("parent-provides", [&] {
gen_parent_service<Rom_session>(xml);
gen_parent_service<Cpu_session>(xml);
gen_parent_service<Pd_session>(xml);
@ -2447,7 +2447,7 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
gen_parent_service<Pin_control::Session>(xml);
});
xml.node("affinity-space", [&] () {
xml.node("affinity-space", [&] {
xml.attribute("width", _affinity_space.width());
xml.attribute("height", _affinity_space.height());
});
@ -2461,7 +2461,7 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
* Load configuration and update depot config on the sculpt partition
*/
if (_storage._sculpt_partition.valid() && _prepare_in_progress())
xml.node("start", [&] () {
xml.node("start", [&] {
gen_prepare_start_content(xml, _prepare_version); });
/*
@ -2471,7 +2471,7 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
if (_storage._sculpt_partition.valid()) {
auto chroot = [&] (Start_name const &name, Path const &path, Writeable w) {
xml.node("start", [&] () {
xml.node("start", [&] {
gen_chroot_start_content(xml, name, path, w); }); };
if (_update_running()) {
@ -2485,18 +2485,18 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
/* execute file operations */
if (_storage._sculpt_partition.valid())
if (_file_operation_queue.any_operation_in_progress())
xml.node("start", [&] () {
xml.node("start", [&] {
gen_fs_tool_start_content(xml, _fs_tool_version,
_file_operation_queue); });
_network.gen_runtime_start_nodes(xml);
if (_update_running())
xml.node("start", [&] () {
xml.node("start", [&] {
gen_update_start_content(xml); });
if (_storage._sculpt_partition.valid() && !_prepare_in_progress()) {
xml.node("start", [&] () {
xml.node("start", [&] {
gen_launcher_query_start_content(xml); });
_deploy.gen_runtime_start_nodes(xml, _prio_levels, _affinity_space);

View File

@ -33,15 +33,15 @@ namespace Sculpt {
void Sculpt::gen_touch_keyboard(Xml_generator &xml, Touch_keyboard_attr const attr)
{
xml.node("start", [&] () {
xml.node("start", [&] {
gen_common_start_content(xml, "manager_keyboard",
Cap_quota{700}, Ram_quota{18*1024*1024},
Priority::LEITZENTRALE);
gen_named_node(xml, "binary", "touch_keyboard", [&] () { });
gen_named_node(xml, "binary", "touch_keyboard", [&] { });
xml.node("config", [&] () {
xml.node("config", [&] {
xml.attribute("min_width", attr.min_width);
xml.attribute("min_height", attr.min_height);
@ -51,7 +51,7 @@ void Sculpt::gen_touch_keyboard(Xml_generator &xml, Touch_keyboard_attr const at
xml.attribute("background", String<20>(attr.background));
});
xml.node("route", [&] () {
xml.node("route", [&] {
gen_parent_rom_route(xml, "ld.lib.so");
gen_parent_rom_route(xml, "touch_keyboard");
gen_parent_rom_route(xml, "layout", "touch_keyboard_layout.config");
@ -70,17 +70,17 @@ void Sculpt::gen_touch_keyboard(Xml_generator &xml, Touch_keyboard_attr const at
gen_parent_route<Log_session> (xml);
gen_parent_route<Timer::Session> (xml);
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", "fonts");
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", "leitzentrale -> fonts"); }); });
gen_service_node<Gui::Session>(xml, [&] () {
xml.node("parent", [&] () {
gen_service_node<Gui::Session>(xml, [&] {
xml.node("parent", [&] {
xml.attribute("label", "leitzentrale -> touch_keyboard"); }); });
gen_service_node<Event::Session>(xml, [&] () {
xml.node("parent", [&] () {
gen_service_node<Event::Session>(xml, [&] {
xml.node("parent", [&] {
xml.attribute("label", "global"); }); });
});
});

View File

@ -172,16 +172,16 @@ void Sculpt::Deploy::gen_runtime_start_nodes(Xml_generator &xml,
Affinity::Space affinity_space) const
{
/* depot-ROM instance for regular (immutable) depot content */
xml.node("start", [&] () {
xml.node("start", [&] {
gen_fs_rom_start_content(xml, "cached_fs_rom", "depot",
cached_depot_rom_state); });
/* depot-ROM instance for mutable content (/depot/local/) */
xml.node("start", [&] () {
xml.node("start", [&] {
gen_fs_rom_start_content(xml, "fs_rom", "depot",
uncached_depot_rom_state); });
xml.node("start", [&] () {
xml.node("start", [&] {
gen_depot_query_start_content(xml); });
Xml_node const managed_deploy = _managed_deploy_rom.xml();
@ -198,7 +198,7 @@ void Sculpt::Deploy::gen_runtime_start_nodes(Xml_generator &xml,
_children.gen_start_nodes(xml, managed_deploy.sub_node("common_routes"),
prio_levels, affinity_space,
"depot_rom", "dynamic_depot_rom");
xml.node("monitor", [&] () {
xml.node("monitor", [&] {
_children.gen_monitor_policy_nodes(xml);});
}
}

View File

@ -137,7 +137,7 @@ struct Sculpt::Deploy
if (_runtime_info.abandoned_by_user(name))
return;
xml.node("start", [&] () {
xml.node("start", [&] {
/*
* Copy attributes

View File

@ -45,8 +45,8 @@ struct Sculpt::Fb_driver : private Noncopyable
start_node(_intel_gpu, "intel_gpu_drv", [&] {
xml.node("provides", [&] {
gen_service_node<Gpu::Session> (xml, [&] () { });
gen_service_node<Platform::Session>(xml, [&] () { });
gen_service_node<Gpu::Session> (xml, [&] { });
gen_service_node<Platform::Session>(xml, [&] { });
});
xml.node("route", [&] {
gen_parent_route<Platform::Session>(xml);
@ -71,7 +71,7 @@ struct Sculpt::Fb_driver : private Noncopyable
});
start_node(_vesa_fb, "vesa_fb_drv", [&] {
xml.node("route", [&] () {
xml.node("route", [&] {
gen_parent_route<Platform::Session>(xml);
gen_capture_route(xml);
gen_parent_rom_route(xml, "vesa_fb_drv");
@ -83,7 +83,7 @@ struct Sculpt::Fb_driver : private Noncopyable
});
start_node(_boot_fb, "boot_fb_drv", [&] {
xml.node("route", [&] () {
xml.node("route", [&] {
gen_parent_rom_route(xml, "config", "config -> fb_drv");
gen_parent_rom_route(xml, "boot_fb_drv");
gen_parent_route<Io_mem_session>(xml);

View File

@ -152,7 +152,7 @@ struct Sculpt::Usb_driver : private Noncopyable
gen_parent_rom_route(xml, "usb_net_drv");
gen_common_routes(xml);
gen_service_node<Uplink::Session>(xml, [&] {
xml.node("child", [&] () {
xml.node("child", [&] {
xml.attribute("name", "nic_router");
xml.attribute("label", "usb_net -> ");
});

View File

@ -256,7 +256,7 @@ void Graph::view(Scope<Depgraph> &s) const
_runtime_config.with_graph_id(dep_name, [&] (Dialog::Id const &id) {
dep_id = id; });
s.node("dep", [&] () {
s.node("dep", [&] {
s.attribute("node", component.graph_id.value);
s.attribute("on", dep_id.value);
});

View File

@ -440,15 +440,15 @@ struct Sculpt::Main : Input_event_handler,
xml.attribute("version", _query_version.value);
if (_popup_dialog.depot_query_needs_users())
xml.node("scan", [&] () {
xml.node("scan", [&] {
xml.attribute("users", "yes"); });
if (_system_dialog_watches_depot() || _scan_rom.xml().has_type("empty"))
xml.node("scan", [&] () {
xml.node("scan", [&] {
xml.attribute("users", "yes"); });
if (_system_dialog_watches_depot() || _image_index_rom.xml().has_type("empty"))
xml.node("image_index", [&] () {
xml.node("image_index", [&] {
xml.attribute("os", "sculpt");
xml.attribute("board", _build_info.board);
xml.attribute("user", _image_index_user);
@ -1578,7 +1578,7 @@ void Sculpt::Main::_handle_window_layout()
auto gen_window = [&] (Xml_node win, Rect rect) {
if (rect.valid()) {
xml.node("window", [&] () {
xml.node("window", [&] {
xml.attribute("id", win.attribute_value("id", 0UL));
xml.attribute("xpos", rect.x1());
xml.attribute("ypos", rect.y1());
@ -1721,11 +1721,11 @@ void Sculpt::Main::_handle_window_layout()
Label const label = win.attribute_value("label", Label());
if (label == inspect_label && _selected_tab == Panel_dialog::Tab::INSPECT)
xml.node("window", [&] () {
xml.node("window", [&] {
xml.attribute("id", win.attribute_value("id", 0UL)); });
if (label == editor_view_label && _selected_tab == Panel_dialog::Tab::FILES)
xml.node("window", [&] () {
xml.node("window", [&] {
xml.attribute("id", win.attribute_value("id", 0UL)); });
});
});
@ -1759,16 +1759,16 @@ void Sculpt::Main::_handle_gui_mode()
_fonts_config.generate([&] (Xml_generator &xml) {
xml.attribute("copy", true);
xml.attribute("paste", true);
xml.node("vfs", [&] () {
xml.node("vfs", [&] {
gen_named_node(xml, "rom", "Vera.ttf");
gen_named_node(xml, "rom", "VeraMono.ttf");
gen_named_node(xml, "dir", "fonts", [&] () {
gen_named_node(xml, "dir", "fonts", [&] {
auto gen_ttf_dir = [&] (char const *dir_name,
char const *ttf_path, double size_px) {
gen_named_node(xml, "dir", dir_name, [&] () {
gen_named_node(xml, "ttf", "regular", [&] () {
gen_named_node(xml, "dir", dir_name, [&] {
gen_named_node(xml, "ttf", "regular", [&] {
xml.attribute("path", ttf_path);
xml.attribute("size_px", size_px);
xml.attribute("cache", "256K");
@ -1782,11 +1782,11 @@ void Sculpt::Main::_handle_gui_mode()
gen_ttf_dir("monospace", "/VeraMono.ttf", _font_size_px);
});
});
xml.node("default-policy", [&] () { xml.attribute("root", "/fonts"); });
xml.node("default-policy", [&] { xml.attribute("root", "/fonts"); });
auto gen_color = [&] (unsigned index, Color color) {
xml.node("palette", [&] () {
xml.node("color", [&] () {
xml.node("palette", [&] {
xml.node("color", [&] {
xml.attribute("index", index);
xml.attribute("value", String<16>(color));
});
@ -2050,7 +2050,7 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
xml.attribute("prio_levels", _prio_levels.value);
xml.node("report", [&] () {
xml.node("report", [&] {
xml.attribute("init_ram", "yes");
xml.attribute("init_caps", "yes");
xml.attribute("child_ram", "yes");
@ -2059,9 +2059,9 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
xml.attribute("buffer", "1M");
});
xml.node("heartbeat", [&] () { xml.attribute("rate_ms", 2000); });
xml.node("heartbeat", [&] { xml.attribute("rate_ms", 2000); });
xml.node("parent-provides", [&] () {
xml.node("parent-provides", [&] {
gen_parent_service<Rom_session>(xml);
gen_parent_service<Cpu_session>(xml);
gen_parent_service<Pd_session>(xml);
@ -2088,7 +2088,7 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
gen_parent_service<Terminal::Session>(xml);
});
xml.node("affinity-space", [&] () {
xml.node("affinity-space", [&] {
xml.attribute("width", _affinity_space.width());
xml.attribute("height", _affinity_space.height());
});
@ -2102,7 +2102,7 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
* Load configuration and update depot config on the sculpt partition
*/
if (_storage._sculpt_partition.valid() && _prepare_in_progress())
xml.node("start", [&] () {
xml.node("start", [&] {
gen_prepare_start_content(xml, _prepare_version); });
if (_storage.any_file_system_inspected())
@ -2116,7 +2116,7 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
if (_storage._sculpt_partition.valid()) {
auto chroot = [&] (Start_name const &name, Path const &path, Writeable w) {
xml.node("start", [&] () {
xml.node("start", [&] {
gen_chroot_start_content(xml, name, path, w); }); };
if (_update_running()) {
@ -2130,18 +2130,18 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
/* execute file operations */
if (_storage._sculpt_partition.valid())
if (_file_operation_queue.any_operation_in_progress())
xml.node("start", [&] () {
xml.node("start", [&] {
gen_fs_tool_start_content(xml, _fs_tool_version,
_file_operation_queue); });
_network.gen_runtime_start_nodes(xml);
if (_update_running())
xml.node("start", [&] () {
xml.node("start", [&] {
gen_update_start_content(xml); });
if (_storage._sculpt_partition.valid() && !_prepare_in_progress()) {
xml.node("start", [&] () {
xml.node("start", [&] {
gen_launcher_query_start_content(xml); });
_deploy.gen_runtime_start_nodes(xml, _prio_levels, _affinity_space);
@ -2152,15 +2152,15 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const
void Sculpt::Main::_generate_event_filter_config(Xml_generator &xml)
{
auto gen_include = [&] (auto rom) {
xml.node("include", [&] () {
xml.node("include", [&] {
xml.attribute("rom", rom); }); };
xml.node("output", [&] () {
xml.node("chargen", [&] () {
xml.node("remap", [&] () {
xml.node("output", [&] {
xml.node("chargen", [&] {
xml.node("remap", [&] {
auto gen_key = [&] (auto from, auto to) {
xml.node("key", [&] () {
xml.node("key", [&] {
xml.attribute("name", from);
xml.attribute("to", to); }); };
@ -2169,31 +2169,31 @@ void Sculpt::Main::_generate_event_filter_config(Xml_generator &xml)
gen_key("KEY_LEFTMETA", "KEY_SCREEN");
gen_include("numlock.remap");
xml.node("merge", [&] () {
xml.node("merge", [&] {
auto gen_input = [&] (auto name) {
xml.node("input", [&] () {
xml.node("input", [&] {
xml.attribute("name", name); }); };
xml.node("accelerate", [&] () {
xml.node("accelerate", [&] {
xml.attribute("max", 50);
xml.attribute("sensitivity_percent", 1000);
xml.attribute("curve", 127);
xml.node("button-scroll", [&] () {
xml.node("button-scroll", [&] {
gen_input("ps2");
xml.node("vertical", [&] () {
xml.node("vertical", [&] {
xml.attribute("button", "BTN_MIDDLE");
xml.attribute("speed_percent", -10); });
xml.node("horizontal", [&] () {
xml.node("horizontal", [&] {
xml.attribute("button", "BTN_MIDDLE");
xml.attribute("speed_percent", -10); });
});
});
xml.node("touch-click", [&] () {
xml.node("touch-click", [&] {
gen_input("touch"); });
gen_input("usb");
@ -2203,24 +2203,24 @@ void Sculpt::Main::_generate_event_filter_config(Xml_generator &xml)
});
auto gen_key = [&] (auto key) {
gen_named_node(xml, "key", key, [&] () {}); };
gen_named_node(xml, "key", key, [&] {}); };
xml.node("mod1", [&] () {
xml.node("mod1", [&] {
gen_key("KEY_LEFTSHIFT");
gen_key("KEY_RIGHTSHIFT"); });
xml.node("mod2", [&] () {
xml.node("mod2", [&] {
gen_key("KEY_LEFTCTRL");
gen_key("KEY_RIGHTCTRL"); });
xml.node("mod3", [&] () {
xml.node("mod3", [&] {
gen_key("KEY_RIGHTALT"); /* AltGr */ });
xml.node("mod4", [&] () {
xml.node("rom", [&] () {
xml.node("mod4", [&] {
xml.node("rom", [&] {
xml.attribute("name", "capslock"); }); });
xml.node("repeat", [&] () {
xml.node("repeat", [&] {
xml.attribute("delay_ms", 230);
xml.attribute("rate_ms", 40); });

View File

@ -83,7 +83,7 @@ struct Sculpt::Child_state : Noncopyable
xml.attribute("caps", _cap_quota.value);
xml.attribute("priority", (int)_priority);
gen_named_node(xml, "resource", "RAM", [&] () {
gen_named_node(xml, "resource", "RAM", [&] {
Number_of_bytes const bytes(_ram_quota.value);
xml.attribute("quantum", String<64>(bytes)); });
}

View File

@ -191,7 +191,7 @@ struct Sculpt::Component : Noncopyable
if (all_cpus)
return;
xml.node("affinity", [&] () {
xml.node("affinity", [&] {
xml.attribute("xpos", affinity_location.xpos());
xml.attribute("ypos", affinity_location.ypos());
xml.attribute("width", affinity_location.width());
@ -202,7 +202,7 @@ struct Sculpt::Component : Noncopyable
void gen_monitor(Xml_generator &xml) const
{
if (monitor)
xml.node("monitor", [&] () {
xml.node("monitor", [&] {
xml.attribute("wait", wait ? "yes" : "no");
xml.attribute("wx", wx ? "yes" : "no");
});
@ -218,9 +218,9 @@ struct Sculpt::Component : Noncopyable
* Until PD & CPU gets merged, enforce on Sculpt that PD and CPU routes
* go to the same server.
*/
gen_named_node(xml, "service", Sculpt::Service::name_attr(pd_route.required), [&] () {
gen_named_node(xml, "service", Sculpt::Service::name_attr(pd_route.required), [&] {
pd_route.selected_service->gen_xml(xml); });
gen_named_node(xml, "service", "CPU", [&] () {
gen_named_node(xml, "service", "CPU", [&] {
pd_route.selected_service->gen_xml(xml); });
}

View File

@ -48,7 +48,7 @@ struct Sculpt::Download_queue : Noncopyable
xml.attribute("verify", "no"); };
auto gen_install_node = [&] (auto type) {
xml.node(type, [&] () {
xml.node(type, [&] {
xml.attribute("path", path);
gen_verify_attr(); }); };
@ -59,7 +59,7 @@ struct Sculpt::Download_queue : Noncopyable
else if (Depot::Archive::image(path))
gen_install_node("image");
else
xml.node("archive", [&] () {
xml.node("archive", [&] {
xml.attribute("path", path);
xml.attribute("source", "no");
gen_verify_attr(); });

View File

@ -79,21 +79,21 @@ struct Sculpt::File_browser_state : Noncopyable
if (!fs_query.constructed() || !any_browsed_fs())
return;
xml.node("start", [&] () {
xml.node("start", [&] {
fs_query->gen_start_node_content(xml);
gen_named_node(xml, "binary", "fs_query");
xml.node("config", [&] () {
xml.node("vfs", [&] () {
xml.node("fs", [&] () {}); });
xml.node("config", [&] {
xml.node("vfs", [&] {
xml.node("fs", [&] {}); });
xml.node("query", [&] () {
xml.node("query", [&] {
xml.attribute("path", path);
});
});
xml.node("route", [&] () {
xml.node("route", [&] {
gen_parent_rom_route(xml, "fs_query");
gen_parent_rom_route(xml, "ld.lib.so");
gen_parent_rom_route(xml, "vfs.lib.so");
@ -103,18 +103,18 @@ struct Sculpt::File_browser_state : Noncopyable
gen_parent_route<Log_session> (xml);
gen_parent_route<Report::Session> (xml);
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
if (browsed_fs == "config") {
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", "config"); });
}
else if (browsed_fs == "report") {
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", "report"); });
}
else {
xml.node("child", [&] () {
xml.node("child", [&] {
xml.attribute("name", browsed_fs); });
}
});
@ -124,18 +124,18 @@ struct Sculpt::File_browser_state : Noncopyable
if (edited_file.length() <= 1 || !text_area.constructed())
return;
xml.node("start", [&] () {
xml.node("start", [&] {
xml.attribute("name", text_area->name());
text_area->gen_start_node_version(xml);
xml.attribute("caps", 350);
gen_named_node(xml, "resource", "RAM", [&] () {
gen_named_node(xml, "resource", "RAM", [&] {
xml.attribute("quantum", String<64>(22*1024*1024UL)); });
gen_named_node(xml, "binary", "text_area");
xml.node("config", [&] () {
xml.node("config", [&] {
Path const file_path = (path == "/")
? Path("/", edited_file)
: Path(path, "/", edited_file);
@ -150,18 +150,18 @@ struct Sculpt::File_browser_state : Noncopyable
xml.attribute("watch", "yes");
if (edit) {
xml.node("save", [&] () {
xml.node("save", [&] {
xml.attribute("version", save_version); });
xml.node("report", [&] () {
xml.node("report", [&] {
xml.attribute("saved", "yes"); });
}
xml.node("vfs", [&] () {
xml.node("fs", [&] () {}); });
xml.node("vfs", [&] {
xml.node("fs", [&] {}); });
});
xml.node("route", [&] () {
xml.node("route", [&] {
gen_parent_rom_route(xml, "text_area");
gen_parent_rom_route(xml, "ld.lib.so");
gen_parent_rom_route(xml, "vfs.lib.so");
@ -179,31 +179,31 @@ struct Sculpt::File_browser_state : Noncopyable
gen_parent_route<Report::Session> (xml);
gen_parent_route<Timer::Session> (xml);
gen_service_node<Rom_session>(xml, [&] () {
gen_service_node<Rom_session>(xml, [&] {
xml.attribute("label", "clipboard");
xml.node("parent", [&] () { }); });
xml.node("parent", [&] { }); });
gen_service_node<Gui::Session>(xml, [&] () {
xml.node("parent", [&] () {
gen_service_node<Gui::Session>(xml, [&] {
xml.node("parent", [&] {
xml.attribute("label", "leitzentrale -> editor"); }); });
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", "fonts");
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", "leitzentrale -> fonts"); }); });
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
if (browsed_fs == "config") {
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", "config"); });
}
else if (browsed_fs == "report") {
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", "report"); });
}
else {
xml.node("child", [&] () {
xml.node("child", [&] {
xml.attribute("name", browsed_fs); });
}
});

View File

@ -136,7 +136,7 @@ struct Sculpt::Route : List_model<Route>::Element
return;
}
gen_named_node(xml, "service", Service::name_attr(required), [&] () {
gen_named_node(xml, "service", Service::name_attr(required), [&] {
if (required_label.valid()) {

View File

@ -171,7 +171,7 @@ class Sculpt::Runtime_state : public Runtime_info
if (!launched)
return;
gen_named_node(xml, "start", name, [&] () {
gen_named_node(xml, "start", name, [&] {
Version const version = state.restarted_version(name);
@ -187,7 +187,7 @@ class Sculpt::Runtime_state : public Runtime_info
construction->gen_affinity(xml);
construction->gen_monitor(xml);
xml.node("route", [&] () {
xml.node("route", [&] {
construction->gen_pd_cpu_route(xml);
construction->routes.for_each([&] (Route const &route) {

View File

@ -99,7 +99,7 @@ struct Sculpt::Service
{
bool const parent = !server.valid();
xml.node(parent ? "parent" : "child", [&] () {
xml.node(parent ? "parent" : "child", [&] {
if (!parent)
xml.attribute("name", server);

View File

@ -238,13 +238,13 @@ void Sculpt::Storage_device::gen_part_block_start_content(Xml_generator &xml) co
gen_named_node(xml, "binary", "part_block");
xml.node("heartbeat", [&] () { });
xml.node("heartbeat", [&] { });
xml.node("config", [&] () {
xml.node("report", [&] () { xml.attribute("partitions", "yes"); });
xml.node("config", [&] {
xml.node("report", [&] { xml.attribute("partitions", "yes"); });
for (unsigned i = 1; i < 10; i++) {
xml.node("policy", [&] () {
xml.node("policy", [&] {
xml.attribute("label", i);
xml.attribute("partition", i);
xml.attribute("writeable", "yes");
@ -254,9 +254,9 @@ void Sculpt::Storage_device::gen_part_block_start_content(Xml_generator &xml) co
gen_provides<Block::Session>(xml);
xml.node("route", [&] () {
xml.node("route", [&] {
gen_service_node<Block::Session>(xml, [&] () {
gen_service_node<Block::Session>(xml, [&] {
if (provider == Provider::PARENT)
xml.node("parent", [&] {
xml.attribute("label", label); });
@ -271,9 +271,9 @@ void Sculpt::Storage_device::gen_part_block_start_content(Xml_generator &xml) co
gen_parent_route<Pd_session> (xml);
gen_parent_route<Log_session> (xml);
gen_service_node<Report::Session>(xml, [&] () {
gen_service_node<Report::Session>(xml, [&] {
xml.attribute("label", "partitions");
xml.node("parent", [&] () { }); });
xml.node("parent", [&] { }); });
});
}

View File

@ -66,24 +66,24 @@ struct Sculpt::Storage_target
bool const whole_device = !partition.valid();
xml.node("service", [&] () {
xml.node("service", [&] {
xml.attribute("name", Block::Session::service_name());
if (whole_device) {
if (usb || ahci || nvme || mmc)
xml.node("child", [&] () {
xml.node("child", [&] {
xml.attribute("name", device);
if (port.valid())
xml.attribute("label", port);
});
else
xml.node("parent", [&] () { xml.attribute("label", device); });
xml.node("parent", [&] { xml.attribute("label", device); });
}
/* access partition */
else {
xml.node("child", [&] () {
xml.node("child", [&] {
xml.attribute("name", Label(device_and_port(), ".part"));
xml.attribute("label", partition);
});

View File

@ -152,16 +152,16 @@ void Sculpt::Usb_storage_device::gen_usb_block_drv_start_content(Xml_generator &
gen_named_node(xml, "binary", "usb_block_drv");
xml.node("config", [&] () {
xml.node("config", [&] {
xml.attribute("report", "yes");
xml.attribute("writeable", "yes");
});
gen_provides<Block::Session>(xml);
xml.node("route", [&] () {
gen_service_node<Usb::Session>(xml, [&] () {
xml.node("child", [&] () {
xml.node("route", [&] {
gen_service_node<Usb::Session>(xml, [&] {
xml.node("child", [&] {
xml.attribute("name", "usb"); }); });
gen_parent_rom_route(xml, "usb_block_drv");
@ -171,8 +171,8 @@ void Sculpt::Usb_storage_device::gen_usb_block_drv_start_content(Xml_generator &
gen_parent_route<Log_session> (xml);
gen_parent_route<Timer::Session> (xml);
gen_service_node<Report::Session>(xml, [&] () {
xml.node("parent", [&] () { }); });
gen_service_node<Report::Session>(xml, [&] {
xml.node("parent", [&] { }); });
});
}

View File

@ -18,12 +18,12 @@
void Sculpt::Network::_generate_nic_router_uplink(Xml_generator &xml,
char const *label)
{
xml.node("policy", [&] () {
xml.node("policy", [&] {
xml.attribute("label_prefix", label);
xml.attribute("domain", "uplink");
});
gen_named_node(xml, "domain", "uplink", [&] () {
xml.node("nat", [&] () {
gen_named_node(xml, "domain", "uplink", [&] {
xml.node("nat", [&] {
xml.attribute("domain", "default");
xml.attribute("tcp-ports", "1000");
xml.attribute("udp-ports", "1000");
@ -81,14 +81,14 @@ void Sculpt::Network::_generate_nic_router_config()
_nic_router_config.generate([&] (Xml_generator &xml) {
xml.attribute("verbose_domain_state", "yes");
xml.node("report", [&] () {
xml.node("report", [&] {
xml.attribute("interval_sec", "5");
xml.attribute("bytes", "yes");
xml.attribute("config", "yes");
xml.attribute("config_triggers", "yes");
});
xml.node("default-policy", [&] () {
xml.node("default-policy", [&] {
xml.attribute("domain", "default"); });
bool uplink_exists = true;
@ -98,10 +98,10 @@ void Sculpt::Network::_generate_nic_router_config()
case Nic_target::MODEM: _generate_nic_router_uplink(xml, "usb_net -> "); break;
default: uplink_exists = false;
}
gen_named_node(xml, "domain", "default", [&] () {
gen_named_node(xml, "domain", "default", [&] {
xml.attribute("interface", "10.0.1.1/24");
xml.node("dhcp-server", [&] () {
xml.node("dhcp-server", [&] {
xml.attribute("ip_first", "10.0.1.2");
xml.attribute("ip_last", "10.0.1.200");
if (_nic_target.type() != Nic_target::DISCONNECTED) {
@ -109,17 +109,17 @@ void Sculpt::Network::_generate_nic_router_config()
});
if (uplink_exists) {
xml.node("tcp", [&] () {
xml.node("tcp", [&] {
xml.attribute("dst", "0.0.0.0/0");
xml.node("permit-any", [&] () {
xml.node("permit-any", [&] {
xml.attribute("domain", "uplink"); }); });
xml.node("udp", [&] () {
xml.node("udp", [&] {
xml.attribute("dst", "0.0.0.0/0");
xml.node("permit-any", [&] () {
xml.node("permit-any", [&] {
xml.attribute("domain", "uplink"); }); });
xml.node("icmp", [&] () {
xml.node("icmp", [&] {
xml.attribute("dst", "0.0.0.0/0");
xml.attribute("domain", "uplink"); });
}
@ -136,7 +136,7 @@ void Sculpt::Network::_generate_nic_router_config()
xml.attribute("label", name);
xml.attribute("domain", name); });
gen_named_node(xml, "domain", name, [&] () {
gen_named_node(xml, "domain", name, [&] {
xml.attribute("interface", interface);
xml.node("dhcp-server", [&] {
xml.attribute("ip_first", dhcp_addr);

View File

@ -22,8 +22,8 @@ void Sculpt::gen_chroot_start_content(Xml_generator &xml, Start_name const &name
gen_named_node(xml, "binary", "chroot");
xml.node("config", [&] () {
xml.node("default-policy", [&] () {
xml.node("config", [&] {
xml.node("default-policy", [&] {
xml.attribute("path", path);
if (writeable == WRITEABLE)
xml.attribute("writeable", "yes");
@ -32,9 +32,9 @@ void Sculpt::gen_chroot_start_content(Xml_generator &xml, Start_name const &name
gen_provides<::File_system::Session>(xml);
xml.node("route", [&] () {
xml.node("route", [&] {
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
gen_named_node(xml, "child", "default_fs_rw"); });
gen_parent_rom_route(xml, "chroot");

View File

@ -21,14 +21,14 @@ void Sculpt::gen_depot_query_start_content(Xml_generator &xml)
gen_named_node(xml, "binary", "depot_query");
xml.node("config", [&] () {
xml.node("config", [&] {
xml.attribute("query", "rom");
xml.node("vfs", [&] () {
gen_named_node(xml, "dir", "depot", [&] () {
xml.node("fs", [&] () {}); }); }); });
xml.node("vfs", [&] {
gen_named_node(xml, "dir", "depot", [&] {
xml.node("fs", [&] {}); }); }); });
xml.node("route", [&] () {
gen_service_node<::File_system::Session>(xml, [&] () {
xml.node("route", [&] {
gen_service_node<::File_system::Session>(xml, [&] {
gen_named_node(xml, "child", "depot"); });
gen_parent_rom_route(xml, "depot_query");

View File

@ -22,7 +22,7 @@ namespace Sculpt {
template <typename ARG>
void gen_arg(Xml_generator &xml, ARG const &arg)
{
xml.node("arg", [&] () { xml.attribute("value", arg); });
xml.node("arg", [&] { xml.attribute("value", arg); });
}
}
@ -39,30 +39,30 @@ void Sculpt::gen_e2fs_start_content(Xml_generator &xml,
gen_named_node(xml, "binary", tool);
xml.node("config", [&] () {
xml.node("libc", [&] () {
xml.node("config", [&] {
xml.node("libc", [&] {
xml.attribute("stdout", "/dev/log");
xml.attribute("stderr", "/dev/log");
xml.attribute("stdin", "/dev/null");
xml.attribute("rtc", "/dev/rtc");
});
xml.node("vfs", [&] () {
gen_named_node(xml, "dir", "dev", [&] () {
gen_named_node(xml, "block", "block", [&] () {
xml.node("vfs", [&] {
gen_named_node(xml, "dir", "dev", [&] {
gen_named_node(xml, "block", "block", [&] {
xml.attribute("label", "default");
xml.attribute("block_buffer_count", 128);
});
gen_named_node(xml, "inline", "rtc", [&] () {
gen_named_node(xml, "inline", "rtc", [&] {
xml.append("2018-01-01 00:01");
});
xml.node("null", [&] () {});
xml.node("log", [&] () {});
xml.node("null", [&] {});
xml.node("log", [&] {});
});
});
gen_args_fn(xml);
});
xml.node("route", [&] () {
xml.node("route", [&] {
target.gen_block_session_route(xml);
gen_parent_route<Cpu_session> (xml);
gen_parent_route<Pd_session> (xml);

View File

@ -25,9 +25,9 @@ void Sculpt::gen_fs_start_content(Xml_generator &xml,
gen_provides<::File_system::Session>(xml);
xml.node("config", [&] () {
xml.node("vfs", [&] () {
xml.node("rump", [&] () {
xml.node("config", [&] {
xml.node("vfs", [&] {
xml.node("rump", [&] {
switch (fs_type) {
case File_system::EXT2: xml.attribute("fs", "ext2fs"); break;
case File_system::FAT32: xml.attribute("fs", "msdos"); break;
@ -41,13 +41,13 @@ void Sculpt::gen_fs_start_content(Xml_generator &xml,
xml.attribute("writeable", "yes");
});
});
xml.node("default-policy", [&] () {
xml.node("default-policy", [&] {
xml.attribute("root", "/");
xml.attribute("writeable", "yes");
});
});
xml.node("route", [&] () {
xml.node("route", [&] {
target.gen_block_session_route(xml);
gen_parent_rom_route(xml, "vfs");
gen_parent_rom_route(xml, "ld.lib.so");

View File

@ -22,13 +22,13 @@ void Sculpt::gen_fs_rom_start_content(Xml_generator &xml,
gen_named_node(xml, "binary", binary);
xml.node("config", [&] () { });
xml.node("config", [&] { });
gen_provides<Rom_session>(xml);
xml.node("route", [&] () {
xml.node("route", [&] {
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
gen_named_node(xml, "child", server); });
gen_parent_rom_route(xml, binary);

View File

@ -24,17 +24,17 @@ void Sculpt::gen_fs_tool_start_content(Xml_generator &xml, Fs_tool_version versi
gen_named_node(xml, "binary", "fs_tool");
xml.node("config", [&] () {
xml.node("config", [&] {
xml.attribute("exit", "yes");
xml.attribute("verbose", "yes");
xml.node("vfs", [&] () {
xml.node("vfs", [&] {
auto gen_fs = [&] (auto name, auto label, auto buffer_size)
{
gen_named_node(xml, "dir", name, [&] () {
xml.node("fs", [&] () {
gen_named_node(xml, "dir", name, [&] {
xml.node("fs", [&] {
xml.attribute("label", label);
xml.attribute("buffer_size", buffer_size); }); });
};
@ -46,9 +46,9 @@ void Sculpt::gen_fs_tool_start_content(Xml_generator &xml, Fs_tool_version versi
operations.gen_fs_tool_config(xml);
});
xml.node("route", [&] () {
xml.node("route", [&] {
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", "target");
gen_named_node(xml, "child", "default_fs_rw"); });
@ -60,8 +60,8 @@ void Sculpt::gen_fs_tool_start_content(Xml_generator &xml, Fs_tool_version versi
gen_parent_route<Log_session> (xml);
gen_parent_route<Rom_session> (xml);
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", "config");
xml.node("parent", [&] () { xml.attribute("label", "config"); }); });
xml.node("parent", [&] { xml.attribute("label", "config"); }); });
});
}

View File

@ -32,15 +32,15 @@ void Sculpt::_gen_gpt_write_start_content(Xml_generator &xml,
gen_named_node(xml, "binary", "gpt_write");
xml.node("config", [&] () {
xml.node("config", [&] {
xml.attribute("verbose", "yes");
xml.attribute("update_geometry", "yes");
xml.attribute("preserve_hybrid", "yes");
xml.node("actions", [&] () { fn(xml); });
xml.node("actions", [&] { fn(xml); });
});
xml.node("route", [&] () {
xml.node("route", [&] {
Storage_target const target { device.label, device.port, Partition::Number { } };
target.gen_block_session_route(xml);
@ -64,7 +64,7 @@ void Sculpt::gen_gpt_relabel_start_content(Xml_generator &xml,
device.for_each_partition([&] (Partition const &partition) {
if (partition.number.valid() && partition.relabel_in_progress())
xml.node("modify", [&] () {
xml.node("modify", [&] {
xml.attribute("entry", partition.number);
xml.attribute("new_label", partition.next_label); }); }); });
}
@ -78,7 +78,7 @@ void Sculpt::gen_gpt_expand_start_content(Xml_generator &xml,
device.for_each_partition([&] (Partition const &partition) {
if (partition.number.valid() && partition.gpt_expand_in_progress)
xml.node("modify", [&] () {
xml.node("modify", [&] {
xml.attribute("entry", partition.number);
xml.attribute("new_size", "max"); }); }); });
}

View File

@ -34,7 +34,7 @@ static void gen_terminal_start(Xml_generator &xml)
gen_provides<Terminal::Session>(xml);
xml.node("route", [&] () {
xml.node("route", [&] {
gen_parent_rom_route(xml, "config", "terminal.config");
gen_parent_route<Rom_session> (xml);
@ -58,28 +58,28 @@ static void gen_vfs_start(Xml_generator &xml,
gen_provides<::File_system::Session>(xml);
xml.node("config", [&] () {
xml.node("config", [&] {
xml.node("vfs", [&] () {
xml.node("vfs", [&] {
gen_named_node(xml, "tar", "bash-minimal.tar");
gen_named_node(xml, "tar", "coreutils-minimal.tar");
gen_named_node(xml, "tar", "vim-minimal.tar");
gen_named_node(xml, "dir", "dev", [&] () {
xml.node("null", [&] () {});
xml.node("zero", [&] () {});
xml.node("terminal", [&] () {});
gen_named_node(xml, "inline", "rtc", [&] () {
gen_named_node(xml, "dir", "dev", [&] {
xml.node("null", [&] {});
xml.node("zero", [&] {});
xml.node("terminal", [&] {});
gen_named_node(xml, "inline", "rtc", [&] {
xml.append("2018-01-01 00:01");
});
gen_named_node(xml, "dir", "pipe", [&] () {
xml.node("pipe", [&] () { });
gen_named_node(xml, "dir", "pipe", [&] {
xml.node("pipe", [&] { });
});
});
auto fs_dir = [&] (String<64> const &label) {
gen_named_node(xml, "dir", label, [&] () {
xml.node("fs", [&] () {
gen_named_node(xml, "dir", label, [&] {
xml.node("fs", [&] {
xml.attribute("buffer_size", 272u << 10);
xml.attribute("label", label); }); }); };
@ -92,40 +92,40 @@ static void gen_vfs_start(Xml_generator &xml,
if (ram_fs_state.inspected)
fs_dir("ram");
gen_named_node(xml, "dir", "tmp", [&] () {
xml.node("ram", [&] () { }); });
gen_named_node(xml, "dir", "tmp", [&] {
xml.node("ram", [&] { }); });
gen_named_node(xml, "dir", "share", [&] () {
gen_named_node(xml, "dir", "vim", [&] () {
xml.node("rom", [&] () {
gen_named_node(xml, "dir", "share", [&] {
gen_named_node(xml, "dir", "vim", [&] {
xml.node("rom", [&] {
xml.attribute("name", "vimrc"); }); }); });
gen_named_node(xml, "rom", "VERSION");
});
xml.node("default-policy", [&] () {
xml.node("default-policy", [&] {
xml.attribute("root", "/");
xml.attribute("writeable", "yes");
});
});
xml.node("route", [&] () {
xml.node("route", [&] {
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", "config");
xml.node("parent", [&] () { xml.attribute("label", "config"); });
xml.node("parent", [&] { xml.attribute("label", "config"); });
});
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", "report");
xml.node("parent", [&] () { xml.attribute("label", "report"); });
xml.node("parent", [&] { xml.attribute("label", "report"); });
});
gen_service_node<Terminal::Session>(xml, [&] () {
gen_service_node<Terminal::Session>(xml, [&] {
gen_named_node(xml, "child", "terminal"); });
xml.node("any-service", [&] () {
xml.node("parent", [&] () { }); });
xml.node("any-service", [&] {
xml.node("parent", [&] { }); });
});
}
@ -136,17 +136,17 @@ static void gen_fs_rom_start(Xml_generator &xml)
Cap_quota{100}, Ram_quota{15*1024*1024},
Priority::LEITZENTRALE);
gen_named_node(xml, "binary", "cached_fs_rom", [&] () { });
gen_named_node(xml, "binary", "cached_fs_rom", [&] { });
gen_provides<Rom_session>(xml);
xml.node("config", [&] () { });
xml.node("config", [&] { });
xml.node("route", [&] () {
gen_service_node<::File_system::Session>(xml, [&] () {
xml.node("route", [&] {
gen_service_node<::File_system::Session>(xml, [&] {
gen_named_node(xml, "child", "vfs"); });
xml.node("any-service", [&] () { xml.node("parent", [&] () { }); });
xml.node("any-service", [&] { xml.node("parent", [&] { }); });
});
}
@ -157,11 +157,11 @@ static void gen_bash_start(Xml_generator &xml)
Cap_quota{400}, Ram_quota{16*1024*1024},
Priority::LEITZENTRALE);
gen_named_node(xml, "binary", "/bin/bash", [&] () { });
gen_named_node(xml, "binary", "/bin/bash", [&] { });
xml.node("config", [&] () {
xml.node("config", [&] {
xml.node("libc", [&] () {
xml.node("libc", [&] {
xml.attribute("stdout", "/dev/terminal");
xml.attribute("stderr", "/dev/terminal");
xml.attribute("stdin", "/dev/terminal");
@ -169,12 +169,12 @@ static void gen_bash_start(Xml_generator &xml)
xml.attribute("rtc", "/dev/rtc");
});
xml.node("vfs", [&] () {
xml.node("fs", [&] () {
xml.node("vfs", [&] {
xml.node("fs", [&] {
xml.attribute("buffer_size", 272u << 10); }); });
auto gen_env = [&] (auto key, auto value) {
xml.node("env", [&] () {
xml.node("env", [&] {
xml.attribute("key", key);
xml.attribute("value", value); }); };
@ -183,24 +183,24 @@ static void gen_bash_start(Xml_generator &xml)
gen_env("PATH", "/bin");
gen_env("PS1", "inspect:$PWD> ");
xml.node("arg", [&] () { xml.attribute("value", "bash"); });
xml.node("arg", [&] { xml.attribute("value", "bash"); });
});
xml.node("route", [&] () {
gen_service_node<::File_system::Session>(xml, [&] () {
xml.node("route", [&] {
gen_service_node<::File_system::Session>(xml, [&] {
gen_named_node(xml, "child", "vfs"); });
gen_service_node<Rom_session>(xml, [&] () {
gen_service_node<Rom_session>(xml, [&] {
xml.attribute("label_last", "/bin/bash");
gen_named_node(xml, "child", "vfs_rom");
});
gen_service_node<Rom_session>(xml, [&] () {
gen_service_node<Rom_session>(xml, [&] {
xml.attribute("label_prefix", "/bin");
gen_named_node(xml, "child", "vfs_rom");
});
xml.node("any-service", [&] () { xml.node("parent", [&] () { }); });
xml.node("any-service", [&] { xml.node("parent", [&] { }); });
});
}
@ -210,7 +210,7 @@ void Sculpt::gen_inspect_view(Xml_generator &xml,
Ram_fs_state const &ram_fs_state,
Inspect_view_version version)
{
xml.node("start", [&] () {
xml.node("start", [&] {
xml.attribute("version", version.value);
@ -218,11 +218,11 @@ void Sculpt::gen_inspect_view(Xml_generator &xml,
Cap_quota{1000}, Ram_quota{76*1024*1024},
Priority::LEITZENTRALE);
gen_named_node(xml, "binary", "init", [&] () { });
gen_named_node(xml, "binary", "init", [&] { });
xml.node("config", [&] () {
xml.node("config", [&] {
xml.node("parent-provides", [&] () {
xml.node("parent-provides", [&] {
gen_parent_service<Rom_session>(xml);
gen_parent_service<Cpu_session>(xml);
gen_parent_service<Pd_session> (xml);
@ -234,27 +234,27 @@ void Sculpt::gen_inspect_view(Xml_generator &xml,
gen_parent_service<Gui::Session>(xml);
});
xml.node("start", [&] () { gen_terminal_start(xml); });
xml.node("start", [&] () { gen_vfs_start(xml, devices, ram_fs_state); });
xml.node("start", [&] () { gen_fs_rom_start(xml); });
xml.node("start", [&] () { gen_bash_start(xml); });
xml.node("start", [&] { gen_terminal_start(xml); });
xml.node("start", [&] { gen_vfs_start(xml, devices, ram_fs_state); });
xml.node("start", [&] { gen_fs_rom_start(xml); });
xml.node("start", [&] { gen_bash_start(xml); });
});
xml.node("route", [&] () {
xml.node("route", [&] {
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", "config");
xml.node("parent", [&] () { xml.attribute("label", "config"); });
xml.node("parent", [&] { xml.attribute("label", "config"); });
});
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", "report");
xml.node("parent", [&] () { xml.attribute("label", "report"); });
xml.node("parent", [&] { xml.attribute("label", "report"); });
});
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", "report");
xml.node("parent", [&] () { xml.attribute("label", "report"); });
xml.node("parent", [&] { xml.attribute("label", "report"); });
});
gen_parent_rom_route(xml, "ld.lib.so");
@ -283,35 +283,35 @@ void Sculpt::gen_inspect_view(Xml_generator &xml,
gen_parent_route<Timer::Session> (xml);
for_each_inspected_storage_target(devices, [&] (Storage_target const &target) {
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label_last", target.label());
gen_named_node(xml, "child", target.fs());
});
});
if (ram_fs_state.inspected)
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label_last", "ram");
gen_named_node(xml, "child", "ram_fs");
});
gen_service_node<Gui::Session>(xml, [&] () {
xml.node("parent", [&] () {
gen_service_node<Gui::Session>(xml, [&] {
xml.node("parent", [&] {
xml.attribute("label", String<64>("leitzentrale -> inspect")); }); });
gen_service_node<Rom_session>(xml, [&] () {
gen_service_node<Rom_session>(xml, [&] {
xml.attribute("label", "terminal.config");
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", String<64>("config -> managed/fonts")); }); });
gen_service_node<Rom_session>(xml, [&] () {
gen_service_node<Rom_session>(xml, [&] {
xml.attribute("label", "terminal -> clipboard");
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", String<64>("inspect -> clipboard")); }); });
gen_service_node<Report::Session>(xml, [&] () {
gen_service_node<Report::Session>(xml, [&] {
xml.attribute("label", "terminal -> clipboard");
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", String<64>("inspect -> clipboard")); }); });
});
});

View File

@ -21,23 +21,23 @@ void Sculpt::gen_launcher_query_start_content(Xml_generator &xml)
gen_named_node(xml, "binary", "fs_query");
xml.node("config", [&] () {
xml.node("config", [&] {
xml.attribute("query", "rom");
xml.node("vfs", [&] () {
xml.node("fs", [&] () {}); });
xml.node("vfs", [&] {
xml.node("fs", [&] {}); });
xml.node("query", [&] () {
xml.node("query", [&] {
xml.attribute("path", "/launcher");
xml.attribute("content", "yes");
});
xml.node("query", [&] () {
xml.node("query", [&] {
xml.attribute("path", "/presets");
xml.attribute("content", "yes");
});
});
xml.node("route", [&] () {
xml.node("route", [&] {
gen_parent_rom_route(xml, "fs_query");
gen_parent_rom_route(xml, "ld.lib.so");
gen_parent_rom_route(xml, "vfs.lib.so");
@ -47,8 +47,8 @@ void Sculpt::gen_launcher_query_start_content(Xml_generator &xml)
gen_parent_route<Log_session> (xml);
gen_parent_route<Report::Session> (xml);
gen_service_node<::File_system::Session>(xml, [&] () {
xml.node("parent", [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.node("parent", [&] {
xml.attribute("label", "config"); }); });
});
}

View File

@ -24,16 +24,16 @@ void Sculpt::gen_nic_router_start_content(Xml_generator &xml)
Cap_quota{300}, Ram_quota{10*1024*1024},
Priority::NETWORK);
xml.node("provides", [&] () {
xml.node("service", [&] () {
xml.node("provides", [&] {
xml.node("service", [&] {
xml.attribute("name", Nic::Session::service_name());
});
xml.node("service", [&] () {
xml.node("service", [&] {
xml.attribute("name", Uplink::Session::service_name());
});
});
xml.node("route", [&] () {
xml.node("route", [&] {
gen_parent_rom_route(xml, "nic_router");
gen_parent_rom_route(xml, "ld.lib.so");
gen_parent_rom_route(xml, "config", "config -> managed/nic_router");

View File

@ -36,45 +36,45 @@ void Sculpt::gen_prepare_vfs_start(Xml_generator &xml)
gen_provides<::File_system::Session>(xml);
xml.node("config", [&] () {
xml.node("config", [&] {
xml.node("vfs", [&] () {
xml.node("vfs", [&] {
gen_named_node(xml, "tar", "bash-minimal.tar");
gen_named_node(xml, "tar", "coreutils-minimal.tar");
gen_named_node(xml, "inline", ".bash_profile", [&] () {
gen_named_node(xml, "inline", ".bash_profile", [&] {
xml.append(script); });
gen_named_node(xml, "dir", "dev", [&] () {
xml.node("null", [&] () {});
xml.node("log", [&] () {});
xml.node("zero", [&] () {});
gen_named_node(xml, "inline", "rtc", [&] () {
gen_named_node(xml, "dir", "dev", [&] {
xml.node("null", [&] {});
xml.node("log", [&] {});
xml.node("zero", [&] {});
gen_named_node(xml, "inline", "rtc", [&] {
xml.append("2018-01-01 00:01");
});
gen_named_node(xml, "dir", "pipe", [&] () {
xml.node("pipe", [&] () { });
gen_named_node(xml, "dir", "pipe", [&] {
xml.node("pipe", [&] { });
});
});
gen_named_node(xml, "dir", "rw", [&] () {
xml.node("fs", [&] () { xml.attribute("label", "target"); }); });
gen_named_node(xml, "dir", "rw", [&] {
xml.node("fs", [&] { xml.attribute("label", "target"); }); });
gen_named_node(xml, "dir", "config", [&] () {
xml.node("fs", [&] () { xml.attribute("label", "config"); }); });
gen_named_node(xml, "dir", "config", [&] {
xml.node("fs", [&] { xml.attribute("label", "config"); }); });
gen_named_node(xml, "rom", "VERSION");
});
xml.node("default-policy", [&] () {
xml.node("default-policy", [&] {
xml.attribute("root", "/");
xml.attribute("writeable", "yes");
});
});
xml.node("route", [&] () {
xml.node("any-service", [&] () {
xml.node("parent", [&] () { }); }); });
xml.node("route", [&] {
xml.node("any-service", [&] {
xml.node("parent", [&] { }); }); });
}
@ -84,17 +84,17 @@ void Sculpt::gen_prepare_fs_rom_start(Xml_generator &xml)
Cap_quota{100}, Ram_quota{15*1024*1024},
Priority::STORAGE);
gen_named_node(xml, "binary", "fs_rom", [&] () { });
gen_named_node(xml, "binary", "fs_rom", [&] { });
gen_provides<Rom_session>(xml);
xml.node("config", [&] () { });
xml.node("config", [&] { });
xml.node("route", [&] () {
gen_service_node<::File_system::Session>(xml, [&] () {
xml.node("route", [&] {
gen_service_node<::File_system::Session>(xml, [&] {
gen_named_node(xml, "child", "vfs"); });
xml.node("any-service", [&] () { xml.node("parent", [&] () { }); });
xml.node("any-service", [&] { xml.node("parent", [&] { }); });
});
}
@ -105,13 +105,13 @@ void Sculpt::gen_prepare_bash_start(Xml_generator &xml)
Cap_quota{400}, Ram_quota{15*1024*1024},
Priority::STORAGE);
gen_named_node(xml, "binary", "/bin/bash", [&] () { });
gen_named_node(xml, "binary", "/bin/bash", [&] { });
xml.node("exit", [&] () { xml.attribute("propagate", "yes"); });
xml.node("exit", [&] { xml.attribute("propagate", "yes"); });
xml.node("config", [&] () {
xml.node("config", [&] {
xml.node("libc", [&] () {
xml.node("libc", [&] {
xml.attribute("stdout", "/dev/null");
xml.attribute("stderr", "/dev/null");
xml.attribute("stdin", "/dev/null");
@ -119,10 +119,10 @@ void Sculpt::gen_prepare_bash_start(Xml_generator &xml)
xml.attribute("rtc", "/dev/rtc");
});
xml.node("vfs", [&] () { xml.node("fs", [&] () { }); });
xml.node("vfs", [&] { xml.node("fs", [&] { }); });
auto gen_env = [&] (auto key, auto value) {
xml.node("env", [&] () {
xml.node("env", [&] {
xml.attribute("key", key);
xml.attribute("value", value); }); };
@ -130,25 +130,25 @@ void Sculpt::gen_prepare_bash_start(Xml_generator &xml)
gen_env("TERM", "screen");
gen_env("PATH", "/bin");
xml.node("arg", [&] () { xml.attribute("value", "bash"); });
xml.node("arg", [&] () { xml.attribute("value", "--login"); });
xml.node("arg", [&] { xml.attribute("value", "bash"); });
xml.node("arg", [&] { xml.attribute("value", "--login"); });
});
xml.node("route", [&] () {
gen_service_node<::File_system::Session>(xml, [&] () {
xml.node("route", [&] {
gen_service_node<::File_system::Session>(xml, [&] {
gen_named_node(xml, "child", "vfs"); });
gen_service_node<Rom_session>(xml, [&] () {
gen_service_node<Rom_session>(xml, [&] {
xml.attribute("label_last", "/bin/bash");
gen_named_node(xml, "child", "vfs_rom");
});
gen_service_node<Rom_session>(xml, [&] () {
gen_service_node<Rom_session>(xml, [&] {
xml.attribute("label_prefix", "/bin");
gen_named_node(xml, "child", "vfs_rom");
});
xml.node("any-service", [&] () { xml.node("parent", [&] () { }); });
xml.node("any-service", [&] { xml.node("parent", [&] { }); });
});
}
@ -163,11 +163,11 @@ void Sculpt::gen_prepare_start_content(Xml_generator &xml, Prepare_version versi
gen_named_node(xml, "binary", "init");
xml.node("config", [&] () {
xml.node("config", [&] {
xml.attribute("prio_levels", 4);
xml.node("parent-provides", [&] () {
xml.node("parent-provides", [&] {
gen_parent_service<Rom_session>(xml);
gen_parent_service<Cpu_session>(xml);
gen_parent_service<Pd_session>(xml);
@ -176,14 +176,14 @@ void Sculpt::gen_prepare_start_content(Xml_generator &xml, Prepare_version versi
gen_parent_service<::File_system::Session>(xml);
});
xml.node("start", [&] () { gen_prepare_vfs_start (xml); });
xml.node("start", [&] () { gen_prepare_fs_rom_start(xml); });
xml.node("start", [&] () { gen_prepare_bash_start (xml); });
xml.node("start", [&] { gen_prepare_vfs_start (xml); });
xml.node("start", [&] { gen_prepare_fs_rom_start(xml); });
xml.node("start", [&] { gen_prepare_bash_start (xml); });
});
xml.node("route", [&] () {
xml.node("route", [&] {
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", "vfs -> target");
gen_named_node(xml, "child", "default_fs_rw"); });
@ -202,8 +202,8 @@ void Sculpt::gen_prepare_start_content(Xml_generator &xml, Prepare_version versi
gen_parent_route<Rom_session> (xml);
gen_parent_route<Timer::Session> (xml);
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", "vfs -> config");
xml.node("parent", [&] () { xml.attribute("label", "config"); }); });
xml.node("parent", [&] { xml.attribute("label", "config"); }); });
});
}

View File

@ -18,11 +18,11 @@ void Sculpt::gen_ram_fs_start_content(Xml_generator &xml,
{
state.gen_start_node_content(xml);
xml.node("binary", [&] () { xml.attribute("name", "vfs"); });
xml.node("binary", [&] { xml.attribute("name", "vfs"); });
gen_provides<::File_system::Session>(xml);
xml.node("route", [&] () {
xml.node("route", [&] {
gen_parent_rom_route(xml, "vfs");
gen_parent_rom_route(xml, "ld.lib.so");
gen_parent_rom_route(xml, "vfs.lib.so");

View File

@ -24,43 +24,43 @@ void Sculpt::gen_runtime_view_start_content(Xml_generator &xml,
{
state.gen_start_node_content(xml);
gen_named_node(xml, "resource", "CPU", [&] () {
gen_named_node(xml, "resource", "CPU", [&] {
xml.attribute("quantum", 20); });
gen_named_node(xml, "binary", "menu_view");
xml.node("config", [&] () {
xml.node("libc", [&] () { xml.attribute("stderr", "/dev/log"); });
xml.node("report", [&] () { xml.attribute("hover", "yes"); });
xml.node("vfs", [&] () {
xml.node("config", [&] {
xml.node("libc", [&] { xml.attribute("stderr", "/dev/log"); });
xml.node("report", [&] { xml.attribute("hover", "yes"); });
xml.node("vfs", [&] {
gen_named_node(xml, "tar", "menu_view_styles.tar");
gen_named_node(xml, "rom", "Vera.ttf");
gen_named_node(xml, "dir", "fonts", [&] () {
gen_named_node(xml, "dir", "text", [&] () {
gen_named_node(xml, "ttf", "regular", [&] () {
gen_named_node(xml, "dir", "fonts", [&] {
gen_named_node(xml, "dir", "text", [&] {
gen_named_node(xml, "ttf", "regular", [&] {
xml.attribute("size_px", font_size);
xml.attribute("cache", "256K");
xml.attribute("path", "/Vera.ttf"); }); }); });
gen_named_node(xml, "dir", "dev", [&] () {
xml.node("log", [&] () { }); });
gen_named_node(xml, "dir", "dev", [&] {
xml.node("log", [&] { }); });
});
});
xml.node("route", [&] () {
xml.node("route", [&] {
gen_service_node<Gui::Session>(xml, [&] () {
xml.node("parent", [&] () {
gen_service_node<Gui::Session>(xml, [&] {
xml.node("parent", [&] {
xml.attribute("label", "leitzentrale -> runtime_view"); }); });
gen_service_node<Rom_session>(xml, [&] () {
gen_service_node<Rom_session>(xml, [&] {
xml.attribute("label", "dialog");
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", "leitzentrale -> runtime_view -> dialog"); }); });
gen_service_node<Report::Session>(xml, [&] () {
gen_service_node<Report::Session>(xml, [&] {
xml.attribute("label", "hover");
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", "leitzentrale -> runtime_view -> hover"); }); });
gen_parent_rom_route(xml, "menu_view");

View File

@ -21,11 +21,11 @@ void Sculpt::gen_update_start_content(Xml_generator &xml)
gen_named_node(xml, "binary", "init");
xml.node("route", [&] () {
xml.node("route", [&] {
typedef String<32> Label;
auto gen_fs = [&] (Label const &label, Label const &server) {
gen_service_node<::File_system::Session>(xml, [&] () {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", label);
gen_named_node(xml, "child", server); }); };
@ -65,9 +65,9 @@ void Sculpt::gen_update_start_content(Xml_generator &xml)
gen_parent_route<Report::Session>(xml);
auto gen_relabeled_log = [&] (Label const &label, Label const &relabeled) {
gen_service_node<Log_session>(xml, [&] () {
gen_service_node<Log_session>(xml, [&] {
xml.attribute("label", label);
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", relabeled); }); }); };
/* shorten LOG-session labels to reduce the debug-output noise */
@ -76,7 +76,7 @@ void Sculpt::gen_update_start_content(Xml_generator &xml)
gen_relabeled_log("dynamic -> extract", "extract");
gen_parent_route<Log_session>(xml);
gen_service_node<Nic::Session>(xml, [&] () {
gen_service_node<Nic::Session>(xml, [&] {
gen_named_node(xml, "child", "nic_router"); });
});
}

View File

@ -127,7 +127,7 @@ void Sculpt::Storage::update(Xml_node const &usb_devices,
void Sculpt::Storage::gen_runtime_start_nodes(Xml_generator &xml) const
{
xml.node("start", [&] () {
xml.node("start", [&] {
gen_ram_fs_start_content(xml, _ram_fs_state); });
auto contains_used_fs = [&] (Storage_device const &device)
@ -145,7 +145,7 @@ void Sculpt::Storage::gen_runtime_start_nodes(Xml_generator &xml) const
_storage_devices.usb_storage_devices.for_each([&] (Usb_storage_device const &device) {
if (device.usb_block_drv_needed() || contains_used_fs(device))
xml.node("start", [&] () {
xml.node("start", [&] {
device.gen_usb_block_drv_start_content(xml); });
});
@ -168,20 +168,20 @@ void Sculpt::Storage::gen_runtime_start_nodes(Xml_generator &xml) const
.partition = partition.number };
if (partition.check_in_progress) {
xml.node("start", [&] () {
xml.node("start", [&] {
gen_fsck_ext2_start_content(xml, target); }); }
if (partition.format_in_progress) {
xml.node("start", [&] () {
xml.node("start", [&] {
gen_mkfs_ext2_start_content(xml, target); }); }
if (partition.fs_resize_in_progress) {
xml.node("start", [&] () {
xml.node("start", [&] {
gen_resize2fs_start_content(xml, target); }); }
if (partition.file_system.type != File_system::UNKNOWN) {
if (partition.file_system.inspected || target == _sculpt_partition)
xml.node("start", [&] () {
xml.node("start", [&] {
gen_fs_start_content(xml, target, partition.file_system.type); });
/*
@ -190,7 +190,7 @@ void Sculpt::Storage::gen_runtime_start_nodes(Xml_generator &xml) const
* underlying storage target.
*/
if (target == _sculpt_partition)
gen_named_node(xml, "alias", "default_fs_rw", [&] () {
gen_named_node(xml, "alias", "default_fs_rw", [&] {
xml.attribute("child", target.fs()); });
}
@ -198,18 +198,18 @@ void Sculpt::Storage::gen_runtime_start_nodes(Xml_generator &xml) const
/* relabel partitions if needed */
if (device.relabel_in_progress())
xml.node("start", [&] () {
xml.node("start", [&] {
gen_gpt_relabel_start_content(xml, device); });
/* expand partitions if needed */
if (device.expand_in_progress())
xml.node("start", [&] () {
xml.node("start", [&] {
gen_gpt_expand_start_content(xml, device); });
}); /* for each device */
if (_sculpt_partition.ram_fs())
gen_named_node(xml, "alias", "default_fs_rw", [&] () {
gen_named_node(xml, "alias", "default_fs_rw", [&] {
xml.attribute("child", "ram_fs"); });
}

View File

@ -69,7 +69,7 @@ struct Dialog::Left_annotation : Sub_scope
static void view_sub_scope(auto &s, auto const &text)
{
s.node("hbox", [&] {
s.sub_node("float", [&] () {
s.sub_node("float", [&] {
s.attribute("west", "yes");
Annotation::sub_node(s, text); }); });
}
@ -83,11 +83,11 @@ struct Dialog::Left_right_annotation : Sub_scope
static void view_sub_scope(auto &s, auto const &left, auto const &right)
{
s.node("hbox", [&] {
s.named_sub_node("float", "left", [&] () {
s.named_sub_node("float", "left", [&] {
s.attribute("west", "yes");
Annotation::sub_node(s, left); });
s.named_sub_node("float", "right", [&] () {
s.named_sub_node("float", "right", [&] {
s.attribute("east", "yes");
Annotation::sub_node(s, right); });
});
@ -282,7 +282,7 @@ struct Dialog::Titled_frame : Widget<Frame>
s.attribute("min_ex", attr.min_ex); });
s.sub_node("label", [&] { s.attribute("text", s.id.value); });
s.sub_node("float", [&] {
s.sub_node("vbox", [&] () {
s.sub_node("vbox", [&] {
fn(); }); }); });
}

View File

@ -297,7 +297,7 @@ struct Sculpt::Popup_dialog : Dialog::Top_level_dialog
{
if (_state >= TOP_LEVEL)
depot_users.for_each_sub_node("user", [&] (Xml_node user) {
xml.node("index", [&] () {
xml.node("index", [&] {
User const name = user.attribute_value("name", User());
xml.attribute("user", name);
xml.attribute("version", _sculpt_version);
@ -308,7 +308,7 @@ struct Sculpt::Popup_dialog : Dialog::Top_level_dialog
if (_state >= PKG_REQUESTED)
_construction_info.with_construction([&] (Component const &component) {
xml.node("blueprint", [&] () {
xml.node("blueprint", [&] {
xml.attribute("pkg", component.path); }); });
}

View File

@ -45,7 +45,7 @@ struct Sculpt::Resource_widget : Widget<Vbox>
*/
s.template sub_scope<Button>([&] (auto &s) {
s.attribute("style", "invisible");
s.sub_node("hbox", [&] () { }); });
s.sub_node("hbox", [&] { }); });
s.template sub_scope<Label>(String<32>(" ", text));
});

View File

@ -27,7 +27,7 @@ namespace Sculpt {
static inline void gen_named_node(Xml_generator &xml,
char const *type, char const *name, FN const &fn)
{
xml.node(type, [&] () {
xml.node(type, [&] {
xml.attribute("name", name);
fn();
});
@ -35,7 +35,7 @@ namespace Sculpt {
static inline void gen_named_node(Xml_generator &xml, char const *type, char const *name)
{
xml.node(type, [&] () { xml.attribute("name", name); });
xml.node(type, [&] { xml.attribute("name", name); });
}
template <size_t N, typename FN>
@ -66,17 +66,17 @@ namespace Sculpt {
template <typename SESSION>
static inline void gen_parent_route(Xml_generator &xml)
{
gen_named_node(xml, "service", SESSION::service_name(), [&] () {
xml.node("parent", [&] () { }); });
gen_named_node(xml, "service", SESSION::service_name(), [&] {
xml.node("parent", [&] { }); });
}
static inline void gen_parent_rom_route(Xml_generator &xml,
Rom_name const &name,
auto const &label)
{
gen_service_node<Rom_session>(xml, [&] () {
gen_service_node<Rom_session>(xml, [&] {
xml.attribute("label_last", name);
xml.node("parent", [&] () {
xml.node("parent", [&] {
xml.attribute("label", label); });
});
}
@ -90,7 +90,7 @@ namespace Sculpt {
template <typename SESSION>
static inline void gen_provides(Xml_generator &xml)
{
xml.node("provides", [&] () {
xml.node("provides", [&] {
gen_named_node(xml, "service", SESSION::service_name()); });
}
@ -113,7 +113,7 @@ namespace Sculpt {
xml.attribute("name", name);
xml.attribute("caps", caps.value);
xml.attribute("priority", (int)priority);
gen_named_node(xml, "resource", "RAM", [&] () {
gen_named_node(xml, "resource", "RAM", [&] {
xml.attribute("quantum", String<64>(Number_of_bytes(ram.value))); });
}