From ca28c0e618890330d429c0dc12429255b20f0c90 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:44 +0200 Subject: tagging ychat-0.5.0 --- CVS/Entries | 78 ++- CVS/Entries.Log | 8 +- CVS/Root | 2 +- Makefile.in | 4 +- README | 79 +-- base.cpp | 56 +- base.h | 90 +-- chat.cpp | 201 +++---- chat.h | 34 +- cmnd.cpp | 19 + cmnd.h | 18 + cmnd/CVS/Entries | 5 + cmnd/CVS/Repository | 1 + cmnd/CVS/Root | 1 + cmnd/compile.sh | 9 + cmnd/yc_q.cpp | 21 + cmnd/yc_test.cpp | 12 + cmnd/yc_version.cpp | 20 + conf.cpp | 82 ++- conf.h | 8 +- conf.txt | 8 +- configure | 1556 ++++++++++++++++++++++++++++++++++++++++++++++++++- configure.in | 27 +- cont.cpp | 8 +- cont.h | 19 +- gfx/CVS/Entries | 1 + gfx/CVS/Repository | 1 + gfx/CVS/Root | 1 + glob.h | 69 +-- hmap.cpp | 189 +++---- hmap.h | 179 +++--- html.cpp | 206 +++---- html.h | 40 +- html/CVS/Entries | 30 +- html/CVS/Root | 2 +- html/index.html | 4 +- incl.h | 6 +- lang.cpp | 75 ++- lang.h | 8 +- lang/CVS/Entries | 3 + lang/CVS/Repository | 1 + lang/CVS/Root | 1 + log/CVS/Entries | 1 - log/CVS/Root | 2 +- logd.cpp | 83 ++- logd.h | 25 +- main.cpp | 98 ++-- modl.cpp | 174 ++---- modl.h | 19 +- msgs.h | 69 +-- mutx.cpp | 6 +- mutx.h | 12 +- name.cpp | 9 +- name.h | 22 +- pool.cpp | 363 ++++++------ pool.h | 98 ++-- reqp.cpp | 463 +++++++-------- reqp.h | 53 +- room.cpp | 6 +- room.h | 30 +- s_chat.h | 21 +- s_conf.h | 21 +- s_html.h | 21 +- s_lang.h | 22 +- s_modl.h | 21 +- s_mutx.h | 21 +- s_sman.h | 21 +- s_sock.h | 21 +- s_tool.cpp | 166 +++--- s_tool.h | 16 +- sess.cpp | 32 +- sess.h | 20 +- sman.cpp | 95 +--- sman.h | 41 +- sock.cpp | 466 +++++---------- sock.h | 57 +- thrd.cpp | 9 +- thrd.h | 19 +- todo.txt | 36 +- user.cpp | 310 +++------- user.h | 118 ++-- 81 files changed, 3582 insertions(+), 2687 deletions(-) create mode 100755 cmnd.cpp create mode 100755 cmnd.h create mode 100644 cmnd/CVS/Entries create mode 100644 cmnd/CVS/Repository create mode 100644 cmnd/CVS/Root create mode 100755 cmnd/compile.sh create mode 100644 cmnd/yc_q.cpp create mode 100644 cmnd/yc_test.cpp create mode 100644 cmnd/yc_version.cpp create mode 100644 gfx/CVS/Entries create mode 100644 gfx/CVS/Repository create mode 100644 gfx/CVS/Root create mode 100644 lang/CVS/Entries create mode 100644 lang/CVS/Repository create mode 100644 lang/CVS/Root diff --git a/CVS/Entries b/CVS/Entries index 9131cd2..9382269 100644 --- a/CVS/Entries +++ b/CVS/Entries @@ -1,10 +1,70 @@ -/CHANGES/1.17/Mon Feb 14 20:09:50 2005// -/COPYING/1.6/Sun Jun 27 06:32:26 2004// -/INSTALL/1.7/Fri Jul 9 22:33:20 2004// -/Makefile/1.31/Sun Feb 13 07:56:58 2005// -/NEWS/1.34/Thu Feb 17 18:09:41 2005// -/README/1.101/Thu Feb 17 18:09:42 2005// -/RELEASES/1.2/Thu Feb 17 18:09:42 2005// -/TODO/1.68/Mon Feb 14 17:33:09 2005// -/configure/1.31/Wed Feb 9 22:42:58 2005// +/COPYING/1.1/Fri Mar 28 00:27:16 2003// +/Makefile.in/1.7/Sat Apr 19 16:16:14 2003// +/README/1.4/Sun Sep 14 14:48:45 2003// +/base.cpp/1.8/Wed Apr 2 10:50:18 2003// +/base.h/1.5/Wed Apr 2 10:50:18 2003// +/chat.cpp/1.12/Sat Apr 19 19:39:17 2003// +/chat.h/1.8/Sat Apr 19 16:16:14 2003// +/cmnd.cpp/1.3/Tue Mar 25 14:54:07 2003// +/cmnd.h/1.1.1.1/Fri Mar 21 15:54:56 2003// +/conf.cpp/1.5/Fri Apr 4 21:35:59 2003// +/conf.h/1.2/Tue Mar 25 14:54:07 2003// +/conf.txt/1.19/Sun Sep 14 14:31:49 2003// +/configure/1.4/Fri Mar 28 02:02:00 2003// +/configure.in/1.5/Fri Mar 28 02:02:00 2003// +/cont.cpp/1.3/Tue Mar 25 14:54:07 2003// +/cont.h/1.2/Sun Mar 30 00:26:42 2003// +/glob.h/1.6/Sun Sep 14 14:31:49 2003// +/hmap.cpp/1.8/Mon Apr 7 13:24:09 2003// +/hmap.h/1.8/Wed Apr 2 10:50:18 2003// +/html.cpp/1.7/Wed Apr 2 10:50:18 2003// +/html.h/1.3/Tue Mar 25 14:54:07 2003// +/incl.h/1.1.1.1/Fri Mar 21 15:54:56 2003// +/lang.cpp/1.1/Fri Apr 4 22:14:35 2003// +/lang.h/1.1/Fri Apr 4 22:14:35 2003// +/logd.cpp/1.2/Thu Apr 10 15:36:10 2003// +/logd.h/1.1/Fri Apr 4 15:19:11 2003// +/main.cpp/1.11/Sat Apr 19 16:16:14 2003// +/modl.cpp/1.2/Wed Apr 2 21:57:34 2003// +/modl.h/1.1/Wed Apr 2 13:23:09 2003// +/msgs.h/1.12/Sun Sep 14 14:48:45 2003// +/mutx.cpp/1.3/Tue Mar 25 14:54:07 2003// +/mutx.h/1.2/Tue Mar 25 14:54:08 2003// +/name.cpp/1.3/Tue Mar 25 22:19:51 2003// +/name.h/1.3/Tue Mar 25 22:21:26 2003// +/pool.cpp/1.8/Sun Sep 7 12:49:46 2003// +/pool.h/1.1/Sun Mar 23 04:55:58 2003// +/reqp.cpp/1.18/Sun Sep 14 14:31:49 2003// +/reqp.h/1.10/Fri Apr 4 15:19:11 2003// +/room.cpp/1.2/Sun Mar 23 05:41:19 2003// +/room.h/1.2/Fri Mar 28 02:51:03 2003// +/s_chat.cpp/1.1/Tue Mar 25 14:54:08 2003// +/s_chat.h/1.1/Tue Mar 25 14:54:08 2003// +/s_conf.cpp/1.1/Tue Mar 25 14:54:08 2003// +/s_conf.h/1.2/Fri Apr 4 21:35:59 2003// +/s_html.cpp/1.1/Tue Mar 25 14:54:08 2003// +/s_html.h/1.1/Tue Mar 25 14:54:08 2003// +/s_lang.cpp/1.1/Fri Apr 4 22:14:35 2003// +/s_lang.h/1.1/Fri Apr 4 22:14:35 2003// +/s_modl.cpp/1.1/Wed Apr 2 23:01:20 2003// +/s_modl.h/1.1/Wed Apr 2 23:01:20 2003// +/s_mutx.cpp/1.1/Tue Mar 25 14:54:08 2003// +/s_mutx.h/1.1/Tue Mar 25 14:54:08 2003// +/s_sman.cpp/1.1/Sat Apr 19 16:16:15 2003// +/s_sman.h/1.1/Sat Apr 19 16:17:09 2003// +/s_sock.cpp/1.1/Tue Mar 25 14:54:08 2003// +/s_sock.h/1.1/Tue Mar 25 14:54:08 2003// +/s_tool.cpp/1.4/Fri Apr 4 10:41:12 2003// +/s_tool.h/1.4/Fri Apr 4 10:41:12 2003// +/sess.cpp/1.2/Sat Apr 19 19:39:17 2003// +/sess.h/1.2/Sat Apr 19 19:39:17 2003// +/sman.cpp/1.1/Sat Apr 19 16:16:15 2003// +/sman.h/1.2/Sat Apr 19 19:39:17 2003// +/sock.cpp/1.17/Sun Sep 14 14:31:49 2003// +/sock.h/1.6/Fri Apr 4 15:19:11 2003// +/thrd.cpp/1.5/Wed Mar 26 14:57:04 2003// +/thrd.h/1.1.1.1/Fri Mar 21 15:54:56 2003// +/todo.txt/1.4/Sun Mar 30 01:48:46 2003// +/user.cpp/1.7/Fri Apr 4 22:14:35 2003// +/user.h/1.8/Sat Apr 19 19:39:17 2003// D diff --git a/CVS/Entries.Log b/CVS/Entries.Log index ebf29e1..c7be84c 100644 --- a/CVS/Entries.Log +++ b/CVS/Entries.Log @@ -1,7 +1,5 @@ -A D/bin//// -A D/docs//// -A D/etc//// +A D/cmnd//// +A D/gfx//// A D/html//// +A D/lang//// A D/log//// -A D/scripts//// -A D/src//// diff --git a/CVS/Root b/CVS/Root index 745de68..a82e29e 100644 --- a/CVS/Root +++ b/CVS/Root @@ -1 +1 @@ -:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot +:pserver:anonymous@cvs.ychat.berlios.de:/cvsroot/ychat diff --git a/Makefile.in b/Makefile.in index 2a9ca34..300d035 100755 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -SRCS=chat.cpp s_chat.cpp conf.cpp s_conf.cpp cont.cpp dir.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 s_mman.cpp mman.cpp mcon.cpp menu.cpp ncur.cpp s_ncur.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++ -lmysqlclient -lncurses -g +LDFLAGS=@LDFLAGS@ -lstdc++ -g LDADD=-pthread -D_THREAD_SAFE all: ychat $(SRCS): diff --git a/README b/README index 24fe7dc..240c854 100755 --- a/README +++ b/README @@ -1,6 +1,5 @@ -yChat; Homepage: www.yChat.org; Version 0.5.5-CURRENT +yChat++ Basic; Homepage: www.yChat.org; Version 0.5 Copyright (C) 2003 Paul C. Buetow, Volker Richter -Copyright (C) 2005 Paul C. Buetow ----------------------------------------------------------------- This program is free software; you can redistribute it and/or @@ -19,20 +18,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ----------------------------------------------------------------- -0.0.0 LEGACY YCHAT 0.5 TABLE OF CONTENTS +0.0.0 YCHAT++ BASIC TABLE OF CONTENTS 1.0.0 REQUIREMENTS 1.1.0 TESTED PLATFORMS 1.2.0 IMPORTANT NOTES -1.3.0 HOW TO OBTAIN YCHAT +1.3.0 HOW TO OBTAIN YCHAT++ 1.3.1 INSTALLATION 1.5.0 CUSTOMIZATION 1.6.0 FILES -1.7.0 WRITING BUG REPORTS 1.8.0 CONTACT 1.0.0 REQUIREMENTS: -- gcc 3.x +- gcc 3.2 The GNU C++ compiler. 1.1.0 TESTED PLATFORMS: @@ -40,26 +38,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The following platforms have been tested with success: - Linux with GCC 3.2.0, GNU make 3.79.1 -- FreeBSD 5.1-RELEASE-p2, GCC 3.2.2, GNU make 3.80 -- FreeBSD 5.3-RELEASE, GCC 3.4, GNU make 3.80 +- FreeBSD 5.1-RELEASE-p2, GCC 3.2.2, GNU make 3.80 ( standard make does not seem work on FreeBSD ). 1.2.0 IMPORTANT NOTES: 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 +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. -1.3.0 HOW TO OBTAIN YCHAT: +1.3.0 HOW TO OBTAIN YCHAT++: yChat can be downloaded as a source package or through CVS. The packages are located at http://www.yChat.org -> Sourcecode -> Packages or go to http://programming.buetow.org/CPP-yChat . -For CVS download type also look at the homepage please. +For CVS download type: + +cvs -d:pserver:anonymous@cvs.ychat.berlios.de:/cvsroot/ychat login +( You will be asked for a password. Use "just enter" ). + +cvs -z3 -d:pserver:anonymous@cvs.ychat.berlios.de:/cvsroot/ychat co \ + ychat_advanced +( The sources will be copied into your local folder. However, if you + want to obtain the yChat++ Basic sources then replace "ychat_advanced" + "ychat" ). + +cvs -d:pserver:anonymous@cvs.ychat.berlios.de:/cvsroot/ychat logout +( Logs your CVS session out ). + +Now you may continue with the installation. 1.3.1 INSTALLATION: @@ -70,8 +81,8 @@ Invoke "cd cmnd && ./compile.sh && cd -". All command modules should get compiled. Now its time to run the server with ./ychat. -Then point your webbrowser to http://yourip:port ! - +Then point your webbrowser to http://yourip:port/index.html ( ignoring +the index.html on the end of the url will not work! ). ... have fun :-). 1.5.0 CUSTOMIZATION: @@ -85,8 +96,6 @@ Dynamic loadable modules can be found in the cmnd/ subdirectory. conf.txt - The yChat configuration file. ( read by conf.cpp ). -Files in ./src: - base.cpp - Encapsulates vector fields of room's or user ( may be later hash_maps ) and provides methods for manipulating data objects. @@ -203,44 +212,6 @@ The basic class structure: / \ conf html -1.7 WRITING BUG REPORTS - -How to submit a good bug report? - -Send them to Bug@yChat.org. - -First you should give the following information: -- 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 yChat crashes randomly. If after crash you see text: - - "segmentation fault (core dumped)" - -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: - - 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 > >&) () - (gdb) bt - #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*) () - #4 0x0805a375 in pool::tpool_thread(void*) () - #5 0x281d44ae in _thread_start () from /usr/lib/libc_r.so.5 - (gdb) - 1.8 CONTACT: You may contact us through the following addresses: diff --git a/base.cpp b/base.cpp index 82b3030..ce585ea 100755 --- a/base.cpp +++ b/base.cpp @@ -1,3 +1,13 @@ +/* + 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 #define BASE_CPP @@ -6,54 +16,50 @@ template base::base() { - map_elem = new hmap(80); - pthread_mutex_init (&mut_map_elem, NULL ); + map_elem = new hmap(80); + pthread_mutex_init (&mut_map_elem, NULL ); } template base::~base( ) { - pthread_mutex_destroy( &mut_map_elem ); + pthread_mutex_destroy( &mut_map_elem ); } -template -void +template void base::add_elem( type* p_type ) { - pthread_mutex_lock ( &mut_map_elem ); - map_elem->add_elem ( p_type, p_type->get_name()); - pthread_mutex_unlock( &mut_map_elem ); + pthread_mutex_lock ( &mut_map_elem ); + map_elem->add_elem ( p_type, p_type->get_name()); + pthread_mutex_unlock( &mut_map_elem ); } -template -void +template void base::del_elem( string &s_name ) { - pthread_mutex_lock ( &mut_map_elem ); - map_elem->del_elem ( s_name ); - pthread_mutex_unlock( &mut_map_elem ); + pthread_mutex_lock ( &mut_map_elem ); + map_elem->del_elem ( s_name ); + pthread_mutex_unlock( &mut_map_elem ); } -template -type* +template type* base::get_elem( string &s_name, bool &b_found ) { - pthread_mutex_lock ( &mut_map_elem ); - type* p_type = map_elem->get_elem( s_name ); - pthread_mutex_unlock( &mut_map_elem ); + pthread_mutex_lock ( &mut_map_elem ); + type* p_type = map_elem->get_elem( s_name ); + pthread_mutex_unlock( &mut_map_elem ); - b_found = p_type == NULL ? false : true; + b_found = p_type == NULL ? false : true; - return p_type; + return p_type; } -template -void +template void base::run_func( void (*func)(type*, void*), void* v_arg ) { - pthread_mutex_lock ( &mut_map_elem ); - map_elem->run_func( func, v_arg ); - pthread_mutex_unlock( &mut_map_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 9128ca1..6f06e4b 100755 --- a/base.h +++ b/base.h @@ -10,60 +10,60 @@ template class base { private: - hmap* map_elem; - pthread_mutex_t mut_map_elem; + hmap* map_elem; + pthread_mutex_t mut_map_elem; public: - base(); - ~base(); + base(); + ~base(); - 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. + 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 map_elem. v_pointer is the argument. - virtual void run_func( void (*func)(type*, 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 ); - } + // 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 ); - } + 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 ) - { + // 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; + 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]) ); - } + 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" diff --git a/chat.cpp b/chat.cpp index fa6200c..b845ec3 100755 --- a/chat.cpp +++ b/chat.cpp @@ -5,158 +5,143 @@ #include "chat.h" #include "s_conf.h" +#include "s_mutx.h" #include "s_tool.h" -#include "s_ncur.h" using namespace std; chat::chat( ) { - if ( s_conf::get - ().get_val( "HTML" ) == "OFF" ) - b_strip_html = true; - else - b_strip_html = false; + if ( s_conf::get().get_val( "HTML" ) == "OFF" ) + b_strip_html = true; + else + b_strip_html = false; + } chat::~chat( ) -{} +{ +} user* chat::get_user( string &s_user ) { - bool b_flag; - return get_user( s_user, b_flag ); + bool b_flag; + return get_user( s_user, b_flag ); } user* chat::get_user( string &s_user, bool &b_found ) { - container param; + container param; - param.elem[0] = (void*) &s_user ; - param.elem[1] = (void*) &b_found; + param.elem[0] = (void*) &s_user ; + param.elem[1] = (void*) &b_found; - b_found = false; + b_found = false; - run_func( get_user_, (void*)¶m ); + run_func( get_user_, (void*)¶m ); - if ( *( (bool*)param.elem[1] ) ) - return (user*)param.elem[2]; + if ( *( (bool*)param.elem[1] ) ) + return (user*)param.elem[2]; } void chat::get_user_( room *room_obj, void *v_arg ) { - container* param = (container*) v_arg; - param->elem[2] = (void*)room_obj->get_elem( *((string*)param->elem[0]), *((bool*)param->elem[1]) ); + container* param = (container*) v_arg; + param->elem[2] = (void*)room_obj->get_elem( *((string*)param->elem[0]), *((bool*)param->elem[1]) ); } void chat::login( map_string &map_params ) { - string s_user = map_params["nick"]; - - // prove if nick is empty: - if ( s_user.empty() ) - { - map_params["INFO"] = E_NONICK; - 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; - } - - bool b_flag; - - // prove if nick is already online / logged in. - get_user( s_user, b_flag ); - - if ( b_flag ) - { - map_params["INFO"] = E_ONLINE; - map_params["request"] = s_conf::get - ().get_val( "STARTMPL" ); - return; - } - - string s_room = map_params["room"]; - room* p_room = get_room( s_room , b_flag ); - - // if room does not exist add room to list! - if ( ! b_flag ) - { - p_room = new room( s_room ); - -#ifdef NCURSES - - string s_tmp( NEWROOM ); - s_tmp.append( s_room ); - s_ncur::get - ().print( &s_tmp ); + string s_user = map_params["nick"]; + + // prove if nick is empty: + if ( s_user.empty() ) + { + map_params["INFO"] = E_NONICK; + 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; + } + + bool b_flag; + + // prove if nick is already online / logged in. + get_user( s_user, b_flag ); + if ( b_flag ) + { + map_params["INFO"] = E_ONLINE; + map_params["request"] = s_conf::get().get_val( "STARTMPL" ); + return; + } + + string s_room = map_params["room"]; + room* p_room = get_room( s_room , b_flag ); + + // if room does not exist add room to list! + if ( ! b_flag ) + { + p_room = new room( s_room ); + +#ifdef VERBOSE + pthread_mutex_lock ( &s_mutx::get().mut_stdout ); + cout << NEWROOM << s_room << endl; + pthread_mutex_unlock( &s_mutx::get().mut_stdout ); #endif - - add_elem( p_room ); - } - - user *p_user = new user( s_user ); - - // add user to the room. - p_room->add_user( p_user ); - sess *ns =s_sman::get - ().create_session(); - ns->setValue(string("nick"), (void *)new string(s_user) ); - map_params["tmpid"]=ns->get_id(); - -#ifdef NCURSES - - { - string s_tmp( NEWUSER ); - s_tmp.append( s_user ); - s_ncur::get - ().print( s_tmp.c_str() ); - } + + add_elem( p_room ); + } + + user *p_user = new user( s_user ); + + // 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( s_lang::get().get_val( "USERENTR" ) ) ) ); + +#ifdef VERBOSE + pthread_mutex_lock ( &s_mutx::get().mut_stdout ); + cout << LOGINPR << s_user << endl; + pthread_mutex_unlock( &s_mutx::get().mut_stdout ); #endif - - // post "username enters the chat" into the room. - p_room->msg_post( new string( p_user->get_colored_name().append( s_lang::get - ().get_val( "USERENTR" ) ) ) ); - } -void +void chat::post( user* p_user, map_string &map_params ) { - string s_msg( map_params["message"] ); + string s_msg( map_params["message"] ); - auto unsigned i_pos = s_msg.find( "/" ); - if ( i_pos == 0 ) - return p_user->command( s_msg ); + 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 ); + if ( b_strip_html ) + s_tool::strip_html( &s_msg ); - string s_post( "get_col1() ) - .append( "\">" ) - .append( p_user->get_name() ) - .append( ": get_col2() ) - .append( "\">" ) - .append( s_msg ) - .append( "
\n" ); + s_post.append( p_user->get_col1() ) + .append( "\">" ) + .append( p_user->get_name() ) + .append( ": " ) + .append( s_msg ) + .append( "
\n" ); - p_user->get_room()->msg_post( &s_post ); + p_user->get_p_room()->msg_post( &s_post ); } #endif diff --git a/chat.h b/chat.h index bd64cb1..60bcf9d 100755 --- a/chat.h +++ b/chat.h @@ -17,30 +17,30 @@ using namespace std; class chat : public base { private: - bool b_strip_html; + bool b_strip_html; public: + + room* get_room( string &s_name, bool &b_found ) + { + return static_cast( get_elem( s_name, b_found ) ); + } - room* get_room( string &s_name, bool &b_found ) - { - return static_cast( get_elem( s_name, b_found ) ); - } + // public methods: + explicit chat(); // a standard constructor. + ~chat(); // destructor. - // public methods: - explicit chat(); // a standard constructor. - ~chat(); // destructor. + // 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_( room* room_obj, void *v_arg ); - // 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_( room* room_obj, void *v_arg ); + // will be called every time a user tries to login. + virtual void login( map_string &map_params ); - // will be called every time a user tries to login. - virtual void login( map_string &map_params ); - - // will be called if a user posts a message. - virtual void post ( user* u_user, map_string &map_params ); + // will be called if a user posts a message. + virtual void post ( user* u_user, map_string &map_params ); }; #endif diff --git a/cmnd.cpp b/cmnd.cpp new file mode 100755 index 0000000..28e73a7 --- /dev/null +++ b/cmnd.cpp @@ -0,0 +1,19 @@ +// class cmnd implementation. + +#ifndef CMND_CXX +#define CMND_CXX + +#include "cmnd.h" +#include "s_mutx.h" + +using namespace std; + +cmnd::cmnd( ) +{ +} + +cmnd::~cmnd() +{ +} + +#endif diff --git a/cmnd.h b/cmnd.h new file mode 100755 index 0000000..2eb1db2 --- /dev/null +++ b/cmnd.h @@ -0,0 +1,18 @@ +// class cmnd declaration. + +#ifndef CMND_H +#define CMND_H + +#include "incl.h" + +using namespace std; + +class cmnd +{ +public: + // public methods: + explicit cmnd( ); // a standard constructor. + ~cmnd( ); +}; + +#endif diff --git a/cmnd/CVS/Entries b/cmnd/CVS/Entries new file mode 100644 index 0000000..a44a45c --- /dev/null +++ b/cmnd/CVS/Entries @@ -0,0 +1,5 @@ +/compile.sh/1.1/Sun Sep 14 14:31:49 2003// +/yc_q.cpp/1.2/Wed Apr 2 21:57:34 2003// +/yc_test.cpp/1.1/Wed Apr 2 10:52:16 2003// +/yc_version.cpp/1.1/Sun Sep 14 14:55:57 2003// +D diff --git a/cmnd/CVS/Repository b/cmnd/CVS/Repository new file mode 100644 index 0000000..d7cf3ae --- /dev/null +++ b/cmnd/CVS/Repository @@ -0,0 +1 @@ +ychat/cmnd diff --git a/cmnd/CVS/Root b/cmnd/CVS/Root new file mode 100644 index 0000000..a82e29e --- /dev/null +++ b/cmnd/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.ychat.berlios.de:/cvsroot/ychat diff --git a/cmnd/compile.sh b/cmnd/compile.sh new file mode 100755 index 0000000..cee438c --- /dev/null +++ b/cmnd/compile.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +rm *.so 2> /dev/null + +for i in *cpp +do + echo Compiling $i + gcc -shared -o $(echo $i | sed s/cpp$/so/) $i +done diff --git a/cmnd/yc_q.cpp b/cmnd/yc_q.cpp new file mode 100644 index 0000000..acc8596 --- /dev/null +++ b/cmnd/yc_q.cpp @@ -0,0 +1,21 @@ +#include +#include "../user.h" + +/* + gcc -shared -o yc_name.so yc_name.cpp +*/ + +using namespace std; + + +extern "C" { + export int extern_function(void *v_arg); + + int extern_function(void *v_arg) + { + user *p_user = (user*) v_arg; + p_user->msg_post( new string( "\n " ) ); + p_user->set_online( false ); + } +} + diff --git a/cmnd/yc_test.cpp b/cmnd/yc_test.cpp new file mode 100644 index 0000000..deb3e54 --- /dev/null +++ b/cmnd/yc_test.cpp @@ -0,0 +1,12 @@ +#include + +using namespace std; + +extern "C" { + export int function(void *v_arg); + + int function(void *v_arg) + { + cout << "Hallo " << (char*)v_arg << endl; + } +} diff --git a/cmnd/yc_version.cpp b/cmnd/yc_version.cpp new file mode 100644 index 0000000..5e686b7 --- /dev/null +++ b/cmnd/yc_version.cpp @@ -0,0 +1,20 @@ +#include +#include "../msgs.h" +#include "../user.h" +/* + gcc -shared -o yc_name.so yc_name.cpp +*/ + +using namespace std; + +extern "C" { + export int extern_function(void *v_arg); + int valid_color( string ); + + int extern_function(void *v_arg) + { + user *p_user = (user*) v_arg; + p_user->msg_post( new string( *new string(VERSION) + "
\n") ); + } +} + diff --git a/conf.cpp b/conf.cpp index e4fcc0b..3ff71b8 100755 --- a/conf.cpp +++ b/conf.cpp @@ -4,84 +4,72 @@ #define s_conf_CXX #include -#include "s_ncur.h" #include "conf.h" using namespace std; conf::conf( string s_conf = CONFILE ) : name( s_conf ) { - parse( ); // parse the config file. + parse( ); // parse the config file. } conf::~conf() -{} +{ +} void conf::parse() { #ifdef VERBOSE - cout << CFILEOK << get_name() << endl; + cout << CFILEOK << get_name() << endl; #endif - string s_configfile=get_name(); - - string homeconfig=string(getenv("HOME"))+string("/.ychat/")+get_name(); - ifstream homecheck( homeconfig.c_str() ); - if( homecheck ) - { - homecheck.close(); - s_configfile=homeconfig; - } - - ifstream fs_conf( s_configfile.c_str() ); + ifstream fs_conf( get_name().c_str() ); - if ( ! fs_conf ) - { + if ( ! fs_conf ) + { #ifdef VERBOSE - cout << CFILENO << get_name() << endl; + cout << CFILENO << get_name() << endl; #endif + return; + } - return; - } + char c_buf[READBUF]; - char c_buf[READBUF]; + while( fs_conf.getline( c_buf, READBUF ) ) + { + string s_token( c_buf ); + unsigned int ui_pos = s_token.find( "#", 0 ); + + // if line is commented out: + if ( ui_pos == 0 ) + continue; - while( fs_conf.getline( c_buf, READBUF ) ) - { - string s_token( c_buf ); - unsigned int ui_pos = s_token.find( "#", 0 ); + ui_pos = s_token.find( ";", 0 ); - // if line is commented out: - if ( ui_pos == 0 ) - continue; + // if token has not been found. + if ( ui_pos == string::npos ) + continue; - ui_pos = s_token.find( ";", 0 ); + s_token = s_token.substr( 0 , --ui_pos ); + ui_pos = s_token.find ( "\"", 0 ); - // if token has not been found. - if ( ui_pos == string::npos ) - continue; + if ( ui_pos == string::npos ) + continue; - s_token = s_token.substr( 0 , --ui_pos ); - ui_pos = s_token.find ( "\"", 0 ); - - if ( ui_pos == string::npos ) - continue; - - string s_val = s_token.substr( ui_pos+1, s_token.length() ); - string s_key = s_token.substr( 0 , --ui_pos ); + string s_val = s_token.substr( ui_pos+1, s_token.length() ); + string s_key = s_token.substr( 0 , --ui_pos ); #ifdef VERBOSE2 - - cout << s_key << "=" << s_val << endl; + cout << s_key << "=" << s_val << endl; #endif - // fill the map. - map_vals[s_key] = s_val; - } + // fill the map. + map_vals[s_key] = s_val; + } - fs_conf.close(); - fs_conf.~ifstream(); + fs_conf.close(); + fs_conf.~ifstream(); } #endif diff --git a/conf.h b/conf.h index a47a628..6e2a890 100755 --- a/conf.h +++ b/conf.h @@ -14,11 +14,11 @@ class conf : public cont, name private: public: - // public methods: - conf ( string s_conf ); // standard constructor. - ~conf(); // standard destructor. + // public methods: + conf ( string s_conf ); // standard constructor. + ~conf(); // standard destructor. - virtual void parse( ); // parses the config file. + virtual void parse( ); // parses the config file. }; #endif diff --git a/conf.txt b/conf.txt index 8ff068c..936af92 100755 --- a/conf.txt +++ b/conf.txt @@ -11,14 +11,14 @@ # all lines which do not contain a semicolon and at least two quotes # or start with a # will be ignored. # -# greets, paul c. buetow ( snooper at ychat dot org ); +# greets, paul c. buetow ( snooper@ychat.org ); # # server specific configurations ( not allowed to be removed ): HTMLTEMP="html/"; # directory of the html-template files. -THRDPOOL="1"; # Initial pool size. -THRDPMAX="52"; # Max thread pool size +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 ) @@ -48,7 +48,7 @@ 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 0.5 - Fast Simple Extensible"; +PGETITLE="yChat++ Basic - Fast Simple Extensible"; # do not edit beyond this line diff --git a/configure b/configure index 333efb0..8c5f0a7 100755 --- a/configure +++ b/configure @@ -1,5 +1,1555 @@ -#!/bin/sh +#! /bin/sh -cd ./src -./configure +# 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/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=s_chat.h + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +#AC_INIT_AUTOMAKE(yChat, 0.2) + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:528: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:561: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:590: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:674: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CXX="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CXX="$ac_cv_prog_CXX" +if test -n "$CXX"; then + echo "$ac_t""$CXX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CXX" && break +done +test -n "$CXX" || CXX="gcc" + + +echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:706: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +cat > conftest.$ac_ext << EOF + +#line 717 "configure" +#include "confdefs.h" + +int main(){return(0);} +EOF +if { (eval echo configure:722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cxx_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cxx_cross=no + else + ac_cv_prog_cxx_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cxx_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 +if test $ac_cv_prog_cxx_works = no; then + { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:748: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 +cross_compiling=$ac_cv_prog_cxx_cross + +echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 +echo "configure:753: checking whether we are using GNU C++" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gxx=yes +else + ac_cv_prog_gxx=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gxx" 1>&6 + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +else + GXX= +fi + +ac_test_CXXFLAGS="${CXXFLAGS+set}" +ac_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS= +echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 +echo "configure:781: checking whether ${CXX-g++} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.cc +if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then + ac_cv_prog_cxx_g=yes +else + ac_cv_prog_cxx_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS="$ac_save_CXXFLAGS" +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi + + + +echo $ac_n "checking for library containing dlopen""... $ac_c" 1>&6 +echo "configure:815: checking for library containing dlopen" >&5 +if eval "test \"`echo '$''{'ac_cv_search_dlopen'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_func_search_save_LIBS="$LIBS" +ac_cv_search_dlopen="no" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_search_dlopen="none required" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +test "$ac_cv_search_dlopen" = "no" && for i in dl; do +LIBS="-l$i $ac_func_search_save_LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_search_dlopen="-l$i" +break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done +LIBS="$ac_func_search_save_LIBS" +fi + +echo "$ac_t""$ac_cv_search_dlopen" 1>&6 +if test "$ac_cv_search_dlopen" != "no"; then + test "$ac_cv_search_dlopen" = "none required" || LIBS="$ac_cv_search_dlopen $LIBS" + +else : + +fi +if test "$ac_cv_search_dlopen" = "-ldl"; then +LDFLAGS="$ac_cv_search_dlopen" +fi +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +echo "configure:883: checking f