aboutsummaryrefslogtreecommitdiff
path: root/kapi
diff options
context:
space:
mode:
Diffstat (limited to 'kapi')
-rw-r--r--kapi/include/kapi/devices/manager.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/kapi/include/kapi/devices/manager.hpp b/kapi/include/kapi/devices/manager.hpp
index 56cd678..7817fbc 100644
--- a/kapi/include/kapi/devices/manager.hpp
+++ b/kapi/include/kapi/devices/manager.hpp
@@ -5,7 +5,10 @@
#include "kapi/devices/device.hpp"
+#include <kstd/memory>
+
#include <cstddef>
+#include <string_view>
namespace kapi::devices
{
@@ -30,6 +33,19 @@ namespace kapi::devices
//! @return true if the device was unregistered successfully, false otherwise.
auto unregister_device(device & device) -> bool;
+ //! Find a device by its major and minor numbers.
+ //!
+ //! @param major the major number of the device.
+ //! @param minor the minor number of the device.
+ //! @return a pointer to the device iff. the device was found, nullptr otherwise.
+ auto find_device(std::size_t major, std::size_t minor) -> kstd::observer_ptr<device>;
+
+ //! Find a device by its name.
+ //!
+ //! @param name the name of the device.
+ //! @return a pointer to the device iff. the device was found, nullptr otherwise.
+ auto find_device(std::string_view name) -> kstd::observer_ptr<device>;
+
//! @}
} // namespace kapi::devices