02910cd662a05c39a8443f3f4ed2856c8dd4db6e
[akaros.git] / user / apps / parlib / matrix.c
1 #include <stdlib.h>
2 #include <string.h>
3 #include <stdio.h>
4 #include <unistd.h>
5 #include <arch/types.h>
6
7 extern char * readline(const char *prompt);
8 extern void draw_nanwan();
9 extern void clrscrn(int leaverows);
10 extern void change_user();
11 extern void set_default_user();
12 extern void file_io();
13 extern char prompt[256];
14
15 void help() {
16         printf("Possible commands to run:\n"
17                "  draw_nanwan:      Draw a picture of Nanwan, our mascot giraffe\n"
18                "  clear_screen:     Clear the Screen\n"
19                "  change_user:      Change Username\n"
20                "  file_io:          Run File Related IO Tests\n"
21               );
22 }
23
24 int main(int argc, char** argv)
25 {       
26         set_default_user();
27         printf("Welcome to the Tessellation OS newlib test suite!\n");
28         printf("Enter at you're own risk....\n");
29         clrscrn(2);
30         while(1) {
31                 char* s = readline(prompt);
32
33                 if (s == NULL)
34                         continue;
35
36                 if(strcmp(s, "draw_nanwan") == 0)
37                         draw_nanwan();          
38                 else if(strcmp(s, "clear_screen") == 0)
39                         clrscrn(0);             
40                 else if (strcmp(s, "change_user") == 0)
41                         change_user();
42                 else if (strcmp(s, "file_io") == 0)
43                         file_io();
44                 else
45                         help(); 
46
47         }       
48         return 0;
49 }