blob: 67380cda1a737afde2e4d1cd58f6c4cef52b3900 [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"
Patrick Venturecd8dab42019-01-15 19:57:38 -08004#include "manager.hpp"
Patrick Venturec18e2b62018-11-21 14:19:28 -08005
Patrick Venturec18e2b62018-11-21 14:19:28 -08006#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