summaryrefslogtreecommitdiff
path: root/src/user/test
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-19 09:23:48 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-19 09:23:48 +0200
commit7b466345af0d3a7dc5622617ce443a90c64e34a4 (patch)
treef276b6bf391ccfe8ec3a2cb62a7f70964249621f /src/user/test
parentac10c1a29c44b0cb29960cd0f792c7361bc430ce (diff)
downloadTCE-7b466345af0d3a7dc5622617ce443a90c64e34a4.tar.gz
TCE-7b466345af0d3a7dc5622617ce443a90c64e34a4.zip
Added ANSI support, minimal readline-like library.
Diffstat (limited to 'src/user/test')
-rw-r--r--src/user/test/main.c56
1 files changed, 1 insertions, 55 deletions
diff --git a/src/user/test/main.c b/src/user/test/main.c
index 3457ac3..7ca4802 100644
--- a/src/user/test/main.c
+++ b/src/user/test/main.c
@@ -34,57 +34,6 @@ void thread_cascade(void* d) {
threads--;
}
-void list_dir(FILE f, int lv) {
- char buf[256];
- int i = 0, k;
- int r;
- file_info info;
-
- while ((r = read(f, i, 256, buf)) > 0) {
- if (strcmp(buf, ".") == 0 || strcmp(buf, "..") == 0) {
- i++;
- continue;
- }
- for (k = 0; k < lv; k++) print(" ");
- print(buf);
- stat_relative(f, buf, &info);
- if (info.type & FT_DIR) print("/");
- print(" \t");
-
- if (info.type & FT_FILE) print("file ");
- if (info.type & FT_DIR) print("dir ");
- if (info.type & FT_SYMLINK) print("symlink ");
- if (info.type & FT_DEV) print("dev ");
- if (info.type & FT_TERMINAL) print("term ");
-
- if (info.type & FT_DIR) {
- print(" \t");
- FILE ff = open_relative(f, buf, 0);
- if (ff <= 0) {
- printf("error: %i\n", ff);
- } else {
- printf("fd: %i\n", ff);
- list_dir(ff, lv+1);
- close(ff);
- }
- } else {
- print("\n");
- }
- i++;
- }
-}
-
-void list_root() {
- FILE f = open("/", 0);
- if (f <= 0) {
- printf(" -> Could not open '/', error #%i\n", f);
- } else {
- printf("Now enumerating '/' (fd %i) :\n", f);
- list_dir(f, 1);
- close(f);
- }
-}
-
int main(char** args) {
char**a;
if (args != 0) {
@@ -103,10 +52,7 @@ int main(char** args) {
thread_sleep(100);
if (threads == 0) break;
}
- printk("\n");
-
- term = open("/.ui/klog", 0);
- list_root();
+ printk("\n -> Test process exiting. Press the super key to go to the home terminal.\n");
return 0;
}