From bf642edd6c77d405637f0695452460640b8e540d Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Tue, 30 Jul 2024 08:49:23 +0200 Subject: [Refactor] SCIKit and DDKit. [IMP} Prevent DDK from being included when we aren't in kernel mode. Signed-off-by: Amlal EL Mahrouss --- DDKit/KernelString.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 DDKit/KernelString.c (limited to 'DDKit/KernelString.c') diff --git a/DDKit/KernelString.c b/DDKit/KernelString.c new file mode 100644 index 00000000..3ef65cf2 --- /dev/null +++ b/DDKit/KernelString.c @@ -0,0 +1,39 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies + + Purpose: DDK Strings. + +------------------------------------------- */ + +#include + +DK_EXTERN size_t kernelStringLength(const char* in) +{ + if (in == nil) + return 0; + if (*in == 0) + return 0; + + size_t index = 0; + + while (in[index] != 0) + { + ++index; + } + + return index; +} + +DK_EXTERN int kernelStringCopy(char* dst, const char* src, size_t len) +{ + size_t index = 0; + + while (index != len) + { + dst[index] = src[index]; + ++index; + } + + return index; +} -- cgit v1.2.3