summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2013-04-06 13:14:42 +0200
committerPaul Buetow <paul@buetow.org>2013-04-06 13:14:42 +0200
commit42b79aa5c591dde88e78922a519802f948d9ea60 (patch)
tree92cd4e576656837bb99214d8c09c3fec3201474f /src
parent520f54d6219b7c625b4e07463ac393e6982ddab6 (diff)
tagging ychat-0.7.9.4ychat-0.7.9.4
Diffstat (limited to 'src')
-rwxr-xr-xsrc/chat/base.h158
-rwxr-xr-xsrc/chat/base.tmpl46
-rwxr-xr-xsrc/chat/chat.cpp488
-rwxr-xr-xsrc/chat/chat.h72
-rwxr-xr-xsrc/chat/gcol.cpp161
-rwxr-xr-xsrc/chat/gcol.h31
-rwxr-xr-xsrc/chat/perm.cpp69
-rwxr-xr-xsrc/chat/perm.h45
-rwxr-xr-xsrc/chat/room.cpp108
-rwxr-xr-xsrc/chat/room.h116
-rwxr-xr-xsrc/chat/sess.cpp39
-rwxr-xr-xsrc/chat/sess.h21
-rwxr-xr-xsrc/chat/sman.cpp127
-rwxr-xr-xsrc/chat/sman.h30
-rwxr-xr-xsrc/chat/user.cpp688
-rwxr-xr-xsrc/chat/user.h237
-rwxr-xr-xsrc/cli/cli.cpp473
-rwxr-xr-xsrc/cli/cli.h39
-rwxr-xr-xsrc/conf/conf.cpp209
-rwxr-xr-xsrc/conf/conf.h24
-rwxr-xr-xsrc/configure314
-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.cpp48
-rwxr-xr-xsrc/data/con.h8
-rwxr-xr-xsrc/data/con_base.cpp5
-rwxr-xr-xsrc/data/con_base.h4
-rw-r--r--src/data/data.cpp262
-rw-r--r--src/data/data.h18
-rw-r--r--src/data/data_base.cpp232
-rw-r--r--src/data/data_base.h23
-rwxr-xr-xsrc/glob.h179
-rwxr-xr-xsrc/html.cpp162
-rwxr-xr-xsrc/html.h45
-rwxr-xr-xsrc/incl.h6
-rwxr-xr-xsrc/logd.cpp192
-rwxr-xr-xsrc/logd.h39
-rwxr-xr-xsrc/main.cpp185
-rw-r--r--src/maps/hashmap.h38
-rw-r--r--src/maps/hashmap.tmpl24
-rw-r--r--src/maps/mtools.h6
-rw-r--r--src/maps/mtools.tmpl5
-rw-r--r--src/maps/nhashmap.h32
-rw-r--r--src/maps/nhashmap.tmpl24
-rw-r--r--src/maps/shashmap.h36
-rw-r--r--src/maps/shashmap.tmpl26
-rwxr-xr-xsrc/modl.cpp166
-rwxr-xr-xsrc/modl.h34
-rwxr-xr-xsrc/mods/Makefile9
-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.cpp114
-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.cpp41
-rwxr-xr-xsrc/mods/commands/yc_getroom.cpp70
-rwxr-xr-xsrc/mods/commands/yc_getrusage.cpp67
-rwxr-xr-xsrc/mods/commands/yc_help.cpp79
-rwxr-xr-xsrc/mods/commands/yc_invisible.cpp43
-rwxr-xr-xsrc/mods/commands/yc_j.cpp181
-rwxr-xr-xsrc/mods/commands/yc_ko.cpp90
-rwxr-xr-xsrc/mods/commands/yc_m.cpp64
-rwxr-xr-xsrc/mods/commands/yc_md5.cpp82
-rwxr-xr-xsrc/mods/commands/yc_me.cpp65
-rwxr-xr-xsrc/mods/commands/yc_morph.cpp77
-rwxr-xr-xsrc/mods/commands/yc_msg.cpp103
-rwxr-xr-xsrc/mods/commands/yc_q.cpp27
-rwxr-xr-xsrc/mods/commands/yc_reload.cpp29
-rwxr-xr-xsrc/mods/commands/yc_ren.cpp108
-rwxr-xr-xsrc/mods/commands/yc_s.cpp76
-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.cpp134
-rwxr-xr-xsrc/mods/commands/yc_uptime.cpp27
-rwxr-xr-x[-rw-r--r--]src/mods/commands/yc_users.cpp24
-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.cpp50
-rwxr-xr-xsrc/mods/html/yc_help.cpp74
-rwxr-xr-x[-rw-r--r--]src/mods/html/yc_loggedin.cpp24
-rwxr-xr-xsrc/mods/html/yc_options.cpp79
-rwxr-xr-xsrc/mods/html/yc_register.cpp145
-rw-r--r--src/monitor/dump.cpp51
-rw-r--r--src/monitor/dump.h51
-rw-r--r--src/monitor/stats.cpp43
-rw-r--r--src/monitor/stats.h30
-rwxr-xr-x[-rw-r--r--]src/msgs.h57
-rwxr-xr-xsrc/name.cpp34
-rwxr-xr-xsrc/name.h20
-rwxr-xr-xsrc/ncur/menu.cpp149
-rwxr-xr-xsrc/ncur/menu.h27
-rwxr-xr-xsrc/ncur/ncur.cpp372
-rwxr-xr-xsrc/ncur/ncur.h51
-rwxr-xr-xsrc/reqp.cpp546
-rwxr-xr-xsrc/reqp.h62
-rw-r--r--src/sign.cpp40
-rw-r--r--src/sign.h27
-rwxr-xr-xsrc/sock/sock.cpp593
-rwxr-xr-xsrc/sock/sock.h103
-rwxr-xr-xsrc/thrd/pool.cpp257
-rwxr-xr-xsrc/thrd/pool.h82
-rw-r--r--src/thrd/thro.cpp24
-rw-r--r--src/thrd/thro.h26
-rwxr-xr-xsrc/time/timo.cpp24
-rwxr-xr-xsrc/time/timo.h12
-rwxr-xr-xsrc/time/timr.cpp202
-rwxr-xr-xsrc/time/timr.h81
-rw-r--r--src/tool/dir.cpp44
-rw-r--r--src/tool/dir.h26
-rw-r--r--src/tool/tool.cpp255
-rw-r--r--src/tool/tool.h96
-rwxr-xr-xsrc/wrap.cpp137
-rwxr-xr-xsrc/wrap.h126
122 files changed, 9839 insertions, 8969 deletions
diff --git a/src/chat/base.h b/src/chat/base.h
index ae2e926..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 "../maps/smap.h"
+#include <map>
+#include "../maps/nhashmap.h"
template<class type>
-class base : public smap<type*,string>
+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 )
- {
- smap<type*,string>::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 )
- {
- smap<type*,string>::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()
- {
- smap<type*,string>::run_func( &base<type>::reconf_ );
- }
-
- static void reconf_ ( type* type_obj )
- {
- type_obj -> reconf ();
- }
-
- void get_data( map_string *p_map_string )
- {
- smap<type*,string>::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*) 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;
-
- smap<type*,string>::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