config.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * config.h
  3. */
  4. #ifndef _clish_config_h
  5. #define _clish_config_h
  6. #include "clish/macros.h"
  7. #include "lub/types.h"
  8. typedef struct clish_config_s clish_config_t;
  9. /* Possible CONFIG operations */
  10. typedef enum {
  11. CLISH_CONFIG_NONE,
  12. CLISH_CONFIG_SET,
  13. CLISH_CONFIG_UNSET,
  14. CLISH_CONFIG_DUMP
  15. } clish_config_op_e;
  16. clish_config_t *clish_config_new(void);
  17. void clish_config_delete(clish_config_t *instance);
  18. void clish_config_dump(const clish_config_t *instance);
  19. _CLISH_SET(config, clish_config_op_e, op);
  20. _CLISH_GET(config, clish_config_op_e, op);
  21. _CLISH_SET(config, unsigned short, priority);
  22. _CLISH_GET(config, unsigned short, priority);
  23. _CLISH_SET(config, bool_t, splitter);
  24. _CLISH_GET(config, bool_t, splitter);
  25. _CLISH_SET(config, bool_t, unique);
  26. _CLISH_GET(config, bool_t, unique);
  27. _CLISH_SET_STR_ONCE(config, pattern);
  28. _CLISH_GET_STR(config, pattern);
  29. _CLISH_SET_STR_ONCE(config, file);
  30. _CLISH_GET_STR(config, file);
  31. _CLISH_SET_STR_ONCE(config, seq);
  32. _CLISH_GET_STR(config, seq);
  33. _CLISH_SET_STR_ONCE(config, depth);
  34. _CLISH_GET_STR(config, depth);
  35. #endif /* _clish_config_h */