This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
stellar-stellar-2022/sdk/include/plugin.h

38 lines
1.3 KiB
C
Raw Normal View History

#ifndef _PLUGIN_H
#define _PLUGIN_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include "session.h"
2022-07-27 18:32:22 +08:00
typedef int plugin_init_callback(void);
typedef void plugin_exit_callback(void);
2022-07-27 15:51:07 +08:00
2022-07-27 18:32:22 +08:00
/******************************************************************************
* Public API For Plugin
2022-07-27 18:32:22 +08:00
******************************************************************************/
/*
* The pm_session_dettach_me just sets the flag to disable this plugin and no longer call this event callback.
* Before calling pm_session_dettach_me, the current plugin must release related resources for the current session.
*/
void pm_session_dettach_me(const struct stellar_session *session);
/*
* The current plugin takes over the current session, the pm_session_take_over setting flag disables other plugins,
* and the current session does not call other plugins except for the SESSION_EVENT_CLOSING event.
*
* The current plugin may be taken over while the session is open (SESSION_EVENT_OPENING),
* other plugins event_cb is not called, the session pme on other plugins is NULL,
* When the session is closed (SESSION_EVENT_CLOSING), call other plugin even_cb to destroy pme must check if pme is NULL.
*/
void pm_session_take_over(const struct stellar_session *session);
#ifdef __cpluscplus
}
#endif
#endif