diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2010-12-10 01:26:08 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2010-12-10 01:26:08 -0500 |
commit | f8ff3e5854b6bd4b61061b6d521619e076623183 (patch) | |
tree | 234e556de09a7f967adb5474f19919d93eb24b3a | |
parent | 659a5bde39aaf66c564d74f26764d9cad14744da (diff) | |
download | NetNuke2-f8ff3e5854b6bd4b61061b6d521619e076623183.tar.gz |
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
-rw-r--r-- | src/nukectl.c | 6 | ||||
-rw-r--r-- | 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 <unistd.h> #include <errno.h> #include <time.h> +#include <pthread.h> #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]; |