xref: /openbmc/phosphor-ipmi-blobs/utils.hpp (revision cd8dab491d3f78124be800252186a32a90c884b8)
14dc584dbSPatrick Venture #pragma once
24dc584dbSPatrick Venture 
3c18e2b64SPatrick Venture #include "internal/sys.hpp"
4*cd8dab49SPatrick Venture #include "manager.hpp"
5c18e2b64SPatrick Venture 
6c18e2b64SPatrick Venture #include <memory>
74dc584dbSPatrick Venture #include <string>
84dc584dbSPatrick Venture 
94dc584dbSPatrick Venture namespace blobs
104dc584dbSPatrick Venture {
11c18e2b64SPatrick Venture using HandlerFactory = std::unique_ptr<GenericBlobInterface> (*)();
12c18e2b64SPatrick Venture 
13c18e2b64SPatrick Venture /**
14c18e2b64SPatrick Venture  * The bitbake recipe symlinks the library lib*.so.? into the folder
15c18e2b64SPatrick Venture  * only, and not the other names, .so, .so.?.?, .so.?.?.?
16c18e2b64SPatrick Venture  *
17c18e2b64SPatrick Venture  * Therefore only care if it's lib*.so.?
18c18e2b64SPatrick Venture  *
19c18e2b64SPatrick Venture  * @param[in] the path to check.
20c18e2b64SPatrick Venture  * @return true if matches, false otherwise
21c18e2b64SPatrick Venture  */
22c18e2b64SPatrick Venture bool matchBlobHandler(const std::string& filename);
234dc584dbSPatrick Venture 
244dc584dbSPatrick Venture /**
254dc584dbSPatrick Venture  * @brief Given a path, find libraries (*.so only) and load them.
264dc584dbSPatrick Venture  *
27c18e2b64SPatrick Venture  * @param[in] manager - pointer to a manager
284dc584dbSPatrick Venture  * @param[in] paths - list of fully qualified paths to libraries to load.
29c18e2b64SPatrick Venture  * @param[in] sys - pointer to implementation of the dlsys interface.
304dc584dbSPatrick Venture  */
31c18e2b64SPatrick Venture void loadLibraries(ManagerInterface* manager, const std::string& path,
32c18e2b64SPatrick Venture                    const internal::DlSysInterface* sys = &internal::dlsys_impl);
334dc584dbSPatrick Venture 
344dc584dbSPatrick Venture } // namespace blobs
35