ksym.h 516 B

1234567891011121314151617181920212223242526272829
  1. /** @file ksym.h
  2. *
  3. * @brief Klish symbol
  4. */
  5. #ifndef _klish_ksym_h
  6. #define _klish_ksym_h
  7. #include <klish/kcontext_base.h>
  8. typedef struct ksym_s ksym_t;
  9. // Callback function prototype
  10. typedef int (*ksym_fn)(kcontext_t *context);
  11. C_DECL_BEGIN
  12. // ksym_t
  13. ksym_t *ksym_new(const char *name, ksym_fn function);
  14. void ksym_free(ksym_t *sym);
  15. const char *ksym_name(const ksym_t *sym);
  16. ksym_fn ksym_function(const ksym_t *sym);
  17. bool_t ksym_set_function(ksym_t *sym, ksym_fn fn);
  18. C_DECL_END
  19. #endif // _klish_ksym_h