summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/Makefile.in34
-rwxr-xr-xsrc/chat/base.h154
-rwxr-xr-xsrc/chat/base.tmpl49
-rwxr-xr-xsrc/chat/chat.cpp482
-rwxr-xr-xsrc/chat/chat.h71
-rwxr-xr-xsrc/chat/gcol.cpp161
-rwxr-xr-xsrc/chat/gcol.h29
-rwxr-xr-xsrc/chat/perm.cpp69
-rwxr-xr-xsrc/chat/perm.h44
-rwxr-xr-xsrc/chat/room.cpp100
-rwxr-xr-xsrc/chat/room.h95
-rwxr-xr-xsrc/chat/sess.cpp25
-rwxr-xr-xsrc/chat/sess.h22
-rwxr-xr-xsrc/chat/sman.cpp126
-rwxr-xr-xsrc/chat/sman.h28
-rwxr-xr-xsrc/chat/user.cpp691
-rwxr-xr-xsrc/chat/user.h241
-rwxr-xr-xsrc/cli/cli.cpp486
-rwxr-xr-xsrc/cli/cli.h28
-rwxr-xr-xsrc/conf/conf.cpp218
-rwxr-xr-xsrc/conf/conf.h15
-rwxr-xr-xsrc/configure1884
-rw-r--r--src/contrib/crypt/md5.cpp333
-rw-r--r--src/contrib/crypt/md5.h15
-rw-r--r--src/contrib/crypt/md5crypt.cpp233
-rw-r--r--src/contrib/xml/tinyxml.cpp1679
-rw-r--r--src/contrib/xml/tinyxml.h2242
-rw-r--r--src/contrib/xml/tinyxmlerror.cpp44
-rw-r--r--src/contrib/xml/tinyxmlparser.cpp2684
-rwxr-xr-xsrc/data/con.cpp26
-rwxr-xr-xsrc/data/con.h12
-rwxr-xr-xsrc/data/con_base.h10
-rw-r--r--src/data/data.cpp133
-rw-r--r--src/data/data.h26
-rw-r--r--src/data/data_base.cpp116
-rw-r--r--src/data/data_base.h42
-rwxr-xr-xsrc/glob.h232
-rwxr-xr-xsrc/html.cpp132
-rwxr-xr-xsrc/html.h36
-rwxr-xr-xsrc/incl.h19
-rwxr-xr-xsrc/logd.cpp181
-rwxr-xr-xsrc/logd.h36
-rwxr-xr-xsrc/main.cpp126
-rw-r--r--src/maps/hashmap.h51
-rw-r--r--src/maps/hashmap.tmpl124
-rw-r--r--src/maps/mtools.h2
-rw-r--r--src/maps/mtools.tmpl5
-rw-r--r--src/maps/nhashmap.h12
-rw-r--r--src/maps/nhashmap.tmpl12
-rw-r--r--src/maps/shashmap.h53
-rw-r--r--src/maps/shashmap.tmpl142
-rw-r--r--src/memb/memb.h50
-rw-r--r--src/memb/memb.tmpl67
-rw-r--r--src/memb/tupel.h2
-rw-r--r--src/memb/tupel.tmpl14
-rwxr-xr-xsrc/modl.cpp160
-rwxr-xr-xsrc/modl.h32
-rwxr-xr-xsrc/mods/commands/Makefile.in2
-rw-r--r--src/mods/commands/yc_about.cpp74
-rwxr-xr-xsrc/mods/commands/yc_all.cpp77
-rwxr-xr-xsrc/mods/commands/yc_away.cpp126
-rwxr-xr-xsrc/mods/commands/yc_col.cpp127
-rwxr-xr-xsrc/mods/commands/yc_compopt.cpp21
-rwxr-xr-xsrc/mods/commands/yc_exec.cpp84
-rwxr-xr-xsrc/mods/commands/yc_fake.cpp43
-rwxr-xr-xsrc/mods/commands/yc_getroom.cpp70
-rwxr-xr-xsrc/mods/commands/yc_getrusage.cpp69
-rwxr-xr-xsrc/mods/commands/yc_help.cpp81
-rwxr-xr-xsrc/mods/commands/yc_invisible.cpp45
-rwxr-xr-xsrc/mods/commands/yc_j.cpp183
-rwxr-xr-xsrc/mods/commands/yc_ko.cpp88
-rwxr-xr-xsrc/mods/commands/yc_m.cpp65
-rwxr-xr-xsrc/mods/commands/yc_md5.cpp84
-rwxr-xr-xsrc/mods/commands/yc_me.cpp67
-rwxr-xr-xsrc/mods/commands/yc_morph.cpp77
-rwxr-xr-xsrc/mods/commands/yc_msg.cpp94
-rwxr-xr-xsrc/mods/commands/yc_q.cpp27
-rwxr-xr-xsrc/mods/commands/yc_reload.cpp29
-rwxr-xr-xsrc/mods/commands/yc_ren.cpp110
-rwxr-xr-xsrc/mods/commands/yc_s.cpp81
-rwxr-xr-xsrc/mods/commands/yc_set.cpp175
-rwxr-xr-xsrc/mods/commands/yc_template.cpp25
-rwxr-xr-xsrc/mods/commands/yc_time.cpp27
-rwxr-xr-xsrc/mods/commands/yc_topic.cpp138
-rwxr-xr-xsrc/mods/commands/yc_uptime.cpp27
-rwxr-xr-xsrc/mods/commands/yc_users.cpp31
-rwxr-xr-xsrc/mods/commands/yc_version.cpp21
-rwxr-xr-xsrc/mods/html/Makefile.in4
-rw-r--r--src/mods/html/yc_admin.cpp117
-rwxr-xr-xsrc/mods/html/yc_colors.cpp52
-rwxr-xr-xsrc/mods/html/yc_help.cpp76
-rwxr-xr-xsrc/mods/html/yc_loggedin.cpp31
-rwxr-xr-xsrc/mods/html/yc_options.cpp81
-rwxr-xr-xsrc/mods/html/yc_register.cpp165
-rw-r--r--src/monitor/dump.cpp27
-rw-r--r--src/monitor/dump.h31
-rwxr-xr-xsrc/msgs.h163
-rwxr-xr-xsrc/name.cpp34
-rwxr-xr-xsrc/name.h20
-rwxr-xr-xsrc/ncur/menu.cpp148
-rwxr-xr-xsrc/ncur/menu.h28
-rwxr-xr-xsrc/ncur/ncur.cpp368
-rwxr-xr-xsrc/ncur/ncur.h53
-rwxr-xr-xsrc/reqp.cpp487
-rwxr-xr-xsrc/reqp.h49
-rw-r--r--src/sign.cpp5
-rw-r--r--src/sign.h3
-rwxr-xr-xsrc/sock/sock.cpp594
-rwxr-xr-xsrc/sock/sock.h96
-rw-r--r--src/sock/sslsock.cpp34
-rw-r--r--src/sock/sslsock.h32
-rwxr-xr-xsrc/thrd/pool.cpp271
-rwxr-xr-xsrc/thrd/pool.h68
-rw-r--r--src/thrd/thro.cpp23
-rw-r--r--src/thrd/thro.h24
-rwxr-xr-xsrc/time/timo.cpp20
-rwxr-xr-xsrc/time/timo.h12
-rwxr-xr-xsrc/time/timr.cpp165
-rwxr-xr-xsrc/time/timr.h81
-rw-r--r--src/tool/dir.cpp44
-rw-r--r--src/tool/dir.h24
-rw-r--r--src/tool/tool.cpp256
-rw-r--r--src/tool/tool.h28
-rwxr-xr-xsrc/wrap.cpp139
-rwxr-xr-xsrc/wrap.h127
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 );
- }
-
- 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;
+ }
+
+ 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;
+