2ee668605fe03a046c1809c851f94eb39d09218a
[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 void file_error();
14 extern char prompt[256];
15
16 void help() {
17         printf("Possible commands to run:\n"
18                "  draw_nanwan:      Draw a picture of Nanwan, our mascot giraffe\n"
19                "  clear_screen:     Clear the Screen\n"
20                "  change_user:      Change Username\n"
21                "  file_io:          Run File Related IO Tests\n"
22                "  file_error:       Run File Error Related Tests\n"
23               );
24 }
25
26 int main(int argc, char** argv)
27 {       
28         set_default_user();
29         printf("Welcome to the Tessellation OS newlib test suite!\n");
30         printf("Enter at you're own risk....\n");
31         clrscrn(2);
32         while(1) {
33                 char* s = readline(prompt);
34
35                 if (s == NULL)
36                         continue;
37
38                 if(strcmp(s, "draw_nanwan") == 0)
39                         draw_nanwan();          
40                 else if(strcmp(s, "clear_screen") == 0)
41                         clrscrn(0);             
42                 else if (strcmp(s, "change_user") == 0)
43                         change_user();
44                 else if (strcmp(s, "file_io") == 0)
45                         file_io();
46                 else if (strcmp(s, "file_error") == 0)
47                         file_error();
48                 else
49                         help(); 
50
51         }       
52         return 0;
53 }