From 07706f56cd421bf8b101a5c0fe44674d36e161a0 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:46 +0200 Subject: tagging ychat-0.5.1 --- COPYING | 1 + ChangeLog | 484 +++++++++++++++ Makefile.in | 2 +- README | 318 +++++----- base.cpp | 97 ++- base.h | 61 +- chat.cpp | 80 ++- chat.h | 16 +- cmnd.cpp | 2 +- cmnd/yc_getrusage.cpp | 51 ++ conf.cpp | 10 +- conf.h | 4 +- conf.txt | 46 +- configure | 1618 ++++++++++++++++++++++++++++++++++++++++++++++--- cont.cpp | 2 +- cont.h | 1 + glob.h | 14 +- hmap.cpp | 9 + hmap.h | 6 + html.cpp | 40 +- html.h | 6 +- html/favicon.ico | Bin html/frameset.html | 12 +- html/index.html | 21 +- html/input.html | 52 +- html/notfound.html | 4 +- html/online.html | 21 +- html/stream.html | 42 +- html/style.css | 0 main.cpp | 48 +- msgs.h | 12 +- mutx.cpp | 4 +- mutx.h | 4 +- name.cpp | 2 + name.h | 4 +- pool.cpp | 48 +- reqp.cpp | 113 +++- reqp.h | 6 +- room.h | 4 +- s_conf.h | 2 +- s_tool.cpp | 28 + s_tool.h | 1 + sock.cpp | 70 ++- sock.h | 16 +- thrd.cpp | 5 +- todo.txt | 14 +- user.cpp | 37 +- user.h | 15 +- 48 files changed, 2831 insertions(+), 622 deletions(-) mode change 100755 => 100644 COPYING create mode 100644 ChangeLog create mode 100644 cmnd/yc_getrusage.cpp mode change 100755 => 100644 html/favicon.ico mode change 100755 => 100644 html/style.css diff --git a/COPYING b/COPYING old mode 100755 new mode 100644 index 27058a5..a43ea21 --- a/COPYING +++ b/COPYING @@ -106,6 +106,7 @@ above, provided that you also meet all of these conditions: announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..b3ada67 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,484 @@ +2003-09-14 16:55 snooper + + * cmnd/yc_version.cpp: Added /version command. + +2003-09-14 16:48 snooper + + * README, msgs.h: Changed Version to 0.5 ( Will be released as soon + as possible ). + +2003-09-14 16:34 snooper + + * msgs.h: Changed version description. + +2003-09-14 16:31 snooper + + * README, conf.txt, glob.h, reqp.cpp, sock.cpp, cmnd/compile.sh: + Fixed all known bugs which already have been fixed in yChat++ + Advanced. + +2003-09-13 20:52 snooper + + * gfx/y_ani_black.gif, gfx/y_ani_white.gif, html/favicon.ico: [no + log message] + +2003-09-07 14:49 snooper + + * pool.cpp: + Removed a pthread_cond_signal which has been set twice! + +2003-09-06 23:34 rover + + * pool.cpp: fixed a typo ( multi thread bug ) + +2003-09-03 18:30 rover + + * reqp.cpp: modified End-Of-Headers to RFC compliant version + +2003-07-26 14:30 snooper + + * reqp.cpp: Added Pragma: no-cache and Expires: 0 to the HTTP + header. ( this is a bugfix ). + +2003-04-19 21:39 rover + + * chat.cpp, reqp.cpp, sess.cpp, sess.h, sman.h, sock.cpp, user.h: + identification now only depends on session + +2003-04-19 18:16 rover + + * Makefile.in, chat.cpp, chat.h, conf.txt, main.cpp, s_sman.cpp, + sess.cpp, sman.cpp, s_sman.h, sess.h, sman.h: added session + manager and session object. + +2003-04-10 17:36 rover + + * logd.cpp: fixed a typo + +2003-04-07 15:24 rover + + * hmap.cpp: added a really really important newline ( this is just + a loginfo test ) + +2003-04-07 15:18 rover + + * msgs.h: message templates are now replaced by language manager + +2003-04-05 00:17 rover + + * Makefile.in: language support + +2003-04-05 00:14 rover + + * chat.cpp, chat.h, conf.txt, lang.cpp, lang.h, main.cpp, + s_lang.cpp, s_lang.h, sock.cpp, user.cpp, user.h, lang/de, + lang/en: support for different languages in chat output + +2003-04-04 23:35 rover + + * conf.cpp, conf.txt, glob.h, s_conf.h, sock.cpp: another bug that + was caused due sed conversion + +2003-04-04 17:42 rover + + * Makefile.in: added log_daemon + +2003-04-04 17:19 rover + + * conf.txt, logd.cpp, logd.h, reqp.cpp, reqp.h, sock.cpp, sock.h: + added access log compatible logging + +2003-04-04 13:13 rover + + * sock.cpp: added IP / PORT to map_params to make logging possible + with only this map + +2003-04-04 12:41 rover + + * s_tool.cpp, s_tool.h: added trim() function to strip whitespaces + at the beginning and end of a string + +2003-04-04 12:40 rover + + * reqp.cpp, reqp.h: http headers are now stored in the requestmap + +2003-04-03 01:01 snooper + + * s_modl.cpp, s_modl.h, user.h: Minor modifications. New static + class wrapper. + +2003-04-02 23:57 snooper + + * Makefile.in, chat.h, conf.txt, main.cpp, modl.cpp, sock.cpp, + user.cpp, user.h, cmnd/yc_q.cpp: Added first command. /q ... + Todo: each user should have his own hashmap of executable + modules. Right now all users use the same module hash map. + +2003-04-02 15:23 rover + + * modl.cpp, modl.h: module loader + +2003-04-02 12:52 snooper + + * dltest.cpp, yc_test.cpp, cmnd/yc_q.cpp, cmnd/yc_test.cpp: [no log + message] + +2003-04-02 12:50 snooper + + * Makefile.in, README, base.cpp, base.h, chat.cpp, chat.h, + conf.cpp, dltest.cpp, glob.h, hmap.cpp, hmap.h, html.cpp, msgs.h, + reqp.cpp, reqp.h, sock.cpp: Dynamic module loader class. Better + hash map functionality. Some bugfixes. + +2003-03-30 15:40 paul + + * hmap.h: + Implementation of operator[]. + +2003-03-30 13:12 volker + + * html/: style.css, y_black.gif: added stylesheet and an image + +2003-03-30 03:48 paul + + * todo.txt: [no log message] + +2003-03-30 03:35 paul + + * base.cpp, conf.txt, hmap.cpp, hmap.h: The hach map now supports + explicit key bindings on each value. The [] operator still has to + be implemented. + +2003-03-30 01:34 volker + + * conf.txt, html/index.html, html/input.html, html/online.html, + html/stream.html: modified appearance and added css + +2003-03-30 01:26 paul + + * README, README.txt, cont.h: Renamed. + +2003-03-30 01:14 paul + + * base.cpp, base.h, hmap.cpp, hmap.h: All user objects and all room + objects are stored in a hash map. + +2003-03-30 01:06 volker + + * conf.txt, reqp.cpp, reqp.h, s_tool.cpp, s_tool.h: support for + different content-types + +2003-03-30 00:21 paul + + * hmap.cpp, hmap.h, main.cpp: Now handles pointer of data objects + instead of references. + +2003-03-30 00:18 volker + + * html.cpp: removed possible deadlock + +2003-03-30 00:11 volker + + * conf.txt, html.cpp: changed format how files are read into + templatecache + +2003-03-28 17:16 volker + + * todo.txt: todo is now up to date + +2003-03-28 03:51 paul + + * data.h: + + Removed data.h + +2003-03-28 03:51 paul + + * README.txt, base.h, chat.h, data.h, room.h: + + Put data.h and base.h together. + +2003-03-28 03:08 paul + + * README.txt: + + Actualizing because of the new configure script. + +2003-03-28 03:02 volker + + * configure, configure.in: [no log message] + +2003-03-28 02:59 volker + + * configure, configure.in: -ldl is not needed under *bsd. Added a + check + +2003-03-28 02:38 volker + + * Makefile, Makefile.in, configure, configure.in: added support for + bsd + +2003-03-28 01:38 volker + + * base.cpp: changed a bug in cvs keywords + +2003-03-28 01:32 volker + + * base.cpp: [no log message] + +2003-03-28 01:27 volker + + * COPYING, configure.in: this file should be in every repository ;) + +2003-03-28 01:18 volker + + * Makefile, Makefile.in, configure, configure.in: configure + dependent files + +2003-03-28 00:22 paul + + * hmap.cpp, hmap.h: + + Optimization of the hash map. + +2003-03-27 17:14 volker + + * dltest.cpp, yc_test.cpp: Dynamic module test + +2003-03-26 18:50 paul + + * html/index.html: + + Changed POST back to GET due read bug. + +2003-03-26 17:40 paul + + * reqp.cpp: + + Bugfix. + +2003-03-26 16:44 paul + + * reqp.cpp, sock.cpp, sock.h: + + Fixed segfault bug. ( stream.html request without existing user + object ). + +2003-03-26 16:17 paul + + * sock.cpp: + + Deletion of variables which are no longer needed after procession + ( e.g. map_params ). + +2003-03-26 15:57 paul + + * thrd.cpp: + + Bugfix. Now every socket connection will be closed the right way + ;). + +2003-03-26 00:03 paul + + * chat.cpp, chat.h, sock.cpp: + + Bugfix + added to the class chat a private bool b_strip_html + member. + +2003-03-25 23:52 paul + + * chat.cpp: + + Style fix. + +2003-03-25 23:41 paul + + * msgs.h, sock.cpp: + + Bugfix. + +2003-03-25 23:21 paul + + * name.h: + + Bugfix. + +2003-03-25 23:19 paul + + * Makefile, README.txt, base.cpp, base.h, conf.txt, data.h, + hmap.cpp, hmap.h, name.cpp, name.h: + + Changed because of hashmap integration. base.cpp and base.h still + have to be modified. Afterwards, all user and rooms will be + stored in a hash map. + +2003-03-25 21:06 paul + + * Makefile, hmap.cpp, hmap.h, user.h: + + Hash Map implementation. + +2003-03-25 20:12 volker + + * chat.cpp, conf.txt, s_tool.cpp, s_tool.h: added possibility to + turn html tags on/off in chat messages + +2003-03-25 19:53 paul + + * conf.txt, html.cpp: + + Bugfix. + +2003-03-25 18:44 paul + + * conf.txt: + + Bugfix. + +2003-03-25 17:22 volker + + * conf.txt, main.cpp: removed some typos that where created due to + sed conversation + +2003-03-25 15:54 volker + + * CHAT.cpp, CHAT.h, CONF.cpp, CONF.h, HTML.cpp, HTML.h, MUTX.cpp, + MUTX.h, Makefile, README.txt, SOCK.cpp, SOCK.h, TOOL.cpp, TOOL.h, + chat.cpp, chat.h, cmnd.cpp, conf.cpp, conf.h, conf.txt, cont.cpp, + data.h, glob.h, html.cpp, html.h, main.cpp, msgs.h, mutx.cpp, + mutx.h, pool.cpp, reqp.cpp, s_chat.cpp, s_chat.h, s_conf.cpp, + s_conf.h, s_html.cpp, s_html.h, s_mutx.cpp, s_mutx.h, s_sock.cpp, + s_sock.h, s_tool.cpp, s_tool.h, sock.cpp, sock.h, thrd.cpp, + user.cpp: changed filenames to windows compatible ones + +2003-03-25 00:49 paul + + * README.txt: + + Bugfixes. + +2003-03-25 00:40 paul + + * todo.txt: + + New brainstorming. + +2003-03-25 00:16 paul + + * TOOL.cpp, TOOL.h, chat.cpp, msgs.h: + + Added check routine if a login nick is alphanumeric or not. If + not a message will appear on the startpage instead of logging in + which may would end in a segmentation fault. + +2003-03-24 23:45 paul + + * main.cpp: [no log message] + +2003-03-24 23:43 paul + + * README.txt, chat.cpp, msgs.h, user.cpp, user.h: + + Added support for chat commands ( chat commands still have to be + implemented ). If you type "/testhere" ychat will tell that + there is no such command! + +2003-03-24 00:30 paul + + * Makefile, cmnd.cpp, main.cpp, msgs.h, reqp.cpp, reqp.h, sock.cpp, + sock.h, thrd.cpp, user.cpp, user.h: [no log message] + +2003-03-23 23:34 vrichter + + * reqp.cpp: removed bogus sock.h + +2003-03-23 23:29 vrichter + + * reqp.cpp, sock.cpp: bugfix POST system + +2003-03-23 20:03 vrichter + + * html/index.html: changed the method of the login form to POST + +2003-03-23 20:02 vrichter + + * reqp.cpp, reqp.h: the request parser now supports POST + +2003-03-23 16:16 paul + + * pool.cpp: + + Fixed changing date! ( System clock was set wrong ), + +2003-03-23 16:05 paul + + * pool.cpp: [no log message] + +2003-03-23 12:33 paul + + * conf.txt, pool.cpp: [no log message] + +2003-03-23 06:41 paul + + * base.cpp, chat.cpp, conf.cpp, cont.cpp, html.cpp, main.cpp, + mutx.cpp, name.cpp, reqp.cpp, room.cpp, thrd.cpp, user.cpp, + msgs.h: [no log message] + +2003-03-23 06:26 paul + + * pool.cpp: [no log message] + +2003-03-23 05:55 paul + + * Makefile, README.txt, conf.txt, glob.h, main.cpp, msgs.h, + pool.cpp, pool.h, reqp.h, sock.cpp, sock.h: [no log message] + +2003-03-22 23:07 paul + + * README.txt: [no log message] + +2003-03-22 22:56 paul + + * html.h: [no log message] + +2003-03-22 07:40 vrichter + + * reqp.h: fixed a paste error + ---------------------------------------------------------------------- + +2003-03-21 20:38 vrichter + + * yc.tgz, ychat: removed binary files that were transfered + +2003-03-21 19:31 vrichter + + * reqp.cpp, reqp.h, ychat: added url decoding + +2003-03-21 16:54 root + + * CHAT.cpp, CHAT.h, CONF.cpp, CONF.h, HTML.cpp, HTML.h, MUTX.cpp, + MUTX.h, Makefile, README.txt, SOCK.cpp, SOCK.h, TOOL.cpp, TOOL.h, + base.cpp, base.h, chat.cpp, chat.h, cmnd.cpp, cmnd.h, conf.cpp, + conf.h, conf.txt, cont.cpp, cont.h, data.h, glob.h, html.cpp, + html.h, incl.h, main.cpp, msgs.h, mutx.cpp, mutx.h, name.cpp, + name.h, reqp.cpp, reqp.h, room.cpp, room.h, sock.cpp, sock.h, + thrd.cpp, thrd.h, todo.txt, user.cpp, user.h, yc.tgz, ychat, + gfx/y_ani_black.gif, gfx/y_ani_white.gif, html/blank.html, + html/frameset.html, html/index.html, html/input.html, + html/notfound.html, html/online.html, html/stream.html, + html/y_ani.gif: Initial revision + +2003-03-21 16:54 root + + * CHAT.cpp, CHAT.h, CONF.cpp, CONF.h, HTML.cpp, HTML.h, MUTX.cpp, + MUTX.h, Makefile, README.txt, SOCK.cpp, SOCK.h, TOOL.cpp, TOOL.h, + base.cpp, base.h, chat.cpp, chat.h, cmnd.cpp, cmnd.h, conf.cpp, + conf.h, conf.txt, cont.cpp, cont.h, data.h, glob.h, html.cpp, + html.h, incl.h, main.cpp, msgs.h, mutx.cpp, mutx.h, name.cpp, + name.h, reqp.cpp, reqp.h, room.cpp, room.h, sock.cpp, sock.h, + thrd.cpp, thrd.h, todo.txt, user.cpp, user.h, yc.tgz, ychat, + gfx/y_ani_black.gif, gfx/y_ani_white.gif, html/blank.html, + html/frameset.html, html/index.html, html/input.html, + html/notfound.html, html/online.html, html/stream.html, + html/y_ani.gif: imported files into ychat cvs + diff --git a/Makefile.in b/Makefile.in index 7c2a0c1..300d035 100755 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -SRCS=base.cpp chat.cpp s_chat.cpp cmnd.cpp conf.cpp s_conf.cpp cont.cpp html.cpp s_html.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 +SRCS=chat.cpp s_chat.cpp cmnd.cpp conf.cpp s_conf.cpp cont.cpp html.cpp s_html.cpp lang.cpp s_lang.cpp logd.cpp main.cpp modl.cpp s_modl.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 OBJS=$(SRCS:.cpp=.o) CC=g++ LDFLAGS=@LDFLAGS@ -lstdc++ -g diff --git a/README b/README index 5b94c8c..3ae4b74 100755 --- a/README +++ b/README @@ -1,7 +1,5 @@ -yhttpd; Homepage: www.yhttpd.org; Version 0.7.1-RELEASE - +yChat++ Basic; Homepage: www.yChat.org; Version 0.5.1 Copyright (C) 2003 Paul C. Buetow, Volker Richter -Copyright (C) 2004 Paul C. Buetow ----------------------------------------------------------------- This program is free software; you can redistribute it and/or @@ -17,246 +15,221 @@ 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. ------------------------------------------------------------------ -YHTTPD TABLE OF CONTENTS: +----------------------------------------------------------------- +0.0.0 YCHAT++ BASIC TABLE OF CONTENTS 1.0.0 REQUIREMENTS 1.1.0 TESTED PLATFORMS -1.2.0 IMPORTANT NOTICES -1.3.0 HOW TO OBTAIN YHTTPD +1.2.0 IMPORTANT NOTES +1.3.0 HOW TO OBTAIN YCHAT++ 1.3.1 INSTALLATION -1.3.2 INSTALLATION QUICK-START -1.4.0 HOW TO USE SCREEN WITH YHTTPD 1.5.0 CUSTOMIZATION 1.6.0 FILES 1.7.0 WRITING BUG REPORTS 1.8.0 CONTACT - 1.0.0 REQUIREMENTS: -- GNU GCC G++ 3.4 or 3.3 or 3.2 or 3.1 - The GNU C++ compiler. G++ version 3.0 or 2.x does NOT work. +- gcc 3.2 + The GNU C++ compiler. -- GNU make 3.80 (gmake) or higher - If you dont have a gmake executable but make is gnu make then you need - to add a symlink or alias from gmake to make. - yhttpd Makefiles only have been tested with GNU make and may not work with - other make versions. +1.1.0 TESTED PLATFORMS: -- ncurses 5.x - Includes libncurses and the ncurses.h header files. +The following platforms have been tested with success: -- Screen - Only needed if yhttpd should run in background with - ncurses or CLI enabled. +- Linux with GCC 3.2.0, GNU make 3.79.1 +- FreeBSD 5.1-RELEASE-p2, GCC 3.2.2, GNU make 3.80 ( standard make does not seem work on FreeBSD ). -- Perl 5.x - Is needed for some scripts. Is not needed if you use precompiled binaries. +1.2.0 IMPORTANT NOTES: -1.1.0 TESTED PLATFORMS: +Before you compile the source you have to be sure to use at least GCC +version 3.x with pthreads enabled. ( Type gcc -v to check it ). +GCC 2.95 did not work while testing on linux and WON'T BE SUPPORTED! +If you like to support yChat++, please write us an email and tell what +you can/like/would help ;-]. Please also take a look at the yChat++ +homepage which is located at http://www.yChat.org. -The following platforms have been tested with success. If you find out that -a listed platform did not work at all please contact me: +1.3.0 HOW TO OBTAIN YCHAT++: - Operating system (arch) GNU G++ GNU make -- FreeBSD 5.2.1-RELEASE (i386) 3.3.3 3.80 -- FreeBSD 4.9-RELEASE (i386) 3.3.4 3.80 -- FreeBSD 4.10-RELEASE (i386) 3.4.1 3.80 -- Gentoo Linux 2004.2 (i386) 3.3.2 3.80 -- OpenBSD 3.6 MP (i386) 3.3.2 3.80 -- Slackware Linux 10.0 (i386) 3.4.0 3.80 -- SUSE Linux 8.0, G (i386) 3.3.1 3.80 +yChat can be downloaded as a source package or through CVS. -Other platforms like Linux based systems, other BSD-Systems or UNICES -are very likely to work too. +The packages are located at http://www.yChat.org -> Sourcecode -> +Packages or go to http://programming.buetow.org/CPP-yChat . -1.2.0 IMPORTANT NOTICES: +For CVS download type also look at the homepage please. -Before you compile the source you have to be sure to use at least GCC -version 3.1 with pthreads enabled. ( Type gcc -v to check it ). -GCC 2.95 and 3.0 did not work while testing and WON'T BE SUPPORTED! -If you like to support yhttpd++, please write us an email and tell what -you can/like/would help ;-]. Please also take a look at the yhttpd++ -homepage which is located at http://www.yhttpd.org. +1.3.1 INSTALLATION: -1.3.0 HOW TO OBTAIN YHTTPD++: +Invoke "./configure" and afterwards "make", edit the conf.txt. -yhttpd can be downloaded as a source package or through CVS. +Now we want to compile all the dynamic loadable modules of ychat. +Invoke "cd cmnd && ./compile.sh && cd -". All command modules should get +compiled. -The packages are located at http://www.yhttpd.org -> Sourcecode -> -Packages or go to http://pub.buetow.org/yhttpd/CPP-yhttpd . +Now its time to run the server with ./ychat. +Then point your webbrowser to http://yourip:port ! -For CVS download type: +... have fun :-). -cvs -d:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot login -( You will be asked for a password. Use "just enter" ). +1.5.0 CUSTOMIZATION: -vs -z3 -d:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot co yhttpd -( The sources will be copied into your local folder ) +If you like to customize the design/layout/language of yChat, you will have +to edit msgs.h and glob.h before you compile the sources. Afterwards you can +change the html-template files which are placed in the html/ subdirectory. +Dynamic loadable modules can be found in the cmnd/ subdirectory. -cvs -d:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot logout -( Logs your CVS session out ). +1.6.0 FILES: ( This list is not complete ) -Now you may continue with the installation. +conf.txt - The yChat configuration file. ( read by conf.cpp ). -1.3.1 INSTALLATION: +base.cpp - Encapsulates vector fields of room's or user ( may be later + hash_maps ) and provides methods for manipulating data + objects. -Invoke "./configure". Afterwards you will get prompted with the before-compile -options of yhttpd. After choosing those options you are ready to type "gmake" -afterwards. - - -You may also invoke gmake with the following options (the PREFIX can be set -in the yhttpd configurator which will be launched by the top configure script -or gmake config): - - gmake or gmake all (compiles everything, also modules) - gmake base (only compiles the base) - gmake base_start (only compiles the base and starts the server) - gmake clean (cleans everything) - gmake clean_base (only cleans the base obj and rpo files) - gmake clean_modules (only cleans the modules .so files) - gmake config (runs yhttpd configurator) - gmake deinstall (deinstalls yhttpd from PREFIX) - gmake gpl (shows the GNU General Public License) - gmake help (shows all available yhttpd gmake targets) - gmake install (installs yhttpd to PREFIX) - gmake modules (only compiles modules) - gmake mrproper (same as gmake clean plus removing all temp files) - gmake setup (runs all configure scripts and afterwards gmake all) - gmake start (compiles everything and starts the server) - gmake stats (generates yhttpd statistics) - gmake uninstall (same as deinstall) - gmake version (shows the current version of yhttpd) - -Example: "gmake all install clean" compiles everything, installs it to PREFIX -and cleans the source directories. - -Now its time to run the server with ./bin/yhttpd. - -Aferwards point your webbrowser to http://yourip:port ! +hmap.cpp - The hash map implementation which is a very fast data + structure. is needed for saving users, rooms and so on. -... have fun :-). +main.cpp - This includes the required manager headers for starting + the server and finally regulates the correct starting. -1.3.2 INSTALLATION QUICK START: +modl.cpp - The module loader. Stores pointers of all dynamic loaded + yChat modules in a hash map object and loads new modules + if desired or returns their pointers. -If you in hury, then you may just type gmake setup. In the yhttpd configurator -you may just choose all the default values. If done, yhttpd will get compiled -and is ready to run with ./bin/yhttpd! +pool.cpp - The implementation of the thread pool. all threads are stored + in a queue. Each thread will be reused if the assigned job is + finished. +reqp.cpp - This class implements the http request parser. If a client + starts a request to the server the reqp class will be + invoked. -1.4.0 HOW TO USE SCREEN WITH YHTTPD: +room.cpp - Specifies a chat room. For each chat room an instance of + this class exists. -If you are running yhttpd in ncurses mode you might want to install -the tool which is called "screen". This will enable you putting the -ncurses interface into the background, closing the terminal session -and reusing the interface later through another terminal. +thrd.cpp - This class is needed by sock.cpp while creating a POSIX thread. + All data which a thread needs to do its tasks are stored in a + thrd object and then a pointer to it will be passed to the + POSIX thread function. -Just do: - - screen -S yhttpd ./bin/yhttpd ( creates a new session and starts yhttpd in it ) - ctrl+d+a ( will detach the yhttpd session ) - ( closing the terminal ) - ( opening a new terminal ) - screen -r yhttpd ( will return you to the yhttpd process ) +user.cpp - Specifies a chat user. For each chat user an instance of + this class exists. -Screen will terminate automaticaly if all processes in its sessions are -terminated. +Abstract classes: -For a closer look read the screen manual page ( man screen ). +cont.cpp - All classes which need to store "key - value" data sets + inherit from this class. ( cont for content ). -1.5.0 CUSTOMIZATION: +name.cpp - All classes which own a private member string name inherit + from this class. It also provides public get_name and + set_name methods. + +As described ( main.cpp ), there are so called managers. Managers are +accessible through their assigned wrapper classes and may be +instanciated only once. + +chat.cpp - The chat manager. Is responsible for managing the internal + data structure of the system and also covers a lot of + important methods of the system. + +conf.cpp - The config manager. Parses the config file specified in + glob.h and stores all the values of it in a map. -If you like to customize the design/layout/language of yhttpd, you will have -to edit src/msgs.h and src/glob.h before you compile the sources. Afterwards -you can change the html-template files which are placed in the html/ -subdirectory and the language-templates which are placed in the XML config -file (etc/yhttpd.conf). +html.cpp - The html-template manager. Reads the requested html-template + files, stores them in an internal cache ( averts reading + template-files from hd twice or more ) and parses the + partivular template in order to substituate dynamic values + of it. -Notice, that you dont have to edit the src/glob.h file by hand any more, its -already done by the top ./configure script for you. +mutx.cpp - The mutex manager. Contains all global mutex handlers for + synchronizing POSIX thread shared data. until now only the + stdout is synchronized by mutx.cpp because most of objects + use their own mutex'. -You can edit the etc/yhttpd.conf to fit your needs. If you dont want to change -the config file, then you also can use yhttpd start parameters. +sock.cpp - The socket manager. Manages the socket connections. There + are multiplexed sockets. For each requests a new POSIX thread + will be created. -Exmpl: ./bin/yhttpd -o chat.database.password secretpassword +Files with a leading s_ contain static C++ classes -You can also use multiple words for a specific option. +s_chat.cpp - Static wrapper for the dynamic chat class. holds one global + reachable instance of chat until the program shuts down. -Exmpl: ./bin/yhttpd -o yhttpd.version "word1 word2 word3" +s_conf.cpp - Static wrapper for the dynamic conf class. holds one global + reachable instance of conf until the program shuts down. -will overwrite the default database password value of the yhttpd.conf. You can -do this with every configuration element by adding several -o option value -arguments to the start command. +s_html.cpp - Static wrapper for the dynamic html class. holds one global + reachable instance of conf until the program shuts down. -Dynamic loadable modules can be found in the mods/ subdirectory. (chat -commands are realized through modules too). Sources of modules can be found -in src/mods instead. If you want to create a new module just create a new -.cpp file and run in src/mods the ./configure script again. Next time -you run gmake your new module gets compiled. +s_mutx.cpp - Static wrapper for the dynamic mutx class. holds one global + reachable instance of conf until the program shuts down. -All messages defined in the msgs.h file contain server messages only ( a chat -user never wont read them, only the administrator will get to see them ). +s_sock.cpp - Static wrapper for the dynamic sock class. holds one global + reachable instance of conf until the program shuts down. -1.6.0 FILES: +s_tool.cpp - Static class which includes some usefull global reachable + methods which are not integraded in independent classes. -etc/yhttpd.conf - The yhttpd configuration file -html/* - The html template files -src/* - The yhttpd base sources -src/mods/* - The dynamic loadable modules sources -scripts/* - Some nice scripts needed for building & co. +Special header files ( all other header files which are not listed here +belong to their respective .cpp files ): -The following is created by building yhttpd: -obj/* - The object files of the compiled yhttpd base -mods/* - The compiled dynamic loadable modules -bin/yhttpd - The yhttpd binary (linked by the object files) +glob.h - Defines global variables which are known by compilation + time. -Customizable source files (if changed you need to run gmake clean all) -src/glob.h - Contains some global building options -src/msgs.h - Defines some server side messages +incl.h - This file is included from every other header file and + includes a set of headers which every class should be able + to use. +msgs.h - Defines console output messages for verbosity level 0 ( see + glob.h for setting up verbosity levels ). and also defines + all the system messages. you may edit this file for translating + the system user language. + +The basic class structure: + + base base + | | name + | | / \ + | | / \ + chat room user + + cont + / \ + / \ +conf html 1.7 WRITING BUG REPORTS How to submit a good bug report? -Send them to Bug@yhttpd.org. +Send them to Bug@yChat.org. First you should give the following information: -- yhttpd version, if CVS (or devel. tarball) then which day? +- yChat version, if CVS (or devel. tarball) then which day? - operating system / distribution and it's version - when did it crash? did you do something? can you reproduce the crash? -Getting backtrace of the crash also helps a lot, especially if yhttpd crashes -randomly. If after crash you see text: +Getting backtrace of the crash also helps a lot, especially if yChat crashes randomly. If after crash you see text: "segmentation fault (core dumped)" -It writes a file named "core" or "yhttpd.core" depending on your OS to directory -where you started yhttpd. If it doesn't print the "(core dumped)" or you can't -find the core file, you'll have to raise the limit for max. core file size -before running yhttpd. To do this, say: +It writes a file named "core" or "ychat.core" depending on your OS to directory where you started yChat. If it doesn't print the "(core dumped)" or you can't find the core file, you'll have to raise the limit for max. core file size before running yChat. To do this, say: ulimit -c unlimited -So, if you have the core file and GNU debugger (gdb), you can get the -backtrace with: +So, if you have the core file and GNU debugger (gdb), you can get the backtrace with: - gdb ./bin/yhttpd yhttpd.core + gdb ychat core bt Paste all the lines starting from line having #0 at the beginning. Here's an example session: - in reqp::parse(thrd*, std::string, std::map, std::allocator > >&) () + in reqp::parse(thrd*, std::string, std::map, std::allocator > >&) () (gdb) bt - #0 0x0805c287 in reqp::parse(thrd*, std::string, std::map, std::allocator > >&) () + #0 0x0805c287 in reqp::parse(thrd*, std::string, std::map, std::allocator > >&) () #1 0x0806060f in sock::read_write(thrd*, int) () #2 0x080612ba in thrd::run() () #3 0x0805a3b8 in pool::run_func(void*) () @@ -264,29 +237,20 @@ Here's an example session: #5 0x281d44ae in _thread_start () from /usr/lib/libc_r.so.5 (gdb) -If you dont get such a gdb output, you need to recompile the yhttpd using -debuggig symbols. You can do it this way: - -cd yhttpd -gmake mrproper -./configure -g3 -ggdb -gmake start - 1.8 CONTACT: You may contact us through the following addresses: - Homepage - The yhttpd homepage is located at http://www.yhttpd.org + The yChat homepage is located at http://www.yChat.org - E-Mail - Paul C. Buetow: Snooper at yhttpd point org ( core developer ) - Volker Richter: Rover at yhttpd dot org ( core developer ) - Mail at yhttpd dot org ( reaches everybody of yhttpd ) + Paul C. Buetow: Snooper@yChat.org ( core developer ) + Volker Richter: Rover@yChat.org ( core developer ) + Mail@yChat.org ( reaches everybody of yChat ) - ICQ Paul C. Buetow: 11655527 - IRC - #Ychat and #Coding at irc.german-elite.net - + #ychat at irc.german-elite.net diff --git a/base.cpp b/base.cpp index 9a67340..ce585ea 100755 --- a/base.cpp +++ b/base.cpp @@ -1,3 +1,11 @@ +/* + This file is part of yChat + + $Author: snooper $ + $Date: 2003/04/02 10:50:18 $ + + $Header: /cvsroot/ychat/ychat/base.cpp,v 1.8 2003/04/02 10:50:18 snooper Exp $ +*/ // template class data implementation; #ifndef BASE_CPP @@ -5,84 +13,53 @@ #include "base.h" -base::base() +template +base::base() { - pthread_mutex_init (&mut_vec_elem, NULL ); + map_elem = new hmap(80); + pthread_mutex_init (&mut_map_elem, NULL ); } -base::~base( ) +template +base::~base( ) { - pthread_mutex_destroy( &mut_vec_elem ); + pthread_mutex_destroy( &mut_map_elem ); } -void -base::add_elem( name* p_name ) +template void +base::add_elem( type* p_type ) { - pthread_mutex_lock ( &mut_vec_elem ); - vec_elem.push_back ( p_name ); - pthread_mutex_unlock( &mut_vec_elem ); + pthread_mutex_lock ( &mut_map_elem ); + map_elem->add_elem ( p_type, p_type->get_name()); + pthread_mutex_unlock( &mut_map_elem ); } -bool -base::del_elem( string &s_name ) +template void +base::del_elem( string &s_name ) { - vector::iterator iter; - pthread_mutex_lock ( &mut_vec_elem ); - - iter = vec_elem.begin(); - while( iter != vec_elem.end() ) - { - if ( (*iter)->get_name() == s_name ) - { - vec_elem.erase( iter ); - pthread_mutex_unlock( &mut_vec_elem ); - return true; - } - iter++; - } - - pthread_mutex_unlock( &mut_vec_elem ); - return false; + pthread_mutex_lock ( &mut_map_elem ); + map_elem->del_elem ( s_name ); + pthread_mutex_unlock( &mut_map_elem ); } -name* -base::get_elem( string &s_name, bool &b_found ) +template type* +base::get_elem( string &s_name, bool &b_found ) { - vector::iterator iter; - pthread_mutex_lock ( &mut_vec_elem ); - - iter = vec_elem.begin(); - while( iter != vec_elem.end() ) - { - if ( (*iter)->get_name() == s_name ) - { - b_found = true; - pthread_mutex_unlock( &mut_vec_elem ); - return (*iter); - } - iter++; - } + pthread_mutex_lock ( &mut_map_elem ); + type* p_type = map_elem->get_elem( s_name ); + pthread_mutex_unlock( &mut_map_elem ); - pthread_mutex_unlock( &mut_vec_elem ); + b_found = p_type == NULL ? false : true; - b_found = false; - - return new name(); + return p_type; } -void -base::run_func( void (*func)(name*, void*), void* v_arg ) +template void +base::run_func( void (*func)(type*, void*), void* v_arg ) { - vector::iterator iter; - pthread_mutex_lock ( &mut_vec_elem ); - - // execute func foreach element of vec_elem with - // 1st argument: a pointer of a element of vec_elem. - // 2nd argument: a void pointer of a object. - for( iter = vec_elem.begin(); iter != vec_elem.end(); iter++ ) - ( *func ) ( (*iter), v_arg ); - - pthread_mutex_unlock( &mut_vec_elem ); + pthread_mutex_lock ( &mut_map_elem ); + map_elem->run_func( func, v_arg ); + pthread_mutex_unlock( &mut_map_elem ); } #endif diff --git a/base.h b/base.h index d1c37ba..6f06e4b 100755 --- a/base.h +++ b/base.h @@ -3,26 +3,69 @@ #ifndef BASE_H #define BASE_H -#include #include "incl.h" -#include "name.h" +#include "hmap.h" +template class base { private: - vector vec_elem ; - pthread_mutex_t mut_vec_elem; + hmap* map_elem; + pthread_mutex_t mut_map_elem; public: base(); ~base(); - virtual void add_elem( name* p_name ); // add a element. - virtual bool del_elem( string &s_name ); // delete a alement. - virtual name* get_elem( string &s_name, bool &b_found ); // get a element. + virtual void add_elem( type* p_type ); // add a element. + virtual void del_elem( string &s_name ); // delete a alement. + virtual type* get_elem( string &s_name, bool &b_found ); // get a element. - // execute func on all elements of vec_elem. v_pointer is the argument. - virtual void run_func( void (*func)(name*, void*), void* v_arg ); + // execute func on all elements of map_elem. v_pointer is the argument. + virtual void run_func( void (*func)(type*, void*), void* v_arg ); + + // 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. + void msg_post( string *s_msg ) + { + run_func( &base::msg_post_ , (void*)s_msg ); + } + static void msg_post_( type* type_obj, void* v_arg ) + { + string *p_msg = (string*) v_arg; + type_obj -> msg_post( p_msg ); + } + + void get_data( map_string *p_map_string ) + { + run_func( &base::get_data_ , (void*)p_map_string ); + } + static void get_data_( type* type_obj, void* v_arg ) + { + map_string *map_params = (map_string*) v_arg; + type_obj -> get_data ( map_params ); + } + + // 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 usernameseperator + void get_user_list( string &s_list, string &s_seperator ) + { + + container c; + c.elem[0] = (void*) &s_list; + c.elem[1] = (void*) &s_seperator; + + run_func( &base::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]), *((string*)c->elem[1]) ); + } }; +#include "base.cpp" + #endif diff --git a/chat.cpp b/chat.cpp index 7b0ccd2..b845ec3 100755 --- a/chat.cpp +++ b/chat.cpp @@ -1,16 +1,22 @@ // class chat implementation. -#ifndef CHAT_CXX -#define CHAT_CXX +#ifndef s_chat_CXX +#define s_chat_CXX #include "chat.h" -#include "CONF.h" -#include "MUTX.h" +#include "s_conf.h" +#include "s_mutx.h" +#include "s_tool.h" using namespace std; chat::chat( ) { + if ( s_conf::get().get_val( "HTML" ) == "OFF" ) + b_strip_html = true; + else + b_strip_html = false; + } chat::~chat( ) @@ -41,10 +47,9 @@ chat::get_user( string &s_user, bool &b_found ) } void -chat::get_user_( name *name_obj, void *v_arg ) +chat::get_user_( room *room_obj, void *v_arg ) { container* param = (container*) v_arg; - room *room_obj = static_cast(name_obj); param->elem[2] = (void*)room_obj->get_elem( *((string*)param->elem[0]), *((bool*)param->elem[1]) ); } @@ -53,11 +58,19 @@ chat::login( map_string &map_params ) { string s_user = map_params["nick"]; - // prove if nick is empty + // prove if nick is empty: if ( s_user.empty() ) { map_params["INFO"] = E_NONICK; - map_params["request"] = CONF::get().get_val( "STARTMPL" ); // redirect to the startpage. + map_params["request"] = s_conf::get().get_val( "STARTMPL" ); // redirect to the startpage. + return; + } + + // prove if the nick ist alphanumeric: + else if ( ! s_tool::is_alpha_numeric( s_user ) ) + { + map_params["INFO"] = E_ALPNUM; + map_params["request"] = s_conf::get().get_val( "STARTMPL" ); // redirect to the startpage. return; } @@ -68,7 +81,7 @@ chat::login( map_string &map_params ) if ( b_flag ) { map_params["INFO"] = E_ONLINE; - map_params["request"] = CONF::get().get_val( "STARTMPL" ); + map_params["request"] = s_conf::get().get_val( "STARTMPL" ); return; } @@ -80,10 +93,10 @@ chat::login( map_string &map_params ) { p_room = new room( s_room ); -#ifdef _VERBOSE - pthread_mutex_lock ( &MUTX::get().mut_stdout ); +#ifdef VERBOSE + pthread_mutex_lock ( &s_mutx::get().mut_stdout ); cout << NEWROOM << s_room << endl; - pthread_mutex_unlock( &MUTX::get().mut_stdout ); + pthread_mutex_unlock( &s_mutx::get().mut_stdout ); #endif add_elem( p_room ); @@ -93,29 +106,42 @@ chat::login( map_string &map_params ) // add user to the room. p_room->add_user( p_user ); - + sess *ns =s_sman::get().createSession(); + ns->setValue(string("nick"), (void *)new string(s_user) ); + map_params["tmpid"]=ns->getId(); // post "username enters the chat" into the room. - p_room->msg_post( new string( s_user.append( USERENTR ) ) ); + p_room->msg_post( new string( s_user.append( s_lang::get().get_val( "USERENTR" ) ) ) ); -#ifdef _VERBOSE - pthread_mutex_lock ( &MUTX::get().mut_stdout ); +#ifdef VERBOSE + pthread_mutex_lock ( &s_mutx::get().mut_stdout ); cout << LOGINPR << s_user << endl; - pthread_mutex_unlock( &MUTX::get().mut_stdout ); + pthread_mutex_unlock( &s_mutx::get().mut_stdout ); #endif } void -chat::post( user* u_user, map_string &map_params ) +chat::post( user* p_user, map_string &map_params ) { - string s_msg( "get_col1() ) - .append( "\">" ) - .append( u_user->get_name() ) - .append( ": " ) - .append( map_params["message"] ) - .append( "
\n" ); - - u_user->get_p_room()->msg_post( &s_msg ); + + string s_msg( map_params["message"] ); + + auto unsigned i_pos = s_msg.find( "/" ); + if ( i_pos == 0 ) + return p_user->command( s_msg ); + + if ( b_strip_html ) + s_tool::strip_html( &s_msg ); + + string s_post( "get_col1() ) + .append( "\">" ) + .append( p_user->get_name() ) + .append( ": " ) + .append( s_msg ) + .append( "
\n" ); + + p_user->get_p_room()->msg_post( &s_post ); } #endif diff --git a/chat.h b/chat.h index 164c0c4..60bcf9d 100755 --- a/chat.h +++ b/chat.h @@ -1,21 +1,27 @@ // class chat declaration. -#ifndef CHAT_H -#define CHAT_H +#ifndef s_chat_H +#define s_chat_H #include #include "incl.h" -#include "data.h" +#include "base.h" #include "room.h" #include "user.h" +#include "sess.h" +#include "s_lang.h" +#include "s_sman.h" using namespace std; -class chat : public data +class chat : public base { private: + bool b_strip_html; public: + + room* get_room( string &s_name, bool &b_found ) { return static_cast( get_elem( s_name, b_found ) ); @@ -28,7 +34,7 @@ public: // get the object of a specific user. virtual user* get_user( string &s_nick ); virtual user* get_user( string &s_nick, bool &b_found ); - static void get_user_( name* name_obj, void *v_arg ); + static void get_user_( room* room_obj, void *v_arg ); // will be called every time a user tries to login. virtual void login( map_string &map_params ); diff --git a/cmnd.cpp b/cmnd.cpp index 9ab008a..28e73a7 100755 --- a/cmnd.cpp +++ b/cmnd.cpp @@ -4,7 +4,7 @@ #define CMND_CXX #include "cmnd.h" -#include "MUTX.h" +#include "s_mutx.h" using namespace std; diff --git a/cmnd/yc_getrusage.cpp b/cmnd/yc_getrusage.cpp new file mode 100644 index 0000000..4e10e7c --- /dev/null +++ b/cmnd/yc_getrusage.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include +#include "../user.h" + +#define RUSAGE_SELF 0 +#define RUSAGE_CHILDREN -1 + +/* + gcc -shared -o yc_name.so yc_name.cpp +*/ + +using namespace std; + +typedef vector str_vector; + +extern "C" { + export int extern_function(void *v_arg); + + int extern_function(void *v_arg) + { + user *p_user = (user*) v_arg; + rusage* p_rusage = new rusage; + getrusage( RUSAGE_SELF, p_rusage ); + char c_msg[1024]; + + /* see man getrusage */ + + sprintf(c_msg, "getrusage:
\nmaxrss: %D (max resident set size)
\nixrss: %D (integral shared text memory size)
\nidrss: %D (integral unshared data size)
\nisrss %D (integral unshared stack size)
\nminflt: %D (page reclaims)
\nmajflt: %D (page faults)
\nnswap: %D (swaps)
\ninblock: %D (block input operations)
\noublock: %D (block output operations)
\nmsgsnd: %D (messages sent)
\nmsgrcv: %D (messages received)
\nnsignals: %D (signals received)
\nnvcsw: %D (voluntary context switches)
\nnivcsw: %D (involuntary context switches)
\n", + p_rusage->ru_maxrss, + p_rusage->ru_ixrss, + p_rusage->ru_idrss, + p_rusage->ru_isrss, + p_rusage->ru_minflt, + p_rusage->ru_majflt, + p_rusage->ru_nswap, + p_rusage->ru_inblock, + p_rusage->ru_oublock, + p_rusage->ru_msgsnd, + p_rusage->ru_msgrcv, + p_rusage->ru_nsignals, + p_rusage->ru_nvcsw, + p_rusage->ru_nivcsw + ); + + p_user->msg_post( new string( c_msg ) ); + } +} + diff --git a/conf.cpp b/conf.cpp index 5214edb..3ff71b8 100755 --- a/conf.cpp +++ b/conf.cpp @@ -1,7 +1,7 @@ // class conf implementation. -#ifndef CONF_CXX -#define CONF_CXX +#ifndef s_conf_CXX +#define s_conf_CXX #include #include "conf.h" @@ -20,7 +20,7 @@ conf::~conf() void conf::parse() { -#ifdef _VERBOSE +#ifdef VERBOSE cout << CFILEOK << get_name() << endl; #endif @@ -28,7 +28,7 @@ conf::parse() if ( ! fs_conf ) { -#ifdef _VERBOSE +#ifdef VERBOSE cout << CFILENO << get_name() << endl; #endif return; @@ -60,7 +60,7 @@ conf::parse() string s_val = s_token.substr( ui_pos+1, s_token.length() ); string s_key = s_token.substr( 0 , --ui_pos ); -#ifdef VERBOSE +#ifdef VERBOSE2 cout << s_key << "=" << s_val << endl; #endif diff --git a/conf.h b/conf.h index a3b5022..6e2a890 100755 --- a/conf.h +++ b/conf.h @@ -1,7 +1,7 @@ // class conf declaration. this class parses the server config file. -#ifndef CONF_H -#define CONF_H +#ifndef s_conf_H +#define s_conf_H #include "incl.h" #include "cont.h" diff --git a/conf.txt b/conf.txt index c31c554..936af92 100755 --- a/conf.txt +++ b/conf.txt @@ -17,31 +17,47 @@ # server specific configurations ( not allowed to be removed ): HTMLTEMP="html/"; # directory of the html-template files. -THRDPOOL="10"; # thread pool size. every time all threads are used so many new - # threads will be added to the pool. -THRDQUEU="100"; # length of the thread pool queue. -SRVRPORT="2000"; # local port on which the server listens. +THRDPOOL="50"; # thread pool size. +THRDQUEU="50"; # length of the thread pool queue. +SRVRPORT="3000"; # local port on which the server listens. STRDROOM="Lounge"; # the name of the standard room. +LANGUAGE="en"; # language of the chat outputs ( CONSOLE OUTPUT IS NOT AFFECTED ) # the html template file which will be send if the requested file does not exists. NOTFOUND="notfound.html"; # specifies the standard start html-template. STARTMPL="index.html"; # user's standard nick color. -USERCOL1="#000000"; - -# superuser level names. level 0 has the most provileges. -SULEVEL0="Coder"; # programmer. -SULEVEL1="Admin"; # administrator. -SULEVEL2="Magic"; # super user with special privileges. -SULEVEL3="Super"; # temporary super user. -SULEVEL4="Basic"; # normal user without special privileges. -SULEVEL5="Guest"; # guest user, has almost no privileges. -SULEVEL6="Restr"; # a very restricted user. -SULEVEL7="Outbn"; # banned out of the system. +USERCOL1="#FFFFFF"; + +# length of the generated session id +SESSION_LENGTH="32"; + +# html = "OFF" strips all html tags from incoming messages +HTML="OFF"; + +# Logging + +# relative or absolute path to logfile +ACCESS_LOG="log/access_log"; + +# we're using buffered logging for performance +# LOG_LINES specifies after how many lines the log is flushed into a file +# if you don't want buffered logging set LOG_LINES to 1 +LOG_LINES="10"; # values which are used by the html-templates and are not sticked within the yC++ core source! GRAPHICS="http://paul.buetow.info/yChat"; # url for graphic files etc. PGETITLE="yChat++ Basic - Fast Simple Extensible"; +# do not edit beyond this line + +CT_HTM="text/html"; +CT_HTML="text/html"; +CT_GIF="image/gif"; +CT_JPG="image/jpeg"; +CT_JPEG="image/jpeg"; +CT_PNG="image/png"; +CT_DEFAULT="text/html"; + # end. diff --git a/configure b/configure index b1d4746..8c5f0a7 100755 --- a/configure +++ b/configure @@ -1,73 +1,1555 @@ -#!/bin/sh +#! /bin/sh -if ! which perl >/dev/null +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev