Added stubs for additional newlib system calls
[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 <ros/common.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 void run_binary();
15 extern void run_binary_colored();
16 extern char prompt[256];
17
18 void help() {
19         printf("Possible commands to run:\n"
20                "  draw_nanwan:      Draw a picture of Nanwan, our mascot giraffe\n"
21                "  clear_screen:     Clear the Screen\n"
22                "  change_user:      Change Username\n"
23            "  file_io:          Run File Related IO Tests\n"
24            "  file_error:       Run File Error Related Tests\n"
25            "  run_binary:       Load and run a binary located on the remote server\n"
26            "  run_binary_colored:       Load and run a binary located on the remote server with a specified number of page colors\n"
27               );
28 }
29
30 int main(int argc, char** argv)
31 {       
32         set_default_user();
33         printf("Welcome to the Tessellation OS newlib test suite!\n");
34         printf("Enter at your own risk....\n");
35         clrscrn(2);
36         while(1) {
37                 char* s = readline(prompt);
38
39                 if (s == NULL)
40                         continue;
41
42                 if(strcmp(s, "draw_nanwan") == 0)
43                         draw_nanwan();          
44                 else if(strcmp(s, "clear_screen") == 0)
45                         clrscrn(0);             
46                 else if (strcmp(s, "change_user") == 0)
47                         change_user();
48                 else if (strcmp(s, "file_io") == 0)
49                         file_io();
50                 else if (strcmp(s, "file_error") == 0)
51                         file_error();
52                 else if (strcmp(s, "run_binary") == 0)
53                         run_binary();
54                 else if (strcmp(s, "run_binary_colored") == 0)
55                         run_binary_colored();
56                 else
57                         help(); 
58
59         }       
60         return 0;
61 }