diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:44 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:44 +0200 |
| commit | ca28c0e618890330d429c0dc12429255b20f0c90 (patch) | |
| tree | ecc02da0184cf4e8bdba94dcdd831abdd1e51b3c | |
| parent | b3a99e6e15af3be25394e66d1138bb2682f565c3 (diff) | |
tagging ychat-0.5.0ychat-0.5.0
| -rw-r--r-- | CVS/Entries | 78 | ||||
| -rw-r--r-- | CVS/Entries.Log | 8 | ||||
| -rw-r--r-- | CVS/Root | 2 | ||||
| -rwxr-xr-x | Makefile.in | 4 | ||||
| -rwxr-xr-x | README | 79 | ||||
| -rwxr-xr-x | base.cpp | 56 | ||||
| -rwxr-xr-x | base.h | 90 | ||||
| -rwxr-xr-x | chat.cpp | 201 | ||||
| -rwxr-xr-x | chat.h | 34 | ||||
| -rwxr-xr-x | cmnd.cpp | 19 | ||||
| -rwxr-xr-x | cmnd.h | 18 | ||||
| -rw-r--r-- | cmnd/CVS/Entries | 5 | ||||
| -rw-r--r-- | cmnd/CVS/Repository | 1 | ||||
| -rw-r--r-- | cmnd/CVS/Root | 1 | ||||
| -rwxr-xr-x | cmnd/compile.sh | 9 | ||||
| -rw-r--r-- | cmnd/yc_q.cpp | 21 | ||||
| -rw-r--r-- | cmnd/yc_test.cpp | 12 | ||||
| -rw-r--r-- | cmnd/yc_version.cpp | 20 | ||||
| -rwxr-xr-x | conf.cpp | 82 | ||||
| -rwxr-xr-x | conf.h | 8 | ||||
| -rwxr-xr-x | conf.txt | 8 | ||||
| -rwxr-xr-x | configure | 1556 | ||||
| -rw-r--r-- | configure.in | 27 | ||||
| -rwxr-xr-x | cont.cpp | 8 | ||||
| -rwxr-xr-x | cont.h | 19 | ||||
| -rw-r--r-- | gfx/CVS/Entries | 1 | ||||
| -rw-r--r-- | gfx/CVS/Repository | 1 | ||||
| -rw-r--r-- | gfx/CVS/Root | 1 | ||||
| -rwxr-xr-x | glob.h | 69 | ||||
| -rw-r--r-- | hmap.cpp | 189 | ||||
| -rw-r--r-- | hmap.h | 179 | ||||
| -rwxr-xr-x | html.cpp | 206 | ||||
| -rwxr-xr-x | html.h | 40 | ||||
| -rw-r--r-- | html/CVS/Entries | 30 | ||||
| -rw-r--r-- | html/CVS/Root | 2 | ||||
| -rwxr-xr-x | html/index.html | 4 | ||||
| -rwxr-xr-x | incl.h | 6 | ||||
| -rwxr-xr-x | lang.cpp | 75 | ||||
| -rwxr-xr-x | lang.h | 8 | ||||
| -rw-r--r-- | lang/CVS/Entries | 3 | ||||
| -rw-r--r-- | lang/CVS/Repository | 1 | ||||
| -rw-r--r-- | lang/CVS/Root | 1 | ||||
| -rw-r--r-- | log/CVS/Entries | 1 | ||||
| -rw-r--r-- | log/CVS/Root | 2 | ||||
| -rw-r--r-- | logd.cpp | 83 | ||||
| -rw-r--r-- | logd.h | 25 | ||||
| -rwxr-xr-x | main.cpp | 98 | ||||
| -rwxr-xr-x | modl.cpp | 174 | ||||
| -rwxr-xr-x | modl.h | 19 | ||||
| -rwxr-xr-x | msgs.h | 69 | ||||
| -rwxr-xr-x | mutx.cpp | 6 | ||||
| -rwxr-xr-x | mutx.h | 12 | ||||
| -rwxr-xr-x | name.cpp | 9 | ||||
| -rwxr-xr-x | name.h | 22 | ||||
| -rwxr-xr-x | pool.cpp | 363 | ||||
| -rwxr-xr-x | pool.h | 98 | ||||
| -rwxr-xr-x | reqp.cpp | 463 | ||||
| -rwxr-xr-x | reqp.h | 53 | ||||
| -rwxr-xr-x | room.cpp | 6 | ||||
| -rwxr-xr-x | room.h | 30 | ||||
| -rw-r--r-- | s_chat.h | 21 | ||||
| -rw-r--r-- | s_conf.h | 21 | ||||
| -rw-r--r-- | s_html.h | 21 | ||||
| -rw-r--r-- | s_lang.h | 22 | ||||
| -rw-r--r-- | s_modl.h | 21 | ||||
| -rw-r--r-- | s_mutx.h | 21 | ||||
| -rw-r--r-- | s_sman.h | 21 | ||||
| -rw-r--r-- | s_sock.h | 21 | ||||
| -rw-r--r-- | s_tool.cpp | 166 | ||||
| -rw-r--r-- | s_tool.h | 16 | ||||
| -rw-r--r-- | sess.cpp | 32 | ||||
| -rw-r--r-- | sess.h | 20 | ||||
| -rw-r--r-- | sman.cpp | 95 | ||||
| -rw-r--r-- | sman.h | 41 | ||||
| -rwxr-xr-x | sock.cpp | 466 | ||||
| -rwxr-xr-x | sock.h | 57 | ||||
| -rwxr-xr-x | thrd.cpp | 9 | ||||
| -rwxr-xr-x | thrd.h | 19 | ||||
| -rwxr-xr-x | todo.txt | 36 | ||||
| -rwxr-xr-x | user.cpp | 310 | ||||
| -rwxr-xr-x | user.h | 118 |
81 files changed, 3582 insertions, 2687 deletions
diff --git a/CVS/Entries b/CVS/Entries index 9131cd2..9382269 100644 --- a/CVS/Entries +++ b/CVS/Entries @@ -1,10 +1,70 @@ -/CHANGES/1.17/Mon Feb 14 20:09:50 2005// -/COPYING/1.6/Sun Jun 27 06:32:26 2004// -/INSTALL/1.7/Fri Jul 9 22:33:20 2004// -/Makefile/1.31/Sun Feb 13 07:56:58 2005// -/NEWS/1.34/Thu Feb 17 18:09:41 2005// -/README/1.101/Thu Feb 17 18:09:42 2005// -/RELEASES/1.2/Thu Feb 17 18:09:42 2005// -/TODO/1.68/Mon Feb 14 17:33:09 2005// -/configure/1.31/Wed Feb 9 22:42:58 2005// +/COPYING/1.1/Fri Mar 28 00:27:16 2003// +/Makefile.in/1.7/Sat Apr 19 16:16:14 2003// +/README/1.4/Sun Sep 14 14:48:45 2003// +/base.cpp/1.8/Wed Apr 2 10:50:18 2003// +/base.h/1.5/Wed Apr 2 10:50:18 2003// +/chat.cpp/1.12/Sat Apr 19 19:39:17 2003// +/chat.h/1.8/Sat Apr 19 16:16:14 2003// +/cmnd.cpp/1.3/Tue Mar 25 14:54:07 2003// +/cmnd.h/1.1.1.1/Fri Mar 21 15:54:56 2003// +/conf.cpp/1.5/Fri Apr 4 21:35:59 2003// +/conf.h/1.2/Tue Mar 25 14:54:07 2003// +/conf.txt/1.19/Sun Sep 14 14:31:49 2003// +/configure/1.4/Fri Mar 28 02:02:00 2003// +/configure.in/1.5/Fri Mar 28 02:02:00 2003// +/cont.cpp/1.3/Tue Mar 25 14:54:07 2003// +/cont.h/1.2/Sun Mar 30 00:26:42 2003// +/glob.h/1.6/Sun Sep 14 14:31:49 2003// +/hmap.cpp/1.8/Mon Apr 7 13:24:09 2003// +/hmap.h/1.8/Wed Apr 2 10:50:18 2003// +/html.cpp/1.7/Wed Apr 2 10:50:18 2003// +/html.h/1.3/Tue Mar 25 14:54:07 2003// +/incl.h/1.1.1.1/Fri Mar 21 15:54:56 2003// +/lang.cpp/1.1/Fri Apr 4 22:14:35 2003// +/lang.h/1.1/Fri Apr 4 22:14:35 2003// +/logd.cpp/1.2/Thu Apr 10 15:36:10 2003// +/logd.h/1.1/Fri Apr 4 15:19:11 2003// +/main.cpp/1.11/Sat Apr 19 16:16:14 2003// +/modl.cpp/1.2/Wed Apr 2 21:57:34 2003// +/modl.h/1.1/Wed Apr 2 13:23:09 2003// +/msgs.h/1.12/Sun Sep 14 14:48:45 2003// +/mutx.cpp/1.3/Tue Mar 25 14:54:07 2003// +/mutx.h/1.2/Tue Mar 25 14:54:08 2003// +/name.cpp/1.3/Tue Mar 25 22:19:51 2003// +/name.h/1.3/Tue Mar 25 22:21:26 2003// +/pool.cpp/1.8/Sun Sep 7 12:49:46 2003// +/pool.h/1.1/Sun Mar 23 04:55:58 2003// +/reqp.cpp/1.18/Sun Sep 14 14:31:49 2003// +/reqp.h/1.10/Fri Apr 4 15:19:11 2003// +/room.cpp/1.2/Sun Mar 23 05:41:19 2003// +/room.h/1.2/Fri Mar 28 02:51:03 2003// +/s_chat.cpp/1.1/Tue Mar 25 14:54:08 2003// +/s_chat.h/1.1/Tue Mar 25 14:54:08 2003// +/s_conf.cpp/1.1/Tue Mar 25 14:54:08 2003// +/s_conf.h/1.2/Fri Apr 4 21:35:59 2003// +/s_html.cpp/1.1/Tue Mar 25 14:54:08 2003// +/s_html.h/1.1/Tue Mar 25 14:54:08 2003// +/s_lang.cpp/1.1/Fri Apr 4 22:14:35 2003// +/s_lang.h/1.1/Fri Apr 4 22:14:35 2003// +/s_modl.cpp/1.1/Wed Apr 2 23:01:20 2003// +/s_modl.h/1.1/Wed Apr 2 23:01:20 2003// +/s_mutx.cpp/1.1/Tue Mar 25 14:54:08 2003// +/s_mutx.h/1.1/Tue Mar 25 14:54:08 2003// +/s_sman.cpp/1.1/Sat Apr 19 16:16:15 2003// +/s_sman.h/1.1/Sat Apr 19 16:17:09 2003// +/s_sock.cpp/1.1/Tue Mar 25 14:54:08 2003// +/s_sock.h/1.1/Tue Mar 25 14:54:08 2003// +/s_tool.cpp/1.4/Fri Apr 4 10:41:12 2003// +/s_tool.h/1.4/Fri Apr 4 10:41:12 2003// +/sess.cpp/1.2/Sat Apr 19 19:39:17 2003// +/sess.h/1.2/Sat Apr 19 19:39:17 2003// +/sman.cpp/1.1/Sat Apr 19 16:16:15 2003// +/sman.h/1.2/Sat Apr 19 19:39:17 2003// +/sock.cpp/1.17/Sun Sep 14 14:31:49 2003// +/sock.h/1.6/Fri Apr 4 15:19:11 2003// +/thrd.cpp/1.5/Wed Mar 26 14:57:04 2003// +/thrd.h/1.1.1.1/Fri Mar 21 15:54:56 2003// +/todo.txt/1.4/Sun Mar 30 01:48:46 2003// +/user.cpp/1.7/Fri Apr 4 22:14:35 2003// +/user.h/1.8/Sat Apr 19 19:39:17 2003// D diff --git a/CVS/Entries.Log b/CVS/Entries.Log index ebf29e1..c7be84c 100644 --- a/CVS/Entries.Log +++ b/CVS/Entries.Log @@ -1,7 +1,5 @@ -A D/bin//// -A D/docs//// -A D/etc//// +A D/cmnd//// +A D/gfx//// A D/html//// +A D/lang//// A D/log//// -A D/scripts//// -A D/src//// @@ -1 +1 @@ -:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot +:pserver:anonymous@cvs.ychat.berlios.de:/cvsroot/ychat diff --git a/Makefile.in b/Makefile.in index 2a9ca34..300d035 100755 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -SRCS=chat.cpp s_chat.cpp conf.cpp s_conf.cpp cont.cpp dir.cpp html.cpp s_html.cpp lang.cpp s_lang.cpp logd.cpp main.cpp modl.cpp s_modl.cpp mutx.cpp s_mutx.cpp name.cpp pool.cpp reqp.cpp room.cpp sock.cpp s_sock.cpp thrd.cpp s_tool.cpp user.cpp sess.cpp sman.cpp s_sman.cpp s_mman.cpp mman.cpp mcon.cpp menu.cpp ncur.cpp s_ncur.cpp +SRCS=chat.cpp s_chat.cpp cmnd.cpp conf.cpp s_conf.cpp cont.cpp html.cpp s_html.cpp lang.cpp s_lang.cpp logd.cpp main.cpp modl.cpp s_modl.cpp mutx.cpp s_mutx.cpp name.cpp pool.cpp reqp.cpp room.cpp sock.cpp s_sock.cpp thrd.cpp s_tool.cpp user.cpp sess.cpp sman.cpp s_sman.cpp OBJS=$(SRCS:.cpp=.o) CC=g++ -LDFLAGS=@LDFLAGS@ -lstdc++ -lmysqlclient -lncurses -g +LDFLAGS=@LDFLAGS@ -lstdc++ -g LDADD=-pthread -D_THREAD_SAFE all: ychat $(SRCS): @@ -1,6 +1,5 @@ -yChat; Homepage: www.yChat.org; Version 0.5.5-CURRENT +yChat++ Basic; Homepage: www.yChat.org; Version 0.5 Copyright (C) 2003 Paul C. Buetow, Volker Richter -Copyright (C) 2005 Paul C. Buetow ----------------------------------------------------------------- This program is free software; you can redistribute it and/or @@ -19,20 +18,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ----------------------------------------------------------------- -0.0.0 LEGACY YCHAT 0.5 TABLE OF CONTENTS +0.0.0 YCHAT++ BASIC TABLE OF CONTENTS 1.0.0 REQUIREMENTS 1.1.0 TESTED PLATFORMS 1.2.0 IMPORTANT NOTES -1.3.0 HOW TO OBTAIN YCHAT +1.3.0 HOW TO OBTAIN YCHAT++ 1.3.1 INSTALLATION 1.5.0 CUSTOMIZATION 1.6.0 FILES -1.7.0 WRITING BUG REPORTS 1.8.0 CONTACT 1.0.0 REQUIREMENTS: -- gcc 3.x +- gcc 3.2 The GNU C++ compiler. 1.1.0 TESTED PLATFORMS: @@ -40,26 +38,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The following platforms have been tested with success: - Linux with GCC 3.2.0, GNU make 3.79.1 -- FreeBSD 5.1-RELEASE-p2, GCC 3.2.2, GNU make 3.80 -- FreeBSD 5.3-RELEASE, GCC 3.4, GNU make 3.80 +- FreeBSD 5.1-RELEASE-p2, GCC 3.2.2, GNU make 3.80 ( standard make does not seem work on FreeBSD ). 1.2.0 IMPORTANT NOTES: Before you compile the source you have to be sure to use at least GCC version 3.x with pthreads enabled. ( Type gcc -v to check it ). GCC 2.95 did not work while testing on linux and WON'T BE SUPPORTED! -If you like to support yChat please write us an email and tell what -you can/like/would help ;-]. Please also take a look at the yChat +If you like to support yChat++, please write us an email and tell what +you can/like/would help ;-]. Please also take a look at the yChat++ homepage which is located at http://www.yChat.org. -1.3.0 HOW TO OBTAIN YCHAT: +1.3.0 HOW TO OBTAIN YCHAT++: yChat can be downloaded as a source package or through CVS. The packages are located at http://www.yChat.org -> Sourcecode -> Packages or go to http://programming.buetow.org/CPP-yChat . -For CVS download type also look at the homepage please. +For CVS download type: + +cvs -d:pserver:anonymous@cvs.ychat.berlios.de:/cvsroot/ychat login +( You will be asked for a password. Use "just enter" ). + +cvs -z3 -d:pserver:anonymous@cvs.ychat.berlios.de:/cvsroot/ychat co \ + ychat_advanced +( The sources will be copied into your local folder. However, if you + want to obtain the yChat++ Basic sources then replace "ychat_advanced" + "ychat" ). + +cvs -d:pserver:anonymous@cvs.ychat.berlios.de:/cvsroot/ychat logout +( Logs your CVS session out ). + +Now you may continue with the installation. 1.3.1 INSTALLATION: @@ -70,8 +81,8 @@ Invoke "cd cmnd && ./compile.sh && cd -". All command modules should get compiled. Now its time to run the server with ./ychat. -Then point your webbrowser to http://yourip:port ! - +Then point your webbrowser to http://yourip:port/index.html ( ignoring +the index.html on the end of the url will not work! ). ... have fun :-). 1.5.0 CUSTOMIZATION: @@ -85,8 +96,6 @@ Dynamic loadable modules can be found in the cmnd/ subdirectory. conf.txt - The yChat configuration file. ( read by conf.cpp ). -Files in ./src: - base.cpp - Encapsulates vector fields of room's or user ( may be later hash_maps ) and provides methods for manipulating data objects. @@ -203,44 +212,6 @@ The basic class structure: / \ conf html -1.7 WRITING BUG REPORTS - -How to submit a good bug report? - -Send them to Bug@yChat.org. - -First you should give the following information: -- yChat version, if CVS (or devel. tarball) then which day? -- operating system / distribution and it's version -- when did it crash? did you do something? can you reproduce the crash? - -Getting backtrace of the crash also helps a lot, especially if yChat crashes randomly. If after crash you see text: - - "segmentation fault (core dumped)" - -It writes a file named "core" or "ychat.core" depending on your OS to directory where you started yChat. If it doesn't print the "(core dumped)" or you can't find the core file, you'll have to raise the limit for max. core file size before running yChat. To do this, say: - - ulimit -c unlimited - -So, if you have the core file and GNU debugger (gdb), you can get the backtrace with: - - gdb ychat core - bt - -Paste all the lines starting from line having #0 at the beginning. - -Here's an example session: - - in reqp::parse(thrd*, std::string, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) () - (gdb) bt - #0 0x0805c287 in reqp::parse(thrd*, std::string, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) () - #1 0x0806060f in sock::read_write(thrd*, int) () - #2 0x080612ba in thrd::run() () - #3 0x0805a3b8 in pool::run_func(void*) () - #4 0x0805a375 in pool::tpool_thread(void*) () - #5 0x281d44ae in _thread_start () from /usr/lib/libc_r.so.5 - (gdb) - 1.8 CONTACT: You may contact us through the following addresses: @@ -1,3 +1,13 @@ +/* + This file is part of yChat + + $Author: snooper $ + $Date: 2003/04/02 10:50:18 $ + + $Header: /cvsroot/ychat/ychat/base.cpp,v 1.8 2003/04/02 10:50:18 snooper Exp $ +*/ +// template class data implementation; + #ifndef BASE_CPP #define BASE_CPP @@ -6,54 +16,50 @@ template<class type> base<type>::base() { - map_elem = new hmap<type*,string>(80); - pthread_mutex_init (&mut_map_elem, NULL ); + map_elem = new hmap<type*,string>(80); + pthread_mutex_init (&mut_map_elem, NULL ); } template<class type> base<type>::~base( ) { - pthread_mutex_destroy( &mut_map_elem ); + pthread_mutex_destroy( &mut_map_elem ); } -template<class type> -void +template<class type> void base<type>::add_elem( type* p_type ) { - pthread_mutex_lock ( &mut_map_elem ); - map_elem->add_elem ( p_type, p_type->get_name()); - pthread_mutex_unlock( &mut_map_elem ); + pthread_mutex_lock ( &mut_map_elem ); + map_elem->add_elem ( p_type, p_type->get_name()); + pthread_mutex_unlock( &mut_map_elem ); } -template<class type> -void +template<class type> void base<type>::del_elem( string &s_name ) { - pthread_mutex_lock ( &mut_map_elem ); - map_elem->del_elem ( s_name ); - pthread_mutex_unlock( &mut_map_elem ); + pthread_mutex_lock ( &mut_map_elem ); + map_elem->del_elem ( s_name ); + pthread_mutex_unlock( &mut_map_elem ); } -template<class type> -type* +template<class type> type* base<type>::get_elem( string &s_name, bool &b_found ) { - pthread_mutex_lock ( &mut_map_elem ); - type* p_type = map_elem->get_elem( s_name ); - pthread_mutex_unlock( &mut_map_elem ); + pthread_mutex_lock ( &mut_map_elem ); + type* p_type = map_elem->get_elem( s_name ); + pthread_mutex_unlock( &mut_map_elem ); - b_found = p_type == NULL ? false : true; + b_found = p_type == NULL ? false : true; - return p_type; + return p_type; } -template<class type> -void +template<class type> void base<type>::run_func( void (*func)(type*, void*), void* v_arg ) { - pthread_mutex_lock ( &mut_map_elem ); - map_elem->run_func( func, v_arg ); - pthread_mutex_unlock( &mut_map_elem ); + pthread_mutex_lock ( &mut_map_elem ); + map_elem->run_func( func, v_arg ); + pthread_mutex_unlock( &mut_map_elem ); } #endif @@ -10,60 +10,60 @@ template<class type> class base { private: - hmap<type*,string>* map_elem; - pthread_mutex_t mut_map_elem; + hmap<type*,string>* map_elem; + pthread_mutex_t mut_map_elem; public: - base(); - ~base(); + base(); + ~base(); - virtual void add_elem( type* p_type ); // add a element. - virtual void del_elem( string &s_name ); // delete a alement. - virtual type* get_elem( string &s_name, bool &b_found ); // get a element. + virtual void add_elem( type* p_type ); // add a element. + virtual void del_elem( string &s_name ); // delete a alement. + virtual type* get_elem( string &s_name, bool &b_found ); // get a element. - // execute func on all elements of map_elem. v_pointer is the argument. - virtual void run_func( void (*func)(type*, void*), void* v_arg ); + // execute func on all elements of map_elem. v_pointer is the argument. + virtual void run_func( void (*func)(type*, void*), void* v_arg ); - // chat::msg_post sends to all users of the system a message. - // room::msg_post sends to all users of the room a message. - // user::msg_post sends to the user a message. - void msg_post( string *s_msg ) - { - run_func( &base<type>::msg_post_ , (void*)s_msg ); - } - static void msg_post_( type* type_obj, void* v_arg ) - { - string *p_msg = (string*) v_arg; - type_obj -> msg_post( p_msg ); - } + // chat::msg_post sends to all users of the system a message. + // room::msg_post sends to all users of the room a message. + // user::msg_post sends to the user a message. + void msg_post( string *s_msg ) + { + run_func( &base<type>::msg_post_ , (void*)s_msg ); + } + static void msg_post_( type* type_obj, void* v_arg ) + { + string *p_msg = (string*) v_arg; + type_obj -> msg_post( p_msg ); + } - void get_data( map_string *p_map_string ) - { - run_func( &base<type>::get_data_ , (void*)p_map_string ); - } - static void get_data_( type* type_obj, void* v_arg ) - { - map_string *map_params = (map_string*) v_arg; - type_obj -> get_data ( map_params ); - } + void get_data( map_string *p_map_string ) + { + run_func( &base<type>::get_data_ , (void*)p_map_string ); + } + static void get_data_( type* type_obj, void* v_arg ) + { + map_string *map_params = (map_string*) v_arg; + type_obj -> get_data ( map_params ); + } - // chat::get_user_list gets a list of all users of the system. - // room::get_user_list gets a list of all users of the room. - // user::get_user_list gets a "list" of a user <font color="usercolor">username</font>seperator - void get_user_list( string &s_list, string &s_seperator ) - { + // chat::get_user_list gets a list of all users of the system. + // room::get_user_list gets a list of all users of the room. + // user::get_user_list gets a "list" of a user <font color="usercolor">username</font>seperator + void get_user_list( string &s_list, string &s_seperator ) + { - container c; - c.elem[0] = (void*) &s_list; - c.elem[1] = (void*) &s_seperator; + container c; + c.elem[0] = (void*) &s_list; + c.elem[1] = (void*) &s_seperator; - run_func( &base<type>::get_user_list_, (void*)&c ); - } - static void get_user_list_( type* type_obj, void* v_arg ) - { - container *c = (container*) v_arg; - type_obj -> get_user_list( *((string*)c->elem[0]), *((string*)c->elem[1]) ); - } + run_func( &base<type>::get_user_list_, (void*)&c ); + } + static void get_user_list_( type* type_obj, void* v_arg ) + { + container *c = (container*) v_arg; + type_obj -> get_user_list( *((string*)c->elem[0]), *((string*)c->elem[1]) ); + } }; #include "base.cpp" @@ -5,158 +5,143 @@ #include "chat.h" #include "s_conf.h" +#include "s_mutx.h" #include "s_tool.h" -#include "s_ncur.h" using namespace std; chat::chat( ) { - if ( s_conf::get - ().get_val( "HTML" ) == "OFF" ) - b_strip_html = true; - else - b_strip_html = false; + if ( s_conf::get().get_val( "HTML" ) == "OFF" ) + b_strip_html = true; + else + b_strip_html = false; + } chat::~chat( ) -{} +{ +} user* chat::get_user( string &s_user ) { - bool b_flag; - return get_user( s_user, b_flag ); + bool b_flag; + return get_user( s_user, b_flag ); } user* chat::get_user( string &s_user, bool &b_found ) { - container param; + container param; - param.elem[0] = (void*) &s_user ; - param.elem[1] = (void*) &b_found; + param.elem[0] = (void*) &s_user ; + param.elem[1] = (void*) &b_found; - b_found = false; + b_found = false; - run_func( get_user_, (void*)¶m ); + run_func( get_user_, (void*)¶m ); - if ( *( (bool*)param.elem[1] ) ) - return (user*)param.elem[2]; + if ( *( (bool*)param.elem[1] ) ) + return (user*)param.elem[2]; } void chat::get_user_( room *room_obj, void *v_arg ) { - container* param = (container*) v_arg; - param->elem[2] = (void*)room_obj->get_elem( *((string*)param->elem[0]), *((bool*)param->elem[1]) ); + container* param = (container*) v_arg; + param->elem[2] = (void*)room_obj->get_elem( *((string*)param->elem[0]), *((bool*)param->elem[1]) ); } void chat::login( map_string &map_params ) { - string s_user = map_params["nick"]; - - // prove if nick is empty: - if ( s_user.empty() ) - { - map_params["INFO"] = E_NONICK; - map_params["request"] = s_conf::get - ().get_val( "STARTMPL" ); // redirect to the startpage. - return; |
