diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-25 10:28:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-25 10:28:07 +0200 |
| commit | 1057fd299e17fcc04f6b3a1aa3ace1026f8652a0 (patch) | |
| tree | a663c7dcd26779295ce0d9681418964f802f2d14 /dev/libDDK/src/ddk_dev.c | |
| parent | 1a32b9307357ac0fc9095e853b2b6d94f9fe62bb (diff) | |
| parent | 328b34360ab8b2462ea5858441693277b3d23f08 (diff) | |
Merge pull request #56 from nekernel-org/dev
Errata: v0.0.4
Diffstat (limited to 'dev/libDDK/src/ddk_dev.c')
| -rw-r--r-- | dev/libDDK/src/ddk_dev.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/dev/libDDK/src/ddk_dev.c b/dev/libDDK/src/ddk_dev.c new file mode 100644 index 00000000..32ec2442 --- /dev/null +++ b/dev/libDDK/src/ddk_dev.c @@ -0,0 +1,26 @@ +/* ------------------------------------------- + + Copyright Amlal El Mahrouss. + + Purpose: DDK Text I/O. + +------------------------------------------- */ + +#include <DriverKit/dev.h> +#include <DriverKit/str.h> + +/// @brief Open a new binary device from path. +DDK_EXTERN DDK_DEVICE_PTR open(const char* devicePath) { + if (!devicePath) return nil; + + return ke_call_dispatch("dk_open_dev", 1, (void*) devicePath, kstrlen(devicePath)); +} + +/// @brief Close any device. +/// @param device valid device. +DDK_EXTERN BOOL close(DDK_DEVICE_PTR device) { + if (!device) return NO; + + ke_call_dispatch("dk_close_dev", 1, device, sizeof(DDK_DEVICE)); + return YES; +} |
