summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2010-11-21 16:22:46 +0000
committerPaul Buetow <paul@buetow.org>2010-11-21 16:22:46 +0000
commitdee37a84ae65ba8bd1e0dab6132955bbc195fa57 (patch)
tree4397f736b9161f50cd0b00cdcfd2b0acc7c1af7e /src
parent93ce2024a62325cbae5f2f6fd2155a4ef89cee63 (diff)
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in21
-rw-r--r--src/chat/base.h119
-rw-r--r--src/chat/base.tmpl85
-rw-r--r--src/chat/chat.cpp394
-rw-r--r--src/chat/chat.h87
-rw-r--r--src/chat/gcol.cpp209
-rw-r--r--src/chat/gcol.h67
-rw-r--r--src/chat/perm.cpp107
-rw-r--r--src/chat/perm.h66
-rw-r--r--src/chat/room.cpp138
-rw-r--r--src/chat/room.h117
-rw-r--r--src/chat/sess.cpp80
-rw-r--r--src/chat/sess.h55
-rw-r--r--src/chat/sman.cpp153
-rw-r--r--src/chat/sman.h66
-rw-r--r--src/chat/user.cpp619
-rw-r--r--src/chat/user.h163
-rw-r--r--src/cli/cli.cpp376
-rw-r--r--src/cli/cli.h85
-rw-r--r--src/conf/conf.cpp204
-rw-r--r--src/conf/conf.h53
-rwxr-xr-xsrc/configure334
-rw-r--r--src/contrib/README5
-rw-r--r--src/contrib/crypt/how1
-rw-r--r--src/contrib/crypt/md5.cpp294
-rw-r--r--src/contrib/crypt/md5.h58
-rw-r--r--src/contrib/crypt/md5crypt.cpp186
-rw-r--r--src/contrib/xml/README504
-rw-r--r--src/contrib/xml/tinyxml.cpp1452
-rw-r--r--src/contrib/xml/tinyxml.h1654
-rw-r--r--src/contrib/xml/tinyxmlerror.cpp75
-rw-r--r--src/contrib/xml/tinyxmlparser.cpp1577
-rw-r--r--src/data/README4
-rw-r--r--src/data/con.cpp68
-rw-r--r--src/data/con.h46
-rw-r--r--src/data/con_base.cpp43
-rw-r--r--src/data/con_base.h43
-rw-r--r--src/data/data.cpp227
-rw-r--r--src/data/data.h53
-rw-r--r--src/data/data_base.cpp251
-rw-r--r--src/data/data_base.h72
-rw-r--r--src/glob.h245
-rw-r--r--src/html.cpp173
-rw-r--r--src/html.h64
-rw-r--r--src/incl.h37
-rw-r--r--src/logd.cpp199
-rw-r--r--src/logd.h61
-rw-r--r--src/main.cpp107
-rw-r--r--src/maps/hashmap.h77
-rw-r--r--src/maps/hashmap.tmpl150
-rw-r--r--src/maps/mtools.h35
-rw-r--r--src/maps/mtools.tmpl36
-rw-r--r--src/maps/nhashmap.h45
-rw-r--r--src/maps/nhashmap.tmpl35
-rw-r--r--src/maps/shashmap.h73
-rw-r--r--src/maps/shashmap.tmpl179
-rw-r--r--src/modl.cpp195
-rw-r--r--src/modl.h63
-rw-r--r--src/mods/Makefile9
-rw-r--r--src/mods/commands/Makefile.in18
-rw-r--r--src/mods/commands/yc_about.cpp83
-rw-r--r--src/mods/commands/yc_all.cpp73
-rw-r--r--src/mods/commands/yc_away.cpp96
-rw-r--r--src/mods/commands/yc_col.cpp112
-rw-r--r--src/mods/commands/yc_compopt.cpp47
-rw-r--r--src/mods/commands/yc_exec.cpp90
-rw-r--r--src/mods/commands/yc_fake.cpp54
-rw-r--r--src/mods/commands/yc_getroom.cpp77
-rw-r--r--src/mods/commands/yc_getrusage.cpp81
-rw-r--r--src/mods/commands/yc_help.cpp76
-rw-r--r--src/mods/commands/yc_invisible.cpp55
-rw-r--r--src/mods/commands/yc_j.cpp128
-rw-r--r--src/mods/commands/yc_ko.cpp96
-rw-r--r--src/mods/commands/yc_m.cpp68
-rw-r--r--src/mods/commands/yc_md5.cpp78
-rw-r--r--src/mods/commands/yc_me.cpp69
-rw-r--r--src/mods/commands/yc_morph.cpp76
-rw-r--r--src/mods/commands/yc_msg.cpp92
-rw-r--r--src/mods/commands/yc_q.cpp54
-rw-r--r--src/mods/commands/yc_reload.cpp49
-rw-r--r--src/mods/commands/yc_ren.cpp98
-rw-r--r--src/mods/commands/yc_s.cpp72
-rw-r--r--src/mods/commands/yc_set.cpp124
-rw-r--r--src/mods/commands/yc_template.cpp49
-rw-r--r--src/mods/commands/yc_time.cpp46
-rw-r--r--src/mods/commands/yc_topic.cpp102
-rw-r--r--src/mods/commands/yc_uptime.cpp46
-rw-r--r--src/mods/commands/yc_users.cpp52
-rw-r--r--src/mods/commands/yc_version.cpp47
-rwxr-xr-xsrc/mods/configure26
-rw-r--r--src/mods/html/Makefile.in18
-rw-r--r--src/mods/html/yc_admin.cpp96
-rw-r--r--src/mods/html/yc_colors.cpp61
-rw-r--r--src/mods/html/yc_help.cpp74
-rw-r--r--src/mods/html/yc_loggedin.cpp53
-rw-r--r--src/mods/html/yc_options.cpp80
-rw-r--r--src/mods/html/yc_register.cpp120
-rw-r--r--src/monitor/dump.cpp141
-rw-r--r--src/monitor/dump.h75
-rw-r--r--src/monitor/stats.cpp174
-rw-r--r--src/monitor/stats.h73
-rw-r--r--src/msgs.h160
-rw-r--r--src/name.cpp73
-rw-r--r--src/name.h48
-rw-r--r--src/ncur/menu.cpp141
-rw-r--r--src/ncur/menu.h63
-rw-r--r--src/ncur/ncur.cpp314
-rw-r--r--src/ncur/ncur.h75
-rw-r--r--src/reqp.cpp400
-rw-r--r--src/reqp.h66
-rw-r--r--src/sign.cpp92
-rw-r--r--src/sign.h45
-rw-r--r--src/sock/sock.cpp544
-rw-r--r--src/sock/sock.h112
-rw-r--r--src/thrd/pool.cpp181
-rw-r--r--src/thrd/pool.h79
-rw-r--r--src/thrd/thro.cpp67
-rw-r--r--src/thrd/thro.h54
-rw-r--r--src/time/timo.cpp62
-rw-r--r--src/time/timo.h46
-rw-r--r--src/time/timr.cpp218
-rw-r--r--src/time/timr.h88
-rw-r--r--src/tool/dir.cpp90
-rw-r--r--src/tool/dir.h59
-rw-r--r--src/tool/tool.cpp264
-rw-r--r--src/tool/tool.h53
-rw-r--r--src/wrap.cpp169
-rw-r--r--src/wrap.h154
128 files changed, 18910 insertions, 0 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..0382389
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 0000000..bfdd6f6
--- /dev/null
+++ b/src/chat/base.h
@@ -0,0 +1,119 @@
+/*:*
+ *: File: ./src/chat/base.h
+ *:
+ *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE
+ *:
+ *: 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.
+ *:*/
+
+#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 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;
+
<