C userspace programs

This commit is contained in:
2025-09-04 23:20:30 +02:00
parent afa4d383e0
commit 90266f044b
51 changed files with 259 additions and 174 deletions

11
ulib/string/string.c Normal file
View 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
View 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_