private.h 705 B

12345678910111213141516171819202122232425262728
  1. #ifndef VERSION
  2. #define VERSION "1.0.0"
  3. #endif
  4. #define LOG_NAME "klishd"
  5. #define DEFAULT_PIDFILE "/var/run/klishd.pid"
  6. #define DEFAULT_CFGFILE "/etc/klish/klishd.conf"
  7. /** @brief Command line and config file options
  8. */
  9. struct options {
  10. char *pidfile;
  11. char *cfgfile;
  12. char *unix_socket_path;
  13. bool_t cfgfile_userdefined;
  14. bool_t foreground; // Don't daemonize
  15. bool_t verbose;
  16. int log_facility;
  17. };
  18. // Options and config file
  19. void help(int status, const char *argv0);
  20. struct options *opts_init(void);
  21. void opts_free(struct options *opts);
  22. int opts_parse(int argc, char *argv[], struct options *opts);
  23. int opts_show(struct options *opts);
  24. int config_parse(const char *cfgfile, struct options *opts);