1

renamings

This commit is contained in:
2022-07-16 00:58:14 +02:00
parent e1f7a7af82
commit ac4b1a05a8
2 changed files with 1 additions and 1 deletions

7
c_os/user/lib/MyLib.cc Executable file
View File

@ -0,0 +1,7 @@
#include "user/lib/MyLib.h"
void mmem::memset(char* destination, char value, unsigned int bytes) {
for (unsigned int byte = 0; byte < bytes; ++byte) {
*(destination + byte) = value;
}
}

23
c_os/user/lib/MyLib.h Executable file
View File

@ -0,0 +1,23 @@
#ifndef __MYSTDLIB_INCLUDE_H_
#define __MYSTDLIB_INCLUDE_H_
namespace mmem {
template<typename T>
void memcpy(T* destination, T* source, unsigned int count = 1) {
for (unsigned int i = 0; i < count; ++i) {
*(destination + i) = *(source + i);
}
}
void memset(char* destination, char value, unsigned int bytes);
template<typename T>
void zero(T* destination) {
mmem::memset((char*)destination, '\0', sizeof(T));
}
// void strcpy(char* destination, char* source);
// unsigned int strlen(char* string);
} // namespace mmem
#endif