From beb8c75afd91bc32f2e7a9c124c9a21ecffd1486 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 27 Jun 2011 15:21:45 -0400 Subject: [PATCH] Rename and add missing header file Rename config.c/.h to conf.* to avoid confusion with the autogenerated config.h from autoconf. Signed-off-by: David Goulet --- lttng/Makefile.am | 2 +- lttng/commands/add_channel.c | 2 +- lttng/commands/create.c | 2 +- lttng/commands/destroy.c | 2 +- lttng/commands/enable_events.c | 2 +- lttng/commands/start.c | 2 +- lttng/commands/stop.c | 2 +- lttng/{config.c => conf.c} | 2 +- lttng/conf.h | 34 ++++++++++++++++++++++++++++++++++ lttng/lttng.c | 2 +- lttng/utils.c | 2 +- 11 files changed, 44 insertions(+), 10 deletions(-) rename lttng/{config.c => conf.c} (99%) create mode 100644 lttng/conf.h diff --git a/lttng/Makefile.am b/lttng/Makefile.am index de2f22cdc..fcea4668a 100644 --- a/lttng/Makefile.am +++ b/lttng/Makefile.am @@ -2,7 +2,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = lttng -lttng_SOURCES = config.c commands/start.c commands/add_channel.c \ +lttng_SOURCES = conf.c commands/start.c commands/add_channel.c \ commands/list.c commands/create.c commands/destroy.c \ commands/stop.c commands/enable_events.c \ utils.c lttng.c diff --git a/lttng/commands/add_channel.c b/lttng/commands/add_channel.c index 6b41e875a..ea7db820e 100644 --- a/lttng/commands/add_channel.c +++ b/lttng/commands/add_channel.c @@ -26,7 +26,7 @@ #include #include "cmd.h" -#include "config.h" +#include "conf.h" #include "utils.h" static char *opt_channel_name; diff --git a/lttng/commands/create.c b/lttng/commands/create.c index 522ebc9c3..941f72355 100644 --- a/lttng/commands/create.c +++ b/lttng/commands/create.c @@ -27,7 +27,7 @@ #include #include "cmd.h" -#include "config.h" +#include "conf.h" static char *opt_output_path; static char *opt_session_name; diff --git a/lttng/commands/destroy.c b/lttng/commands/destroy.c index 9519403ad..f08a99fd7 100644 --- a/lttng/commands/destroy.c +++ b/lttng/commands/destroy.c @@ -26,7 +26,7 @@ #include #include "cmd.h" -#include "config.h" +#include "conf.h" #include "utils.h" static char *opt_session_name; diff --git a/lttng/commands/enable_events.c b/lttng/commands/enable_events.c index f9b51b14d..cde0cc48c 100644 --- a/lttng/commands/enable_events.c +++ b/lttng/commands/enable_events.c @@ -26,7 +26,7 @@ #include #include "cmd.h" -#include "config.h" +#include "conf.h" #include "utils.h" static char *opt_event_list; diff --git a/lttng/commands/start.c b/lttng/commands/start.c index 3a4febe4f..1a3e568ed 100644 --- a/lttng/commands/start.c +++ b/lttng/commands/start.c @@ -26,7 +26,7 @@ #include #include "cmd.h" -#include "config.h" +#include "conf.h" #include "utils.h" static char *opt_session_name; diff --git a/lttng/commands/stop.c b/lttng/commands/stop.c index 0245296a4..56edc2d6d 100644 --- a/lttng/commands/stop.c +++ b/lttng/commands/stop.c @@ -26,7 +26,7 @@ #include #include "cmd.h" -#include "config.h" +#include "conf.h" #include "utils.h" static char *opt_session_name; diff --git a/lttng/config.c b/lttng/conf.c similarity index 99% rename from lttng/config.c rename to lttng/conf.c index 224bd1a1b..9e3a626ba 100644 --- a/lttng/config.c +++ b/lttng/conf.c @@ -25,7 +25,7 @@ #include #include -#include "config.h" +#include "conf.h" #include "lttngerr.h" /* diff --git a/lttng/conf.h b/lttng/conf.h new file mode 100644 index 000000000..b221d5a92 --- /dev/null +++ b/lttng/conf.h @@ -0,0 +1,34 @@ +/* + * 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; either version 2 + * of the License, or (at your option) any later version. + * + * 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_CONFIG_H +#define _LTTNG_CONFIG_H + +#define CONFIG_FILENAME "config" +#define CONFIG_DIRNAME ".lttng" + +void config_destroy(char *path); +int config_init(char *path); +int config_add_session_name(char *path, char *name); + +/* Must free() the return pointer */ +char *config_generate_dir_path(char *path); +char *config_read_session_name(char *path); +char *config_get_default_path(void); + +#endif /* _LTTNG_CONFIG_H */ diff --git a/lttng/lttng.c b/lttng/lttng.c index 09e336803..5f0699119 100644 --- a/lttng/lttng.c +++ b/lttng/lttng.c @@ -27,7 +27,7 @@ #include #include "cmd.h" -#include "config.h" +#include "conf.h" #include "lttngerr.h" /* Variables */ diff --git a/lttng/utils.c b/lttng/utils.c index b05fd2283..f9edb173b 100644 --- a/lttng/utils.c +++ b/lttng/utils.c @@ -20,7 +20,7 @@ #include -#include "config.h" +#include "conf.h" /* * get_config_file_path -- 2.34.1