#ifndef N_OS_TR_TUI_H
#define N_OS_TR_TUI_H

#include <stddef.h>

#define N_OS_TR_TUI_VERSION "0.2.0"

#define NOSTR_TUI_MAX_MNEMONIC 256
#define NOSTR_TUI_MAX_NPUB 128
#define N_OS_TR_TUI_MAX_SERVICES 16

#define N_OS_TR_TUI_OK 0
#define N_OS_TR_TUI_ERR 1

typedef struct {
    char key;
    char unit[64];
    char label[64];
    int default_on;
    char deps[128];
    int desired_on;
} service_entry_t;

int services_conf_load(const char* path, service_entry_t* out, size_t max, size_t* out_count);
int services_conf_load_fallback(service_entry_t* out, size_t max, size_t* out_count);

int systemd_is_simulation_mode(void);
int systemd_unit_is_active(const char* unit, int* is_active);
int systemd_unit_start(const char* unit, char* err_out, size_t err_out_len);
int systemd_unit_stop(const char* unit, char* err_out, size_t err_out_len);

#endif /* N_OS_TR_TUI_H */
