From 9cd3ccffd5372dfde3af478e3f832f18db4be3f1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:41 +0200 Subject: tagging tags --- ychat-0.5.5/CHANGES | 20 + ychat-0.5.5/COPYING | 339 ++++++++ ychat-0.5.5/Makefile | 24 + ychat-0.5.5/README | 260 ++++++ ychat-0.5.5/conf.txt | 63 ++ ychat-0.5.5/configure | 5 + ychat-0.5.5/html/blank.html | 4 + ychat-0.5.5/html/favicon.ico | Bin 0 -> 2238 bytes ychat-0.5.5/html/frameset.html | 20 + ychat-0.5.5/html/index.html | 32 + ychat-0.5.5/html/input.html | 34 + ychat-0.5.5/html/notfound.html | 10 + ychat-0.5.5/html/online.html | 7 + ychat-0.5.5/html/stream.html | 30 + ychat-0.5.5/html/style.css | 11 + ychat-0.5.5/html/y_black.gif | Bin 0 -> 61100 bytes ychat-0.5.5/lang/de | 3 + ychat-0.5.5/lang/en | 3 + ychat-0.5.5/scripts/astyle.sh | 15 + ychat-0.5.5/scripts/modules/file.pm | 28 + ychat-0.5.5/scripts/stats.pl | 95 +++ ychat-0.5.5/scripts/version.sh | 6 + ychat-0.5.5/src/Makefile | 18 + ychat-0.5.5/src/Makefile.in | 17 + ychat-0.5.5/src/base.cpp | 69 ++ ychat-0.5.5/src/base.h | 71 ++ ychat-0.5.5/src/chat.cpp | 156 ++++ ychat-0.5.5/src/chat.h | 46 ++ ychat-0.5.5/src/conf.cpp | 76 ++ ychat-0.5.5/src/conf.h | 24 + ychat-0.5.5/src/config.cache | 30 + ychat-0.5.5/src/config.log | 71 ++ ychat-0.5.5/src/config.status | 151 ++++ ychat-0.5.5/src/configure | 1555 +++++++++++++++++++++++++++++++++++ ychat-0.5.5/src/cont.cpp | 24 + ychat-0.5.5/src/cont.h | 29 + ychat-0.5.5/src/glob.h | 68 ++ ychat-0.5.5/src/hmap.cpp | 183 +++++ ychat-0.5.5/src/hmap.h | 123 +++ ychat-0.5.5/src/html.cpp | 147 ++++ ychat-0.5.5/src/html.h | 42 + ychat-0.5.5/src/incl.h | 16 + ychat-0.5.5/src/lang.cpp | 79 ++ ychat-0.5.5/src/lang.h | 24 + ychat-0.5.5/src/main.cpp | 97 +++ ychat-0.5.5/src/msgs.h | 39 + ychat-0.5.5/src/mutx.cpp | 20 + ychat-0.5.5/src/mutx.h | 21 + ychat-0.5.5/src/name.cpp | 31 + ychat-0.5.5/src/name.h | 30 + ychat-0.5.5/src/pool.cpp | 180 ++++ ychat-0.5.5/src/pool.h | 52 ++ ychat-0.5.5/src/reqp.cpp | 443 ++++++++++ ychat-0.5.5/src/reqp.h | 49 ++ ychat-0.5.5/src/room.cpp | 16 + ychat-0.5.5/src/room.h | 34 + ychat-0.5.5/src/s_chat.cpp | 10 + ychat-0.5.5/src/s_chat.h | 27 + ychat-0.5.5/src/s_conf.cpp | 10 + ychat-0.5.5/src/s_conf.h | 27 + ychat-0.5.5/src/s_html.cpp | 10 + ychat-0.5.5/src/s_html.h | 27 + ychat-0.5.5/src/s_lang.cpp | 10 + ychat-0.5.5/src/s_lang.h | 28 + ychat-0.5.5/src/s_mutx.cpp | 10 + ychat-0.5.5/src/s_mutx.h | 27 + ychat-0.5.5/src/s_sman.cpp | 10 + ychat-0.5.5/src/s_sman.h | 27 + ychat-0.5.5/src/s_sock.cpp | 10 + ychat-0.5.5/src/s_sock.h | 27 + ychat-0.5.5/src/s_tool.cpp | 139 ++++ ychat-0.5.5/src/s_tool.h | 21 + ychat-0.5.5/src/sess.cpp | 39 + ychat-0.5.5/src/sess.h | 28 + ychat-0.5.5/src/sman.cpp | 57 ++ ychat-0.5.5/src/sman.h | 36 + ychat-0.5.5/src/sock.cpp | 240 ++++++ ychat-0.5.5/src/sock.h | 57 ++ ychat-0.5.5/src/thrd.cpp | 29 + ychat-0.5.5/src/thrd.h | 29 + ychat-0.5.5/src/user.cpp | 144 ++++ ychat-0.5.5/src/user.h | 102 +++ 82 files changed, 6221 insertions(+) create mode 100644 ychat-0.5.5/CHANGES create mode 100644 ychat-0.5.5/COPYING create mode 100755 ychat-0.5.5/Makefile create mode 100755 ychat-0.5.5/README create mode 100755 ychat-0.5.5/conf.txt create mode 100755 ychat-0.5.5/configure create mode 100755 ychat-0.5.5/html/blank.html create mode 100644 ychat-0.5.5/html/favicon.ico create mode 100755 ychat-0.5.5/html/frameset.html create mode 100755 ychat-0.5.5/html/index.html create mode 100755 ychat-0.5.5/html/input.html create mode 100755 ychat-0.5.5/html/notfound.html create mode 100755 ychat-0.5.5/html/online.html create mode 100755 ychat-0.5.5/html/stream.html create mode 100644 ychat-0.5.5/html/style.css create mode 100755 ychat-0.5.5/html/y_black.gif create mode 100644 ychat-0.5.5/lang/de create mode 100644 ychat-0.5.5/lang/en create mode 100755 ychat-0.5.5/scripts/astyle.sh create mode 100755 ychat-0.5.5/scripts/modules/file.pm create mode 100755 ychat-0.5.5/scripts/stats.pl create mode 100755 ychat-0.5.5/scripts/version.sh create mode 100644 ychat-0.5.5/src/Makefile create mode 100755 ychat-0.5.5/src/Makefile.in create mode 100755 ychat-0.5.5/src/base.cpp create mode 100755 ychat-0.5.5/src/base.h create mode 100755 ychat-0.5.5/src/chat.cpp create mode 100755 ychat-0.5.5/src/chat.h create mode 100755 ychat-0.5.5/src/conf.cpp create mode 100755 ychat-0.5.5/src/conf.h create mode 100644 ychat-0.5.5/src/config.cache create mode 100644 ychat-0.5.5/src/config.log create mode 100755 ychat-0.5.5/src/config.status create mode 100755 ychat-0.5.5/src/configure create mode 100755 ychat-0.5.5/src/cont.cpp create mode 100755 ychat-0.5.5/src/cont.h create mode 100755 ychat-0.5.5/src/glob.h create mode 100644 ychat-0.5.5/src/hmap.cpp create mode 100644 ychat-0.5.5/src/hmap.h create mode 100755 ychat-0.5.5/src/html.cpp create mode 100755 ychat-0.5.5/src/html.h create mode 100755 ychat-0.5.5/src/incl.h create mode 100755 ychat-0.5.5/src/lang.cpp create mode 100755 ychat-0.5.5/src/lang.h create mode 100755 ychat-0.5.5/src/main.cpp create mode 100755 ychat-0.5.5/src/msgs.h create mode 100755 ychat-0.5.5/src/mutx.cpp create mode 100755 ychat-0.5.5/src/mutx.h create mode 100755 ychat-0.5.5/src/name.cpp create mode 100755 ychat-0.5.5/src/name.h create mode 100755 ychat-0.5.5/src/pool.cpp create mode 100755 ychat-0.5.5/src/pool.h create mode 100755 ychat-0.5.5/src/reqp.cpp create mode 100755 ychat-0.5.5/src/reqp.h create mode 100755 ychat-0.5.5/src/room.cpp create mode 100755 ychat-0.5.5/src/room.h create mode 100644 ychat-0.5.5/src/s_chat.cpp create mode 100644 ychat-0.5.5/src/s_chat.h create mode 100644 ychat-0.5.5/src/s_conf.cpp create mode 100644 ychat-0.5.5/src/s_conf.h create mode 100644 ychat-0.5.5/src/s_html.cpp create mode 100644 ychat-0.5.5/src/s_html.h create mode 100644 ychat-0.5.5/src/s_lang.cpp create mode 100644 ychat-0.5.5/src/s_lang.h create mode 100644 ychat-0.5.5/src/s_mutx.cpp create mode 100644 ychat-0.5.5/src/s_mutx.h create mode 100644 ychat-0.5.5/src/s_sman.cpp create mode 100644 ychat-0.5.5/src/s_sman.h create mode 100644 ychat-0.5.5/src/s_sock.cpp create mode 100644 ychat-0.5.5/src/s_sock.h create mode 100644 ychat-0.5.5/src/s_tool.cpp create mode 100644 ychat-0.5.5/src/s_tool.h create mode 100644 ychat-0.5.5/src/sess.cpp create mode 100644 ychat-0.5.5/src/sess.h create mode 100644 ychat-0.5.5/src/sman.cpp create mode 100644 ychat-0.5.5/src/sman.h create mode 100755 ychat-0.5.5/src/sock.cpp create mode 100755 ychat-0.5.5/src/sock.h create mode 100755 ychat-0.5.5/src/thrd.cpp create mode 100755 ychat-0.5.5/src/thrd.h create mode 100755 ychat-0.5.5/src/user.cpp create mode 100755 ychat-0.5.5/src/user.h (limited to 'ychat-0.5.5') diff --git a/ychat-0.5.5/CHANGES b/ychat-0.5.5/CHANGES new file mode 100644 index 0000000..9994891 --- /dev/null +++ b/ychat-0.5.5/CHANGES @@ -0,0 +1,20 @@ +Changes from 0.5.4-STABLERELEASE to 0.5.5-STABLERELEASE +- Added scripts/version.sh (can be invoked by gmake version) +- Fixed a bug in the session manager. +- Removed the large animated GIF graphic. + +Changes from 0.5.3-LEGACYRELEASE to 0.5.4-STABLERELEASE +- Backported reqp::get_url from yChat 0.7.8-CURRENT. +- Tagged 0.5-STABLE + +Changes from 0.5.2-LEGACYRELEASE to 0.5.3-LEGACYRLEASE +- Code cleanup +- Added ./scripts/* +- Added gmake stats option + +Changes from 0.5.1-RELEASE to 0.5.2-LEGACYRLEASE +- Changed this branch into a LEGACY branch. +- Rewrote the dynamic thread pool (backport from 0.7.8-CURRENT). +- Added scripts/* +- Code now uses ANSI C++ style with 2 space code indenting. + diff --git a/ychat-0.5.5/COPYING b/ychat-0.5.5/COPYING new file mode 100644 index 0000000..a43ea21 --- /dev/null +++ b/ychat-0.5.5/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + 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.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ychat-0.5.5/Makefile b/ychat-0.5.5/Makefile new file mode 100755 index 0000000..a453f44 --- /dev/null +++ b/ychat-0.5.5/Makefile @@ -0,0 +1,24 @@ +MAKE=gmake +all: base + @echo "Now edit the ./conf.txt file and run ./ychat!" +install: deinstall +uninstall: deinstall +deinstall: + @echo Install/deinstall is not supported! + @echo Start yChat with ./ychat instead! + @exit 1 +base: + @${MAKE} -C ./src +clean_base: + @${MAKE} -C ./src clean +stats: + @perl scripts/stats.pl +run: + ./ychat +gpl: + @more COPYING +clean: clean_base +debug: + @gdb ./ychat ychat.core +version: + @sh ./scripts/version.sh diff --git a/ychat-0.5.5/README b/ychat-0.5.5/README new file mode 100755 index 0000000..24fe7dc --- /dev/null +++ b/ychat-0.5.5/README @@ -0,0 +1,260 @@ +yChat; Homepage: www.yChat.org; Version 0.5.5-CURRENT +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 +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +----------------------------------------------------------------- + +0.0.0 LEGACY YCHAT 0.5 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.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 + The GNU C++ compiler. + +1.1.0 TESTED PLATFORMS: + +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 + +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 +homepage which is located at http://www.yChat.org. + +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. + +1.3.1 INSTALLATION: + +Invoke "./configure" and afterwards "make", edit the conf.txt. + +Now we want to compile all the dynamic loadable modules of ychat. +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 ! + +... have fun :-). + +1.5.0 CUSTOMIZATION: + +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. + +1.6.0 FILES: ( This list is not complete ) + +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. + +hmap.cpp - The hash map implementation which is a very fast data + structure. is needed for saving users, rooms and so on. + +main.cpp - This includes the required manager headers for starting + the server and finally regulates the correct starting. + +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. + +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. + +room.cpp - Specifies a chat room. For each chat room an instance of + this class exists. + +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. + +user.cpp - Specifies a chat user. For each chat user an instance of + this class exists. + +Abstract classes: + +cont.cpp - All classes which need to store "key - value" data sets + inherit from this class. ( cont for content ). + +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. + +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. + +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'. + +sock.cpp - The socket manager. Manages the socket connections. There + are multiplexed sockets. For each requests a new POSIX thread + will be created. + +Files with a leading s_ contain static C++ classes + +s_chat.cpp - Static wrapper for the dynamic chat class. holds one global + reachable instance of chat until the program shuts down. + +s_conf.cpp - Static wrapper for the dynamic conf class. holds one global + reachable instance of conf until the program shuts down. + +s_html.cpp - Static wrapper for the dynamic html class. holds one global + reachable instance of conf until the program shuts down. + +s_mutx.cpp - Static wrapper for the dynamic mutx class. holds one global + reachable instance of conf until the program shuts down. + +s_sock.cpp - Static wrapper for the dynamic sock class. holds one global + reachable instance of conf until the program shuts down. + +s_tool.cpp - Static class which includes some usefull global reachable + methods which are not integraded in independent classes. + +Special header files ( all other header files which are not listed here +belong to their respective .cpp files ): + +glob.h - Defines global variables which are known by compilation + time. + +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@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: + +- Homepage + The yChat homepage is located at http://www.yChat.org + +- E-Mail + 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 at irc.german-elite.net diff --git a/ychat-0.5.5/conf.txt b/ychat-0.5.5/conf.txt new file mode 100755 index 0000000..8ff068c --- /dev/null +++ b/ychat-0.5.5/conf.txt @@ -0,0 +1,63 @@ +# +# please notice this: +# the server parses this configuration file while starting or by an +# administrator's request. +# +# not allowed are semicolons ';' inside or before the quotes " ", +# otherwise this might result in errors. +# +# the syntax is easy: KEYNAME="value"; +# +# 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 ); +# + +# 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 +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="#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 0.5 - 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/ychat-0.5.5/configure b/ychat-0.5.5/configure new file mode 100755 index 0000000..333efb0 --- /dev/null +++ b/ychat-0.5.5/configure @@ -0,0 +1,5 @@ +#!/bin/sh + +cd ./src +./configure + diff --git a/ychat-0.5.5/html/blank.html b/ychat-0.5.5/html/blank.html new file mode 100755 index 0000000..4ddd1a7 --- /dev/null +++ b/ychat-0.5.5/html/blank.html @@ -0,0 +1,4 @@ + + + + diff --git a/ychat-0.5.5/html/favicon.ico b/ychat-0.5.5/html/favicon.ico new file mode 100644 index 0000000..4deafd5 Binary files /dev/null and b/ychat-0.5.5/html/favicon.ico differ diff --git a/ychat-0.5.5/html/frameset.html b/ychat-0.5.5/html/frameset.html new file mode 100755 index 0000000..fe6b973 --- /dev/null +++ b/ychat-0.5.5/html/frameset.html @@ -0,0 +1,20 @@ + + + + %%PGETITLE%% + + + + + Your browser does not support frames, + + + + + + + + + + + diff --git a/ychat-0.5.5/html/index.html b/ychat-0.5.5/html/index.html new file mode 100755 index 0000000..e8de35c --- /dev/null +++ b/ychat-0.5.5/html/index.html @@ -0,0 +1,32 @@ + + + + %%PGETITLE%% + + + + + + + + + + + + + + + +
%%PGETITLE%%%%INFO%%
 
+Enter your nick: +
+ + + + +
+
+

+
yChat is OpenSource - get it at http://www.yChat.org
+ + diff --git a/ychat-0.5.5/html/input.html b/ychat-0.5.5/html/input.html new file mode 100755 index 0000000..a403d8e --- /dev/null +++ b/ychat-0.5.5/html/input.html @@ -0,0 +1,34 @@ + + + + %%PGETITLE%% + + + + + + +
+ + + + + + +
+ + diff --git a/ychat-0.5.5/html/notfound.html b/ychat-0.5.5/html/notfound.html new file mode 100755 index 0000000..574e341 --- /dev/null +++ b/ychat-0.5.5/html/notfound.html @@ -0,0 +1,10 @@ + + + + %%PGETITLE%% + + + + Page not found. + + diff --git a/ychat-0.5.5/html/online.html b/ychat-0.5.5/html/online.html new file mode 100755 index 0000000..aa14f8d --- /dev/null +++ b/ychat-0.5.5/html/online.html @@ -0,0 +1,7 @@ + + + + + %%MESSAGE%% + + diff --git a/ychat-0.5.5/html/stream.html b/ychat-0.5.5/html/stream.html new file mode 100755 index 0000000..6678069 --- /dev/null +++ b/ychat-0.5.5/html/stream.html @@ -0,0 +1,30 @@ + + + + %%PGETITLE%% + + + + + + Welcome to yChat %%nick%%! +
+
diff --git a/ychat-0.5.5/html/style.css b/ychat-0.5.5/html/style.css new file mode 100644 index 0000000..e31bd7e --- /dev/null +++ b/ychat-0.5.5/html/style.css @@ -0,0 +1,11 @@ +BODY, TD { + font-family: Verdana, Helvetica, sans-serif; + font-size: 11pt; +} +A { + color: #dddddd; +} +.signature { + color: #dddddd; + font-size: 9pt; +} diff --git a/ychat-0.5.5/html/y_black.gif b/ychat-0.5.5/html/y_black.gif new file mode 100755 index 0000000..06274c2 Binary files /dev/null and b/ychat-0.5.5/html/y_black.gif differ diff --git a/ychat-0.5.5/lang/de b/ychat-0.5.5/lang/de new file mode 100644 index 0000000..ae5404b --- /dev/null +++ b/ychat-0.5.5/lang/de @@ -0,0 +1,3 @@ +ERRORCMD="Befehl nicht gefunden!
"; +USERENTR=" betritt den Chat.
"; +USERLEAV=" verläßt den Chat.
" diff --git a/ychat-0.5.5/lang/en b/ychat-0.5.5/lang/en new file mode 100644 index 0000000..33e9b52 --- /dev/null +++ b/ychat-0.5.5/lang/en @@ -0,0 +1,3 @@ +ERRORCMD=" No such command!
"; +USERENTR=" enters the chat
"; +USERLEAV=" leaves the chat
"; diff --git a/ychat-0.5.5/scripts/astyle.sh b/ychat-0.5.5/scripts/astyle.sh new file mode 100755 index 0000000..757364e --- /dev/null +++ b/ychat-0.5.5/scripts/astyle.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# The yChat Project (2004, 2005) +# +# This uses "astyle" to format C++ code into a specific code style! + +for f in h cpp tmpl +do + for i in `find . -name "*.$f"` + do + echo $i + astyle --style=ansi -s2 $i + rm -f $i.orig + done +done diff --git a/ychat-0.5.5/scripts/modules/file.pm b/ychat-0.5.5/scripts/modules/file.pm new file mode 100755 index 0000000..b11e2b3 --- /dev/null +++ b/ychat-0.5.5/scripts/modules/file.pm @@ -0,0 +1,28 @@ +sub dopen +{ + my $shift = shift; + opendir DIR, $shift or die "$shift: $!\n"; + my @dir = readdir(DIR); + closedir DIR; + return @dir; +} + +sub fopen +{ + my $shift = shift; + open FILE, $shift or die "$shift: $!\n"; + my @file = ; + close FILE; + return @file; +} + +sub fwrite +{ + my $shift = shift; + my @file = @_; + open FILE, ">$shift" or die "$shift: $!\n"; + print FILE @file; + close FILE; +} + +1; diff --git a/ychat-0.5.5/scripts/stats.pl b/ychat-0.5.5/scripts/stats.pl new file mode 100755 index 0000000..96fbdf1 --- /dev/null +++ b/ychat-0.5.5/scripts/stats.pl @@ -0,0 +1,95 @@ +#!/usr/bin/perl + +# The yhttpd Project (2003 - 2004) +# +# This script generates source code and project statistics + +use strict; + +use scripts::modules::file; + +my %stats; +my $param = shift; + +&recursive("."); + +$stats{"Lines total"} = $stats{"Lines of source"} + + $stats{"Lines of scripts"} + + $stats{"Lines of text"} + + $stats{"Lines of HTML"}; + +unless (defined $param) { + + print "$_ = " . $stats{$_} . "\n" + for ( sort keys %stats ); + +} else { + + print $stats{$_} . " " + for sort keys %stats; + +} + +print "\n"; + +sub recursive +{ + my $shift = shift; + my @dir = &dopen($shift); + + foreach (@dir) + { + next if /^\.$/ or /^\.{2}$/; + + if ( -f "$shift/$_" ) + { + $stats{"Number of files total"}++; + &filestats("$shift/$_"); + } + elsif ( -d "$shift/$_" ) + { + $stats{"Number of dirs total"}++; + &recursive("$shift/$_"); + } + } +} + +sub filestats +{ + my $shift = shift; + if ( $shift =~ /\.(cpp|h|tmpl)$/ ) + { + $stats{"Number of source files"}++; + $stats{"Lines of source"} += countlines($shift); + } + elsif ( $shift =~ /\.(html|css)$/ ) + { + $stats{"Number of HTML files"}++; + $stats{"Lines of HTML"} += countlines($shift); + } + elsif ( $shift =~ /\.(gif|png|jpg)$/ ) + { + $stats{"Number of gfx files"}++; + } + elsif ( $shift =~ /(\.pl|\.sh|configure.*|Makefile.*)$/ ) + { + $stats{"Number of script files"}++; + $stats{"Lines of scripts"} += countlines($shift); + } + elsif ( $shift =~ /(\.txt|[A-Z]+)$/ ) + { + $stats{"Number of text files"}++; + $stats{"Lines of text"} += countlines($shift); + } + elsif ( $shift =~ /\.so$/ ) + { + $stats{"Number of compiled module files"}++; + } +} + +sub countlines +{ + my $shift = shift; + my @file = fopen($shift); + return $#file; +} diff --git a/ychat-0.5.5/scripts/version.sh b/ychat-0.5.5/scripts/version.sh new file mode 100755 index 0000000..be1b351 --- /dev/null +++ b/ychat-0.5.5/scripts/version.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# The yChat Project (2005) +# +# This script shows yChat VERSION-BRANCH + +sed -n 's/.*VERSION.*: \(.*\)".*/\1/p' src/msgs.h diff --git a/ychat-0.5.5/src/Makefile b/ychat-0.5.5/src/Makefile new file mode 100644 index 0000000..7164d56 --- /dev/null +++ b/ychat-0.5.5/src/Makefile @@ -0,0 +1,18 @@ +# Generated automatically from Makefile.in by configure. +SRCS=chat.cpp s_chat.cpp conf.cpp s_conf.cpp cont.cpp html.cpp s_html.cpp lang.cpp s_lang.cpp main.cpp mutx.cpp s_mutx.cpp name.cpp pool.cpp reqp.cpp room.cpp sock.cpp s_sock.cpp thrd.cpp s_tool.cpp user.cpp sess.cpp sman.cpp s_sman.cpp +#logd.cpp modl.cpp s_modl.cpp cmnd.cpp +OBJS=$(SRCS:.cpp=.o) +CC=g++ +LDFLAGS= -lstdc++ -g +LDADD=-pthread -D_THREAD_SAFE +all: ychat +$(SRCS): + $(CC) $(CFLAGS) -c $*.cpp +ychat: $(OBJS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDADD) + @mv -f ychat .. +mrproper: clean + @rm -f Makefile config.log config.cache config.status + rm -f ../ychat +clean: + rm *.o diff --git a/ychat-0.5.5/src/Makefile.in b/ychat-0.5.5/src/Makefile.in new file mode 100755 index 0000000..6f43bf9 --- /dev/null +++ b/ychat-0.5.5/src/Makefile.in @@ -0,0 +1,17 @@ +SRCS=chat.cpp s_chat.cpp conf.cpp s_conf.cpp cont.cpp html.cpp s_html.cpp lang.cpp s_lang.cpp main.cpp mutx.cpp s_mutx.cpp name.cpp pool.cpp reqp.cpp room.cpp sock.cpp s_sock.cpp thrd.cpp s_tool.cpp user.cpp sess.cpp sman.cpp s_sman.cpp +#logd.cpp modl.cpp s_modl.cpp cmnd.cpp +OBJS=$(SRCS:.cpp=.o) +CC=g++ +LDFLAGS=@LDFLAGS@ -lstdc++ -g +LDADD=-pthread -D_THREAD_SAFE +all: ychat +$(SRCS): + $(CC) $(CFLAGS) -c $*.cpp +ychat: $(OBJS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDADD) + @mv -f ychat .. +mrproper: clean + @rm -f Makefile config.log config.cache config.status + rm -f ../ychat +clean: + rm *.o diff --git a/ychat-0.5.5/src/base.cpp b/ychat-0.5.5/src/base.cpp new file mode 100755 index 0000000..06c0c2d --- /dev/null +++ b/ychat-0.5.5/src/base.cpp @@ -0,0 +1,69 @@ +/* + This file is part of yChat + + $Author: buetow $ + $Date: 2005/03/02 12:57:41 $ + + $Header: /usr/home/cvs/cvsroot/ychat-stable/src/base.cpp,v 1.1 2005/03/02 12:57:41 buetow Exp $ +*/ +// template class data implementation; + +#ifndef BASE_CPP +#define BASE_CPP + +#include "base.h" + +template +base::base() +{ + map_elem = new hmap(80); + pthread_mutex_init (&mut_map_elem, NULL ); +} + +template +base::~base( ) +{ + pthread_mutex_destroy( &mut_map_elem ); +} + +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 ); +} + +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 ); +} + +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 ); + + b_found = p_type == NULL ? false : true; + + return p_type; +} + +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 ); +} + +#endif diff --git a/ychat-0.5.5/src/base.h b/ychat-0.5.5/src/base.h new file mode 100755 index 0000000..9ea405d --- /dev/null +++ b/ychat-0.5.5/src/base.h @@ -0,0 +1,71 @@ +// template class data declaration; + +#ifndef BASE_H +#define BASE_H + +#include "incl.h" +#include "hmap.h" + +template +class base +{ +private: + hmap* map_elem; + pthread_mutex_t mut_map_elem; + +public: + 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. + + // 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/ychat-0.5.5/src/chat.cpp b/ychat-0.5.5/src/chat.cpp new file mode 100755 index 0000000..38d7a6a --- /dev/null +++ b/ychat-0.5.5/src/chat.cpp @@ -0,0 +1,156 @@ +// class chat implementation. + +#ifndef s_chat_CXX +#define s_chat_CXX + +#include "chat.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( ) +{} + +user* +chat::get_user( string &s_user ) +{ + bool b_flag; + return get_user( s_user, b_flag ); +} + +user* +chat::get_user( string &s_user, bool &b_found ) +{ + container param; + + param.elem[0] = (void*) &s_user ; + param.elem[1] = (void*) &b_found; + + b_found = false; + + run_func( get_user_, (void*)¶m ); + + 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]) ); +} + +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 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 + ().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 +} + +void +chat::post( user* p_user, map_string &map_params ) +{ + + string s_msg( map_params["message"] ); + + auto unsigned i_pos = s_msg.find( "/" ); + + 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/ychat-0.5.5/src/chat.h b/ychat-0.5.5/src/chat.h new file mode 100755 index 0000000..f8a6523 --- /dev/null +++ b/ychat-0.5.5/src/chat.h @@ -0,0 +1,46 @@ +// class chat declaration. + +#ifndef s_chat_H +#define s_chat_H + +#include +#include "incl.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 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 ) ); + } + + // 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 ); + + // 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 ); +}; + +#endif diff --git a/ychat-0.5.5/src/conf.cpp b/ychat-0.5.5/src/conf.cpp new file mode 100755 index 0000000..14dc199 --- /dev/null +++ b/ychat-0.5.5/src/conf.cpp @@ -0,0 +1,76 @@ +// class conf implementation. + +#ifndef s_conf_CXX +#define s_conf_CXX + +#include +#include "conf.h" + +using namespace std; + +conf::conf( string s_conf = CONFILE ) : name( s_conf ) +{ + parse( ); // parse the config file. +} + +conf::~conf() +{} + +void +conf::parse() +{ +#ifdef VERBOSE + cout << CFILEOK << get_name() << endl; +#endif + + ifstream fs_conf( get_name().c_str() ); + + if ( ! fs_conf ) + { +#ifdef VERBOSE + cout << CFILENO << get_name() << endl; +#endif + + return; + } + + 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; + + ui_pos = s_token.find( ";", 0 ); + + // if token has not been found. + 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 ); + +#ifdef VERBOSE2 + + cout << s_key << "=" << s_val << endl; +#endif + + // fill the map. + map_vals[s_key] = s_val; + } + + fs_conf.close(); + fs_conf.~ifstream(); +} + +#endif diff --git a/ychat-0.5.5/src/conf.h b/ychat-0.5.5/src/conf.h new file mode 100755 index 0000000..7d0b807 --- /dev/null +++ b/ychat-0.5.5/src/conf.h @@ -0,0 +1,24 @@ +// class conf declaration. this class parses the server config file. + +#ifndef s_conf_H +#define s_conf_H + +#include "incl.h" +#include "cont.h" +#include "name.h" + +using namespace std; + +class conf : public cont, name +{ +private: + +public: + // public methods: + conf ( string s_conf ); // standard constructor. + ~conf(); // standard destructor. + + virtual void parse( ); // parses the config file. +}; + +#endif diff --git a/ychat-0.5.5/src/config.cache b/ychat-0.5.5/src/config.cache new file mode 100644 index 0000000..f5f09c0 --- /dev/null +++ b/ychat-0.5.5/src/config.cache @@ -0,0 +1,30 @@ +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +ac_cv_cygwin=${ac_cv_cygwin=no} +ac_cv_header_dirent_dirent_h=${ac_cv_header_dirent_dirent_h=yes} +ac_cv_prog_CXX=${ac_cv_prog_CXX=c++} +ac_cv_search_dlopen=${ac_cv_search_dlopen='none required'} +ac_cv_prog_cxx_cross=${ac_cv_prog_cxx_cross=no} +ac_cv_c_const=${ac_cv_c_const=yes} +ac_cv_header_stdc=${ac_cv_header_stdc=yes} +ac_cv_lib_dir_opendir=${ac_cv_lib_dir_opendir=no} +ac_cv_c_inline=${ac_cv_c_inline=inline} +ac_cv_header_string_h=${ac_cv_header_string_h=yes} +ac_cv_header_unistd_h=${ac_cv_header_unistd_h=yes} +ac_cv_prog_cxx_works=${ac_cv_prog_cxx_works=yes} +ac_cv_prog_cxx_g=${ac_cv_prog_cxx_g=yes} +ac_cv_prog_gxx=${ac_cv_prog_gxx=yes} +ac_cv_prog_CPP=${ac_cv_prog_CPP='cc -E'} +ac_cv_mingw32=${ac_cv_mingw32=no} diff --git a/ychat-0.5.5/src/config.log b/ychat-0.5.5/src/config.log new file mode 100644 index 0000000..0a02618 --- /dev/null +++ b/ychat-0.5.5/src/config.log @@ -0,0 +1,71 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +configure:528: checking for Cygwin environment +configure:544: cc -c conftest.c 1>&5 +configure: In function `main': +configure:540: error: `__CYGWIN32__' undeclared (first use in this function) +configure:540: error: (Each undeclared identifier is reported only once +configure:540: error: for each function it appears in.) +configure: failed program was: +#line 533 "configure" +#include "confdefs.h" + +int main() { + +#ifndef __CYGWIN__ +#define __CYGWIN__ __CYGWIN32__ +#endif +return __CYGWIN__; +; return 0; } +configure:561: checking for mingw32 environment +configure:573: cc -c conftest.c 1>&5 +configure: In function `main': +configure:569: error: `__MINGW32__' undeclared (first use in this function) +configure:569: error: (Each undeclared identifier is reported only once +configure:569: error: for each function it appears in.) +configure: failed program was: +#line 566 "configure" +#include "confdefs.h" + +int main() { +return __MINGW32__; +; return 0; } +configure:590: checking how to run the C preprocessor +configure:611: cc -E conftest.c >/dev/null 2>conftest.out +configure:674: checking for c++ +configure:706: checking whether the C++ compiler (c++ ) works +configure:722: c++ -o conftest conftest.C 1>&5 +configure:748: checking whether the C++ compiler (c++ ) is a cross-compiler +configure:753: checking whether we are using GNU C++ +configure:762: c++ -E conftest.C +configure:781: checking whether c++ accepts -g +configure:815: checking for library containing dlopen +configure:833: cc -o conftest conftest.c 1>&5 +configure:883: checking for dirent.h that defines DIR +configure:896: cc