/** @file kcontext_base.h * * @brief Klish base context to pass to plugin's functions */ #ifndef _klish_kcontext_base_h #define _klish_kcontext_base_h #include typedef struct kcontext_s kcontext_t; typedef enum { KCONTEXT_NONE, // Context for plugin initialization KCONTEXT_PLUGIN_INIT, // Context for plugin finalization KCONTEXT_PLUGIN_FINI, // Context for command's action KCONTEXT_ACTION, // Context for service actions like PTYPE, COND, etc. KCONTEXT_SERVICE_ACTION, } kcontext_type_e; C_DECL_BEGIN kcontext_t *kcontext_new(kcontext_type_e type); void kcontext_free(kcontext_t *context); kcontext_type_e kcontext_type(const kcontext_t *context); bool_t kcontext_set_type(kcontext_t *context, kcontext_type_e type); C_DECL_END #endif // _klish_kcontext_base_h