summaryrefslogtreecommitdiffhomepage
path: root/dev/ddk/KernelString.c
blob: 0030aa02956ae644f43087e98b7ecf783150b62b (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
35
36
37
38
39
/* -------------------------------------------

	Copyright ZKA Technologies.

	Purpose: DDK Strings.

------------------------------------------- */

#include <ddk/KernelString.h>

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;
}