Skip to content

Commit

Permalink
Add binding functions for notify
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Apr 19, 2024
1 parent 7ca91b3 commit f0e9e1b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions librz/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ RZ_API void rz_core_notify_error(RZ_NONNULL RzCore *core, RZ_NONNULL const char
va_end(args);
}

RZ_API void rz_core_notify_begin_bind(RZ_NONNULL RzCore *core, RZ_NONNULL const char *text) {
rz_core_notify_begin(core, "%s", text);
}

RZ_API void rz_core_notify_done_bind(RZ_NONNULL RzCore *core, RZ_NONNULL const char *text) {
rz_core_notify_done(core, "%s", text);
}

RZ_API void rz_core_notify_error_bind(RZ_NONNULL RzCore *core, RZ_NONNULL const char *text) {
rz_core_notify_error(core, "%s", text);
}

static int on_fcn_new(RzAnalysis *_analysis, void *_user, RzAnalysisFunction *fcn) {
RzCore *core = (RzCore *)_user;
const char *cmd = rz_config_get(core->config, "cmd.fcn.new");
Expand Down
4 changes: 4 additions & 0 deletions librz/include/rz_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ RZ_API void rz_core_notify_begin(RZ_NONNULL RzCore *core, RZ_NONNULL const char
RZ_API void rz_core_notify_done(RZ_NONNULL RzCore *core, RZ_NONNULL const char *format, ...) RZ_PRINTF_CHECK(2, 3);
RZ_API void rz_core_notify_error(RZ_NONNULL RzCore *core, RZ_NONNULL const char *format, ...) RZ_PRINTF_CHECK(2, 3);

RZ_API void rz_core_notify_begin_bind(RZ_NONNULL RzCore *core, RZ_NONNULL const char *text);
RZ_API void rz_core_notify_done_bind(RZ_NONNULL RzCore *core, RZ_NONNULL const char *text);
RZ_API void rz_core_notify_error_bind(RZ_NONNULL RzCore *core, RZ_NONNULL const char *text);

/**
* \brief APIs to handle Visual Gadgets
*/
Expand Down

0 comments on commit f0e9e1b

Please sign in to comment.