MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / load_backend

Function load_backend

src/main.cpp:163–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163static wf::config_backend_t *load_backend(const std::string& backend)
164{
165 std::string config_plugin(backend);
166
167 if (backend.size())
168 {
169 std::vector<std::string> plugin_prefixes = wf::get_plugin_paths();
170 config_plugin =
171 wf::get_plugin_path_for_name(plugin_prefixes, backend).value_or("");
172 }
173
174 auto [_, init_ptr] = wf::get_new_instance_handle(config_plugin, false);
175
176 if (!init_ptr)
177 {
178 return nullptr;
179 }
180
181 using backend_init_t = wf::config_backend_t * (*)();
182 auto init = wf::union_cast<void*, backend_init_t>(init_ptr);
183 return init();
184}
185
186static std::string_view get_category_name(wf::log::logging_category category)
187{

Callers 1

mainFunction · 0.85

Calls 2

initFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected