From f8ff3e5854b6bd4b61061b6d521619e076623183 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 10 Dec 2010 01:26:08 -0500 Subject: Dual window testing (sad attempt so far) A new variable will need to be introduced to track how many devices there are, so that we know how many rows to increment while printing --- src/nukectl.c | 6 +++++- src/output_redirect.c | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/nukectl.c b/src/nukectl.c index 3ee3bc5..de6b28d 100644 --- a/src/nukectl.c +++ b/src/nukectl.c @@ -59,6 +59,8 @@ void ignore_device(char** list, nndevice_t** d) void* wipe(void* device) { + extern WINDOW* main_window, *info_window; + extern pthread_mutex_t main_window_lock; nndevice_t* d = (nndevice_t*)device; unsigned long long times = 0; unsigned long long block = 0; @@ -91,7 +93,9 @@ void* wipe(void* device) if(verbose_flag) { percent = (long double)((bytes_out / (long double)d->sz) * 100); - printf("%s: %llu of %llu (%0.2Lf%%)\n", d->path, bytes_out, d->sz, percent); + //COM(self, "%s: %llu of %llu (%0.2Lf%%)\n", d->path, bytes_out, d->sz, percent); + mvwprintw(info_window, 0, 0, "%s: %llu of %llu (%0.2Lf%%)\n", d->path, bytes_out, d->sz, percent); + wrefresh(info_window); } bytes_out += nnwrite(fd, d->blksz); block++; diff --git a/src/output_redirect.c b/src/output_redirect.c index 8384270..f29bbea 100644 --- a/src/output_redirect.c +++ b/src/output_redirect.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "netnuke.h" extern int logging_flag; @@ -40,9 +41,10 @@ int nnlogcleanup() return status; } +extern WINDOW* main_window; +extern pthread_mutex_t main_window_lock; int COM(const char* func, char *format, ...) { - extern WINDOW* main_window; struct tm *logtm; time_t logtime = time(NULL); char timestr[64]; -- cgit