env.InstallSubdir(target = '$INCLUDEINSTALLDIR',
source = sorted(env.Glob("*.hh", strings=True)))
+
+# Create Version.hh
+MAJOR = 1
+MINOR = 1
+REV = int(os.popen("svn info | grep 'Last Changed Rev:' | awk '{print $4}'").read().strip().lower())
+env.CreateFile("Version.hh", env.Value(
+ '// auto-generated file.\n\n'
+ '#ifndef HH_SENF_Version\n'
+ '#define HH_SENF_Version\n\n'
+ '// SENF_VERSION %% 100000 is the revision number\n'
+ '// SENF_VERSION / 100000 %% 100 is the minor version\n'
+ '// SENF_VERSION / 10000000 is the major version\n'
+ '#define SENF_VERSION %(MAJOR)d%(MINOR)02d%(REV)05d\n\n'
+ '#define SENF_LIB_VERSION "%(MAJOR)d.%(MINOR)02d"\n\n'
+ '#define SENF_REVISION "%(REV)d"\n\n'
+ '#endif\n' % locals()) )
#include <senf/Utils/senfassert.hh>
#include <senf/Utils/membind.hh>
#include <senf/Utils/Logger/SenfLog.hh>
+#include <senf/Version.hh>
#include "LineEditor.hh"
#include "ScopedDirectory.hh"
#include "Sysdir.hh"
+#include "SysInfo.hh"
#include "ParsedCommand.hh"
//#include "Server.mpp"
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
+namespace {
+ senf::console::SysInfo::Proxy addSysInfo (
+ "SENF: The Simple and Extensible Network Framework\n"
+ " © 2006-2010 Fraunhofer Institute for Open Communication Systems, Network Research\n"
+ " Contact: senf-dev@lists.berlios.de\n"
+ " Version: " SENF_LIB_VERSION " Revision number: " SENF_REVISION "\n", 0);
+}
///////////////////////////////////////////////////////////////////////////
// senf::console::detail::NonBlockingSocketSink
--- /dev/null
+// $Id$
+//
+// Copyright (C) 2010
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Thorsten Horstmann <tho@berlios.de>
+//
+// 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.
+
+/** \file
+ \brief SysInfo non-inline non-template implementation */
+
+#include "SysInfo.hh"
+
+// Custom includes
+#include <boost/foreach.hpp>
+#include "ScopedDirectory.hh"
+#include "Sysdir.hh"
+#include "ParsedCommand.hh"
+
+#define prefix_
+///////////////////////////////cc.p////////////////////////////////////////
+
+prefix_ senf::console::SysInfo::Proxy::Proxy(std::string const & descr, unsigned pos)
+{
+ SysInfo::instance().addEntry( descr, pos);
+}
+
+prefix_ senf::console::SysInfo::SysInfo()
+{
+ sysdir().add("info", factory::Command(&SysInfo::dump, this));
+}
+
+prefix_ void senf::console::SysInfo::addEntry(std::string const & descr, unsigned pos)
+{
+ if (pos < 0)
+ descr_.push_back( descr);
+ else
+ descr_.insert( boost::next(descr_.begin(), pos > descr_.size() ? descr_.size() : pos), descr);
+
+}
+
+prefix_ void senf::console::SysInfo::dump(std::ostream & os)
+ const
+{
+ BOOST_FOREACH( std::string const & d, descr_) {
+ os << d << std::endl;
+ }
+}
+
+///////////////////////////////cc.e////////////////////////////////////////
+#undef prefix_
+
+
+
+// Local Variables:
+// mode: c++
+// fill-column: 100
+// c-file-style: "senf"
+// indent-tabs-mode: nil
+// ispell-local-dictionary: "american"
+// compile-command: "scons -u test"
+// comment-column: 40
+// End:
--- /dev/null
+// $Id$
+//
+// Copyright (C) 2010
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Thorsten Horstmann <tho@berlios.de>
+//
+// 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.
+
+/** \file
+ \brief SysInfo public header */
+
+#ifndef HH_SENF_Scheduler_Console_SysInfo_
+#define HH_SENF_Scheduler_Console_SysInfo_ 1
+
+// Custom includes
+#include <list>
+#include <senf/Utils/singleton.hh>
+
+///////////////////////////////hh.p////////////////////////////////////////
+namespace senf {
+namespace console {
+
+ class SysInfo
+ : public singleton<SysInfo>
+ {
+ public:
+ using singleton<SysInfo>::instance;
+ void addEntry(std::string const & descr, unsigned pos=-1);
+
+ struct Proxy {
+ Proxy(std::string const & descr, unsigned pos=-1);
+ };
+
+ private:
+ std::list<std::string> descr_;
+
+ SysInfo();
+ void dump(std::ostream & os) const;
+
+ friend class singleton<SysInfo>;
+ };
+
+}}
+
+///////////////////////////////hh.e////////////////////////////////////////
+//#include "SysInfo.cci"
+//#include "SysInfo.ct"
+//#include "SysInfo.cti"
+#endif