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 | c8b2ef7b899766d04562f7e04a84251cea8fa701 (patch) | |
| tree | 52816b17c17e2db0cf89e68537ad1a52392f1510 /src | |
| parent | ca28c0e618890330d429c0dc12429255b20f0c90 (diff) | |
tagging ychat-0.8.0ychat-0.8.0
Diffstat (limited to 'src')
125 files changed, 10227 insertions, 10056 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 6f43bf9..0382389 100755 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,17 +1,21 @@ -SRCS=chat.cpp s_chat.cpp conf.cpp s_conf.cpp cont.cpp html.cpp s_html.cpp lang.cpp s_lang.cpp main.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 -#logd.cpp modl.cpp s_modl.cpp cmnd.cpp -OBJS=$(SRCS:.cpp=.o) -CC=g++ -LDFLAGS=@LDFLAGS@ -lstdc++ -g -LDADD=-pthread -D_THREAD_SAFE +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) $(CFLAGS) -c $*.cpp -ychat: $(OBJS) - $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDADD) - @mv -f ychat .. -mrproper: clean - @rm -f Makefile config.log config.cache config.status - rm -f ../ychat -clean: - rm *.o + $(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 0006848..b995c5c 100755 --- a/src/chat/base.h +++ b/src/chat/base.h @@ -1,89 +1,93 @@ -// template class data declaration; #include "../incl.h" #ifndef BASE_H #define BASE_H +#include <map> #include "../maps/nhashmap.h" template<class type> class base : public nhashmap<type*> { +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 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 ); - } - |
