config.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * config.h
  3. */
  4. #ifndef _clish_config_h
  5. #define _clish_config_h
  6. #include "lub/types.h"
  7. typedef struct clish_config_s clish_config_t;
  8. /* Possible CONFIG operations */
  9. typedef enum {
  10. CLISH_CONFIG_NONE,
  11. CLISH_CONFIG_SET,
  12. CLISH_CONFIG_UNSET,
  13. CLISH_CONFIG_DUMP
  14. } clish_config_op_e;
  15. /*=====================================
  16. * COMMAND INTERFACE
  17. *===================================== */
  18. /*-----------------
  19. * meta functions
  20. *----------------- */
  21. clish_config_t *clish_config_new(void);
  22. /*-----------------
  23. * methods
  24. *----------------- */
  25. void clish_config_delete(clish_config_t *instance);
  26. void clish_config_dump(const clish_config_t *instance);
  27. /*-----------------
  28. * attributes
  29. *----------------- */
  30. void clish_config__set_op(clish_config_t *instance, clish_config_op_e op);
  31. clish_config_op_e clish_config__get_op(const clish_config_t *instance);
  32. void clish_config__set_priority(clish_config_t *instance, unsigned short priority);
  33. unsigned short clish_config__get_priority(const clish_config_t *instance);
  34. void clish_config__set_pattern(clish_config_t *instance, const char *pattern);
  35. char *clish_config__get_pattern(const clish_config_t *instance);
  36. void clish_config__set_file(clish_config_t *instance, const char *file);
  37. char *clish_config__get_file(const clish_config_t *instance);
  38. void clish_config__set_splitter(clish_config_t *instance, bool_t splitter);
  39. bool_t clish_config__get_splitter(const clish_config_t *instance);
  40. void clish_config__set_seq(clish_config_t *instance, const char *seq_num);
  41. const char *clish_config__get_seq(const clish_config_t *instance);
  42. bool_t clish_config__get_unique(const clish_config_t *instance);
  43. void clish_config__set_unique(clish_config_t *instance, bool_t unique);
  44. void clish_config__set_depth(clish_config_t *instance, const char *depth);
  45. const char *clish_config__get_depth(const clish_config_t *instance);
  46. #endif /* _clish_config_h */