|
|
@ -83,8 +83,11 @@ AUTODATA_TYPE(hooks, struct plugin_hook); |
|
|
|
|
|
|
|
/* Do not call this directly, rather use the `plugin_hook_call_name`
|
|
|
|
* wrappers generated by the `PLUGIN_HOOK_REGISTER` macro. |
|
|
|
* |
|
|
|
* Returns true if callback called immediately, otherwise false if it's |
|
|
|
* still waiting on a plugin response. |
|
|
|
*/ |
|
|
|
void plugin_hook_call_(struct lightningd *ld, const struct plugin_hook *hook, |
|
|
|
bool plugin_hook_call_(struct lightningd *ld, const struct plugin_hook *hook, |
|
|
|
tal_t *cb_arg STEALS); |
|
|
|
|
|
|
|
/* Generic deserialize_cb: returns true iff 'result': 'continue' */ |
|
|
@ -97,10 +100,10 @@ bool plugin_hook_continue(void *arg, const char *buffer, const jsmntok_t *toks); |
|
|
|
*/ |
|
|
|
/* FIXME: Find a way to avoid back-to-back declaration and definition */ |
|
|
|
#define PLUGIN_HOOK_CALL_DEF(name, cb_arg_type) \ |
|
|
|
UNNEEDED static inline void plugin_hook_call_##name( \ |
|
|
|
UNNEEDED static inline bool plugin_hook_call_##name( \ |
|
|
|
struct lightningd *ld, cb_arg_type cb_arg STEALS) \ |
|
|
|
{ \ |
|
|
|
plugin_hook_call_(ld, &name##_hook_gen, cb_arg); \ |
|
|
|
return plugin_hook_call_(ld, &name##_hook_gen, cb_arg); \ |
|
|
|
} |
|
|
|
|
|
|
|
/* Typechecked registration of a plugin hook. We check that the
|
|
|
|