aboutsummaryrefslogtreecommitdiff
path: root/kapi/include
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-04-02 15:18:05 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-04-02 15:18:05 +0200
commit3e80b6baa8f9666a9dd3cd4531bc68a3de4fee92 (patch)
tree29bd443811905ead4e8bdd2b350c429757c8b8be /kapi/include
parentab4c59912c526d515e6e72188c08a7f92e5573e8 (diff)
downloadteachos-3e80b6baa8f9666a9dd3cd4531bc68a3de4fee92.tar.xz
teachos-3e80b6baa8f9666a9dd3cd4531bc68a3de4fee92.zip
kapi: allow for device searches
Diffstat (limited to 'kapi/include')
-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