summaryrefslogtreecommitdiffstats
path: root/utils.hpp
blob: 67380cda1a737afde2e4d1cd58f6c4cef52b3900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include "internal/sys.hpp"
#include "manager.hpp"

#include <memory>
#include <string>

namespace blobs
{
using HandlerFactory = std::unique_ptr<GenericBlobInterface> (*)();

/**
 * The bitbake recipe symlinks the library lib*.so.? into the folder
 * only, and not the other names, .so, .so.?.?, .so.?.?.?
 *
 * Therefore only care if it's lib*.so.?
 *
 * @param[in] the path to check.
 * @return true if matches, false otherwise
 */
bool matchBlobHandler(const std::string& filename);

/**
 * @brief Given a path, find libraries (*.so only) and load them.
 *
 * @param[in] manager - pointer to a manager
 * @param[in] paths - list of fully qualified paths to libraries to load.
 * @param[in] sys - pointer to implementation of the dlsys interface.
 */
void loadLibraries(ManagerInterface* manager, const std::string& path,
                   const internal::DlSysInterface* sys = &internal::dlsys_impl);

} // namespace blobs
OpenPOWER on IntegriCloud