From b891420946d5269cc326d67555c6aab3db41a01a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 21 Nov 2010 17:01:59 +0000 Subject: added yhttpd and ycurses trunk versions --- ycurses/COPYING | 338 ++++++++++++++++++++++++++++++++ ycurses/Makefile | 69 +++++++ ycurses/README | 382 +++++++++++++++++++++++++++++++++++++ ycurses/SHORTDESC | 3 + ycurses/TODO | 3 + ycurses/configure | 77 ++++++++ ycurses/scripts/README | 6 + ycurses/scripts/astyle.sh | 14 ++ ycurses/scripts/buildnr.pl | 26 +++ ycurses/scripts/checkperl.sh | 13 ++ ycurses/scripts/config.pl | 144 ++++++++++++++ ycurses/scripts/modules/file.pm | 28 +++ ycurses/scripts/screen.sh | 3 + ycurses/scripts/setglobvals.pl | 32 ++++ ycurses/scripts/stats.pl | 95 +++++++++ ycurses/scripts/version.sh | 11 ++ ycurses/src/Makefile.in | 21 ++ ycurses/src/configure | 330 ++++++++++++++++++++++++++++++++ ycurses/src/curses/attributes.cpp | 80 ++++++++ ycurses/src/curses/attributes.h | 70 +++++++ ycurses/src/curses/color.cpp | 54 ++++++ ycurses/src/curses/color.h | 39 ++++ ycurses/src/curses/coordinate.cpp | 134 +++++++++++++ ycurses/src/curses/coordinate.h | 43 +++++ ycurses/src/curses/coordinate.impl | 17 ++ ycurses/src/curses/curses.cpp | 86 +++++++++ ycurses/src/curses/curses.h | 55 ++++++ ycurses/src/curses/cursor.cpp | 32 ++++ ycurses/src/curses/cursor.h | 30 +++ ycurses/src/curses/dummy.cpp | 11 ++ ycurses/src/curses/dummy.h | 11 ++ ycurses/src/curses/hidden.cpp | 29 +++ ycurses/src/curses/hidden.h | 21 ++ ycurses/src/curses/incl.h | 8 + ycurses/src/curses/menu.cpp | 117 ++++++++++++ ycurses/src/curses/menu.h | 28 +++ ycurses/src/curses/pwindow.cpp | 99 ++++++++++ ycurses/src/curses/pwindow.h | 37 ++++ ycurses/src/curses/tool.cpp | 37 ++++ ycurses/src/curses/tool.h | 15 ++ ycurses/src/curses/window.cpp | 367 +++++++++++++++++++++++++++++++++++ ycurses/src/curses/window.h | 85 +++++++++ ycurses/src/curses/ycurses.h | 6 + ycurses/src/examples/example1.cpp | 80 ++++++++ ycurses/src/examples/example1.h | 8 + ycurses/src/examples/example2.cpp | 52 +++++ ycurses/src/examples/example2.h | 8 + ycurses/src/examples/example3.cpp | 45 +++++ ycurses/src/examples/example3.h | 8 + ycurses/src/examples/example4.cpp | 22 +++ ycurses/src/examples/example4.h | 8 + ycurses/src/glob.h | 21 ++ ycurses/src/main.cpp | 110 +++++++++++ ycurses/src/msgs.h | 11 ++ 54 files changed, 3479 insertions(+) create mode 100644 ycurses/COPYING create mode 100644 ycurses/Makefile create mode 100644 ycurses/README create mode 100644 ycurses/SHORTDESC create mode 100644 ycurses/TODO create mode 100755 ycurses/configure create mode 100644 ycurses/scripts/README create mode 100755 ycurses/scripts/astyle.sh create mode 100755 ycurses/scripts/buildnr.pl create mode 100755 ycurses/scripts/checkperl.sh create mode 100755 ycurses/scripts/config.pl create mode 100644 ycurses/scripts/modules/file.pm create mode 100755 ycurses/scripts/screen.sh create mode 100755 ycurses/scripts/setglobvals.pl create mode 100755 ycurses/scripts/stats.pl create mode 100755 ycurses/scripts/version.sh create mode 100644 ycurses/src/Makefile.in create mode 100755 ycurses/src/configure create mode 100644 ycurses/src/curses/attributes.cpp create mode 100644 ycurses/src/curses/attributes.h create mode 100644 ycurses/src/curses/color.cpp create mode 100644 ycurses/src/curses/color.h create mode 100644 ycurses/src/curses/coordinate.cpp create mode 100644 ycurses/src/curses/coordinate.h create mode 100644 ycurses/src/curses/coordinate.impl create mode 100644 ycurses/src/curses/curses.cpp create mode 100644 ycurses/src/curses/curses.h create mode 100644 ycurses/src/curses/cursor.cpp create mode 100644 ycurses/src/curses/cursor.h create mode 100644 ycurses/src/curses/dummy.cpp create mode 100644 ycurses/src/curses/dummy.h create mode 100644 ycurses/src/curses/hidden.cpp create mode 100644 ycurses/src/curses/hidden.h create mode 100644 ycurses/src/curses/incl.h create mode 100644 ycurses/src/curses/menu.cpp create mode 100644 ycurses/src/curses/menu.h create mode 100644 ycurses/src/curses/pwindow.cpp create mode 100644 ycurses/src/curses/pwindow.h create mode 100644 ycurses/src/curses/tool.cpp create mode 100644 ycurses/src/curses/tool.h create mode 100644 ycurses/src/curses/window.cpp create mode 100644 ycurses/src/curses/window.h create mode 100644 ycurses/src/curses/ycurses.h create mode 100644 ycurses/src/examples/example1.cpp create mode 100644 ycurses/src/examples/example1.h create mode 100644 ycurses/src/examples/example2.cpp create mode 100644 ycurses/src/examples/example2.h create mode 100644 ycurses/src/examples/example3.cpp create mode 100644 ycurses/src/examples/example3.h create mode 100644 ycurses/src/examples/example4.cpp create mode 100644 ycurses/src/examples/example4.h create mode 100644 ycurses/src/glob.h create mode 100644 ycurses/src/main.cpp create mode 100644 ycurses/src/msgs.h (limited to 'ycurses') diff --git a/ycurses/COPYING b/ycurses/COPYING new file mode 100644 index 0000000..27058a5 --- /dev/null +++ b/ycurses/COPYING @@ -0,0 +1,338 @@ + 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 + 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/ycurses/Makefile b/ycurses/Makefile new file mode 100644 index 0000000..6e1e203 --- /dev/null +++ b/ycurses/Makefile @@ -0,0 +1,69 @@ +MAKE=`tail -n 1 make.version` +PREFIX=`grep "define PREFIX" src/glob.h | cut -d'"' -f2` +all: version base + @echo If you want to help the ycurses project please run gmake mail + @echo so that the developers receive an email about the platform + @echo being used. + @echo WARNING! This software is EXPERIMENTAL! +mail: + @echo "VERSION:" > mail.tmp + @${MAKE} version >> mail.tmp + @echo >> mail.tmp + @echo "UNAME:" >> mail.tmp + @uname -a >> mail.tmp + @echo >> mail.tmp + @echo "DATE:" >> mail.tmp + @date >> mail.tmp + @echo >> mail.tmp + @echo "COMPILER AND MAKE:" >> mail.tmp + @cat g++.version make.version >> mail.tmp + @cat mail.tmp | mail -s "Successfull build of ycurses" successfullbuild@yhttpd.org + @rm -f mail.tmp +install: deinstall +uninstall: deinstall +deinstall: + @echo Install/deinstall is not supported! + @echo Start ycurses with ./bin/ycurses instead! + @exit 1 +base: + @if test -f bin/ycurses; then echo "Backing up old binary";if test -f bin/ycurses.old; then rm -f bin/ycurses.old; fi; mv bin/ycurses bin/ycurses.old; fi + @perl ./scripts/buildnr.pl + @perl ./scripts/setglobvals.pl + @${MAKE} -C ./src +clean_base: + @${MAKE} -C ./src clean +stats: + @perl scripts/stats.pl +run: + ./bin/ycurses +base_start: base + ./bin/ycurses +gpl: + @more COPYING +clean: clean_base +help: + @echo "You may run ${MAKE} with the following parameters:" + @grep "^ ${MAKE} " README + @echo "For more questions read the README file or contact mail@ycurses.org!" +setup: + @./configure + @${MAKE} +config: + @sh -c "scripts/config.sh" + @echo If you run ${MAKE} config from the command line then you may need + @echo to rerun ./configure and recompile all now! + +mrproper: clean + @if test -f src/glob.h.org; then mv -f src/glob.h.org src/glob.h;fi + @if test -f g++.version; then rm -f g++.version; fi + @if test -f make.version; then rm -f make.version; fi + @if test -f src/Makefile; then rm -f src/Makefile; fi + @if test -f bin/ycurses; then find bin/ -name "ycurses*" | xargs rm -f; fi + @find . -name "*.add" | xargs rm -f + @ls | grep core | xargs rm -f +version: + @./scripts/version.sh +debug: + @gdb bin/ycurses ycurses.core +confdebug: + ./configure -g3 -ggdb diff --git a/ycurses/README b/ycurses/README new file mode 100644 index 0000000..e2e9237 --- /dev/null +++ b/ycurses/README @@ -0,0 +1,382 @@ +yCurses; Version 0.1-CURRENT + +Copyright (C) 2005 EXA Digital Solutions GbR +----------------------------------------------------------------- +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +----------------------------------------------------------------- + +YCURSES TABLE OF CONTENTS: + +1.0.0 REQUIREMENTS +2.0.0 LICENSE + +1.0.0 REQUIREMENTS: + +- GNU GCC G++ + The GNU C++ compiler version 3.1 or up. + +- GNU make 3.80 (gmake) or higher + If you dont have a gmake executable but make is gnu make then you need + to add a symlink or alias from gmake to make. + yChat Makefiles only have been tested with GNU make and may not work with + other make versions. + +- ncurses 5.x + Includes libncurses and the ncurses.h header files. + +- Perl 5.x + Is needed for some scripts. Is not needed if you use precompiled binaries. + +2.0.0 LICENSE + + 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/ycurses/SHORTDESC b/ycurses/SHORTDESC new file mode 100644 index 0000000..ac17c13 --- /dev/null +++ b/ycurses/SHORTDESC @@ -0,0 +1,3 @@ +ycurses is a small C++ wrapper around the C ncurses API designed to be used in +the yChat core. + diff --git a/ycurses/TODO b/ycurses/TODO new file mode 100644 index 0000000..53c0ef4 --- /dev/null +++ b/ycurses/TODO @@ -0,0 +1,3 @@ +Adopt ychat coding style. +Message box +Curses obj counter diff --git a/ycurses/configure b/ycurses/configure new file mode 100755 index 0000000..9aab971 --- /dev/null +++ b/ycurses/configure @@ -0,0 +1,77 @@ +#!/bin/sh + +if ! ./scripts/checkperl.sh +then + exit 1 +fi + +perl -e ' + use strict; + $|=1; + sub check_gcc { + my $f = shift; + my $s = shift; + my $r = 0; + print "Checking for GNU G++ $f.$s\n"; + if ( `g++ -v 2> g++.version && tail -n 1 g++.version` =~ / $f\.$s/ ) { + `echo $f.$s >> g++.version`; + `echo g++ >> g++.version`; + $r = 1; + } else { + if (`g++$f$s -v 2> g++.version && tail -n 1 g++.version` =~ / $f\.$s/) { + `echo $f.$s >> g++.version`; + `echo g++$f$s >> g++.version`; + $r = 1; + } + } + print "No " if $r == 0; + print "GNU G++ $f.$s found!\n"; + return $r; + } + sub check_make { + print "Checking for GNU make\n"; + my $err = "No GNU make found.\nPlease install a version of GNU make!\n"; + my $make; + if (`which gmake`) { + $make = "gmake"; + } elsif ( `which make` ) { + $make = "make"; + } else { + print $err; + exit(1); + } + + `sh -c "$make -v > make.version 2>/dev/null"`; + if ( `cat make.version` =~ /GNU Make/ ) { + `echo $make >> make.version`; + } else { + print $err; + exit(1); + } + } + &check_make; + print "Checking compiler version\n"; + my $r = 0; + for (my $i = 4; $i > 0 && $r == 0; --$i ) { + $r = &check_gcc(3,$i); + } + if ($r == 0) { + print "No suitable g++ compiler found!\n"; + print "Please install a right version of GNU G++!\n"; + exit(1); + } + + system("perl \"scripts/config.pl\""); + chdir("src"); + system("./configure ".join(" ", @ARGV)); + chdir(".."); + + exit(0); +' `echo "$*" | sed "s/-//g"` + +if test -f err +then + rm -f err +else + echo You are ready to type gmake now! +fi diff --git a/ycurses/scripts/README b/ycurses/scripts/README new file mode 100644 index 0000000..e44cc2d --- /dev/null +++ b/ycurses/scripts/README @@ -0,0 +1,6 @@ +All scripts should be run from the ycurses main directory, example: + +./scripts/makeycurses.pl + + +A ./makeycurses.pl WILL NOT work :) diff --git a/ycurses/scripts/astyle.sh b/ycurses/scripts/astyle.sh new file mode 100755 index 0000000..f986cde --- /dev/null +++ b/ycurses/scripts/astyle.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# The ycurses Project (2004) +# +# 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/ycurses/scripts/buildnr.pl b/ycurses/scripts/buildnr.pl new file mode 100755 index 0000000..7867787 --- /dev/null +++ b/ycurses/scripts/buildnr.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +# The ycurses Project (2003) +# +# This script increases the BUILNR of src/msgs.h each time the ycurses +# gets recompiled! + +use strict; + +open MSGS, "src/msgs.h"; +my @msgs = ; +close MSGS; + +foreach (@msgs) +{ + if ( /define BUILDNR/ ) + { + s/(BUILDNR )(.+)$/$1.($2+1)/e; + print; + next; + } +} + +open MSGS, ">src/msgs.h"; +print MSGS @msgs; +close MSGS; diff --git a/ycurses/scripts/checkperl.sh b/ycurses/scripts/checkperl.sh new file mode 100755 index 0000000..418087f --- /dev/null +++ b/ycurses/scripts/checkperl.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# The ycurses Project (2005) +# +# This scripts checks for a perl installation + +if ! which perl >/dev/null +then + echo You need to have Perl in your PATH! + exit 1 +fi + +echo Using `which perl` +exit 0 diff --git a/ycurses/scripts/config.pl b/ycurses/scripts/config.pl new file mode 100755 index 0000000..afb4d76 --- /dev/null +++ b/ycurses/scripts/config.pl @@ -0,0 +1,144 @@ +#!/usr/bin/perl + +# The ycurses Project (2004, 2005) +# +# This script modifues the src/glob.h file. + +use strict; +use scripts::modules::file; + +print <; + chomp $stdin; + prove_if_default(\$stdin); + print "\n"; + + if ( $stdin eq "yes") + { + print " You chose to use all the default before-compile options. Exiti-\n"; + print " ng the configurator now!\n"; + print $sep; + exit(0); + } + + last if $stdin eq "no" or $stdin eq ""; + print " Wrong input: You need to specify yes or no!\n"; +} # for + +`cp src/glob.h src/glob.h.org` unless -f "src/glob.h.org"; + +my @glob = fopen("src/glob.h.org"); +my $flag = 0; + +for (@glob) +{ + if ( $flag == 0 && /- CONFIG -/ ) + { + print $sep; + $flag = 1; + next; + } + + elsif ( $flag == 1 ) + { + if ( /\*\// ) + { + $flag = 2; + } + + else + { + print; + } + + next; + } + + elsif ( $flag == 2 ) + { + if ( /#define (.+) (.+)/ ) + { + my $def = $1; + my $val = $2; + my $flg = 0; + + $flg = 1 if $val =~ s/"//g; + + print " [Press enter to use default value: $val] "; + $stdin = ; + chomp $stdin; + + unless ( prove_if_default(\$stdin) ) + { + $stdin = "\"$stdin\"" if $flg == 1; + $_ = "#define $def $stdin\n"; + } + + print "\n"; + $flag = 0; + next; + } + + elsif ( /#define .+/ ) + { + my $default = "true"; + my $stdin; + + for (;;) + { + $default = "false" if /\/\/#define/; + + print " [Press enter to use default value: $default] "; + $stdin = ; + chomp $stdin; + + last if $stdin eq "" || $stdin eq "true" || $stdin eq "false"; + print " Wrong input: You need to specify true or false!\n"; + } + + if ( $default eq "true" ) + { + $_ = "//$_" + unless prove_if_default(\$stdin); + } + + else + { + s/^\/\/// + unless prove_if_default(\$stdin); + } + + print "\n"; + $flag = 0; + next; + } + } +} // for + + fwrite("src/glob.h", @glob); + +sub prove_if_default +{ + my $val = shift; + if ( $$val eq "" ) + { + print " -> Using default option!\n"; + return 1; + } + print " -> Using new option $$val!\n"; + return 0; +} diff --git a/ycurses/scripts/modules/file.pm b/ycurses/scripts/modules/file.pm new file mode 100644 index 0000000..b11e2b3 --- /dev/null +++ b/ycurses/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/ycurses/scripts/screen.sh b/ycurses/scripts/screen.sh new file mode 100755 index 0000000..23d4e66 --- /dev/null +++ b/ycurses/scripts/screen.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +screen -S ycurses ./bin/ycurses diff --git a/ycurses/scripts/setglobvals.pl b/ycurses/scripts/setglobvals.pl new file mode 100755 index 0000000..f0763ac --- /dev/null +++ b/ycurses/scripts/setglobvals.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl + +# The ycurses Project (2003) +# +# This script sets up some variables in src/glob.h + +use strict; + +use scripts::modules::file; + +my $file = 'src/glob.h'; +my $gmake = `which gmake`; +my @glob = fopen($file); +chomp($gmake); + +print "-> Setting values in $file\n"; + +my $modified = 0; +foreach (@glob) +{ + if (/^(#define GMAKE) "(.*)"/) + { + if ($2 ne "$gmake \\0") + { + s/^$1 "$2"/#define GMAKE "$gmake \\0"/; + print " -> Set $gmake\n"; + fwrite($file,@glob); + last; + } + } +} + diff --git a/ycurses/scripts/stats.pl b/ycurses/scripts/stats.pl new file mode 100755 index 0000000..222c16e --- /dev/null +++ b/ycurses/scripts/stats.pl @@ -0,0 +1,95 @@ +#!/usr/bin/perl + +# The ycurses 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|README|INSTALL|COPYING|NEWS|SNAPSHOT|CHANGES|RELEASES)$/ ) + { + $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/ycurses/scripts/version.sh b/ycurses/scripts/version.sh new file mode 100755 index 0000000..8bb9bdd --- /dev/null +++ b/ycurses/scripts/version.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# The ycurses Project (2005) +# +# This script shows ycurses VERSION-BRANCH Build BUILDNUMBER + +version=`grep VERSION src/msgs.h | head -n 1 | cut -d'"' -f2` +branch=`grep BRANCH src/msgs.h | head -n 1 | cut -d'"' -f2` +build=`grep BUILD src/msgs.h | tail -n 1 | cut -d' ' -f3` +echo "ycurses $version-$branch Build $build" + + diff --git a/ycurses/src/Makefile.in b/ycurses/src/Makefile.in new file mode 100644 index 0000000..7723d45 --- /dev/null +++ b/ycurses/src/Makefile.in @@ -0,0 +1,21 @@ +SRCS=WILLBEADDEDBYCONFIGURE +OBJS=$(addprefix ../obj/,$(SRCS:.cpp=.o)) +CC=WILLBEADDEDBYCONFIGURE +LIBADD=`cat libs.add` +LDFLAGS=$(LIBADD) -lstdc++ +LDADD= +INCLUDES=`cat includes.add` +CFLAGS=-fno-inline -fno-default-inline -frepo +all: ycurses +$(SRCS): + $(CC) $(INCLUDES) $(CFLAGS) -c $*.cpp +infotext: + @echo Compiling base +ycurses: infotext $(OBJS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDADD) + @mv ycurses ../bin + @echo -n "Size of linked executable: " + @du -hc ../bin/ycurses | tail -n 1 +clean: + @echo Cleaning base obj + @if test -d ../obj; then rm -Rf ../obj; fi diff --git a/ycurses/src/configure b/ycurses/src/configure new file mode 100755 index 0000000..cb7c9ff --- /dev/null +++ b/ycurses/src/configure @@ -0,0 +1,330 @@ +#!/bin/sh + +# +# The ycurses Project (2003 - 2005) +# + +if ! ../scripts/checkperl.sh +then + exit 1 +fi + +if ! test -f ../g++.version +then + echo You need to run ./configure of the top level source dir first + exit 1 +fi + +perl -e ' + use strict; + $|=1; + + my %libadd; + my %incadd; + my $deepness = 500; + + my @headers = ( + "ncurses.h", + "menu.h", + "panel.h" + ); + + my @libs = ( + "libpanel.so", + "libmenu.so", + "libncurses.so" + ); + + my @headerpaths = ( + $ENV{HOME}."/include", + $ENV{HOME}."/usr/include", + "/include", + "/usr/include", + "/usr/local/include", + "/usr/lib/", + "/usr/pkg/include", + "/opt/include", + "/opt/local/include" + ); + + my @libpaths = ( + $ENV{HOME}."/lib", + $ENV{HOME}."/usr/lib", + "/lib", + "/usr/lib", + "/usr/local/lib", + "/usr/pkg/lib", + "/opt/lib", + "/opt/local/lib" + ); + + open FILE, "glob.h" or die "glob.h: $!\n"; + while() + { + if ( /\/\/#define DATABASE/ ) + { + remove_from_array("mysql/mysql.h",\@headers); + remove_from_array("libmysqlclient.so",\@libs); + } + + elsif ( /\/\/#define NCURSES/ ) + { + remove_from_array("ncurses.h",\@headers); + remove_from_array("libncurses.so",\@libs); + } + } + close FILE; + + if ( defined $ENV{YHTTPDHEADERPATHS} ) + { + map { print "Adding $_...\n"; + unshift @headerpaths, $_ } split /:/, $ENV{YHTTPDHEADERPATHS}; + } + + if ( defined $ENV{YHTTPDLIBPATHS} ) + { + map { print "Adding $_...\n"; + unshift @libpaths, $_ } split /:/, $ENV{YHTTPDLIBPATHS}; + } + + + print "Headers:\n"; + + my $testit = 0; + map { $incadd{&check($deepness, $_, @headerpaths)}++ } + @headers; + + $testit = 0; + print "Libraries:\n"; + map { $libadd{&check($deepness, $_, @libpaths)}++ } + @libs; + + my $incadd = &make_add("-I", \%incadd); + my $libadd = &make_add("-L", \%libadd); + + for ( @libs ) + { + $libadd .= "-l$_ " if s/^lib// and s/\.so$//; + } + + print "Incadd: $incadd\n"; + print "Libadd: $libadd\n"; + + `echo $incadd > includes.add`; + `echo $libadd > libs.add`; + + print "Creating new base Makefile...\n"; + unlink("Makefile") if -f "Makefile"; + unlink("../err") if -f "../err"; + open Fin, "Makefile.in" or die "Makefile.in: $!\n"; + open Fout, ">Makefile" or die "Makefile: $!\n"; + +# my $cpp = `echo *.cpp */*.cpp contrib/*/*.cpp | sort`; + my $cpp = `echo *.cpp */*.cpp | sort`; + my $compiler = `tail -n 1 ../g++.version`; + my $version = `tail -n 2 ../g++.version | head -n 1`; + my $uname = `uname -srm`; + my $compopt = join "; ", split /\n/, `cat ../g++.version`; + + chomp $uname; + chomp $compopt; + + print "Configuring for $uname...\n"; + chomp $cpp; + chomp $version; + + while () + { + s/^(CC=).*\n/$1$compiler/; + s/^(SRCS=).*/$1$cpp/; + s/ -frepo//; # unless $version =~ /3\.4/; + if ( $uname !~ /Linux/i ) { + print "Disabling -ldl flag...\n" if s/ -ldl//; + } + print Fout; + } + close Fin; + + my $args = join(" -",@ARGV); + $args = "-".$args unless $args eq ""; + + for my $cppfile (split / /, $cpp) + { + my $ofile = $cppfile; + $ofile =~ s/\.cpp/\.o/; + print Fout "../obj/$ofile: $cppfile\n"; + print Fout "\t\@if ! test -d `dirname ../obj/$ofile`; then mkdir -p `dirname ../obj/$ofile`; fi\n"; + my $class = $ofile; + $class =~ s/\.o//; + if ( $class =~ /contrib\/.+/ ) + { + my $dirname = `dirname $class`; + print Fout "\t\@echo -n \"Compiling contributed class $class \"\n"; + } + + else + { + print Fout "\t\@echo -n \"Compiling base class $class \"\n"; + } + + print Fout "\t\@\$(CC) \$(CFLAGS) \$(INCLUDES) $args -c -o ../obj/$ofile $cppfile\n"; + print Fout "\t\@du -hc ../obj/$ofile | tail -n 1 | sed s/total// | sed \"s/ //g\"\n"; + } + + close Fout; + + open F, "msgs.h" or die "msgs.h: $!\n"; + my @msgs = ; + close F; + unlink("msgs.h"); + open F, ">msgs.h" or die "msgs.h: $!\n"; + + for (@msgs) + { + s/(UNAME)(.+)$/UNAME "$uname"/; + s/(COMPOPT)(.+)$/COMPOPT "$compopt"/; + print F; + } + close F; + + if ( -d "mods" ) + { + chdir("mods"); + my $cflags = "-fno-inline -fno-default-inline"; + + $cflags .= " -nostdlib" if $uname =~ /FreeBSD/i && `uname -r` =~ /^4\./; + + system("echo $cflags > cflags.add"); + system("./configure"); + chdir(".."); + } + + sub remove_from_array + { + my $elem = shift; + my $array = shift; + + for ( my $i = 0; $i <= $#$array; ++$i ) + { + if ( $$array[$i] eq $elem ) + { + splice(@$array,$i,1); + last; + } + } # for + } + + sub check { + my $deep = shift; + + if ($deep == 0) { + print "Looking too deep! ($deepness)\n"; + exit(1); + } + + my $check = shift; + $testit = 1 if $check =~ s/::test:://; + + my $print = 1; + if ( $_[-1] eq "subsearch" ) { + $print = 0; + pop(@_); + } + + if ($print) + { + print "Checking for $check..."; + print "\n" if $testit; + } + + for (@_) + { + if ( -f "$_/$check" ) + { + if ($testit) + { + return $_ if test_include($_, $check); + return ""; + } + + else + { + print "OK\n"; + return "" if $_ eq "/usr/lib" or $_ eq "/usr/include"; + return $_; + } + } + } + + for (@_) + { + next unless -d $_; + opendir D, $_ or warn "$_: $!\n"; + my @dir = readdir(D); + closedir D; + + for my $dir ( @dir ) + { + next if $dir =~ /^\.+$/ or !-d "$_/$dir"; + my $path = &check($deep-1, $check, "$_/$dir", "subsearch"); + return $path if $path ne ""; + } + } + + if ($print) + { + print "NOT OK\n"; + print "Please make sure that you have the needed software installed!\n"; + print "If you have a special path for your includes then edit src/configure!\n"; + print "Or set the environment variables YHTTPDHEADERPATHS and YHTTPDLIBPATHS.\n"; + print " Example: setenv YHTTPDHEADERPATHS \"/your/header/includes:/a/includes\"\n"; + print "(The environment variables have to be seperated by an :)\n"; + print "PS: You may use the locate and/or find command to search for files.\n"; + exit(1); + } + + `touch ../err`; + return ""; + } + + sub make_add { + my $flag = shift; + my $add = shift; + my $ret = ""; + + for (reverse keys %$add) { + next unless /.+/; + $ret .= "$flag$_ "; + } + return $ret; + } + + sub test_include + { + my $shift = shift; + my $check = shift; + my $return = 0; + print "Testing $shift/$check..."; + + `echo "\#include \\"maps/hashmap.h\\"" > __test.cpp`; + `echo "int main(void){return 0;}" >> __test.cpp`; + my $cmd = "`tail -n 1 ../g++.version` -I$shift __test.cpp -o /dev/null 2>/dev/null"; + system $cmd; + + unless ($?) + { + print "OK\n"; + $return = 1; + } + + else + { + print "Not OK\n"; + } + + unlink "__test.cpp" if -f "__test.cpp"; + return $return; + } + + exit(0); +' `echo "$*" | sed "s/-//g"` diff --git a/ycurses/src/curses/attributes.cpp b/ycurses/src/curses/attributes.cpp new file mode 100644 index 0000000..b859da0 --- /dev/null +++ b/ycurses/src/curses/attributes.cpp @@ -0,0 +1,80 @@ +#ifndef ATTRIBUTES_CPP +#define ATTRIBUTES_CPP + +#include "attributes.h" + +attributes::attributes() +{ + init()