C userspace programs
This commit is contained in:
11
ulib/string/string.c
Normal file
11
ulib/string/string.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include <stddef.h>
|
||||
#include <string/string.h>
|
||||
|
||||
size_t string_len(const char *s) {
|
||||
size_t l = 0;
|
||||
while (*s != '\0') {
|
||||
l++;
|
||||
s++;
|
||||
}
|
||||
return l;
|
||||
}
|
8
ulib/string/string.h
Normal file
8
ulib/string/string.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef ULIB_STRING_STRING_H_
|
||||
#define ULIB_STRING_STRING_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
size_t string_len(const char *s);
|
||||
|
||||
#endif // ULIB_STRING_STRING_H_
|
Reference in New Issue
Block a user