aboutsummaryrefslogtreecommitdiff
path: root/src/libc/stdio.c
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-04-09 10:29:23 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-04-09 10:29:23 +0200
commitf6323421e22c3585c58b54658a11e1e4706cc8fa (patch)
treef317b7129dc4350fd088b59a43c1b6e80cd5c39b /src/libc/stdio.c
parent8fee35522dee033863f68c1d2b45f5fe988de9eb (diff)
Cleaning code and provide minimal libc
Diffstat (limited to 'src/libc/stdio.c')
-rw-r--r--src/libc/stdio.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/libc/stdio.c b/src/libc/stdio.c
new file mode 100644
index 0000000..6e0063b
--- /dev/null
+++ b/src/libc/stdio.c
@@ -0,0 +1,25 @@
+#include "stdio.h"
+#include "string.h"
+
+extern VIDEO_STATE VS;
+
+void print(char *str){
+ int i=0;
+ while(str[i]!='\0'){
+ putchar(str[i]);
+ i++;
+ }
+}
+
+void printc(char* str,VIDEO_COLORS c){
+ VIDEO_COLORS backup=VS.fg;
+ VS.fg=c;
+ print(str);
+ VS.fg=backup;
+}
+
+void printi(int i){
+ char str[12];
+ itoa(i,str);
+ print(str);
+} \ No newline at end of file