From: Philippe Proulx Date: Sat, 5 Sep 2015 18:15:21 +0000 (-0400) Subject: lttng: factor out declaration of commands X-Git-Tag: v2.8.0-rc1~219 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5e71a0e86493091ae375c5dfc209c0f18f94b38f;p=lttng-tools.git lttng: factor out declaration of commands Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/command.h b/src/bin/lttng/command.h index a4f06d446..9d6bc093b 100644 --- a/src/bin/lttng/command.h +++ b/src/bin/lttng/command.h @@ -25,6 +25,9 @@ #include "conf.h" #include "utils.h" +#define DECL_COMMAND(_name) \ + extern int cmd_##_name(int, const char **) + enum cmd_error_code { CMD_SUCCESS = 0, CMD_ERROR, @@ -39,26 +42,26 @@ struct cmd_struct { int (*func)(int argc, const char **argv); }; -extern int cmd_list(int argc, const char **argv); -extern int cmd_create(int argc, const char **argv); -extern int cmd_destroy(int argc, const char **argv); -extern int cmd_start(int argc, const char **argv); -extern int cmd_stop(int argc, const char **argv); -extern int cmd_enable_events(int argc, const char **argv); -extern int cmd_disable_events(int argc, const char **argv); -extern int cmd_enable_channels(int argc, const char **argv); -extern int cmd_disable_channels(int argc, const char **argv); -extern int cmd_add_context(int argc, const char **argv); -extern int cmd_set_session(int argc, const char **argv); -extern int cmd_version(int argc, const char **argv); -extern int cmd_calibrate(int argc, const char **argv); -extern int cmd_view(int argc, const char **argv); -extern int cmd_enable_consumer(int argc, const char **argv); -extern int cmd_disable_consumer(int argc, const char **argv); -extern int cmd_snapshot(int argc, const char **argv); -extern int cmd_save(int argc, const char **argv); -extern int cmd_load(int argc, const char **argv); -extern int cmd_track(int argc, const char **argv); -extern int cmd_untrack(int argc, const char **argv); +DECL_COMMAND(list); +DECL_COMMAND(create); +DECL_COMMAND(destroy); +DECL_COMMAND(start); +DECL_COMMAND(stop); +DECL_COMMAND(enable_events); +DECL_COMMAND(disable_events); +DECL_COMMAND(enable_channels); +DECL_COMMAND(disable_channels); +DECL_COMMAND(add_context); +DECL_COMMAND(set_session); +DECL_COMMAND(version); +DECL_COMMAND(calibrate); +DECL_COMMAND(view); +DECL_COMMAND(enable_consumer); +DECL_COMMAND(disable_consumer); +DECL_COMMAND(snapshot); +DECL_COMMAND(save); +DECL_COMMAND(load); +DECL_COMMAND(track); +DECL_COMMAND(untrack); #endif /* _LTTNG_CMD_H */