once again switched to complex data types, basic file coloring implemented
This commit is contained in:
32
window.c
32
window.c
@ -4,16 +4,15 @@
|
||||
|
||||
extern unsigned int status;
|
||||
|
||||
extern char *mid_content;
|
||||
extern unsigned long *mid_width;
|
||||
extern unsigned long *mid_length_width;
|
||||
extern unsigned long *mid_file_name_width;
|
||||
extern file *mid_content;
|
||||
extern file *lft_content;
|
||||
extern file *rgt_content;
|
||||
extern char *top_content;
|
||||
extern unsigned long *top_length_width;
|
||||
extern char *lft_content;
|
||||
extern unsigned long *lft_width;
|
||||
extern unsigned long *lft_length_width;
|
||||
extern unsigned long *lft_file_name_width;
|
||||
|
||||
extern unsigned long lft_file_count;
|
||||
extern unsigned long mid_file_count;
|
||||
extern unsigned long rgt_file_count;
|
||||
extern unsigned long top_width;
|
||||
|
||||
extern pthread_mutex_t mutex_top;
|
||||
extern pthread_mutex_t mutex_btm;
|
||||
@ -30,7 +29,7 @@ void window_top(WINDOW *win){
|
||||
status |= STATUS_UPDATE_SCREEN_0;
|
||||
|
||||
} else {
|
||||
for (i = 0; i<top_length_width[1]; i++) {
|
||||
for (i = 0; i < top_width; i++) {
|
||||
mvwprintw(win, 0, i, "%c", top_content[i]);
|
||||
}
|
||||
pthread_mutex_unlock(&mutex_top);
|
||||
@ -55,8 +54,7 @@ void window_lft(WINDOW *win){
|
||||
status |= STATUS_UPDATE_SCREEN_0;
|
||||
|
||||
} else {
|
||||
mvwprintw(win, local_height/2, local_width/2, "%ld %ld", lft_length_width[0], lft_length_width[1]);
|
||||
print_dir(win, lft_length_width, lft_file_name_width, lft_content);
|
||||
print_dir(win, &lft_file_count, lft_content);
|
||||
pthread_mutex_unlock(&mutex_lft);
|
||||
}
|
||||
}
|
||||
@ -72,8 +70,7 @@ void window_mid(WINDOW *win){
|
||||
status |= STATUS_UPDATE_SCREEN_0;
|
||||
|
||||
} else {
|
||||
mvwprintw(win, local_height/2, local_width/2, "%ld %ld", mid_length_width[0], mid_length_width[1]);
|
||||
print_dir(win, mid_length_width, mid_file_name_width, mid_content);
|
||||
print_dir(win, &mid_file_count, mid_content);
|
||||
pthread_mutex_unlock(&mutex_mid);
|
||||
}
|
||||
}
|
||||
@ -81,8 +78,15 @@ void window_rgt(WINDOW *win){
|
||||
werase(win);
|
||||
box(win, 0, 0);
|
||||
|
||||
unsigned long local_width;
|
||||
unsigned long local_height;
|
||||
getmaxyx(win, local_height, local_width);
|
||||
if (pthread_mutex_trylock(&mutex_rgt)) {
|
||||
} else {
|
||||
/*
|
||||
pthread_mutex_unlock(&mutex_rgt);
|
||||
mvwprintw(win, local_height/2, local_width/2, "%ld %ld", rgt_length_width[0], rgt_length_width[1]);
|
||||
print_dir(win, rgt_length_width, rgt_file_name_width, rgt_content);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user