FACT++  1.0
int main ( int  argc,
const char *  argv[] 
)
Examples:
chatserv.cc.

Definition at line 75 of file chatserv.cc.

References Configuration::DoParse(), Configuration::Get(), Configuration::GetName(), Configuration::Has(), WindowLog::OpenLogFile(), ReadlineColor::PrintBootMsg(), PrintHelp(), PrintUsage(), StateMachineImp::Run(), Configuration::SetPrintUsage(), Dim::Setup(), and SetupConfiguration().

76 {
77  Configuration conf(argv[0]);
78  conf.SetPrintUsage(PrintUsage);
79  SetupConfiguration(conf);
80 
81  if (!conf.DoParse(argc, argv, PrintHelp))
82  return 127;
83 
84  Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
85 
86  WindowLog log;
87 
88  ReadlineColor::PrintBootMsg(log, conf.GetName(), false);
89 
90  if (conf.Has("log"))
91  if (!log.OpenLogFile(conf.Get<string>("log")))
92  cerr << "ERROR - Couldn't open log-file " << conf.Get<string>("log") << ": " << strerror(errno) << endl;
93 
94  return ChatServer(log).Run();
95 }
A C++ ostream to an ncurses window supporting attributes and colors.
Definition: WindowLog.h:50
void Setup(const std::string &dns="", const std::string &host="")
Definition: DimSetup.cc:160
void PrintUsage()
Definition: chatserv.cc:38
void SetupConfiguration(Configuration &conf)
Definition: chatserv.cc:12
bool PrintBootMsg(std::ostream &out, const std::string &name, bool interactive=true)
Commandline parsing, resource file parsing and database access.
Definition: Configuration.h:9
virtual int Run(bool dummy)
Start the mainloop.
bool OpenLogFile(const std::string &filename, bool append=false)
Open a log-file.
Definition: WindowLog.cc:111
void PrintHelp()
Definition: chatserv.cc:52

+ Here is the call graph for this function: