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

View File

@ -1,7 +1,3 @@
#ifndef CONFIG_GUARD
#define CONFIG_GUARD
#include "config.h"
#endif
#define STATUS_QUIT_PROGRAM 1
#define STATUS_RUN_BACKEND 2
@ -52,9 +48,9 @@
#define FILE_TYPE_ORPHAN COLOR_ORPHAN
#define FILE_TYPE_OPEN_FILE 128 /* this is only used in rgt_content to print a file preview, not the dir */
#ifndef STRUCT_GUARD
#define STRUCT_GUARD
/* complex types are good actually */
typedef struct File {
char status;
@ -68,11 +64,14 @@ typedef struct Color {
char *file_extension;
short color_pair;
} color;
typedef struct File_preview {
char *file_extension;
char *command; /* this will blindly execute any inserted shell command */
/* commands with an '&' prefix are inbuild */
} file_preview;
typedef struct Mimetype {
char *mimetype;
char *command;
} mimetype;
typedef struct Binding {
char key;
void (*func)();
} binding;
#endif