var.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef _clish_var_h
  2. #define _clish_var_h
  3. #include "lub/types.h"
  4. #include "lub/bintree.h"
  5. typedef struct clish_var_s clish_var_t;
  6. typedef char *clish_var_expand_fn_t(const char *str, void *context);
  7. char *clish_var_expand_default(const char *str, void *context);
  8. /*=====================================
  9. * VAR INTERFACE
  10. *===================================== */
  11. /*-----------------
  12. * meta functions
  13. *----------------- */
  14. int clish_var_bt_compare(const void *clientnode, const void *clientkey);
  15. void clish_var_bt_getkey(const void *clientnode, lub_bintree_key_t * key);
  16. size_t clish_var_bt_offset(void);
  17. clish_var_t *clish_var_new(const char *name);
  18. /*-----------------
  19. * methods
  20. *----------------- */
  21. void clish_var_delete(clish_var_t *instance);
  22. void clish_var_dump(const clish_var_t *instance);
  23. /*-----------------
  24. * attributes
  25. *----------------- */
  26. const char *clish_var__get_name(const clish_var_t *instance);
  27. void clish_var__set_dynamic(clish_var_t *instance, bool_t defval);
  28. bool_t clish_var__get_dynamic(const clish_var_t *instance);
  29. void clish_var__set_value(clish_var_t *instance, const char *value);
  30. char *clish_var__get_value(const clish_var_t *instance);
  31. #endif /* _clish_var_h */