user input now handled through function pointers, now defined in config.h

This commit is contained in:
nova
2025-06-15 20:14:53 +02:00
parent d2bde3a31c
commit 7c9af0d340
5 changed files with 82 additions and 48 deletions

8
main.c
View File

@ -6,9 +6,9 @@
#include <sys/sysinfo.h>
#include "threading.h"
#include "window.h"
#include "interactions.h"
#include "defines.h"
#include "colors.h"
#include "interactions.h"
unsigned int terminal_height;
unsigned int terminal_width;
@ -24,7 +24,7 @@ void render_pass(WINDOW *wint, WINDOW *winb, WINDOW *winl, WINDOW *winm, WINDOW
void init();
int main() {
int main(){
init();
@ -54,11 +54,13 @@ int main() {
}
if (status & STATUS_RUN_BACKEND || threading) {
if (threading) {
/* temporary comment, somehow stops timing related crashes
pthread_cancel(thread_t);
pthread_cancel(thread_b);
pthread_cancel(thread_l);
pthread_cancel(thread_m);
pthread_cancel(thread_r);
*/
threading = 0;
status &= ~STATUS_RUN_BACKEND;
status &= ~STATUS_RELOAD_DIRECTORY;
@ -73,7 +75,7 @@ int main() {
}
}
if ((input = getch())) {
user_interactions(&input, &status, &settings);
user_interactions(&input);
timeout_time = 5;
} else {
timeout_time += 10;