kptype.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /** @file kptype.h
  2. *
  3. * @brief Klish scheme's "ptype" entry
  4. */
  5. #ifndef _klish_kptype_h
  6. #define _klish_kptype_h
  7. #include <faux/error.h>
  8. #include <klish/iptype.h>
  9. #include <klish/kaction.h>
  10. typedef struct kptype_s kptype_t;
  11. typedef enum {
  12. KPTYPE_ERROR_OK,
  13. KPTYPE_ERROR_INTERNAL,
  14. KPTYPE_ERROR_ALLOC,
  15. KPTYPE_ERROR_ATTR_NAME,
  16. KPTYPE_ERROR_ATTR_HELP,
  17. } kptype_error_e;
  18. C_DECL_BEGIN
  19. void kptype_free(kptype_t *ptype);
  20. bool_t kptype_parse(kptype_t *ptype, const iptype_t *info, kptype_error_e *error);
  21. kptype_t *kptype_new(const iptype_t *info, kptype_error_e *error);
  22. const char *kptype_strerror(kptype_error_e error);
  23. const char *kptype_name(const kptype_t *ptype);
  24. bool_t kptype_set_name(kptype_t *ptype, const char *name);
  25. const char *kptype_help(const kptype_t *ptype);
  26. bool_t kptype_set_help(kptype_t *ptype, const char *help);
  27. bool_t kptype_nested_from_iptype(kptype_t *kptype, iptype_t *iptype,
  28. faux_error_t *error_stack);
  29. kptype_t *kptype_from_iptype(iptype_t *iptype, faux_error_t *error_stack);
  30. C_DECL_END
  31. #endif // _klish_kptype_h