Commit fca15660 by malcolm

Moved strlen to string.h

parent f98f0cda
......@@ -22,3 +22,10 @@ void itoa(int n, char s[])
s[i] = '\0';
//reverse(s);
}
size_t strlen(const char* str) {
size_t ret = 0;
while ( str[ret] != 0 )
ret++;
return ret;
}
......@@ -4,5 +4,6 @@
void* memset(void *s, int c, size_t n);
void itoa(int n, char s[]);
size_t strlen(const char* str);
#endif
......@@ -16,13 +16,6 @@ uint16_t make_vgaentry(char c, uint8_t color) {
return c16 | color16 << 8;
}
size_t strlen(const char* str) {
size_t ret = 0;
while ( str[ret] != 0 )
ret++;
return ret;
}
static const size_t VGA_WIDTH = 80;
static const size_t VGA_HEIGHT = 25;
......
......@@ -6,7 +6,7 @@
#include <stdint.h>
#include <stddef.h>
#include "string.h"
/* Hardware text mode color constants. */
enum vga_color {
COLOR_BLACK = 0,
......@@ -29,7 +29,6 @@ enum vga_color {
uint8_t make_color(enum vga_color fg, enum vga_color bg);
uint16_t make_vgaentry(char c, uint8_t color);
size_t strlen(const char* str);
void terminal_initialize();
void terminal_setcolor(uint8_t color);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment