From: jkaeber Date: Thu, 3 Apr 2008 09:30:14 +0000 (+0000) Subject: Modified argv() to return the original "char **" instead of "char const **". X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=6876608d730140be160e1cd33094d493e88dee79;p=senf.git Modified argv() to return the original "char **" instead of "char const **". According to C99, section 5.1.2.2.1 (Program startup): "The parameters argc and argv and the strings pointed to by the argv array shall be modifiable by the program, and retain their last-stored values between program startup and program termination." And it makes using boost::program_options much easier :) git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@776 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Utils/Daemon/Daemon.cc b/Utils/Daemon/Daemon.cc index f1ac715..1a684a5 100644 --- a/Utils/Daemon/Daemon.cc +++ b/Utils/Daemon/Daemon.cc @@ -82,7 +82,7 @@ prefix_ int senf::Daemon::argc() return argc_; } -prefix_ char const ** senf::Daemon::argv() +prefix_ char ** senf::Daemon::argv() { return argv_; } @@ -184,7 +184,7 @@ prefix_ void senf::Daemon::exit(unsigned code) throw DaemonExitException(code); } -prefix_ int senf::Daemon::start(int argc, char const ** argv) +prefix_ int senf::Daemon::start(int argc, char ** argv) { argc_ = argc; argv_ = argv; diff --git a/Utils/Daemon/Daemon.hh b/Utils/Daemon/Daemon.hh index 2a0ee69..25b8e60 100644 --- a/Utils/Daemon/Daemon.hh +++ b/Utils/Daemon/Daemon.hh @@ -154,13 +154,13 @@ namespace senf { successful startup. */ int argc(); ///< Access command line parameter count - char const ** argv(); ///< Access command line parameters + char ** argv(); ///< Access command line parameters static void exit(unsigned code=0); ///< Terminate daemon with failure ///\} - int start(int argc, char const ** argv); ///< Called from main() to launch daemon. + int start(int argc, char ** argv); ///< Called from main() to launch daemon. /**< Normally not called directly but from the \ref SENF_DAEMON_MAIN macro. */ @@ -201,7 +201,7 @@ namespace senf { bool pidfileCreate(); int argc_; - char const ** argv_; + char ** argv_; bool daemonize_; std::string stdoutLog_; @@ -222,7 +222,7 @@ namespace senf { \ingroup process */ # define SENF_DAEMON_MAIN(klass) \ - int main(int argc, char const ** argv) \ + int main(int argc, char ** argv) \ { \ klass instance; \ return instance.start(argc, argv); \