diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:41 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:41 +0200 |
| commit | ae4e87df37ed8904de92c7cf2f3a11128cda2a21 (patch) | |
| tree | 5333f2930165cc6e4083ce15154799626ddb3d03 /src/wrap.cpp | |
| parent | 9cd3ccffd5372dfde3af478e3f832f18db4be3f1 (diff) | |
tagging ychat-0.7.4.1ychat-0.7.4.1
Diffstat (limited to 'src/wrap.cpp')
| -rwxr-xr-x[-rw-r--r--] | src/wrap.cpp | 133 |
1 files changed, 20 insertions, 113 deletions
diff --git a/src/wrap.cpp b/src/wrap.cpp index c9f0ea8..a0e1443 100644..100755 --- a/src/wrap.cpp +++ b/src/wrap.cpp @@ -1,27 +1,3 @@ -/*:* - *: File: ./src/wrap.cpp - *: - *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT - *: - *: Copyright (C) 2003 Paul C. Buetow, Volker Richter - *: Copyright (C) 2004 Paul C. Buetow - *: Copyright (C) 2005 EXA Digital Solutions GbR - *: - *: 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 WRAP_CPP #define WRAP_CPP @@ -30,108 +6,39 @@ using namespace std; //<<* -chat* wrap::CHAT = NULL; +chat* wrap::CHAT; #ifdef DATABASE -data* wrap::DATA = NULL; +data* wrap::DATA; #endif -gcol* wrap::GCOL = NULL; -sman* wrap::SMAN = NULL; -modl* wrap::MODL = NULL; +gcol* wrap::GCOL; +sman* wrap::SMAN; +modl* wrap::MODL; //*>> -conf* wrap::CONF = NULL; -html* wrap::HTML = NULL; +conf* wrap::CONF; +html* wrap::HTML; #ifdef LOGGING -logd* wrap::LOGD = NULL; +logd* wrap::LOGD; +#endif +#ifdef NCURSES +ncur* wrap::NCUR; #endif -sock* wrap::SOCK = NULL; -stats* wrap::STAT = NULL; -timr* wrap::TIMR = NULL; -dynamic_wrap* wrap::WRAP = NULL; +sock* wrap::SOCK; +stats* wrap::STAT; +timr* wrap::TIMR; +dynamic_wrap* wrap::WRAP; void wrap::system_message( string s_message ) { -#ifdef SERVMSG - cout << s_message << endl; +#ifdef NCURSES + wrap::NCUR->print( s_message ); #endif - -#ifdef LOGGING - - LOGD->log_simple_line( s_message + "\n" ); +#ifdef SERVMSG + cout << s_message << endl; #endif -} - -void -wrap::init_wrapper(map<string,string>* p_main_loop_params) -{ - // Init the dynamic wrapper (is needed to pass all wrapped objects through a single pointer). - WRAP = new dynamic_wrap; - - // Init the config manager. - WRAP->CONF = CONF = new conf( CONFILE, p_main_loop_params ); - delete p_main_loop_params, - - // Init the statistic manager. - WRAP->STAT = STAT = new stats; - - // Init the html-template manager. - WRAP->HTML = HTML = new html; - #ifdef LOGGING - // Init the system message logd - WRAP->LOGD = LOGD = new logd( CONF->get_elem("httpd.logging.systemfile"), - CONF->get_elem("httpd.logging.systemlines") ); -#endif - - //<<* - // Init the session manager. - WRAP->SMAN = SMAN = new sman; - //*>> - // Init the socket manager. - int i_port = tool::string2int( wrap::CONF->get_elem( "httpd.serverport" ) ); - -#ifndef OPENSSL - - WRAP->SOCK = SOCK = new sock; -#else - - WRAP->SOCK = SOCK = new sslsock; -#endif - - // create the server socket and set it up to accept connections. - if(SOCK->_make_server_socket ( i_port ) <= 0) - { - system_message(SOCKER1); - exit(-1); - } - - pool::init(); - - //<<* - // Init the chat manager. - WRAP->CHAT = CHAT = new chat; - //*>> - - // Init the system timer. - WRAP->TIMR = TIMR = new timr; - - //<<* - // Init the module-loader manager. - WRAP->MODL = MODL = new modl; - - // Init the garbage collector - WRAP->GCOL = GCOL = new gcol; - - // Init the data manager. -#ifdef DATABASE - - WRAP->DATA = DATA = new data; + wrap::LOGD->log_simple_line( s_message + "\n" ); #endif - //*>> - - // Run threads - TIMR->run(); } - #endif |
