conf.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * conf.h
  3. */
  4. /**
  5. \ingroup clish
  6. \defgroup clish_conf config
  7. @{
  8. \brief This class is a config in memory container.
  9. Use it to implement config in memory.
  10. */
  11. #ifndef _cliconf_h
  12. #define _cliconf_h
  13. #include <stdio.h>
  14. #include "cliconf/conf/private.h"
  15. #include "lub/types.h"
  16. #include "lub/bintree.h"
  17. typedef struct cliconf_s cliconf_t;
  18. /*=====================================
  19. * CONF INTERFACE
  20. *===================================== */
  21. /*-----------------
  22. * meta functions
  23. *----------------- */
  24. cliconf_t *cliconf_new(const char * line, unsigned short priority);
  25. int cliconf_bt_compare(const void *clientnode, const void *clientkey);
  26. void cliconf_bt_getkey(const void *clientnode, lub_bintree_key_t * key);
  27. size_t cliconf_bt_offset(void);
  28. /*-----------------
  29. * methods
  30. *----------------- */
  31. void cliconf_delete(cliconf_t * instance);
  32. void cliconf_fprintf(cliconf_t * instance, FILE * stream,
  33. const char *pattern,
  34. int depth, unsigned char prev_pri_hi);
  35. cliconf_t *cliconf_new_conf(cliconf_t * instance,
  36. const char *line, unsigned short priority);
  37. cliconf_t *cliconf_find_conf(cliconf_t * instance,
  38. const char *line, unsigned short priority);
  39. void cliconf_del_pattern(cliconf_t *this,
  40. const char *pattern);
  41. /*-----------------
  42. * attributes
  43. *----------------- */
  44. unsigned cliconf__get_depth(const cliconf_t * instance);
  45. unsigned short cliconf__get_priority(const cliconf_t * instance);
  46. unsigned char cliconf__get_priority_hi(const cliconf_t * instance);
  47. unsigned char cliconf__get_priority_lo(const cliconf_t * instance);
  48. bool_t cliconf__get_splitter(const cliconf_t * instance);
  49. void cliconf__set_splitter(cliconf_t *instance, bool_t splitter);
  50. #endif /* _cliconf_h */
  51. /** @} clish_conf */