diff options
author | Marvin Borner | 2020-07-22 18:26:56 +0200 |
---|---|---|
committer | Marvin Borner | 2020-07-22 18:26:56 +0200 |
commit | 40cc5e32663cd0350b791b8e54825f564489343f (patch) | |
tree | 3561c2f379b98ac3c3005f9048bb5535a0d3952d /src/lib | |
parent | c0a2074864e668b005eea8f50c6719bceb66bf20 (diff) |
Imported some things from master
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/inc/def.h (renamed from src/lib/def.h) | 2 | ||||
-rw-r--r-- | src/lib/inc/string.h | 10 | ||||
-rw-r--r-- | src/lib/string.c | 11 |
3 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/def.h b/src/lib/inc/def.h index dc3cc55..69b43e3 100644 --- a/src/lib/def.h +++ b/src/lib/inc/def.h @@ -1,3 +1,5 @@ +// MIT License, Copyright (c) 2020 Marvin Borner + #ifndef DEF_H #define DEF_H diff --git a/src/lib/inc/string.h b/src/lib/inc/string.h new file mode 100644 index 0000000..c97fada --- /dev/null +++ b/src/lib/inc/string.h @@ -0,0 +1,10 @@ +// MIT License, Copyright (c) 2020 Marvin Borner + +#ifndef STRING_H +#define STRING_H + +#include <def.h> + +u32 strlen(const char *str); + +#endif diff --git a/src/lib/string.c b/src/lib/string.c new file mode 100644 index 0000000..1b7a2b8 --- /dev/null +++ b/src/lib/string.c @@ -0,0 +1,11 @@ +// MIT License, Copyright (c) 2020 Marvin Borner + +#include <def.h> + +u32 strlen(const char *str) +{ + u32 len = 0; + while (str[len]) + len++; + return len; +} |