diff options
Diffstat (limited to 'src')
| -rwxr-xr-x[-rw-r--r--] | src/Makefile.in | 54 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/base.h | 182 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/base.tmpl | 73 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/chat.cpp | 543 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/chat.h | 103 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/gcol.cpp | 184 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/gcol.h | 58 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/perm.cpp | 93 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/perm.h | 69 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/room.cpp | 124 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/room.h | 131 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/sess.cpp | 63 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/sess.h | 50 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/sman.cpp | 165 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/sman.h | 56 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/user.cpp | 796 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/chat/user.h | 283 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/cli/cli.cpp | 579 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/cli/cli.h | 52 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/conf/conf.cpp | 242 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/conf/conf.h | 43 | ||||
| -rwxr-xr-x | src/configure | 6641 | ||||
| -rw-r--r-- | src/contrib/crypt/md5.cpp | 357 | ||||
| -rw-r--r-- | src/contrib/crypt/md5.h | 39 | ||||
| -rw-r--r-- | src/contrib/crypt/md5crypt.cpp | 257 | ||||
| -rw-r--r-- | src/contrib/xml/tinyxml.cpp | 1703 | ||||
| -rw-r--r-- | src/contrib/xml/tinyxml.h | 2266 | ||||
| -rw-r--r-- | src/contrib/xml/tinyxmlerror.cpp | 68 | ||||
| -rw-r--r-- | src/contrib/xml/tinyxmlparser.cpp | 2708 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/data/con.cpp | 26 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/data/con.h | 12 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/data/con_base.cpp | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/data/con_base.h | 10 | ||||
| -rw-r--r-- | src/data/data.cpp | 137 | ||||
| -rw-r--r-- | src/data/data.h | 26 | ||||
| -rw-r--r-- | src/data/data_base.cpp | 151 | ||||
| -rw-r--r-- | src/data/data_base.h | 47 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/glob.h | 230 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/html.cpp | 187 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/html.h | 65 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/incl.h | 29 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/logd.cpp | 205 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/logd.h | 58 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/main.cpp | 237 | ||||
| -rw-r--r-- | src/maps/hmap.h | 96 | ||||
| -rw-r--r-- | src/maps/hmap.tmpl | 289 | ||||
| -rw-r--r-- | src/maps/mtools.h | 26 | ||||
| -rw-r--r-- | src/maps/mtools.tmpl | 29 | ||||
| -rw-r--r-- | src/maps/nmap.h | 22 | ||||
| -rw-r--r-- | src/maps/nmap.tmpl | 31 | ||||
| -rw-r--r-- | src/maps/smap.h | 55 | ||||
| -rw-r--r-- | src/maps/smap.tmpl | 215 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/modl.cpp | 188 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/modl.h | 59 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/Makefile | 12 | ||||
| -rwxr-xr-x | src/mods/commands/Makefile.in | 18 | ||||
| -rw-r--r-- | src/mods/commands/yc_about.cpp | 98 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_all.cpp | 101 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_away.cpp | 150 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_col.cpp | 167 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_compopt.cpp | 45 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_exec.cpp | 108 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_fake.cpp | 67 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_getroom.cpp | 94 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_getrusage.cpp | 93 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_help.cpp | 106 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_invisible.cpp | 69 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_j.cpp | 203 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_ko.cpp | 112 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_m.cpp | 89 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_md5.cpp | 108 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_me.cpp | 77 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_morph.cpp | 101 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_msg.cpp | 128 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_q.cpp | 51 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_reload.cpp | 57 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_ren.cpp | 134 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_s.cpp | 105 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_set.cpp | 199 | ||||
| -rwxr-xr-x | src/mods/commands/yc_template.cpp | 24 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_time.cpp | 55 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_topic.cpp | 162 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_uptime.cpp | 55 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/commands/yc_version.cpp | 45 | ||||
| -rwxr-xr-x | src/mods/configure | 40 | ||||
| -rwxr-xr-x | src/mods/html/Makefile.in | 18 | ||||
| -rw-r--r-- | src/mods/html/yc_admin.cpp | 143 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/html/yc_colors.cpp | 76 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/html/yc_help.cpp | 100 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/html/yc_options.cpp | 103 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/mods/html/yc_register.cpp | 189 | ||||
| -rw-r--r-- | src/msgs.h | 95 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/name.cpp | 54 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/name.h | 40 | ||||
| -rwxr-xr-x | src/ncur/menu.cpp | 119 | ||||
| -rwxr-xr-x | src/ncur/menu.h | 39 | ||||
| -rwxr-xr-x | src/ncur/ncur.cpp | 284 | ||||
| -rwxr-xr-x | src/ncur/ncur.h | 50 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/reqp.cpp | 532 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/reqp.h | 77 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/sock/sock.cpp | 629 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/sock/sock.h | 102 | ||||
| -rw-r--r-- | src/stats.cpp | 149 | ||||
| -rw-r--r-- | src/stats.h | 48 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/thrd/pool.cpp | 306 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/thrd/pool.h | 98 | ||||
| -rw-r--r-- | src/thrd/thro.cpp | 47 | ||||
| -rw-r--r-- | src/thrd/thro.h | 48 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/time/timo.cpp | 44 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/time/timo.h | 36 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/time/timr.cpp | 193 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/time/timr.h | 104 | ||||
| -rw-r--r-- | src/tool/dir.cpp | 68 | ||||
| -rw-r--r-- | src/tool/dir.h | 48 | ||||
| -rw-r--r-- | src/tool/tool.cpp | 277 | ||||
| -rw-r--r-- | src/tool/tool.h | 52 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/wrap.cpp | 133 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/wrap.h | 147 |
118 files changed, 10108 insertions, 17625 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 66ab5be..0382389 100644..100755 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,33 +1,21 @@ -BIN=../bin/ychat -CXX=@CXX@ -#EFLAGS=-frepo -CXXFLAGS=-fno-inline -fno-default-inline @CXXFLAGS@ ${EFLAGS} ${BOOST_CPPFLAGS} -LDADD+=@LIBS@-lstdc++ -D_THREAD_SAVE -export-dynamic -PREFIX=@prefix@ -all: message ${OBJS} - @dirname=`dirname ${BIN}`; if ! test -d $$dirname; then mkdir -p $$dirname; fi - @echo; echo "===> Linking base sources" - @${CXX} -o ${BIN} ${OBJS} ${LDADD} - @echo "===> LDADD : ${LDADD}" - @echo "===> CXXFLAGS : ${CXXFLAGS}" - @echo "===> CXX : ${CXX}" - @echo "===> Binary size : `du -hs ${BIN} | sed 's/\.\.\/bin\///'`" - @echo "===> `cd ..; ./scripts/version.sh`" - @echo -${OBJS}: - @dirname=`dirname $@`; if ! test -d $$dirname; then mkdir -p $$dirname; fi - @${CXX} ${CXXFLAGS} -c -o $@ `echo $@ | \ - sed 's/\.\.\/obj\/\.\/\(.*\)\.o/\.\/\1.cpp/'` - @echo "base:`echo $@ | sed 's/\.\.\/obj\/\.\/\(.*\)\.o$$/\1/'` (`du \ - -hs $@ | awk '{ print $$1 }'`) " -message: - @echo "===> Building base sources" -clean: - @echo "===> Cleaning base" - @find ../obj -name '*.o' | grep -v mods | xargs rm -f - @if [ -f ${BIN} ]; then rm -f ${BIN}; fi -mrproper: clean - @for i in autom4te.cache; \ - do if [ -d $$i ]; then rm -Rf $$i; fi; done - @for i in Makefile config.h config.log config.status; \ - do if [ -f $$i ]; then rm -f $$i; fi; done +SRCS=WILLBEADDEDBYCONFIGURE +OBJS=$(addprefix ../obj/,$(SRCS:.cpp=.o)) +CC=WILLBEADDEDBYCONFIGURE +LIBADD=`cat libs.add` +LDFLAGS=$(LIBADD) -lstdc++ +LDADD=-pthread -D_THREAD_SAFE -export-dynamic -ldl +INCLUDES=`cat includes.add` +CFLAGS=-fno-inline -fno-default-inline -frepo +all: ychat +$(SRCS): + $(CC) $(INCLUDES) $(CFLAGS) -c $*.cpp +infotext: + @echo Compiling base +ychat: infotext $(OBJS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDADD) + @mv ychat ../bin + @echo -n "Size of linked executable: " + @du -hc ../bin/ychat | tail -n 1 +clean: + @echo Cleaning base obj + @if test -d ../obj; then rm -Rf ../obj; fi diff --git a/src/chat/base.h b/src/chat/base.h index 145fb6c..dc44c69 100644..100755 --- a/src/chat/base.h +++ b/src/chat/base.h @@ -1,117 +1,89 @@ -/*:* - *: File: ./src/chat/base.h - *: - *: 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. - *:*/ - +// template class data declaration; #include "../incl.h" #ifndef BASE_H #define BASE_H -#include <map> -#include "../maps/nhashmap.h" +#include "../maps/smap.h" template<class type> -class base : public nhashmap<type*> +class base : public smap<type*,string> { -protected: - void dumpit(); - public: - base(); - ~base(); - - static string to_lower( string s ) - { - string s_tmp(""); - for(int i=0;i < s.size() ;i++) - s_tmp=s_tmp+(char)tolower(s.at(i)); - return s_tmp; - } - - virtual type* get_elem( string s_name, bool &b_found ); // get a element. - virtual type* get_elem( string s_name ); - virtual void add_elem( type* p_type ); // add a element. - - // 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. - virtual void msg_post( string *s_msg ) - { - nhashmap<type*>::run_func( &base<type>::msg_post_ , (void*)s_msg ); - } - - static void msg_post_( type* type_obj, void* v_arg ) - { - type_obj -> msg_post( (string*) v_arg ); - } - - virtual void check_timeout( int* i_timeout_settings ) - { - nhashmap<type*>::run_func( &base<type>::check_timeout_ , (void*)i_timeout_settings ); - } - - static void check_timeout_( type* type_obj, void* v_arg ) - { - type_obj -> check_timeout( (int*) v_arg ); - } - - virtual void reconf() - { - nhashmap<type*>::run_func( &base<type>::reconf_ ); - } - - static void reconf_ ( type* type_obj ) - { - type_obj -> reconf (); - } - - void get_data( map<string,string> *p_map_string ) - { - nhashmap<type*>::run_func( &base<type>::get_data_ , (void*)p_map_string ); - } - - static void get_data_( type* type_obj, void* v_arg ) - { - type_obj -> get_data ( (map<string,string>*) v_arg ); - } - - - // 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 ) - { - container c; - c.elem[0] = (void*) &s_list; - - nhashmap<type*>::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]) ); - } + base(); + ~base(); + + static string to_lower( string s ) + { + string s_tmp(""); + for(int i=0;i < s.size() ;i++) + s_tmp=s_tmp+(char)tolower(s.at(i)); + return s_tmp; + } |
