From: David Goulet Date: Fri, 20 Jan 2012 20:44:44 +0000 (-0500) Subject: Rename cmd.h for command.h X-Git-Tag: v2.0-pre18~16 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=c399183f4b3257c43915f3d81f44befd23165ad9;ds=sidebyside Rename cmd.h for command.h Also move utils.h and conf.h inside the command.h because every lttng cli commands are using those headers. Signed-off-by: David Goulet --- diff --git a/src/bin/lttng/cmd.h b/src/bin/lttng/cmd.h deleted file mode 100644 index f66d6d953..000000000 --- a/src/bin/lttng/cmd.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2011 - David Goulet - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; only version 2 - * of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _LTTNG_CMD_H -#define _LTTNG_CMD_H - -#include -#include -#include - -enum cmd_error_code { - CMD_SUCCESS, - CMD_ERROR, - CMD_UNDEFINED, - CMD_NOT_IMPLEMENTED, - CMD_FATAL, -}; - -struct cmd_struct { - const char *name; - 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); - -#endif /* _LTTNG_CMD_H */ diff --git a/src/bin/lttng/command.h b/src/bin/lttng/command.h new file mode 100644 index 000000000..d7670f26d --- /dev/null +++ b/src/bin/lttng/command.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 - David Goulet + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; only version 2 + * of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _LTTNG_CMD_H +#define _LTTNG_CMD_H + +#include +#include +#include + +#include "conf.h" +#include "utils.h" + +enum cmd_error_code { + CMD_SUCCESS, + CMD_ERROR, + CMD_UNDEFINED, + CMD_NOT_IMPLEMENTED, + CMD_FATAL, +}; + +struct cmd_struct { + const char *name; + 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); + +#endif /* _LTTNG_CMD_H */ diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c index 2d9699ce2..23ae8f2a8 100644 --- a/src/bin/lttng/commands/add_context.c +++ b/src/bin/lttng/commands/add_context.c @@ -28,9 +28,7 @@ #include -#include "../cmd.h" -#include "../conf.h" -#include "../utils.h" +#include "../command.h" #define PRINT_LINE_LEN 80 diff --git a/src/bin/lttng/commands/calibrate.c b/src/bin/lttng/commands/calibrate.c index 3fa87e3ec..ee2c76af1 100644 --- a/src/bin/lttng/commands/calibrate.c +++ b/src/bin/lttng/commands/calibrate.c @@ -28,9 +28,7 @@ #include #include -#include "../cmd.h" -#include "../conf.h" -#include "../utils.h" +#include "../command.h" static int opt_event_type; static char *opt_kernel; diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index 4083e4195..835d82a4f 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -26,9 +26,7 @@ #include #include -#include "../cmd.h" -#include "../conf.h" -#include "../utils.h" +#include "../command.h" static char *opt_output_path; static char *opt_session_name; diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c index 151686ff9..b79315958 100644 --- a/src/bin/lttng/commands/destroy.c +++ b/src/bin/lttng/commands/destroy.c @@ -25,9 +25,7 @@ #include #include -#include "../cmd.h" -#include "../conf.h" -#include "../utils.h" +#include "../command.h" static char *opt_session_name; diff --git a/src/bin/lttng/commands/disable_channels.c b/src/bin/lttng/commands/disable_channels.c index 59ad9fc28..f2e181971 100644 --- a/src/bin/lttng/commands/disable_channels.c +++ b/src/bin/lttng/commands/disable_channels.c @@ -25,9 +25,7 @@ #include #include -#include "../cmd.h" -#include "../conf.h" -#include "../utils.h" +#include "../command.h" static char *opt_channels; static int opt_kernel; diff --git a/src/bin/lttng/commands/disable_events.c b/src/bin/lttng/commands/disable_events.c index 5247110ef..0e53b4228 100644 --- a/src/bin/lttng/commands/disable_events.c +++ b/src/bin/lttng/commands/disable_events.c @@ -25,9 +25,7 @@ #include #include -#include "../cmd.h" -#include "../conf.h" -#include "../utils.h" +#include "../command.h" static char *opt_event_list; static int opt_kernel; diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index 52745f69a..3ec02ef41 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -26,9 +26,7 @@ #include #include -#include "../cmd.h" -#include "../conf.h" -#include "../utils.h" +#include "../command.h" static char *opt_channels; static int opt_kernel; diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index 3c1c3916e..ca18ccd48 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -27,9 +27,7 @@ #include #include -#include "../cmd.h" -#include "../conf.h" -#include "../utils.h" +#include "../command.h" static char *opt_event_list; static int opt_event_type; diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 6f37254e4..7698bb6ed 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -24,7 +24,7 @@ #include #include -#include "../cmd.h" +#include "../command.h" static int opt_pid; static int opt_userspace; diff --git a/src/bin/lttng/commands/set_session.c b/src/bin/lttng/commands/set_session.c index 8a76403ad..bc25b8d1e 100644 --- a/src/bin/lttng/commands/set_session.c +++ b/src/bin/lttng/commands/set_session.c @@ -25,9 +25,7 @@ #include #include -#include "../cmd.h" -#include "../conf.h" -#include "../utils.h" +#include "../command.h" static char *opt_session_name; diff --git a/src/bin/lttng/commands/start.c b/src/bin/lttng/commands/start.c index 2eacc462f..829278773 100644 --- a/src/bin/lttng/commands/start.c +++ b/src/bin/lttng/commands/start.c @@ -25,9 +25,7 @@ #include #include -#include "../cmd.h" -#include "../conf.h" -#include "../utils.h" +#include "../command.h" static char *opt_session_name; diff --git a/src/bin/lttng/commands/stop.c b/src/bin/lttng/commands/stop.c index f1299b5bc..0a942645d 100644 --- a/src/bin/lttng/commands/stop.c +++ b/src/bin/lttng/commands/stop.c @@ -25,9 +25,7 @@ #include #include -#include "../cmd.h" -#include "../conf.h" -#include "../utils.h" +#include "../command.h" static char *opt_session_name; diff --git a/src/bin/lttng/commands/version.c b/src/bin/lttng/commands/version.c index 4d8d75b12..c9b547bce 100644 --- a/src/bin/lttng/commands/version.c +++ b/src/bin/lttng/commands/version.c @@ -26,7 +26,7 @@ #include #include -#include "../cmd.h" +#include "../command.h" enum { OPT_HELP = 1, diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index 65cea55a2..a76a869a2 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -28,8 +28,7 @@ #include #include -#include "cmd.h" -#include "conf.h" +#include "command.h" /* Variables */ static char *progname;