oops many changes

This commit is contained in:
sankalp committed 2025-10-13 23:03:22 +05:45
1 parent 028785ac27
commit 4343cf56bf
25 files changed
+1413 -1234

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
#ifndef KEYVIBE_CLI_H
#define KEYVIBE_CLI_H
typedef struct {
char *sound;
char *mouse_sound;
int volume;
int keyboard_volume;
int mouse_volume;
int daemon_flag;
int stop_flag;
int list_flag;
int verbose;
int keyboard_mute; // -1 unchanged, 0 unmute, 1 mute
int mouse_mute; // -1 unchanged, 0 unmute, 1 mute
} CliOptions;
void print_usage(const char *program_name);
int parse_cli(int argc, char **argv, CliOptions *out);
#endif // KEYVIBE_CLI_H
+23
View File
@@ -0,0 +1,23 @@
#ifndef KEYVIBE_PROCESS_H
#define KEYVIBE_PROCESS_H
#include <signal.h>
#include <sys/types.h>
extern pid_t keyboard_pid;
extern pid_t sound_pid;
extern char pidfile_path[];
extern int is_daemon;
extern volatile sig_atomic_t reload_requested;
void cleanup_processes(int sig);
int require_running_pid(pid_t *out_pid);
void daemonize_self(void);
void stop_children(void);
int start_children(const char *sound_dir, const char *config_path, int volume,
int verbose, int mute, const char *mouse_sound_dir,
const char *mouse_config_path, int mouse_volume,
int keyboard_mute, int mouse_mute);
void handle_sighup(int sig);
#endif // KEYVIBE_PROCESS_H
+15
View File
@@ -0,0 +1,15 @@
#ifndef KEYVIBE_RELOAD_H
#define KEYVIBE_RELOAD_H
int handle_reload(const char *user_cfg_path,
char *current_sound_name, char *current_mouse_sound_name,
int *current_keyboard_volume, int *current_mouse_volume,
char *current_config_path, char *current_sound_dir,
char *current_mouse_config_path, char *current_mouse_sound_dir,
int current_mute, int current_verbose,
int current_mouse_volume_arg, int current_keyboard_mute,
int current_mouse_mute);
#endif // KEYVIBE_RELOAD_H
+6
View File
@@ -0,0 +1,6 @@
#ifndef KEYVIBE_WATCH_H
#define KEYVIBE_WATCH_H
int start_config_watcher(const char *path);
#endif // KEYVIBE_WATCH_H