ksym.h 562 B

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