mirror of https://github.com/0Nera/BMOSP.git
Добавление tool_strcpy
This commit is contained in:
parent
ad38cbda6b
commit
4bcd50a63f
|
@ -42,6 +42,7 @@ static inline void pause( ) {
|
|||
void tool_memcpy(void *dest, void *src, uint64_t n);
|
||||
void *tool_memset(void *ptr, uint8_t n, uint64_t size);
|
||||
uint64_t tool_strlen(const char *str);
|
||||
void tool_strcpy(char *dest, char *src);
|
||||
uint64_t tool_starts_with(const char *str, const char *prefix);
|
||||
void tool_format(void (*putc)(char c), const char *format_string, va_list args);
|
||||
|
||||
|
|
|
@ -32,6 +32,15 @@ uint64_t tool_strlen(const char *str) {
|
|||
return length;
|
||||
}
|
||||
|
||||
void tool_strcpy(char *dest, char *src) {
|
||||
uint64_t i = 0;
|
||||
while (src[i] != '\0') {
|
||||
dest[i] = src[i];
|
||||
i++;
|
||||
}
|
||||
dest[i] = '\0';
|
||||
}
|
||||
|
||||
uint64_t tool_starts_with(const char *str, const char *prefix) {
|
||||
uint64_t str_len = tool_strlen(str);
|
||||
uint64_t prefix_len = tool_strlen(prefix);
|
||||
|
|
Loading…
Reference in New Issue