blob: 50d320e9ab91c5383fd64490eb43f81022c0d98b [file] [log] [blame]
Patrick Venture4dc584d2018-09-27 15:00:46 -07001#pragma once
2
Patrick Venturec18e2b62018-11-21 14:19:28 -08003#include "internal/sys.hpp"
4
5#include <blobs-ipmid/manager.hpp>
6#include <memory>
Patrick Venture4dc584d2018-09-27 15:00:46 -07007#include <string>
8
9namespace blobs
10{
Patrick Venturec18e2b62018-11-21 14:19:28 -080011using HandlerFactory = std::unique_ptr<GenericBlobInterface> (*)();
12
13/**
14 * The bitbake recipe symlinks the library lib*.so.? into the folder
15 * only, and not the other names, .so, .so.?.?, .so.?.?.?
16 *
17 * Therefore only care if it's lib*.so.?
18 *
19 * @param[in] the path to check.
20 * @return true if matches, false otherwise
21 */
22bool matchBlobHandler(const std::string& filename);
Patrick Venture4dc584d2018-09-27 15:00:46 -070023
24/**
25 * @brief Given a path, find libraries (*.so only) and load them.
26 *
Patrick Venturec18e2b62018-11-21 14:19:28 -080027 * @param[in] manager - pointer to a manager
Patrick Venture4dc584d2018-09-27 15:00:46 -070028 * @param[in] paths - list of fully qualified paths to libraries to load.
Patrick Venturec18e2b62018-11-21 14:19:28 -080029 * @param[in] sys - pointer to implementation of the dlsys interface.
Patrick Venture4dc584d2018-09-27 15:00:46 -070030 */
Patrick Venturec18e2b62018-11-21 14:19:28 -080031void loadLibraries(ManagerInterface* manager, const std::string& path,
32 const internal::DlSysInterface* sys = &internal::dlsys_impl);
Patrick Venture4dc584d2018-09-27 15:00:46 -070033
34} // namespace blobs