last commit before large rewrite
This commit is contained in:
25
main.c
25
main.c
@ -15,9 +15,9 @@ unsigned int settings;
|
||||
unsigned int file_modifiers;
|
||||
unsigned int status; //bit 0 = enable
|
||||
unsigned short cpu_cores; //amount of cores/threads the host system reports to have
|
||||
char **content_l; //content of parent dir, used in left window
|
||||
char **content_m; //content of current dir, used in main window
|
||||
char **content_r; //content of child dir, used in right window
|
||||
file_data *content_l; //content of parent dir, used in left window
|
||||
file_data *content_m; //content of current dir, used in main window
|
||||
file_data *content_r; //content of child dir, used in right window
|
||||
char *path = ".";
|
||||
char input = 0;
|
||||
|
||||
@ -52,7 +52,8 @@ int main() {
|
||||
pthread_join(populate_l, NULL);
|
||||
pthread_join(populate_m, NULL);
|
||||
pthread_join(populate_r, NULL);
|
||||
status ^= STATUS_UPDATE_SCREEN_0;
|
||||
status ^= STATUS_RUN_BACKEND;
|
||||
status |= STATUS_UPDATE_SCREEN_0;
|
||||
}
|
||||
|
||||
|
||||
@ -67,12 +68,13 @@ int main() {
|
||||
}
|
||||
|
||||
wmove(stdscr,0,0);
|
||||
status &= ~STATUS_UPDATE_SCREEN_MASK;
|
||||
//status &= ~STATUS_UPDATE_SCREEN_MASK;
|
||||
status = 0;
|
||||
}
|
||||
|
||||
|
||||
if ((input = getch())) {
|
||||
user_interactions(&input, &status, &settings, &file_modifiers);
|
||||
user_interactions(&input, &status, &settings);
|
||||
}
|
||||
}
|
||||
free(content_l);
|
||||
@ -88,11 +90,12 @@ int main() {
|
||||
void init() {
|
||||
|
||||
cpu_cores = get_nprocs();
|
||||
file_modifiers ^= FILE_MODIFIERS_HIDDEN_FILES;
|
||||
status ^= STATUS_RUN_BACKEND;
|
||||
//file_modifiers = (FILE_MODIFIERS_HIDDEN_FILES | FILE_MODIFIERS_SORT_BITMASK);
|
||||
file_modifiers = FILE_MODIFIERS_SORT_BITMASK;
|
||||
status = (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_0);
|
||||
|
||||
content_l = calloc(1, sizeof(*content_l)); //allocation in order to allow a more streamlined backend
|
||||
content_m = calloc(1, sizeof(*content_m));
|
||||
content_r = calloc(1, sizeof(*content_r));
|
||||
content_l = (file_data*)calloc(1, sizeof(file_data)); //allocation in order to allow a more streamlined backend
|
||||
content_m = (file_data*)calloc(1, sizeof(file_data));
|
||||
content_r = (file_data*)calloc(1, sizeof(file_data));
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user