Skip to content

Commit

Permalink
configfile: replaced preprocessor macro CONFIG_FILE by std::string
Browse files Browse the repository at this point in the history
- #define CONFIG_FILE --> const std::string default_config_filename
  • Loading branch information
franku committed Aug 22, 2018
1 parent 3d83c9b commit a686cbd
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/src/console/console_conf.cc
Expand Up @@ -377,7 +377,7 @@ ConfigurationParser *InitConsConfig(const char *configfile, int exit_code)
R_LAST,
resources,
res_head,
CONFIG_FILE,
default_config_filename.c_str(),
"bconsole.d");
}

Expand Down
6 changes: 5 additions & 1 deletion core/src/console/console_conf.h
Expand Up @@ -28,12 +28,15 @@
* Bareos User Agent specific configuration and defines
*/

#ifndef BAREOS_CONSOLE_CONSOLE_CONF_H_
#define BAREOS_CONSOLE_CONSOLE_CONF_H_ 1

class ConfigurationParser;
extern ConfigurationParser *my_config; /* Our Global config */

namespace console {

#define CONFIG_FILE "bconsole.conf" /* default configuration file */
static const std::string default_config_filename("bconsole.conf");

/**
* Resource codes -- they must be sequential for indexing
Expand Down Expand Up @@ -98,3 +101,4 @@ ConfigurationParser *InitConsConfig(const char *configfile, int exit_code);
bool PrintConfigSchemaJson(PoolMem &buffer);

} /* namespace console */
#endif /* BAREOS_CONSOLE_CONSOLE_CONF_H_ */
2 changes: 1 addition & 1 deletion core/src/dird/dird_conf.cc
Expand Up @@ -3795,7 +3795,7 @@ ConfigurationParser *InitDirConfig(const char *configfile, int exit_code)
R_LAST,
resources,
res_head,
CONFIG_FILE,
default_config_filename.c_str(),
"bareos-dir.d");
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/dird/dird_conf.h
Expand Up @@ -31,10 +31,10 @@
#define BAREOS_DIRD_DIRD_CONF_H_
/* NOTE: #includes at the end of this file */

#define CONFIG_FILE "bareos-dir.conf" /* default configuration file */

namespace directordaemon {

static std::string default_config_filename("bareos-dir.conf");

/**
* Resource codes -- they must be sequential for indexing
*/
Expand Down
2 changes: 1 addition & 1 deletion core/src/filed/filed_conf.cc
Expand Up @@ -267,7 +267,7 @@ ConfigurationParser *InitFdConfig(const char *configfile, int exit_code)
R_LAST,
resources,
res_head,
CONFIG_FILE,
default_config_filename.c_str(),
"bareos-fd.d");
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/filed/filed_conf.h
Expand Up @@ -31,7 +31,7 @@

namespace filedaemon {

#define CONFIG_FILE "bareos-fd.conf" /* default config file */
static const std::string default_config_filename("bareos-fd.conf");

/*
* Resource codes -- they must be sequential for indexing
Expand Down
4 changes: 2 additions & 2 deletions core/src/qt-tray-monitor/tray_conf.cc
Expand Up @@ -44,7 +44,7 @@
#include "include/bareos.h"
#include "tray_conf.h"

#define CONFIG_FILE "tray-monitor.conf" /* default configuration file */
static const std::string default_config_filename("tray-monitor.conf");

/*
* Define the first and last resource ID record
Expand Down Expand Up @@ -388,7 +388,7 @@ ConfigurationParser *InitTmonConfig(const char *configfile, int exit_code)
R_LAST,
resources,
res_head,
CONFIG_FILE,
default_config_filename.c_str(),
"tray-monitor.d");
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/stored/stored_conf.cc
Expand Up @@ -512,7 +512,7 @@ ConfigurationParser *InitSdConfig(const char *configfile, int exit_code)
R_LAST,
resources,
res_head,
CONFIG_FILE,
default_config_filename.c_str(),
"bareos-sd.d");
}

Expand Down
6 changes: 5 additions & 1 deletion core/src/stored/stored_conf.h
Expand Up @@ -25,12 +25,15 @@
* @file bareos storage daemon configuration definitions
*
*/
#define CONFIG_FILE "bareos-sd.conf" /* Default config file */
#ifndef BAREOS_STORED_STORED_CONF_H_
#define BAREOS_STORED_STORED_CONF_H_ 1

#include "stored/dev.h"

namespace storagedaemon {

static const std::string default_config_filename("bareos-sd.conf");

/*
* Resource codes -- they must be sequential for indexing
*/
Expand Down Expand Up @@ -202,3 +205,4 @@ ConfigurationParser *InitSdConfig(const char *configfile, int exit_code);
bool PrintConfigSchemaJson(PoolMem &buffer);

} /* namespace storagedaemon */
#endif /* BAREOS_STORED_STORED_CONF_H_ */

0 comments on commit a686cbd

Please sign in to comment.