private.h 778 B

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