1

move user stuff to user

This commit is contained in:
2022-07-11 19:29:42 +02:00
parent 996a45d7f8
commit ec084d3aca
4 changed files with 5 additions and 9 deletions

23
c_os/user/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