tree.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * conf.h
  3. */
  4. #ifndef _konf_tree_h
  5. #define _konf_tree_h
  6. #include <stdio.h>
  7. #include "lub/types.h"
  8. #include "lub/list.h"
  9. typedef struct konf_tree_s konf_tree_t;
  10. #define KONF_ENTRY_OK 0xffff
  11. #define KONF_ENTRY_DIRTY 0xfffe
  12. #define KONF_ENTRY_NEW 0xfffd
  13. konf_tree_t *konf_tree_new(const char *line, unsigned short priority);
  14. void konf_tree_delete(void *instance);
  15. void konf_tree_fprintf(konf_tree_t * instance, FILE * stream,
  16. const char *pattern, int top_depth, int depth,
  17. bool_t seq, bool_t splitter, unsigned char prev_pri_hi);
  18. konf_tree_t *konf_tree_new_conf(konf_tree_t * instance,
  19. const char *line, unsigned short priority,
  20. bool_t seq, unsigned short seq_num);
  21. konf_tree_t *konf_tree_find_conf(konf_tree_t * instance,
  22. const char *line, unsigned short priority, unsigned short sequence);
  23. int konf_tree_del_pattern(konf_tree_t * instance,
  24. const char *line, bool_t unique,
  25. const char *pattern, unsigned short priority,
  26. bool_t seq, unsigned short seq_num);
  27. unsigned short konf_tree__get_priority(const konf_tree_t * instance);
  28. unsigned char konf_tree__get_priority_hi(const konf_tree_t * instance);
  29. unsigned char konf_tree__get_priority_lo(const konf_tree_t * instance);
  30. bool_t konf_tree__get_splitter(const konf_tree_t * instance);
  31. void konf_tree__set_splitter(konf_tree_t *instance, bool_t splitter);
  32. unsigned short konf_tree__get_seq_num(const konf_tree_t * instance);
  33. void konf_tree__set_seq_num(konf_tree_t * instance, unsigned short seq_num);
  34. unsigned short konf_tree__get_sub_num(const konf_tree_t * instance);
  35. void konf_tree__set_sub_num(konf_tree_t * instance, unsigned short sub_num);
  36. const char * konf_tree__get_line(const konf_tree_t * instance);
  37. void konf_tree__set_depth(konf_tree_t * instance, int depth);
  38. int konf_tree__get_depth(const konf_tree_t * instance);
  39. #endif /* _konf_tree_h */