From dec31daba6135005623f6165a9e839ed2d5a15b5 Mon Sep 17 00:00:00 2001 From: a1batross Date: Thu, 13 Aug 2015 23:42:01 +0600 Subject: [PATCH] First blood! --- AUTHORS | 1 + COPYING | 340 +++ ChangeLog | 140 ++ HLMaster.dsp | 146 ++ HLMaster.dsw | 44 + INSTALL | 177 ++ Makefile.am | 31 + Makefile.in | 413 ++++ NEWS | 24 + README | 85 + TODO | 5 + aclocal.m4 | 578 +++++ config.guess | 1314 ++++++++++ config.h.in | 7 + config.sub | 1410 +++++++++++ configure | 3530 +++++++++++++++++++++++++++ configure.in | 39 + depcomp | 411 ++++ doc/Makefile.am | 21 + doc/Makefile.in | 309 +++ doc/html/Makefile.am | 26 + doc/html/Makefile.in | 198 ++ doc/html/hlmaster.filter.html | 122 + doc/html/hlmaster.gameserver.html | 91 + doc/html/hlmaster.html | 153 ++ doc/html/hlmaster.list.html | 120 + doc/html/make_html.bat | 26 + doc/html/man2html.sed | 37 + doc/man/Makefile.am | 27 + doc/man/Makefile.in | 244 ++ doc/man/hlmaster.1 | 172 ++ doc/man/hlmaster.filter.1 | 125 + doc/man/hlmaster.gameserver.1 | 96 + doc/man/hlmaster.list.1 | 131 + examples/filter.list | 41 + examples/server.list | 19 + examples/woncomm.lst | 32 + include/HLInfoList.h | 135 + include/HLMaster.h | 204 ++ include/HLServerFilterList.h | 130 + include/HLServerList.h | 191 ++ include/Makefile.am | 24 + include/Makefile.in | 228 ++ install-sh | 251 ++ lib/Makefile.am | 21 + lib/Makefile.in | 309 +++ lib/pfc++/AUTHORS | 1 + lib/pfc++/COPYING | 504 ++++ lib/pfc++/ChangeLog | 0 lib/pfc++/INSTALL | 177 ++ lib/pfc++/Makefile.am | 23 + lib/pfc++/Makefile.in | 312 +++ lib/pfc++/NEWS | 0 lib/pfc++/NOTES | 3 + lib/pfc++/README | 0 lib/pfc++/TODO | 0 lib/pfc++/configure.in | 29 + lib/pfc++/include/CInetAddress.h | 74 + lib/pfc++/include/CStringBuffer.h | 92 + lib/pfc++/include/Makefile.am | 32 + lib/pfc++/include/Makefile.in | 323 +++ lib/pfc++/include/PArgumentList.h | 266 ++ lib/pfc++/include/PException.h | 120 + lib/pfc++/include/PFile.h | 74 + lib/pfc++/include/PLogfile.h | 121 + lib/pfc++/include/PSocket.h | 162 ++ lib/pfc++/include/PString.h | 139 ++ lib/pfc++/include/PStringList.h | 129 + lib/pfc++/include/PUDPSocket.h | 110 + lib/pfc++/include/pfc++/Makefile.am | 26 + lib/pfc++/include/pfc++/Makefile.in | 230 ++ lib/pfc++/include/pfc++/file.h | 65 + lib/pfc++/include/pfc++/inet.h | 46 + lib/pfc++/include/pfc++/socket.h | 108 + lib/pfc++/include/pfc++/string.h | 39 + lib/pfc++/include/pfc++/system.h | 55 + lib/pfc++/include/pfc++/types.h | 69 + lib/pfc++/pfc++.dsp | 192 ++ lib/pfc++/pfc++.dsw | 29 + lib/pfc++/src/CInetAddress.cpp | 128 + lib/pfc++/src/CStringBuffer.cpp | 176 ++ lib/pfc++/src/Makefile.am | 31 + lib/pfc++/src/Makefile.in | 306 +++ lib/pfc++/src/PArgumentList.cpp | 842 +++++++ lib/pfc++/src/PLogfile.cpp | 260 ++ lib/pfc++/src/PSocket.cpp | 173 ++ lib/pfc++/src/PString.cpp | 381 +++ lib/pfc++/src/PStringList.cpp | 352 +++ lib/pfc++/src/PUDPSocket.cpp | 166 ++ missing | 283 +++ mkinstalldirs | 40 + src/HLInfoList.cpp | 205 ++ src/HLMaster.cpp | 1145 +++++++++ src/HLServerFilterList.cpp | 529 ++++ src/HLServerList.cpp | 1200 +++++++++ src/Makefile.am | 33 + src/Makefile.in | 318 +++ src/main.cpp | 970 ++++++++ stamp-h.in | 1 + win32/HLMaster.exe | Bin 0 -> 81920 bytes 100 files changed, 23267 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 HLMaster.dsp create mode 100644 HLMaster.dsw create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 TODO create mode 100644 aclocal.m4 create mode 100755 config.guess create mode 100644 config.h.in create mode 100755 config.sub create mode 100755 configure create mode 100644 configure.in create mode 100755 depcomp create mode 100644 doc/Makefile.am create mode 100644 doc/Makefile.in create mode 100644 doc/html/Makefile.am create mode 100644 doc/html/Makefile.in create mode 100644 doc/html/hlmaster.filter.html create mode 100644 doc/html/hlmaster.gameserver.html create mode 100644 doc/html/hlmaster.html create mode 100644 doc/html/hlmaster.list.html create mode 100755 doc/html/make_html.bat create mode 100644 doc/html/man2html.sed create mode 100644 doc/man/Makefile.am create mode 100644 doc/man/Makefile.in create mode 100644 doc/man/hlmaster.1 create mode 100644 doc/man/hlmaster.filter.1 create mode 100644 doc/man/hlmaster.gameserver.1 create mode 100644 doc/man/hlmaster.list.1 create mode 100644 examples/filter.list create mode 100644 examples/server.list create mode 100644 examples/woncomm.lst create mode 100644 include/HLInfoList.h create mode 100644 include/HLMaster.h create mode 100644 include/HLServerFilterList.h create mode 100644 include/HLServerList.h create mode 100644 include/Makefile.am create mode 100644 include/Makefile.in create mode 100755 install-sh create mode 100644 lib/Makefile.am create mode 100644 lib/Makefile.in create mode 100644 lib/pfc++/AUTHORS create mode 100644 lib/pfc++/COPYING create mode 100644 lib/pfc++/ChangeLog create mode 100644 lib/pfc++/INSTALL create mode 100644 lib/pfc++/Makefile.am create mode 100644 lib/pfc++/Makefile.in create mode 100644 lib/pfc++/NEWS create mode 100644 lib/pfc++/NOTES create mode 100644 lib/pfc++/README create mode 100644 lib/pfc++/TODO create mode 100644 lib/pfc++/configure.in create mode 100644 lib/pfc++/include/CInetAddress.h create mode 100644 lib/pfc++/include/CStringBuffer.h create mode 100644 lib/pfc++/include/Makefile.am create mode 100644 lib/pfc++/include/Makefile.in create mode 100644 lib/pfc++/include/PArgumentList.h create mode 100644 lib/pfc++/include/PException.h create mode 100644 lib/pfc++/include/PFile.h create mode 100644 lib/pfc++/include/PLogfile.h create mode 100644 lib/pfc++/include/PSocket.h create mode 100644 lib/pfc++/include/PString.h create mode 100644 lib/pfc++/include/PStringList.h create mode 100644 lib/pfc++/include/PUDPSocket.h create mode 100644 lib/pfc++/include/pfc++/Makefile.am create mode 100644 lib/pfc++/include/pfc++/Makefile.in create mode 100644 lib/pfc++/include/pfc++/file.h create mode 100644 lib/pfc++/include/pfc++/inet.h create mode 100644 lib/pfc++/include/pfc++/socket.h create mode 100644 lib/pfc++/include/pfc++/string.h create mode 100644 lib/pfc++/include/pfc++/system.h create mode 100644 lib/pfc++/include/pfc++/types.h create mode 100644 lib/pfc++/pfc++.dsp create mode 100644 lib/pfc++/pfc++.dsw create mode 100644 lib/pfc++/src/CInetAddress.cpp create mode 100644 lib/pfc++/src/CStringBuffer.cpp create mode 100644 lib/pfc++/src/Makefile.am create mode 100644 lib/pfc++/src/Makefile.in create mode 100644 lib/pfc++/src/PArgumentList.cpp create mode 100644 lib/pfc++/src/PLogfile.cpp create mode 100644 lib/pfc++/src/PSocket.cpp create mode 100644 lib/pfc++/src/PString.cpp create mode 100644 lib/pfc++/src/PStringList.cpp create mode 100644 lib/pfc++/src/PUDPSocket.cpp create mode 100755 missing create mode 100755 mkinstalldirs create mode 100644 src/HLInfoList.cpp create mode 100644 src/HLMaster.cpp create mode 100644 src/HLServerFilterList.cpp create mode 100644 src/HLServerList.cpp create mode 100644 src/Makefile.am create mode 100644 src/Makefile.in create mode 100644 src/main.cpp create mode 100644 stamp-h.in create mode 100755 win32/HLMaster.exe diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..8ce6478 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Silvan Minghetti (bullet) \ No newline at end of file diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..5b6e7c6 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 + + 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) + + 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 + + +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) year 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/ChangeLog b/ChangeLog new file mode 100644 index 0000000..0ff4e2f --- /dev/null +++ b/ChangeLog @@ -0,0 +1,140 @@ + + +2001-12-22 Silvan Minghetti + + * Added --user and --group options to run as user/group. + * Updated man/hlmaster.1 accordingly. + + +2001-12-15 Silvan Minghetti + + * Added debug function HLServerList::LogSnapshot(). + + +2001-11-27 Silvan Minghetti + + * Fixed a nullpointer exception in HLServerList::HeartBeat. + * Added HLInfoList.cpp and HLInfoList.h to Makefile.am in + src and include. + + +2001-11-07 Silvan Minghetti + + * Moved HeartBeat logic to HLServerList class. + * Moved Challenge Id logic to HLServerList class. + + +2001-11-03 Silvan Minghetti + + * Changed serverinfo datatypes to use less memory. + * Redesigned the CheckTimeout function. + * Converted HLServerList to a doubly linked list. + * Number of bad-checks set to 1 for new hosts. + * Number of bad-checks set to 2 for loaded hosts. + * Removed ping code (replaced by details request/reply). + * Changed max listsize to 60'000. + * Limited number of servers loadable by --server-list + to 3'000. + * Servers loaded via --server-list are getting checked + in a bunch of 100 servers every 10 seconds. If you + load a lot of servers, it'll take a while until they + get checked (max 5 minutes). + + +2001-11-01 Silvan Minghetti + + * Send a details request instead of a ping request to + servers loaded by --server-list. + * Created HLInfoList - which is used to save the + gamedir and mapname status informations. + + +2001-10-30 Silvan Minghetti + + * Randomized the challenge number in HLMaster to prevent + denial of service with spoofed ip's. + * Moved the challenge string parsing logic into the + HLMaster class. + * Challenge infos changed a bit with hl version 1.1.0.8: + - Old: \dedicated\1 + - New: \type\d + * Hosts replying with an invalid challenge id are + now rejected to prevent flooding with spoofed ip's. + + +2001-10-30 Silvan Minghetti + + * ServerList and FilterList Load functions now return + the number of successfully loaded servers instead + of true/false. + + +2001-10-29 Silvan Minghetti + + * Added basic (no filtering) support for the Half-Life + ingame browser. + * Fixed a bug concerning gamespy. If the list had more + than 230 entries, gamespy did not display any of them. + * Changed #ifdef __linux__ to PFC_SYSTEM_UNIX - which in + fact checks for __linux__, __FreeBSD__, __NetBSD__. + + +2001-07-04 Silvan Minghetti + + * The custom servername (--server-name) is now allways + prefixed by "HLMaster 0.9.2 - ". + * List type2 request was broken (returned bad index, only + occured with more than about 340 servers). + + +2001-06-29 Silvan Minghetti + + * Added --server-filter option. + * SIGUSR1 now reloads configuration files only. + * SIGUSR2 now reloads logfiles only. + + +2001-06-28 Silvan Minghetti + + * Created CStringBuffer class, and use it for creating + the log-strings. + * Increased and improved log-messages. + + +2001-06-27 Silvan Minghetti + + * Removed multi-master code complety (main.cpp). + * Split input processing (ProcessInput) into multiple + functions. (HLMaster.cpp) + * Select is now performed on the Socket object directly, + instead of requireing a PFileDescriptor object. The + PFileDescriptor class might be a subject to drop completly. + * Gameservers which send a hearbeat but do not respond + to the challenge request wont be listed by list requests. + They are not deleted, because they're still heartbeating. + + +2001-06-23 Silvan Minghetti + + * Tabs in the --server-list are now accepted. + * Changed some argument names (--host-list to --server-list, + --server-name to --master-name, ...). + + +2001-06-22 Silvan Minghetti + + * Removed --error-log. All errors are now reported + within the --info-log. + * Added --host-list. You can now load a list of hosts + instead of waiting for them to send a heartbeat. + * Added --private-mode. If you load hosts, you may + go into private mode. This adds ban filter for all + hosts, so only the ones in your host-list are accepted. + * The access-log now does not use the log-level value + specified with --log-level. It's allways on level "Info". + * Invalid queries are logged only with log-level "Debug". + + +2001-06-15 Silvan Minghetti + + * Initial release. diff --git a/HLMaster.dsp b/HLMaster.dsp new file mode 100644 index 0000000..7303750 --- /dev/null +++ b/HLMaster.dsp @@ -0,0 +1,146 @@ +# Microsoft Developer Studio Project File - Name="HLMaster" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=HLMaster - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "HLMaster.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "HLMaster.mak" CFG="HLMaster - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "HLMaster - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "HLMaster - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "HLMaster - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I ".\include" /I "lib\pfc++\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x807 /d "NDEBUG" +# ADD RSC /l 0x807 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 wsock32.lib pfc++.lib /nologo /subsystem:console /machine:I386 /libpath:"lib\pfc++\Release" +# Begin Custom Build - Copy hlmaster.exe to win32 directory +ProjDir=. +TargetPath=.\Release\HLMaster.exe +TargetName=HLMaster +InputPath=.\Release\HLMaster.exe +SOURCE="$(InputPath)" + +"$(TargetName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + copy $(TargetPath) $(ProjDir)\win32\ + +# End Custom Build + +!ELSEIF "$(CFG)" == "HLMaster - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".\include" /I "lib\pfc++\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x807 /d "_DEBUG" +# ADD RSC /l 0x807 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 wsock32.lib pfc++.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"lib\pfc++\Debug" +# SUBTRACT LINK32 /nodefaultlib + +!ENDIF + +# Begin Target + +# Name "HLMaster - Win32 Release" +# Name "HLMaster - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\src\HLInfoList.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\HLMaster.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\HLServerFilterList.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\HLServerList.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\main.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\include\HLInfoList.h +# End Source File +# Begin Source File + +SOURCE=.\include\HLMaster.h +# End Source File +# Begin Source File + +SOURCE=.\include\HLServerFilterList.h +# End Source File +# Begin Source File + +SOURCE=.\include\HLServerList.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/HLMaster.dsw b/HLMaster.dsw new file mode 100644 index 0000000..763e622 --- /dev/null +++ b/HLMaster.dsw @@ -0,0 +1,44 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "HLMaster"=".\HLMaster.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name pfc++ + End Project Dependency +}}} + +############################################################################### + +Project: "pfc++"="lib\pfc++\pfc++.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..d7a1584 --- /dev/null +++ b/INSTALL @@ -0,0 +1,177 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes a while. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..d33cdb5 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,31 @@ +## Makefile for hlmaster +## Copyright (C) 2001 Silvan Minghetti +## +## 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, 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. +## +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = dist-zip + +SUBDIRS= lib include src doc + + +EXTRA_DIST= HLMaster.dsp \ + HLMaster.dsw \ + examples/filter.list \ + examples/server.list \ + examples/woncomm.lst \ + win32/HLMaster.exe diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..71e57c4 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,413 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +AUTOMAKE_OPTIONS = dist-zip + +SUBDIRS = lib include src doc + +EXTRA_DIST = HLMaster.dsp \ + HLMaster.dsw \ + examples/filter.list \ + examples/server.list \ + examples/woncomm.lst \ + win32/HLMaster.exe + +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ + Makefile.am Makefile.in NEWS TODO aclocal.m4 config.guess \ + config.h.in config.sub configure configure.in depcomp \ + install-sh missing mkinstalldirs +DIST_SUBDIRS = $(SUBDIRS) +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$@ $(SHELL) ./config.status + +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +$(ACLOCAL_M4): configure.in + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +config.h: stamp-h + @if test ! -f $@; then \ + rm -f stamp-h; \ + $(MAKE) stamp-h; \ + else :; fi +stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h stamp-hT + @echo timestamp > stamp-hT 2> /dev/null + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=config.h \ + $(SHELL) ./config.status + @mv stamp-hT stamp-h +$(srcdir)/config.h.in: $(srcdir)/./stamp-h.in + @if test ! -f $@; then \ + rm -f $(srcdir)/./stamp-h.in; \ + $(MAKE) $(srcdir)/./stamp-h.in; \ + else :; fi +$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) + @rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT + @echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null + cd $(top_srcdir) && $(AUTOHEADER) + @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in + +distclean-hdr: + -rm -f config.h +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = . +# Avoid unsightly `./'. +distdir = $(PACKAGE)-$(VERSION) + +GZIP_ENV = --best + +distdir: $(DISTFILES) + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/examples $(distdir)/win32 + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + chmod a-w $(distdir) + dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \ + && cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ + || (echo "Error: files left after uninstall" 1>&2; \ + exit 1) ) \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && $(MAKE) $(AM_MAKEFLAGS) distclean \ + && rm -f $(distdir).tar.gz \ + && (test `find . -type f -print | wc -l` -eq 0 \ + || (echo "Error: files left after distclean" 1>&2; \ + exit 1) ) + -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) +distclean: distclean-recursive + -rm -f config.status config.cache config.log +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-recursive dist dist-all dist-zip distcheck \ + distclean distclean-generic distclean-hdr distclean-recursive \ + distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ + info-recursive install install-am install-data install-data-am \ + install-data-recursive install-exec install-exec-am \ + install-exec-recursive install-info install-info-am \ + install-info-recursive install-man install-recursive \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am installdirs-recursive maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive mostlyclean \ + mostlyclean-generic mostlyclean-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..99ec159 --- /dev/null +++ b/NEWS @@ -0,0 +1,24 @@ +HLMaster News - User visible changes. + + +Version 0.9.3 ::............................................2001-12-22 +---------------------------------------------------------------------- + + * Added basic support for the Half-Life ingame browser. Please + note, that filtering does not work yet. HLMaster will allways + send the total list. + * You cannot load more than 3'000 with --server-list anymore. The + overall limit however is still 60'000. + * New commandline options (linux only): + -u, --user=USER run hlmaster as USER. + -g, --group=GROUP run hlmaster as GROUP. + + * Now compiles on FreeBSD via configure && make. + * Minimized memory usage. + + +Version 0.9.2 ::............................................2001-07-05 +---------------------------------------------------------------------- + + * First public release. + diff --git a/README b/README new file mode 100644 index 0000000..dfe5624 --- /dev/null +++ b/README @@ -0,0 +1,85 @@ +HLMaster readme last updated Saturday, 22. December 2001 + + + +Function and purpose ::............................................... +---------------------------------------------------------------------- + + HLMaster implements a fully functional, automatic master-server + daemon for the game Half-life (and all mods based on this engine). + + Because the master-server protocol is not open, I had to figure + it out myself. Some features might not be implemented, some may + be 'wrong'. However, all basically required features should work. + + I have tested hlmaster with the following query-tools: + + o GameSpy - http://www.gamespy.com + o QStat - http://www.qstat.org + + + If you encounter any problems with any query tool, please + send an e-mail to bullet@users.sourceforge.net. + + Note: Current versions of gamespy are incapable of receiving more + than 230 gameservers from hlmaster. This limitation comes + from GameSpy, not hlmaster (GameSpy is using an old protocol). + + Check http://hlmaster.sourceforge.net for newest version. + + +Documentation ::...................................................... +---------------------------------------------------------------------- + + Documentation is provided within the 'doc' directory. On Linux, + the manfiles are installed by 'make install' as well. + + Additionally, there is an html version of the manfiles in the + doc/html directory. + + Please note: The documentation might not allways be up to date. + + + +Additional files ::................................................... +---------------------------------------------------------------------- + + o COPYING License information. + o AUTHORS List of authors working on this project. + o NEWS Human readable list of major changes. + o ChangeLog Raw list of changes. + o TODO List of unimplemented features. + o INSTALL Basic installation instructions. + + + +Example files ::...................................................... +---------------------------------------------------------------------- + + These files should be found in the 'examples' directory. + + o woncomm.lst A sample master configuration for half-life. + o server.list A sample gameserver list for hlmaster. + o filter.list A sample gameserver filter list for hlmaster. + + + Check the documentation for more information. + + + +Copyright ::.......................................................... +---------------------------------------------------------------------- + + Copyright (c) 2001 Silvan Minghetti + + 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. + + +Legal notes ::........................................................ +---------------------------------------------------------------------- + + Half-Life is a trademark of valve software. + diff --git a/TODO b/TODO new file mode 100644 index 0000000..1632297 --- /dev/null +++ b/TODO @@ -0,0 +1,5 @@ +TODO list for HLMaster last updated Monday, 29. October 2001 +---------------------------------------------------------------------- + +* Implement the full new protocol which has filtering capabilities. +* Add ability to chroot. diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..2e594ed --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,578 @@ +# aclocal.m4 generated automatically by aclocal 1.5 + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Like AC_CONFIG_HEADER, but automatically create stamp file. + +# serial 3 + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. We must strip everything past the first ":", +# and everything past the last "/". + +AC_PREREQ([2.12]) + +AC_DEFUN([AM_CONFIG_HEADER], +[ifdef([AC_FOREACH],dnl + [dnl init our file count if it isn't already + m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0])) + dnl prepare to store our destination file list for use in config.status + AC_FOREACH([_AM_File], [$1], + [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*])) + m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index)) + dnl and add it to the list of files AC keeps track of, along + dnl with our hook + AC_CONFIG_HEADERS(_AM_File, +dnl COMMANDS, [, INIT-CMDS] +[# update the timestamp +echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index[" +][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS + m4_popdef([_AM_Dest])])],dnl +[AC_CONFIG_HEADER([$1]) + AC_OUTPUT_COMMANDS( + ifelse(patsubst([$1], [[^ ]], []), + [], + [test -z "$CONFIG_HEADERS" || echo timestamp >dnl + patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl +[am_indx=1 +for am_file in $1; do + case " \$CONFIG_HEADERS " in + *" \$am_file "*) + am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\` + if test -n "\$am_dir"; then + am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\` + for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do + am_tmpdir=\$am_tmpdir\$am_subdir/ + if test ! -d \$am_tmpdir; then + mkdir \$am_tmpdir + fi + done + fi + echo timestamp > "\$am_dir"stamp-h\$am_indx + ;; + esac + am_indx=\`expr \$am_indx + 1\` +done]) +])]) # AM_CONFIG_HEADER + +# _AM_DIRNAME(PATH) +# ----------------- +# Like AS_DIRNAME, only do it during macro expansion +AC_DEFUN([_AM_DIRNAME], + [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, + m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1, + m4_if(m4_regexp([$1], [^/.*]), -1, + [.], + m4_patsubst([$1], [^\(/\).*], [\1])), + m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), + m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl +]) # _AM_DIRNAME + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 5 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# We require 2.13 because we rely on SHELL being computed by configure. +AC_PREREQ([2.13]) + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED. +# The purpose of this macro is to provide the user with a means to +# check macros which are provided without letting her know how the +# information is coded. +# If this macro is not defined by Autoconf, define it here. +ifdef([AC_PROVIDE_IFELSE], + [], + [define([AC_PROVIDE_IFELSE], + [ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE]) +# ---------------------------------------------- +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first]) +fi + +# Define the identity of the package. +PACKAGE=$1 +AC_SUBST(PACKAGE)dnl +VERSION=$2 +AC_SUBST(VERSION)dnl +ifelse([$3],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +ifdef([m4_pattern_allow], + [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl + +# Autoconf 2.50 always computes EXEEXT. However we need to be +# compatible with 2.13, for now. So we always define EXEEXT, but we +# don't compute it. +AC_SUBST(EXEEXT) +# Similar for OBJEXT -- only we only use OBJEXT if the user actually +# requests that it be used. This is a bit dumb. +: ${OBJEXT=o} +AC_SUBST(OBJEXT) + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl +AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_PROVIDE_IFELSE([AC_PROG_][CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_][CC], + defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_][CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_][CXX], + defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) + +# +# Check to make sure that the build environment is sane. +# + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + + +# serial 2 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + am_backtick='`' + AC_MSG_WARN([${am_backtick}missing' script is too old or missing]) +fi +]) + +# AM_AUX_DIR_EXPAND + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], [ +# expand $ac_aux_dir to an absolute path +am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` +]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# serial 4 -*- Autoconf -*- + + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# --------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX" or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'] + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type" +AC_SUBST([$1DEPMODE]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null +AC_SUBST(DEPDIR) +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +pushdef([subst], defn([AC_SUBST])) +subst(AMDEPBACKSLASH) +popdef([subst]) +]) + +# Generate code to set up dependency tracking. +# This macro should only be invoked once -- use via AC_REQUIRE. +# Usage: +# AM_OUTPUT_DEPENDENCY_COMMANDS + +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[ +AC_OUTPUT_COMMANDS([ +test x"$AMDEP_TRUE" != x"" || +for mf in $CONFIG_FILES; do + case "$mf" in + Makefile) dirpart=.;; + */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; + *) continue;; + esac + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`echo "$file" | sed -e 's|/[^/]*$||'` + $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +], [AMDEP_TRUE="$AMDEP_TRUE" +ac_aux_dir="$ac_aux_dir"])]) + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include='#' +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote='"' + _am_result=BSD + fi +fi +AC_SUBST(am__include) +AC_SUBST(am__quote) +AC_MSG_RESULT($_am_result) +rm -f confinc confmf +]) + +# serial 3 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +# +# FIXME: Once using 2.50, use this: +# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], + [errprint(__file__:__line__: [$0: invalid condition: $1 +])dnl +m4exit(1)])dnl +ifelse([$1], [FALSE], + [errprint(__file__:__line__: [$0: invalid condition: $1 +])dnl +m4exit(1)])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + +#serial 1 +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN([AC_ISC_POSIX], + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) + diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..cd430f6 --- /dev/null +++ b/config.guess @@ -0,0 +1,1314 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. + +timestamp='2001-08-21' + +# This file 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner . +# Please send patches to . +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; + for c in cc gcc c89 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # Netbsd (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-unknown ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE}" in + i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + sparc*:NetBSD:*) + echo `uname -p`-unknown-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + case "${HPUX_REV}" in + 11.[0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + esac ;; + esac + fi ;; + esac + if [ "${HP_ARCH}" = "" ]; then + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + eval $set_cc_for_build + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in + big) echo mips-unknown-linux-gnu && exit 0 ;; + little) echo mipsel-unknown-linux-gnu && exit 0 ;; + esac + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_supported_targets=`cd /; ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c < +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-pc-linux-gnu\n", argv[1]); +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-pc-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[KW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +eval $set_cc_for_build +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..f71889d --- /dev/null +++ b/config.h.in @@ -0,0 +1,7 @@ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Name of package */ +#undef PACKAGE + +/* Version number of package */ +#undef VERSION diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..12ebc78 --- /dev/null +++ b/config.sub @@ -0,0 +1,1410 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. + +timestamp='2001-08-13' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dsp16xx \ + | fr30 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipsel | mipsle | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | s390 | s390x \ + | sh | sh[34] | sh[34]eb | shbe | shle \ + | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 \ + | we32k \ + | x86 | xscale \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alphapca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cray2-* | cydra-* \ + | d10v-* | d30v-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | m32r-* \ + | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipsel-* \ + | mipsle-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | s390-* | s390x-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \ + | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [cjt]90) + basic_machine=${basic_machine}-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh3eb | sh4eb) + basic_machine=sh-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..03d0d97 --- /dev/null +++ b/configure @@ -0,0 +1,3530 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by Autoconf 2.52. +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +ac_unique_file="src/main.cpp" + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: should be removed in autoconf 3.0. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat < if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CC C compiler command + CFLAGS C compiler flags + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +EOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue + cd $ac_subdir + # A "../" for each directory in /$ac_subdir. + ac_dots=`echo $ac_subdir | + sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_subdir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure.gnu; then + echo + $SHELL $ac_sub_srcdir/configure.gnu --help=recursive + elif test -f $ac_sub_srcdir/configure; then + echo + $SHELL $ac_sub_srcdir/configure --help=recursive + elif test -f $ac_sub_srcdir/configure.ac || + test -f $ac_sub_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\EOF + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +EOF + exit 0 +fi +exec 5>config.log +cat >&5 </dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +PATH = $PATH + +_ASUNAME +} >&5 + +cat >&5 <\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + echo >&5 + echo "## ----------------- ##" >&5 + echo "## Cache variables. ##" >&5 + echo "## ----------------- ##" >&5 + echo >&5 + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} >&5 + sed "/^$/d" confdefs.h >conftest.log + if test -s conftest.log; then + echo >&5 + echo "## ------------ ##" >&5 + echo "## confdefs.h. ##" >&5 + echo "## ------------ ##" >&5 + echo >&5 + cat conftest.log >&5 + fi + (echo; echo) >&5 + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" >&5 + echo "$as_me: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:839: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + cat "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:850: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:858: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:874: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:878: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:884: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:886: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:888: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. It doesn't matter if + # we pass some twice (in addition to the command line arguments). + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" + ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:907: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:909: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +echo "#! $SHELL" >conftest.sh +echo "exit 0" >>conftest.sh +chmod +x conftest.sh +if { (echo "$as_me:929: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:932: \$? = $ac_status" >&5 + (exit $ac_status); }; then + ac_path_separator=';' +else + ac_path_separator=: +fi +PATH_SEPARATOR="$ac_path_separator" +rm -f conftest.sh + + ac_config_headers="$ac_config_headers config.h" + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:960: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:970: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:974: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:983: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:987: error: $ac_config_sub $ac_cv_build_alias failed." >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:992: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +echo "$as_me:999: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:1008: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1013: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:1032: checking for a BSD compatible install" >&5 +echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_IFS=$IFS; IFS=$ac_path_separator + for ac_dir in $PATH; do + IFS=$ac_save_IFS + # Account for people who put trailing slashes in PATH elements. + case $ac_dir/ in + / | ./ | .// | /cC/* \ + | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ + | /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if $as_executable_p "$ac_dir/$ac_prog"; then + if test $ac_prog = install && + grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:1081: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:1092: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:1116: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:1129: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:1135: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + am_backtick='`' + { echo "$as_me:1160: WARNING: ${am_backtick}missing' script is too old or missing" >&5 +echo "$as_me: WARNING: ${am_backtick}missing' script is too old or missing" >&2;} +fi + +for ac_prog in mawk gawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:1168: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AWK="$ac_prog" +echo "$as_me:1183: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:1191: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:1194: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:1201: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:1221: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:1225: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + +rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null + +# test to see if srcdir already configured +if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:1261: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# Define the identity of the package. +PACKAGE=hlmaster +VERSION=0.9.3 + +cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" +echo "$as_me:1335: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:1343: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:1346: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:1359: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CXX="$ac_prog" +echo "$as_me:1374: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:1382: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:1385: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + +# Provide some information about the compiler. +echo "$as_me:1397:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:1400: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:1403: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1405: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:1408: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1410: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:1413: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line 1417 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:1433: checking for C++ compiler default output" >&5 +echo $ECHO_N "checking for C++ compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:1436: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:1439: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. +for ac_file in `ls a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1462: error: C++ compiler cannot create executables" >&5 +echo "$as_me: error: C++ compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:1468: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1473: checking whether the C++ compiler works" >&5 +echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:1479: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1482: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:1489: error: cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:1497: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1504: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:1506: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:1509: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:1511: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:1514: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:1530: error: cannot compute EXEEXT: cannot compile and link" >&5 +echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:1536: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:1542: checking for object suffix" >&5 +echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1548 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:1560: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1563: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1575: error: cannot compute OBJEXT: cannot compile" >&5 +echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:1582: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:1586: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1592 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1607: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1610: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1613: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1616: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:1628: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:1634: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1640 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1652: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1655: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1658: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1661: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cxx_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:1671: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 1698 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1711: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1714: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1717: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1720: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 1730 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1742: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1745: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1748: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1751: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_config_commands="$ac_config_commands default-1" + +am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:1781: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include='#' +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote='"' + _am_result=BSD + fi +fi + +echo "$as_me:1808: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +depcc="$CXX" am_compiler_list= + +echo "$as_me:1814: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +echo "$as_me:1876: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 +CXXDEPMODE="depmode=$am_cv_CXX_dependencies_compiler_type" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:1883: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" +echo "$as_me:1898: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:1906: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:1909: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:1918: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_RANLIB="ranlib" +echo "$as_me:1933: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:1942: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:1945: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:1962: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}gcc" +echo "$as_me:1977: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1985: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1988: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:1997: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="gcc" +echo "$as_me:2012: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:2020: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:2023: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:2036: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}cc" +echo "$as_me:2051: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:2059: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:2062: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:2071: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="cc" +echo "$as_me:2086: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:2094: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:2097: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:2110: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +fi +ac_cv_prog_CC="cc" +echo "$as_me:2130: found $ac_dir/$ac_word" >&5 +break +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:2152: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:2155: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:2166: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="$ac_tool_prefix$ac_prog" +echo "$as_me:2181: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:2189: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:2192: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:2205: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="$ac_prog" +echo "$as_me:2220: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:2228: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:2231: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:2243: error: no acceptable cc found in \$PATH" >&5 +echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:2248:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:2251: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:2254: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:2256: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:2259: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:2261: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:2264: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:2267: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2273 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2288: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2291: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2294: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2297: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:2309: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:2315: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2321 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2333: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2336: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2339: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2342: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2352: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2379: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2382: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2385: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2388: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 2400 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2413: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2416: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2419: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2422: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 2432 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2444: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2447: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2450: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2453: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +echo "$as_me:2482: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:2544: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type" + + echo "$as_me:2548: checking for strerror in -lcposix" >&5 +echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6 +if test "${ac_cv_lib_cposix_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcposix $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 2556 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2575: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2578: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2581: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2584: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_cposix_strerror=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_cposix_strerror=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:2595: result: $ac_cv_lib_cposix_strerror" >&5 +echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6 +if test $ac_cv_lib_cposix_strerror = yes; then + LIBS="$LIBS -lcposix" +fi + +ac_config_files="$ac_config_files Makefile include/Makefile src/Makefile doc/Makefile doc/man/Makefile doc/html/Makefile lib/Makefile lib/pfc++/Makefile lib/pfc++/include/Makefile lib/pfc++/include/pfc++/Makefile lib/pfc++/src/Makefile" +cat >confcache <<\_ACEOF +# 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, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:2681: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +ac_cs_invocation="\$0 \$@" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +exec 6>&1 + +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\EOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:2857: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:2876: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +exec 5>>config.log +cat >&5 << _ACEOF + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by $as_me 2.52, executed with + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + > $ac_cs_invocation +on `(hostname || uname -n) 2>/dev/null | sed 1q` + +_ACEOF +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "doc/man/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/man/Makefile" ;; + "doc/html/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/html/Makefile" ;; + "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "lib/pfc++/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/pfc++/Makefile" ;; + "lib/pfc++/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/pfc++/include/Makefile" ;; + "lib/pfc++/include/pfc++/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/pfc++/include/pfc++/Makefile" ;; + "lib/pfc++/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/pfc++/src/Makefile" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:2934: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +EOF + +cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@DEFS@,$DEFS,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@CXXDEPMODE@,$CXXDEPMODE,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +CEOF + +EOF + + cat >>$CONFIG_STATUS <<\EOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +EOF +cat >>$CONFIG_STATUS <<\EOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` + else + ac_dir_suffix= ac_dots= + fi + + case $srcdir in + .) ac_srcdir=. + if test -z "$ac_dots"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_dots$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_dots$srcdir ;; + esac + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_dots$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:3173: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + configure_input="Generated automatically from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:3191: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:3204: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:3265: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:3276: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:3289: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +EOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\EOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +EOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\EOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +EOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # egrep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\EOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated automatically by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:3406: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + fi + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi + # Run the commands associated with the file. + case $ac_file in + config.h ) # update the timestamp +echo timestamp >"./stamp-h1" + ;; + esac +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + + case $ac_dest in + default-1 ) +test x"$AMDEP_TRUE" != x"" || +for mf in $CONFIG_FILES; do + case "$mf" in + Makefile) dirpart=.;; + */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; + *) continue;; + esac + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`echo "$file" | sed -e 's|/[^/]*$||'` + $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +EOF + +cat >>$CONFIG_STATUS <<\EOF + +{ (exit 0); exit 0; } +EOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..29a96b5 --- /dev/null +++ b/configure.in @@ -0,0 +1,39 @@ +# Configure template for hlmaster +# Copyright (C) 2001 Silvan Minghetti + +# 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, 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. + +AC_INIT(src/main.cpp) +AM_CONFIG_HEADER(config.h) +AC_CANONICAL_HOST +AM_INIT_AUTOMAKE(hlmaster, 0.9.3) + +AC_PROG_CXX +AC_PROG_RANLIB +AC_ISC_POSIX + + +AC_OUTPUT(Makefile \ + include/Makefile \ + src/Makefile \ + doc/Makefile \ + doc/man/Makefile \ + doc/html/Makefile \ + lib/Makefile \ + lib/pfc++/Makefile \ + lib/pfc++/include/Makefile \ + lib/pfc++/include/pfc++/Makefile \ + lib/pfc++/src/Makefile) diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..6589965 --- /dev/null +++ b/depcomp @@ -0,0 +1,411 @@ +#! /bin/sh + +# depcomp - compile a program generating dependencies as side-effects +# Copyright 1999, 2000 Free Software Foundation, Inc. + +# 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, 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi +# `libtool' can also be set to `yes' or `no'. + +depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. This file always lives in the current directory. + # Also, the AIX compiler puts `$object:' at the start of each line; + # $object doesn't have directory information. + stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + outname="$stripped.o" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 AIX compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + + tmpdepfile1="$object.d" + tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` + if test "$libtool" = yes; then + "$@" -Wc,-MD + else + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a space and a tab in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + test -z "$dashmflag" && dashmflag=-M + ( IFS=" " + case " $* " in + *" --mode=compile "*) # this is libtool, let us make it quiet + for arg + do # cycle over the arguments + case "$arg" in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + # X makedepend + ( + shift + cleared=no + for arg in "$@"; do + case $cleared in no) + set ""; shift + cleared=yes + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift;; + -*) + ;; + *) + set fnord "$@" "$arg"; shift;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tail +3 "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..410317f --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,21 @@ +## Makefile for hlmaster +## Copyright (C) 2001 Silvan Minghetti +## +## 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, 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. +## +## Process this file with automake to produce Makefile.in + +SUBDIRS = man html diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 0000000..414f8ab --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,309 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +SUBDIRS = man html +subdir = doc +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = Makefile.am Makefile.in +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-recursive distclean distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive tags tags-recursive uninstall \ + uninstall-am uninstall-info-am uninstall-info-recursive \ + uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/doc/html/Makefile.am b/doc/html/Makefile.am new file mode 100644 index 0000000..ec5ab1c --- /dev/null +++ b/doc/html/Makefile.am @@ -0,0 +1,26 @@ +## Makefile for hlmaster +## Copyright (C) 2001 Silvan Minghetti +## +## 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, 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. +## +## Process this file with automake to produce Makefile.in + +EXTRA_DIST= make_html.bat \ + man2html.sed \ + hlmaster.html \ + hlmaster.list.html \ + hlmaster.filter.html \ + hlmaster.gameserver.html diff --git a/doc/html/Makefile.in b/doc/html/Makefile.in new file mode 100644 index 0000000..fca7faa --- /dev/null +++ b/doc/html/Makefile.in @@ -0,0 +1,198 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +EXTRA_DIST = make_html.bat \ + man2html.sed \ + hlmaster.html \ + hlmaster.list.html \ + hlmaster.filter.html \ + hlmaster.gameserver.html + +subdir = doc/html +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/html/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: +tags: TAGS +TAGS: + + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/doc/html/hlmaster.filter.html b/doc/html/hlmaster.filter.html new file mode 100644 index 0000000..1db616c --- /dev/null +++ b/doc/html/hlmaster.filter.html @@ -0,0 +1,122 @@ + + + + + +
+
+hlmaster.filter(1)         User Manual         hlmaster.filter(1)
+
+
+
+NAME
+       hlmaster.filter - How to allow/block specific gameservers.
+
+
+DESCRIPTION
+       This document describes, how the config-file has  to  look
+       like,  for  loading into hlmaster with the --server-filter
+       argument.
+
+       These filter rules allow you, to allow/deny specific game-
+       servers and as well complete networks.
+       You  can  however  not  ban a gameserver upon his port. At
+       least one ip-address is filtered.
+
+       Please note, that server filtering  has  not  been  tested
+       through and through yet.
+
+
+COMMANDS
+       Commands are case-sensitive, so enshure you write them all
+       in lowercase and only one command per line.
+
+       The following commands are used to  configure  some  basic
+       settings:
+
+       default allow | deny
+              This  sets the default behaviour, what to do, if no
+              specific filter rule could be found.
+              If you  ommit  this  default  rule,  deny  will  be
+              applied.
+
+       order allow | deny
+              This  determines,  if  a deny rule takes precedence
+              over an allow rule and vice versa.
+
+
+       Now, the commands used to deny/allow hosts/networks:
+
+            allow ip-address [ netmask ]
+            deny  ip-address [ netmask ]
+
+
+       This will allow or  deny  the  host  given  by  ip-address
+       (hostnames  are  not  allowed).   If  no netmask is given,
+       255.255.255.255 is assumed - wich  leads  to  filtering  a
+       single host. And this is normally exactly what you want.
+       I'm  not  going to describe netmasks any further, you will
+       never need them anyway...
+
+       Comments are also allowed and initiated with the  familiar
+       '#'  sign.  They may begin everywhere in a line and remain
+       active until the end of line.
+
+       Look at the SIGNALS section in the hlmaster(1) manpage for
+       instructions  on  reloading the filters, while hlmaster is
+       running.
+
+
+EXAMPLES
+       An example filter.list is  provided  within  the  examples
+       directory  of  the  source distribution. However, here's a
+       short example:
+
+            # example hlmaster filter list
+
+            order deny
+            default allow
+
+            # aaa swiss counterstrike
+            allow     194.209.69.205
+
+            # some sux0rz
+            deny 123.123.123.123
+            deny 194.216.124.21
+
+            # localhost network
+            deny 127.0.0.0 255.0.0.0
+
+
+
+REPORTING BUGS
+       Report bugs to <bullet@users.sourceforge.net>.
+
+
+AUTHOR
+       Silvan Minghetti <bullet@users.sourceforge.net>.
+
+
+COPYRIGHT
+       Copyright (c) 2001 Silvan Minghetti
+       This is free software; see the source for  copying  condi-
+       tions.  There is NO warranty; not even for MERCHANTABILITY
+       or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+LEGAL NOTES
+       Half-Life is a trademark of valve software.
+
+
+SEE ALSO
+       hlmaster(1), hlmaster.list(1), hlmaster.gameserver(1)
+
+       Check  http://hlmaster.sourceforge.net for newest version.
+
+
+
+HLMaster                   22 June 2001        hlmaster.filter(1)
+
+ + + diff --git a/doc/html/hlmaster.gameserver.html b/doc/html/hlmaster.gameserver.html new file mode 100644 index 0000000..4092378 --- /dev/null +++ b/doc/html/hlmaster.gameserver.html @@ -0,0 +1,91 @@ + + + + + +
+
+hlmaster.gameserver(1)     User Manual     hlmaster.gameserver(1)
+
+
+
+NAME
+       hlmaster.gameserver  - How to configure your gameserver to
+       send heartbeats to hlmaster.
+
+
+DESCRIPTION
+       If  you  want   to   get   your   gameserver   dynamically
+       added/removed  from your master-server, you'll have to add
+       an entry into the file woncomm.lst.  This file is  located
+       within  the gameservers mod directory (eg. valve, cstrike,
+       tfc...).
+       There might be no woncomm.lst in  a  mods  directory,  but
+       that  doesnt  really  matter.  You can either copy the one
+       found in the valve directory, or just leave it  there  and
+       edit  it.  If Half-Life does not find a woncomm.lst in the
+       mod's directory, it defaults to using the one found in the
+       valve directory.
+
+       After  editing  your woncomm.lst, it's required to restart
+       your gameserver for the changes to take effect. To verify,
+       your  gameserver is really sending heartbeats to your mas-
+       ter, you can go to the Half-Life console and  enter  'set-
+       master' - respectivly 'rcon setmaster'.
+       You  should  now  get  a lists of the currently configured
+       master-servers. You can also add  a  master-server,  while
+       half-life  is  running.  This is performed with 'setmaster
+       add ip port' - where ip is your master server's ip-address
+       (eg.  194.209.69.205)  and  port is it's port-number (nor-
+       mally 27010).
+
+       NOTE: Configuration changes made with the  setmaster  com-
+       mand  only  remain  active  till next gameserver shutdown.
+       Therefore, you'll have to edit your woncomm.lst anyway.
+
+
+EXAMPLES
+       An example woncomm.lst is  provided  within  the  examples
+       directory  of  the  source distribution. However, here's a
+       short example of the master section:
+
+            Master
+            {
+                 your.server.com:27010
+                 half-life.east.won.net:27010
+                 half-life.west.won.net:27010
+                 half-life.central.won.net:27010
+            }
+
+
+REPORTING BUGS
+       Report bugs to <bullet@users.sourceforge.net>.
+
+
+AUTHOR
+       Silvan Minghetti <bullet@users.sourceforge.net>.
+
+
+COPYRIGHT
+       Copyright (c) 2001 Silvan Minghetti
+       This is free software; see the source for  copying  condi-
+       tions.  There is NO warranty; not even for MERCHANTABILITY
+       or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+LEGAL NOTES
+       Half-Life is a trademark of valve software.
+
+
+SEE ALSO
+       hlmaster(1), hlmaster.list(1), hlmaster.filter(1)
+
+       Check  http://hlmaster.sourceforge.net for newest version.
+
+
+
+HLMaster                   22 June 2001    hlmaster.gameserver(1)
+
+ + + diff --git a/doc/html/hlmaster.html b/doc/html/hlmaster.html new file mode 100644 index 0000000..47cbfd1 --- /dev/null +++ b/doc/html/hlmaster.html @@ -0,0 +1,153 @@ + + + + + +
+
+hlmaster(1)                User Manual                hlmaster(1)
+
+
+
+NAME
+       hlmaster  -  A  Half-Life  master  server  daemon (made in
+       switzerland)
+
+
+SYNOPSIS
+       hlmaster [ options ]
+
+
+DESCRIPTION
+       hlmaster is a  standalone,  automatic  master  server  for
+       Half-Life.  It  accepts  heartbeats  from  gameservers and
+       keeps an actual list of gameservers.
+
+       To get a gameserver listet by  hlmaster,  you'll  have  to
+       configure  it  accordingly. See hlmaster.gameserver(1) for
+       more information.
+
+       Additionally, you might want to load  a  list  of  servers
+       from  a file.  This is not the normal operation for a real
+       master-server, but it's a nice feature for your own little
+       master. See hlmaster.list(1) for more information.
+
+
+OPTIONS
+       -V, --version
+              Display version of hlmaster and exit.
+
+       -h, --help
+              Print a help screen.
+
+       -n number, --log-level=number
+              Set  log  level  of  the info-log as numeric value.
+              (0=none, 1=critical,  2=error,  3=warning,  4=info,
+              5=debug). The default level is 4 (info).
+
+       -d, --no-daemon
+              If activated, hlmaster does not go to background at
+              startup. This  is  usefull  for  debugging  and  is
+              turned off by default.
+
+       -u user, --user=user
+              Run hlmaster as user.
+
+       -g group, --group=group
+              Run hlmaster as group.
+
+       -a address, --ip-address=address
+              Set  the  network  interface  address to listen on.
+              You'll have to supply a numeric  ip-address,  host-
+              names are not resolved. The default is to listen on
+              all interfaces (0.0.0.0).
+
+       -p port, --port=port
+              Set the port to listen on. The  default  is  27010,
+              which  is also the official port for Half-Life mas-
+              ter servers.
+
+       -s name, --master-name=name
+              Set the name, the  master  server  will  report  to
+              clients.  Though I do not really know, if this fea-
+              ture is used by any client.
+
+       -m number, --max-servers=number
+              Set the maximum number  of  gameservers,  that  are
+              allowed to fit in the list. The default is 200, the
+              absolute maximum 60000.
+              fetch more than 230 servers (they use an old proto-
+              col).
+
+       -l file, --server-list=file
+              Load  a  list of gameservers (max. 3000) from file.
+              See hlmaster.list(1) for further information.
+
+       -c, --closed
+              If activated, the master does not accept any heart-
+              beats.  You  will  have  to specify a list of game-
+              servers to be loaded, otherwise hlmaster would have
+              nothing to do.
+
+       -P file, --pid-file=file
+              Write  process  id  (PID) to file.  Remember to use
+              absolute paths, if you  start  hlmaster  as  daemon
+              process.
+
+       -I file, --info-log=file
+              Log informations to file.  Remember to use absolute
+              paths, if you start hlmaster as daemon process.
+
+       -A file, --access-log=file
+              Log access information to  file.  Remember  to  use
+              absolute  paths,  if  you  start hlmaster as daemon
+              process.
+
+
+SIGNALS
+       SIGTERM
+              Abort hlmaster immediatly.
+
+       SIGHUP Reload configuration and logfiles.
+
+       SIGUSR1
+              Reload configuration files only. Please note,  that
+              the  configuration  files  are not reloaded immedi-
+              atly, but allways before the next request.
+
+       SIGUSR2
+              Reload logfiles only.
+
+
+REPORTING BUGS
+       Report bugs to <bullet@users.sourceforge.net>.
+
+
+AUTHOR
+       Silvan Minghetti <bullet@users.sourceforge.net>.
+
+
+COPYRIGHT
+       Copyright (c) 2001 Silvan Minghetti
+       This is free software; see the source for  copying  condi-
+       tions.  There is NO warranty; not even for MERCHANTABILITY
+       or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+LEGAL NOTES
+       Half-Life is a trademark of valve software.
+
+
+SEE ALSO
+       hlmaster.list(1),    hlmaster.filter(1),    hlmaster.game-
+       server(1)
+
+       Check  http://hlmaster.sourceforge.net for newest version.
+
+
+
+HLMaster                 22 December 2001             hlmaster(1)
+
+ + + diff --git a/doc/html/hlmaster.list.html b/doc/html/hlmaster.list.html new file mode 100644 index 0000000..5537182 --- /dev/null +++ b/doc/html/hlmaster.list.html @@ -0,0 +1,120 @@ + + + + + +
+
+hlmaster.list(1)           User Manual           hlmaster.list(1)
+
+
+
+NAME
+       hlmaster.list  - How to load your own list of gameservers.
+
+
+DESCRIPTION
+       This document describes, how the config-file has  to  look
+       like,  for  loading  into  hlmaster with the --server-list
+       argument.
+       You might also want to start hlmaster  with  the  --closed
+       argument. See hlmaster(1) for more information.
+
+       Create  an  empty  text-file and insert one gameserver per
+       line with the following syntax:
+
+            type ip-address port
+
+       Please note that you cannot pass  a  hostname,  you  abso-
+       lutely have to give hlmaster an ip-address.
+       The port however is not required (27015 is presumed then).
+       The ip-address and the port have to be separated by a  ':'
+       or  by at least one space/tab character. Servers loaded by
+       --server-list are limited to 3000. The overall limit  with
+       dynamically added servers is 60000.
+
+       The type definition has to be passed in front of the host,
+       but you may optionally ommit it completly (check is  taken
+       by default).
+
+       Available types:
+
+       check  The  gameservers  loaded from your list do not send
+              heartbeats. To prevent your list of containing dead
+              servers,  this options turns on pinging the servers
+              every five minutes. This is also the default, if no
+              type was specified.
+              Note:   hlmaster   automagically  converts  servers
+              marked as check to  'dynamic'  upon  receipt  of  a
+              heartbeat/challenge  and  thereby  removes  them if
+              they stop sending beats.
+
+       nocheck
+              Servers marked with nocheck will  never  time  out!
+              They  will  remain  in  the  list, even if they are
+              dead. This option actually should not be used.
+              Note: hlmaster does  not  convert  nocheck  servers
+              upon receipt of a heartbeat.
+
+
+       Note: Case is not ignored! Enshure you write the type def-
+       inition in lowercase.
+
+       Comments are also allowed and initiated with the  familiar
+       '#'  sign.  They may begin everywhere in a line and remain
+       active until the end of line.
+
+       Look at the SIGNALS section in the hlmaster(1) manpage for
+       instructions  on  reloading the filters, while hlmaster is
+       running.
+
+
+EXAMPLES
+       An example server.list is  provided  within  the  examples
+       directory  of  the  source distribution. However, here's a
+       short example:
+
+            # example hlmaster gameserver list
+
+            # aaa swiss counterstrike
+            check     194.209.69.205:27015
+
+            # l33t s3rv3r, n3v3r d0wn
+            nocheck   194.209.69.205:27020
+
+            # some other servers
+            123.123.123.123     27015
+            234.234.234.234     27015
+
+
+REPORTING BUGS
+       Report bugs to <bullet@users.sourceforge.net>.
+
+
+AUTHOR
+       Silvan Minghetti <bullet@users.sourceforge.net>.
+
+
+COPYRIGHT
+       Copyright (c) 2001 Silvan Minghetti
+       This is free software; see the source for  copying  condi-
+       tions.  There is NO warranty; not even for MERCHANTABILITY
+       or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+LEGAL NOTES
+       Half-Life is a trademark of valve software.
+
+
+SEE ALSO
+       hlmaster(1), hlmaster.filter(1), hlmaster.gameserver(1)
+
+       Check  http://hlmaster.sourceforge.net for newest version.
+
+
+
+HLMaster                   22 June 2001          hlmaster.list(1)
+
+ + + diff --git a/doc/html/make_html.bat b/doc/html/make_html.bat new file mode 100755 index 0000000..fa9452a --- /dev/null +++ b/doc/html/make_html.bat @@ -0,0 +1,26 @@ +@echo off + +echo Create html ::................................................... +echo ----------------------------------------------------------------- +echo o hlmaster.1 +groff -Tascii -man ..\man\hlmaster.1 | sed -f man2html.sed > hlmaster.html + +echo o hlmaster.gameserver.1 +groff -Tascii -man ..\man\hlmaster.gameserver.1 | sed -f man2html.sed > hlmaster.gameserver.html + +echo o hlmaster.list.1 +groff -Tascii -man ..\man\hlmaster.list.1 | sed -f man2html.sed > hlmaster.list.html + +echo o hlmaster.filter.1 +groff -Tascii -man ..\man\hlmaster.filter.1 | sed -f man2html.sed > hlmaster.filter.html + + +echo. +echo. +echo Checking html files for bad links (they are marked red) ::....... +echo ----------------------------------------------------------------- +grep -l "color=red" -F *.html + +echo. +echo. +pause diff --git a/doc/html/man2html.sed b/doc/html/man2html.sed new file mode 100644 index 0000000..0b29341 --- /dev/null +++ b/doc/html/man2html.sed @@ -0,0 +1,37 @@ +1i\ +\ +\ +\ +\ +\ +
\
+
+
+s/\([<>&]\)\1/\1/g
+s/&/\&/g
+s//\>/g
+s;_\(.\);\1;g
+s;.\(.\);\1;g
+s;;;g
+s;;;g
+s/	/    /g
+
+# create email links
+s;\([a-zA-z0-9\.\_]*\@[a-zA-z0-9\.\_]*\);\1;g
+
+# create man links
+/[a-zA-Z0-9\-\_\.\+]*<\/b>([0-9])/{
+s/\([a-zA-Z0-9\-\_\.\+]*\)<\/b>/\1<\/a><\/b>/g
+}
+
+# check for 'broken' links and mark them red (newline)
+/[a-zA-Z0-9\-\_\.\+]*\-<\/b>$/{
+s/\([a-zA-Z0-9\-\_\.\+]*\-<\/b>\)/\1<\/font>/g
+}
+
+
+$a\
+
\ +\ +\ diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am new file mode 100644 index 0000000..fc133c3 --- /dev/null +++ b/doc/man/Makefile.am @@ -0,0 +1,27 @@ +## Makefile for hlmaster +## Copyright (C) 2001 Silvan Minghetti +## +## 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, 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. +## +## Process this file with automake to produce Makefile.in + +man_MANS = hlmaster.1 \ + hlmaster.gameserver.1 \ + hlmaster.list.1 \ + hlmaster.filter.1 + + +EXTRA_DIST = $(man_MANS) diff --git a/doc/man/Makefile.in b/doc/man/Makefile.in new file mode 100644 index 0000000..e89f6f1 --- /dev/null +++ b/doc/man/Makefile.in @@ -0,0 +1,244 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +man_MANS = hlmaster.1 \ + hlmaster.gameserver.1 \ + hlmaster.list.1 \ + hlmaster.filter.1 + + +EXTRA_DIST = $(man_MANS) +subdir = doc/man +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +NROFF = nroff +MANS = $(man_MANS) +DIST_COMMON = Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/man/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: + +man1dir = $(mandir)/man1 +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done +tags: TAGS +TAGS: + + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(MANS) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-exec-am: + +install-info: install-info-am + +install-man: install-man1 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am uninstall-man + +uninstall-man: uninstall-man1 + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-man1 install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic uninstall uninstall-am \ + uninstall-info-am uninstall-man uninstall-man1 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/doc/man/hlmaster.1 b/doc/man/hlmaster.1 new file mode 100644 index 0000000..b8e7c11 --- /dev/null +++ b/doc/man/hlmaster.1 @@ -0,0 +1,172 @@ +.\" Copyright (C) 2001 Silvan Minghetti +.\" +.\" 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. +.\" +.\" +.\" Process this file with "groff -man -Tascii" +.\" +.TH "hlmaster" "1" "22 December 2001" "HLMaster" "User Manual" +.SH NAME +.BR "hlmaster" " \- A Half-Life master server daemon (made in switzerland)" + +.SH SYNOPSIS +.B hlmaster [ +.I options +.B ] + +.SH DESCRIPTION +.B hlmaster +is a standalone, automatic master server for Half-Life. It accepts +heartbeats from gameservers and keeps an actual list of gameservers. +.br + +To get a gameserver listet by hlmaster, you'll have to configure it +accordingly. See +.BR "hlmaster.gameserver" "(1)" +for more information. + +Additionally, you might want to load a list of servers from a file. +This is not the normal operation for a real master-server, but it's +a nice feature for your own little master. See +.BR "hlmaster.list" "(1)" +for more information. + +.SH OPTIONS +.TP +.B "-V, --version" +Display version of +.B hlmaster +and exit. +.TP +.B "-h, --help" +Print a help screen. +.TP +.BI "-n " "number" ", --log-level=" "number" +Set log level of the info-log as numeric value. (0=none, 1=critical, +2=error, 3=warning, 4=info, 5=debug). The default level is 4 (info). +.TP +.B "-d, --no-daemon" +If activated, +.B hlmaster +does not go to background at startup. This is usefull for +debugging and is turned off by default. +.TP +.BI "-u " "user" ", --user=" "user" +.RB "Run " "hlmaster" +.RI "as " "user" "." +.TP +.BI "-g " "group" ", --group=" "group" +.RB "Run " "hlmaster" +.RI "as " "group" "." +.TP +.BI "-a " "address" ", --ip-address=" "address" +Set the network interface +.I address +to listen on. You'll have to supply a numeric ip-address, +hostnames are not resolved. The default is to listen +on all interfaces (0.0.0.0). +.TP +.BI "-p " "port" ", --port=" "port" +Set the +.I port +to listen on. The default is 27010, which is also the +official port for Half-Life master servers. +.TP +.BI "-s " "name" ", --master-name=" "name" +Set the +.IR "name" "," +the master server will report to clients. Though +I do not really know, if this feature is used by any client. +.TP +.BI "-m " "number" ", --max-servers=" "number" +Set the maximum +.I number +of gameservers, that are allowed to fit in the list. The +default is 200, the absolute maximum 60000. +.br Please note: Current gamespy versions are not able to +fetch more than 230 servers (they use an old protocol). +.TP +.BI "-l " "file" ", --server-list=" "file" +Load a list of gameservers (max. 3000) from +.I file. +See +.BR "hlmaster.list" "(1)" +for further information. +.TP +.B "-c, --closed" +If activated, the master does not accept any heartbeats. You will +have to specify a list of gameservers to be loaded, otherwise +.B hlmaster +would have nothing to do. +.TP +.BI "-P " "file" ", --pid-file=" "file" +Write process id (PID) to +.IR "file" "." +Remember to use absolute paths, if you start +.B hlmaster +as daemon process. +.TP +.BI "-I " "file" ", --info-log=" "file" +Log informations to +.I file. +Remember to use absolute paths, if you start +.B hlmaster +as daemon process. +.TP +.BI "-A " "file" ", --access-log=" "file" +Log access information to file. Remember to use absolute paths, +if you start +.B hlmaster +as daemon process. + +.SH SIGNALS +.TP +.B SIGTERM +Abort +.B hlmaster +immediatly. +.TP +.B SIGHUP +Reload configuration and logfiles. +.TP +.B SIGUSR1 +Reload configuration files only. Please note, that the configuration files are +not reloaded immediatly, but allways before the next request. +.TP +.B SIGUSR2 +Reload logfiles only. + +.SH "REPORTING BUGS" +Report bugs to . + +.SH AUTHOR +Silvan Minghetti . + +.SH COPYRIGHT +Copyright (c) 2001 Silvan Minghetti +.br +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +.SH "LEGAL NOTES" +Half-Life is a trademark of valve software. + +.SH "SEE ALSO" +.BR "hlmaster.list" "(1)," +.BR "hlmaster.filter" "(1)," +.BR "hlmaster.gameserver" "(1)" + +Check http://hlmaster.sourceforge.net for newest version. diff --git a/doc/man/hlmaster.filter.1 b/doc/man/hlmaster.filter.1 new file mode 100644 index 0000000..ed6d35c --- /dev/null +++ b/doc/man/hlmaster.filter.1 @@ -0,0 +1,125 @@ +.\" Copyright (C) 2001 Silvan Minghetti +.\" +.\" 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. +.\" +.\" +.\" Process this file with "groff -man -Tascii" +.\" +.TH "hlmaster.filter" "1" "22 June 2001" "HLMaster" "User Manual" +.SH NAME +.BR "hlmaster.filter" " \- How to allow/block specific gameservers." + +.SH DESCRIPTION +This document describes, how the config-file has to look like, for loading +into +.BR "hlmaster" " with the " "--server-filter" " argument." + +These filter rules allow you, to allow/deny specific gameservers and as well +complete networks. +.br +You can however not ban a gameserver upon his port. At least one ip-address +is filtered. + +Please note, that server filtering has not been tested through and through yet. + +.SH COMMANDS +Commands are case-sensitive, so enshure you write them all in lowercase and only +one command per line. + +The following commands are used to configure some basic settings: +.TP +.BI "default " "allow" " | " "deny" +This sets the default behaviour, what to do, if no specific filter rule could +be found. +.br +If you ommit this default rule, +.I deny +will be applied. +.TP +.BI "order " "allow" " | " "deny" +This determines, if a deny rule takes precedence over an allow rule and +vice versa. +.PP + +Now, the commands used to deny/allow hosts/networks: + +.BI " allow " "ip-address" " [ " "netmask" " ]" +.br +.BI " deny " "ip-address" " [ " "netmask" " ]" +.PP + +This will allow or deny the host given by +.IR "ip-address" " (hostnames are not allowed)." +If no +.I netmask +is given, 255.255.255.255 is assumed - wich leads to filtering a single +host. And this is normally exactly what you want. +.br +I'm not going to describe netmasks any further, you will never need them +anyway... + +Comments are also allowed and initiated with the familiar '#' sign. They +may begin everywhere in a line and remain active until the end of line. + +Look at the SIGNALS section in the +.BR "hlmaster" "(1)" +manpage for instructions on reloading the filters, while hlmaster is running. + +.SH EXAMPLES +An example +.I filter.list +is provided within the examples directory of the source distribution. However, here's +a short example: + +.nf + # example hlmaster filter list + + order deny + default allow + + # aaa swiss counterstrike + allow 194.209.69.205 + + # some sux0rz + deny 123.123.123.123 + deny 194.216.124.21 + + # localhost network + deny 127.0.0.0 255.0.0.0 + +.fi + +.SH "REPORTING BUGS" +Report bugs to . + +.SH AUTHOR +Silvan Minghetti . + +.SH COPYRIGHT +Copyright (c) 2001 Silvan Minghetti +.br +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +.SH "LEGAL NOTES" +Half-Life is a trademark of valve software. + +.SH "SEE ALSO" +.BR "hlmaster" "(1)," +.BR "hlmaster.list" "(1)," +.BR "hlmaster.gameserver" "(1)" + +Check http://hlmaster.sourceforge.net for newest version. diff --git a/doc/man/hlmaster.gameserver.1 b/doc/man/hlmaster.gameserver.1 new file mode 100644 index 0000000..01b6f26 --- /dev/null +++ b/doc/man/hlmaster.gameserver.1 @@ -0,0 +1,96 @@ +.\" Copyright (C) 2001 Silvan Minghetti +.\" +.\" 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. +.\" +.\" +.\" Process this file with "groff -man -Tascii" +.\" +.TH "hlmaster.gameserver" "1" "22 June 2001" "HLMaster" "User Manual" +.SH NAME +.BR "hlmaster.gameserver" " \- How to configure your gameserver to send heartbeats to hlmaster." + +.SH DESCRIPTION +If you want to get your gameserver dynamically added/removed from +your master-server, you'll have to add an entry into the file +.IR "woncomm.lst" "." +This file is located within the gameservers mod directory (eg. valve, cstrike, tfc...). +.br +There might be no +.I woncomm.lst +in a mods directory, but that doesnt really matter. You can either copy the one found in +the valve directory, or just leave it there and edit it. If Half-Life does not find a +.I "woncomm.lst" +in the mod's directory, it defaults to using the one found in the valve directory. + +After editing your +.IR "woncomm.lst" "," +it's required to restart your gameserver for the changes to take effect. To verify, +your gameserver is really sending heartbeats to your master, you can go to the +Half-Life console and enter +.IR "'setmaster'" " - respectivly " "'rcon setmaster'" "." +.br +You should now get a lists of the currently configured master-servers. You can also +add a master-server, while half-life is running. This is performed with +.IB "'setmaster add " "ip port'" +- where +.B ip +is your master server's ip-address (eg. 194.209.69.205) and +.B port +is it's port-number (normally 27010). + +NOTE: Configuration changes made with the setmaster +command only remain active till next gameserver shutdown. Therefore, you'll +have to edit your +.I woncomm.lst +anyway. + +.SH EXAMPLES +An example +.I woncomm.lst +is provided within the examples directory of the source distribution. However, here's +a short example of the master section: + +.nf + Master + { +.B your.server.com:27010 + half-life.east.won.net:27010 + half-life.west.won.net:27010 + half-life.central.won.net:27010 + } +.fi + +.SH "REPORTING BUGS" +Report bugs to . + +.SH AUTHOR +Silvan Minghetti . + +.SH COPYRIGHT +Copyright (c) 2001 Silvan Minghetti +.br +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +.SH "LEGAL NOTES" +Half-Life is a trademark of valve software. + +.SH "SEE ALSO" +.BR "hlmaster" "(1)," +.BR "hlmaster.list" "(1)," +.BR "hlmaster.filter" "(1)" + +Check http://hlmaster.sourceforge.net for newest version. diff --git a/doc/man/hlmaster.list.1 b/doc/man/hlmaster.list.1 new file mode 100644 index 0000000..8c16091 --- /dev/null +++ b/doc/man/hlmaster.list.1 @@ -0,0 +1,131 @@ +.\" Copyright (C) 2001 Silvan Minghetti +.\" +.\" 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. +.\" +.\" +.\" Process this file with "groff -man -Tascii" +.\" +.TH "hlmaster.list" "1" "22 June 2001" "HLMaster" "User Manual" +.SH NAME +.BR "hlmaster.list" " \- How to load your own list of gameservers." + +.SH DESCRIPTION +This document describes, how the config-file has to look like, for loading +into +.BR "hlmaster" " with the " "--server-list" " argument." +.br +You might also want to start +.BR "hlmaster" " with the " "--closed" " argument. See " "hlmaster" "(1)" +for more information. + +Create an empty text-file and insert one gameserver per line +with the following syntax: + +.I type ip-address port + +Please note that you cannot pass a hostname, you absolutely have to give +.B hlmaster +an +.IR "ip-address" "." +.br +The +.I port +however is not required (27015 is presumed then). +The +.IR "ip-address" " and the " "port" +have to be separated by a ':' or by at least one space/tab character. Servers +loaded by --server-list are limited to 3000. The overall limit with dynamically +added servers is 60000. +.br + +The +.I type +definition has to be passed in front of the host, but you +may optionally ommit it completly (check is taken by default). + +.B Available types: +.TP +.B "check" +The gameservers loaded from your list do not send heartbeats. To prevent your +list of containing dead servers, this options turns on pinging the servers +every five minutes. This is also the default, if no type was specified. +.br +Note: +.B hlmaster +automagically converts servers marked as +.B check +to 'dynamic' upon receipt of a heartbeat/challenge and thereby removes them if they stop sending beats. +.TP +.B nocheck +Servers marked with +.B nocheck +will never time out! They will remain in the list, even if +they are dead. This option actually should not be used. +.br +Note: +.BR "hlmaster" " does not convert " "nocheck" " servers upon receipt of a heartbeat." +.PP + +Note: Case is not ignored! Enshure you write the type definition in lowercase. + +Comments are also allowed and initiated with the familiar '#' sign. They +may begin everywhere in a line and remain active until the end of line. + +Look at the SIGNALS section in the +.BR "hlmaster" "(1)" +manpage for instructions on reloading the filters, while hlmaster is running. + +.SH EXAMPLES +An example +.I server.list +is provided within the examples directory of the source distribution. However, here's +a short example: + +.nf + # example hlmaster gameserver list + + # aaa swiss counterstrike + check 194.209.69.205:27015 + + # l33t s3rv3r, n3v3r d0wn + nocheck 194.209.69.205:27020 + + # some other servers + 123.123.123.123 27015 + 234.234.234.234 27015 +.fi + +.SH "REPORTING BUGS" +Report bugs to . + +.SH AUTHOR +Silvan Minghetti . + +.SH COPYRIGHT +Copyright (c) 2001 Silvan Minghetti +.br +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +.SH "LEGAL NOTES" +Half-Life is a trademark of valve software. + +.SH "SEE ALSO" +.BR "hlmaster" "(1)," +.BR "hlmaster.filter" "(1)," +.BR "hlmaster.gameserver" "(1)" + +Check http://hlmaster.sourceforge.net for newest version. diff --git a/examples/filter.list b/examples/filter.list new file mode 100644 index 0000000..90afc4b --- /dev/null +++ b/examples/filter.list @@ -0,0 +1,41 @@ +# example hlmaster filter list +# +# order: +# order allow +# order deny +# +# default: +# default allow +# default deny +# +# allow: +# allow 124.134.123.124/255.255.255.255 +# +# deny: +# deny 124.134.123.124/255.255.255.255 +# +# +# ATTENTION: +# - hlmaster is case sensitive +# - hostnames are not allowed (only ip's) +# + +# deny rules are stronger then allow rules +order deny + +# allow all unspecified servers by default +default allow + + + +# allow some server +allow 194.209.69.205/255.255.255.255 # aaa swiss counterstrike + + +# deny some server +deny 123.123.123.123/255.255.255.255 # s0me sux0r +deny 145.242.21.147 # no mask defaults to 255.255.255.255 + + +# deny a whole network +deny 127.0.0.0/255.0.0.0 diff --git a/examples/server.list b/examples/server.list new file mode 100644 index 0000000..9bdab94 --- /dev/null +++ b/examples/server.list @@ -0,0 +1,19 @@ +# example hlmaster gameserver list +# +# syntax: [check/nocheck] ip:port +# +# ATTENTION: +# - case is sensitive for keywords +# - hostnames are not allowed (only ip's) +# + +# aaa swiss counterstrike +check 194.209.69.205:27015 + +nocheck 194.209.69.205:27020 # l33t s3rv3r, n3v3r d0wn + +# some other servers +# note, if you do not specify check/nocheck, it will +# default to 'check' +123.123.123.123:27015 +143.235.112.145:27020 diff --git a/examples/woncomm.lst b/examples/woncomm.lst new file mode 100644 index 0000000..7e5bb22 --- /dev/null +++ b/examples/woncomm.lst @@ -0,0 +1,32 @@ +// Server Lists +// +Titan +{ + half-life.east.won.net:6003 + half-life.west.won.net:6003 + half-life.central.won.net:6003 +} + +Auth +{ + half-life.east.won.net:7002 + half-life.west.won.net:7002 + half-life.central.won.net:7002 +} + +Master +{ +// your own master-server + your.server.com:27010 + + half-life.east.won.net:27010 + half-life.west.won.net:27010 + half-life.central.won.net:27010 +} + +ModServer +{ + half-life.east.won.net:27011 + half-life.west.won.net:27011 + half-life.central.won.net:27011 +} diff --git a/include/HLInfoList.h b/include/HLInfoList.h new file mode 100644 index 0000000..eba6713 --- /dev/null +++ b/include/HLInfoList.h @@ -0,0 +1,135 @@ +/* + +--------------------------------------------------------------------+ + | ..........................:: HLMaster ::.......................... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | 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. | + | | + +--------------------------------------------------------------------+ + | Created.......: Friday, 2. November 2001 | + | Author........: Silvan Minghetti | + | Description...: Half-Life master-server deamon. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _HLINFOLIST_H_ +#define _HLINFOLIST_H_ + + +// Classes defined in this document +// --------------------------------- +// +class HLInfoList; +class HLInfoListItem; + + + +// Header includes +// --------------------------------- +// +#include "HLServerList.h" + + +// Class definition +// --------------------------------- +// +class HLInfoList +{ +public: + + HLInfoList(); + ~HLInfoList(); + + int RemoveAllItems(); + int RemoveAllUnusedItems(); + + int GetNumItems() const { return m_nItems; } + + HLInfoListItem* AddItem(const char *pszInfo); + HLInfoListItem* GetItem(const char *pszInfo); + + +private: + + int m_nItems; + + HLInfoListItem *m_pFirstItem; + HLInfoListItem *m_pLastItem; +}; + + + + +class HLInfoListItem +{ +public: + + HLInfoListItem(const char *pszInfo); + + int GetUsage() const { return m_nReferenceCounter; } + void IncrementUsage() { m_nReferenceCounter++; } + void DecrementUsage() + { + if(m_nReferenceCounter == 0) + return; + + m_nReferenceCounter--; + + if(m_nReferenceCounter == 0) + m_pListIndex = NULL; + } + + + bool Equals(const char *pszInfo) + { + if(pszInfo == NULL) + return false; + + // compare strings (case sensitive) + char *pszString1 = m_szInfoString; + char *pszString2 = (char*) pszInfo; + + while((*(pszString1) == *(pszString2)) && (*(pszString1) != '\0')) + { + pszString1++; + pszString2++; + } + + if(*(pszString1) == '\0' && *(pszString2) == '\0') + return true; + + return false; + } + +private: + + friend class HLInfoList; + friend class HLServerList; + + char m_szInfoString[33]; + int m_nReferenceCounter; + + HLServerListItem *m_pListIndex; // index to the first listitem with this info + + HLInfoListItem *m_pNextItem; +}; + + + + +#endif // #ifndef _HLINFOLIST_H_ diff --git a/include/HLMaster.h b/include/HLMaster.h new file mode 100644 index 0000000..cf1568e --- /dev/null +++ b/include/HLMaster.h @@ -0,0 +1,204 @@ +/* + +--------------------------------------------------------------------+ + | ..........................:: HLMaster ::.......................... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | 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. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Half-Life master-server deamon. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _HLMASTER_H_ +#define _HLMASTER_H_ + + + +// Classes defined in this document +// --------------------------------- +// +class HLMaster; + + + +// Header includes +// --------------------------------- +// +#include "PUDPSocket.h" +#include "HLServerList.h" +#include "HLServerFilterList.h" +#include "PLogfile.h" +#include "PString.h" +#include "CStringBuffer.h" + + +#include + + +// Class definition +// --------------------------------- +// +class HLMaster +{ +public: + + HLMaster(const char *pszIpAddress, unsigned short nPort, int nMaxHosts, PLogfile *pInfoLog, PLogfile *pAccessLog); + ~HLMaster(); + + + void SetServerId(int nId) { m_nServerId = nId; } + int GetServerId() { return m_nServerId; } + + void SetServerName(const char *pszName); + int GetServerName(char *pszBuffer, int nBufferSize); + + bool WaitForInput(); + bool ReadInput(); + void ProcessInput() + { + time_t nTimeout = time(NULL); + ProcessInput(nTimeout); + } + void ProcessInput(time_t nTimestamp); + + + inline time_t GetIntervalRemaining(time_t nTimestamp); + inline time_t GetRequestIntervalRemaining(time_t nTimestamp); + + void SendDetailsRequest(HLServerListItem *pItem); + + void EnableHostFilter(); + void DisableHostFilter(); + bool LoadHostFilter(const char *pszFilename); + bool ReloadHostFilter(); + HLServerFilterList* GetHostFilter() const { return m_pHostFilter; } + + bool LoadHosts(const char *pszFilename); + bool ReloadHosts(); + + + const PFC_FD GetSocketDescriptor() const { return m_pServerSocket->GetDescriptor(); } + const int GetNumHosts() const { return m_pServerList->GetNumItems(); } + + + static const time_t c_CHECK_TIMEOUT; + static const time_t c_CHECK_INTERVAL; + static const time_t c_REQUEST_INTERVAL; + + +protected: + + inline void ProcessHeartbeat(); + inline void ProcessChallenge(); + inline void ProcessLogoff(); + + inline void ProcessDetailsReply(); + + inline void ProcessAuthServerListRequest(); + inline void ProcessListRequest(); + inline void ProcessEnhancedListRequest(); + inline void ProcessPingRequest(); + inline void ProcessNameRequest(); + + inline void ProcessInvalidQuery(); + + bool ParseChallengeString(const char *pszChallenge, const int nChallengeSize); + bool ParseDetailsString(const char *pszDetails, const int nDetailsSize); + +private: + + int m_nServerId; + char m_szServerName[65]; + + PLogfile *m_pInfoLog; + PLogfile *m_pAccessLog; + + PUDPSocket *m_pServerSocket; + HLServerList *m_pServerList; + HLServerFilterList *m_pHostFilter; + + PString *m_pHostFilterFile; + PString *m_pHostListFile; + + + time_t m_nCurrentTimestamp; + time_t m_nLastInterval; + time_t m_nLastRequest; + + bool m_bRequestQueueFinished; + + pfc_inet_addr m_nForeignAddress; + pfc_inet_port m_nForeignPort; + + + // send & receive buffer + int m_nBufferLength; + char m_szBuffer[2048]; + + + // temporary buffer for the server-infos + char m_szChallenge_VarName[33]; + char m_szChallenge_VarValue[33]; + + int m_nChallenge_Id; + char m_nChallenge_Protocol; + char m_nChallenge_Players; + char m_nChallenge_MaxPlayers; + char m_nChallenge_OsType; + bool m_bChallenge_Dedicated; + bool m_bChallenge_Password; + bool m_bChallenge_Lan; + + char m_szChallenge_GameDir[33]; + char m_szChallenge_MapName[33]; + + // m_nChallenge_Os values + static const char c_OSTYPE_UNKNOWN; + static const char c_OSTYPE_WINDOWS; + static const char c_OSTYPE_LINUX; + + // predefined packages + static const char m_pPackage_Challenge[]; + static const int m_nPkgSize_Challenge; + + static const char m_pPackage_Ping[]; + static const int m_nPkgSize_Ping; + + static const char m_pPackage_Servername[]; + static const int m_nPkgSize_Servername; + + static const char m_pPackage_List_Type1[]; + static const int m_nPkgSize_List_Type1; + + static const char m_pPackage_List_Type2[]; + static const int m_nPkgSize_List_Type2; + + static const char m_pPackage_List_Auth[]; + static const int m_nPkgSize_List_Auth; + + static const char m_pPackage_Req_Details[]; + static const int m_nPkgSize_Req_Details; +}; + + + + +#endif // #ifndef _HLMASTER_H_ diff --git a/include/HLServerFilterList.h b/include/HLServerFilterList.h new file mode 100644 index 0000000..aae0858 --- /dev/null +++ b/include/HLServerFilterList.h @@ -0,0 +1,130 @@ +/* + +--------------------------------------------------------------------+ + | ..........................:: HLMaster ::.......................... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | 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. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Half-Life master-server deamon. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _HLSERVERFILTERLIST_H_ +#define _HLSERVERFILTERLIST_H_ + + +#ifndef NULL +#define NULL 0 +#endif + + + +// Classes defined in this document +// --------------------------------- +// +class HLServerFilterList; +class HLServerFilterList_Item; + + + +// Header includes +// --------------------------------- +// +#include "PLogfile.h" + + +// Class definition +// --------------------------------- +// +class HLServerFilterList +{ +public: + + HLServerFilterList(); + ~HLServerFilterList(); + + bool AddDefaultHost(bool bAllow); + bool AddHost(bool bAllow, pfc_inet_addr nIpAddress); + bool AddHost(bool bAllow, const char *pszIpAddress); + bool AddHost(bool bAllow, const char *pszIpAddress, const char *pszNetMask); + bool AddHost(bool bAllow, pfc_inet_addr nIpAddress, pfc_inet_addr nNetMask); + + bool Exists(bool bAllow, pfc_inet_addr nIpAddress, pfc_inet_addr nNetMask); + bool IsAllowed(pfc_inet_addr nIpAddress); + bool IsAllowed(const char *pszIpAddress); + + void SetOrderAllow() { m_bOrderAllow = true; } + void SetOrderDeny() { m_bOrderAllow = false; } + bool IsOrderAllow() { return m_bOrderAllow; } + + void SetDefaultAllow(){ m_bDefaultAllow = true; } + void SetDefaultDeny() { m_bDefaultAllow = false; } + bool IsDefaultAllow() { return m_bDefaultAllow; } + + bool RemoveDefaultHost(bool bAllow); + bool RemoveHost(bool bAllow, pfc_inet_addr nIpAddress); + bool RemoveHost(bool bAllow, pfc_inet_addr nIpAddress, pfc_inet_addr nNetMask); + bool RemoveHost(bool bAllow, const char *pszIpAddress); + bool RemoveHost(bool bAllow, const char *pszIpAddress, const char *pszNetMask); + + int RemoveAll(); + + int Load(const char *pszFilename, PLogfile *pLogfile = NULL); + + +private: + + int m_nItems; + + HLServerFilterList_Item* m_pFirstItem; + HLServerFilterList_Item* m_pLastItem; + + bool m_bOrderAllow; + bool m_bDefaultAllow; +}; + + + + +class HLServerFilterList_Item +{ +public: + + HLServerFilterList_Item(bool bAllow, pfc_inet_addr nIpAddress, pfc_inet_addr nNetMask); + + +private: + + friend class HLServerFilterList; + + bool m_bAllow; + pfc_inet_addr m_nIpAddress; + pfc_inet_addr m_nMaskedIpAddress; + pfc_inet_addr m_nNetMask; + + + HLServerFilterList_Item* m_pNextItem; +}; + + + + +#endif // #ifndef _HLSERVERFILTERLIST_H_ diff --git a/include/HLServerList.h b/include/HLServerList.h new file mode 100644 index 0000000..4f9d95f --- /dev/null +++ b/include/HLServerList.h @@ -0,0 +1,191 @@ +/* + +--------------------------------------------------------------------+ + | ..........................:: HLMaster ::.......................... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | 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. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Half-Life master-server deamon. | + +--------------------------------------------------------------------+ +*/ + +#include "HLMaster.h" + + + +#ifndef _HLSERVERLIST_H_ +#define _HLSERVERLIST_H_ + + + +// Classes defined in this document +// --------------------------------- +// +class HLServerList; +class HLServerListItem; + + + +// Header includes +// --------------------------------- +// +#include "HLServerFilterList.h" +#include "HLInfoList.h" +#include "PLogfile.h" +#include "CStringBuffer.h" + +#include + + + +// Class definition +// --------------------------------- +// +class HLServerList +{ +public: + + HLServerList(int nMaxItems, PLogfile *pInfoLog); + ~HLServerList(); + + HLServerListItem* AddItem(pfc_inet_addr nIpAddress, pfc_inet_port nPort); + bool RemoveItem(pfc_inet_addr nIpAddress, pfc_inet_port nPort); + int RemoveAllItems(); + int RemoveAllStaticItems(); + int RemoveAllDynamicItems(); + + HLServerListItem* Find(pfc_inet_addr nIpAddress, pfc_inet_port nPort); + + int FillPacket_Quakeworld(char *pBuffer, int nBufferSize); + int FillPacket_Halflife(int nSkip, char *pBuffer, int nBufferSize, unsigned short *pnSkipped = NULL, bool *pbHasMore = NULL); + + + int GetNumItems() const { return m_nItems; } + HLServerListItem* GetFirstItem() const { return m_pFirstItem; } + HLServerListItem* GetLastItem() const { return m_pLastItem; } + + int LoadHosts(const char *pszFilename); + + int CheckTimeout(time_t nTimestamp, HLMaster *pMaster); + bool RequestStatus(time_t nTimestamp, HLMaster *pMaster); + int GetRandomChallenge(int nSeed, int nSeed2); + + HLServerListItem* HeartBeat(pfc_inet_addr nIpAddress, pfc_inet_port nPort, time_t nTimestamp); + HLServerListItem* Challenge(pfc_inet_addr nIpAddress, pfc_inet_port nPort, time_t nTimestamp, const int nChallengeId, const char nProtocol, const char nPlayers, const char nMaxPlayers, const char nOsType, const bool bDedicated, const bool bPassword, const bool bLan, const char *pszGameDir, const char *pszMapName); + HLServerListItem* UpdateDetails(pfc_inet_addr nIpAddress, pfc_inet_port nPort, time_t nTimestamp, const char nProtocol, const char nPlayers, const char nMaxPlayers, const char nOsType, const bool bDedicated, const bool bPassword, const bool bLan, const char *pszGameDir, const char *pszMapName); + bool Logoff(pfc_inet_addr nIpAddress, pfc_inet_port nPort); + + +#ifdef _DEBUG + int LogSnapshot(); +#endif // _DEBUG + +private: + + void SetGameDir(HLServerListItem *pItem, const char *pszGameDir); + void SetMapName(HLServerListItem *pItem, const char *pszMapName); + + void RemoveItem(HLServerListItem *pItem); + void ResortItem(HLServerListItem *pItem); + + + int m_nMaxItems; + int m_nItems; + int m_nSkipRequests; + + int m_nChallengeSeed; + + PLogfile *m_pInfoLog; + + + HLInfoList *m_pGameList; + HLInfoList *m_pMapList; + + HLServerListItem *m_pHeadDummyItem; + HLServerListItem *m_pTailDummyItem; + + HLServerListItem *m_pFirstItem; + HLServerListItem *m_pLastItem; + + HLServerListItem *m_pUnknownIndex; + HLServerListItem *m_pRequestIndex; +}; + + + + +class HLServerListItem +{ +public: + + HLServerListItem(pfc_inet_addr nIpAddress, pfc_inet_port nPort); + ~HLServerListItem(); + +// int GetGameDir(char *pBuffer, const int nBufferSize); +// int GetMapName(char *pBuffer, const int nBufferSize); + + + void SetType(char nType) + { + if(nType >= c_TYPE_DYNAMIC && nType <= c_TYPE_STATIC_NOCHECK) + m_nType = nType; + } + + char GetType() const { return m_nType; } + + + static const char c_TYPE_DYNAMIC; + static const char c_TYPE_STATIC_CHECK; + static const char c_TYPE_STATIC_NOCHECK; + + +private: + + friend class HLServerList; + friend class HLMaster; + + char m_nType; // dynamic, static or static_nocheck + unsigned int m_nBadChecks; + + pfc_inet_addr m_nIpAddress; + pfc_inet_port m_nPort; + time_t m_nLastHeartbeat; + + // server infos + int m_nChallengeId; + char m_nProtocol; + char m_nPlayers; + char m_nMaxPlayers; + char m_nOsType; + bool m_bDedicated; + bool m_bPassword; + bool m_bLan; + + HLInfoListItem *m_pGame; + HLInfoListItem *m_pMap; + + + HLServerListItem *m_pNextItem; + HLServerListItem *m_pPreviousItem; +}; + + + +#endif // #ifndef _HLSERVERLIST_H_ diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..57b2d45 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,24 @@ +## Makefile for hlmaster +## Copyright (C) 2001 Silvan Minghetti +## +## 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, 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. +## +## Process this file with automake to produce Makefile.in + +noinst_HEADERS = HLMaster.h \ + HLServerList.h \ + HLServerFilterList.h \ + HLInfoList.h diff --git a/include/Makefile.in b/include/Makefile.in new file mode 100644 index 0000000..2de546f --- /dev/null +++ b/include/Makefile.in @@ -0,0 +1,228 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +noinst_HEADERS = HLMaster.h \ + HLServerList.h \ + HLServerFilterList.h \ + HLInfoList.h + +subdir = include +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +HEADERS = $(noinst_HEADERS) + +DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +.PHONY: GTAGS all all-am check check-am clean clean-generic distclean \ + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic tags uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..e9de238 --- /dev/null +++ b/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000..2780dec --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1,21 @@ +## Makefile for hlmaster +## Copyright (C) 2001 Silvan Minghetti +## +## 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, 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. +## +## Process this file with automake to produce Makefile.in + +SUBDIRS = pfc++ diff --git a/lib/Makefile.in b/lib/Makefile.in new file mode 100644 index 0000000..e544832 --- /dev/null +++ b/lib/Makefile.in @@ -0,0 +1,309 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +SUBDIRS = pfc++ +subdir = lib +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = Makefile.am Makefile.in +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-recursive distclean distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive tags tags-recursive uninstall \ + uninstall-am uninstall-info-am uninstall-info-recursive \ + uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/pfc++/AUTHORS b/lib/pfc++/AUTHORS new file mode 100644 index 0000000..c4705a2 --- /dev/null +++ b/lib/pfc++/AUTHORS @@ -0,0 +1 @@ +Silvan Minghetti (bullet) diff --git a/lib/pfc++/COPYING b/lib/pfc++/COPYING new file mode 100644 index 0000000..cbee875 --- /dev/null +++ b/lib/pfc++/COPYING @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, 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 library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete 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 distribute a copy of this License along with the +Library. + + 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 Library or any portion +of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +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 Library, 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 Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you 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. + + If distribution of 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 satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be 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. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library 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. + + 9. 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 Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +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 with +this License. + + 11. 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 Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library 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 Library. + +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. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library 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. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser 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 Library +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 Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +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 + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "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 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. 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 LIBRARY 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 +LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. 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) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/lib/pfc++/ChangeLog b/lib/pfc++/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/lib/pfc++/INSTALL b/lib/pfc++/INSTALL new file mode 100644 index 0000000..b7c9896 --- /dev/null +++ b/lib/pfc++/INSTALL @@ -0,0 +1,177 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes a while. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/lib/pfc++/Makefile.am b/lib/pfc++/Makefile.am new file mode 100644 index 0000000..58f8dc9 --- /dev/null +++ b/lib/pfc++/Makefile.am @@ -0,0 +1,23 @@ +## Makefile for pfc library +## Copyright (C) 2001 Silvan Minghetti +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library 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 +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the +## Free Software Foundation, Inc., 59 Temple Place - Suite 330, +## Boston, MA 02111-1307, USA. +## +## Process this file with automake to produce Makefile.in + +SUBDIRS = include src + +EXTRA_DIST = pfc++.dsw pfc++.dsp NOTES diff --git a/lib/pfc++/Makefile.in b/lib/pfc++/Makefile.in new file mode 100644 index 0000000..a13c603 --- /dev/null +++ b/lib/pfc++/Makefile.in @@ -0,0 +1,312 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +SUBDIRS = include src + +EXTRA_DIST = pfc++.dsw pfc++.dsp NOTES +subdir = lib/pfc++ +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ + Makefile.in NEWS TODO configure.in +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/pfc++/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-recursive distclean distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive tags tags-recursive uninstall \ + uninstall-am uninstall-info-am uninstall-info-recursive \ + uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/pfc++/NEWS b/lib/pfc++/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/lib/pfc++/NOTES b/lib/pfc++/NOTES new file mode 100644 index 0000000..76389b7 --- /dev/null +++ b/lib/pfc++/NOTES @@ -0,0 +1,3 @@ + + * This library is not yet ment for production use. Only functions + needed by hlmaster are implemented. diff --git a/lib/pfc++/README b/lib/pfc++/README new file mode 100644 index 0000000..e69de29 diff --git a/lib/pfc++/TODO b/lib/pfc++/TODO new file mode 100644 index 0000000..e69de29 diff --git a/lib/pfc++/configure.in b/lib/pfc++/configure.in new file mode 100644 index 0000000..b5eb06f --- /dev/null +++ b/lib/pfc++/configure.in @@ -0,0 +1,29 @@ +# Configure template for pfc library +# Copyright (C) 2001 Silvan Minghetti + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# This library 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 +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +AC_INIT(src/PString.cpp) +AM_CONFIG_HEADER(config.h) +AC_CANONICAL_HOST +AM_INIT_AUTOMAKE(libpfc, 0.1.0) + +AC_PROG_CXX +AC_PROG_RANLIB +AC_ISC_POSIX + + +AC_OUTPUT(Makefile src/Makefile include/Makefile include/pfc++/Makefile) diff --git a/lib/pfc++/include/CInetAddress.h b/lib/pfc++/include/CInetAddress.h new file mode 100644 index 0000000..37beaeb --- /dev/null +++ b/lib/pfc++/include/CInetAddress.h @@ -0,0 +1,74 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 27. June 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PFC_CINETADDRESS_H_ +#define _PFC_CINETADDRESS_H_ + + +// Header includes +// ====================================================================== +#include "PSocket.h" +#include "PString.h" + + +// start namespace pfc +// ====================================================================== + +namespace pfc +{ + class CInetAddress + { + public: + + CInetAddress(); + CInetAddress(pfc_inet_addr nIpAddress); + CInetAddress(const char *pszIpAddress); + ~CInetAddress(); + + bool IsValid(); + + void SetAddress(const char *pszString); + void SetAddress(pfc_inet_addr nIpAddress); + +// pfc_inet_addr GetAddress() { return m_nIpAddress; } + int GetAddress(char *pszBuffer, int nBufferSize); + + + // TODO: a lot. this class is far away from usefull... + + private: + + pfc_inet_addr m_nIpAddress; + }; + +// ====================================================================== +// end namespace pfc +} + +#endif // #ifndef _PFC_CINETADDRESS_H_ diff --git a/lib/pfc++/include/CStringBuffer.h b/lib/pfc++/include/CStringBuffer.h new file mode 100644 index 0000000..61c9e4d --- /dev/null +++ b/lib/pfc++/include/CStringBuffer.h @@ -0,0 +1,92 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 27. June 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PFC_CSTRINGBUFFER_H_ +#define _PFC_CSTRINGBUFFER_H_ + + +// Header includes +// ====================================================================== +#include "PString.h" +#include "CInetAddress.h" + +// start namespace pfc +// ====================================================================== + +namespace pfc +{ + + class CStringBuffer + { + public: + + CStringBuffer(int nBufferSize); + ~CStringBuffer(); + + bool Append(char cValue); + bool Append(int nValue); + // DUMMY: bool Append(float fValue); + // DUMMY: bool Append(double dValue); + // DUMMY: bool Append(bool bValue); + bool Append(CInetAddress *pInetAddr); + bool Append(const char *pszValue); + // DUMMY: bool Append(const char *pszValue, int nLength); + + // DUMMY: bool Insert(int nValue, bool bOverwrite = true); + // DUMMY: bool Insert(const char *pszValue, bool bOverwrite = true); + // DUMMY: bool Insert(const char *pszValue, int nLength, bool bOverwrite = true); + + + // DUMMY: int CharAt(int nIndex) const; + // DUMMY: bool SetCharAt(int nIndex, char nChar); + + void Clear() { SetLength(0); } + int SetLength(int nLength); + int GetLength() const { return m_nLength; } + int GetBufferSize() const { return m_nBufferSize; } + + const char* GetCharPointer() const { return m_pszBuffer; } + const char* GetValueBuffer() const { return m_pszBuffer; } + + + private: + + int m_nLength; // the number of bytes currently in use + int m_nFree; // the number of bytes currently available + int m_nBufferSize; // the total size of the buffer + + char *m_pszBuffer; // the buffer + char *m_pEnd; // points to terminating '\0' of buffer + }; + +// ====================================================================== +// end namespace pfc +} + +#endif // #ifndef _PFC_CSTRINGBUFFER_H_ diff --git a/lib/pfc++/include/Makefile.am b/lib/pfc++/include/Makefile.am new file mode 100644 index 0000000..da0aa05 --- /dev/null +++ b/lib/pfc++/include/Makefile.am @@ -0,0 +1,32 @@ +## Makefile for pfc library +## Copyright (C) 2001 Silvan Minghetti +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library 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 +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the +## Free Software Foundation, Inc., 59 Temple Place - Suite 330, +## Boston, MA 02111-1307, USA. +## +## Process this file with automake to produce Makefile.in + +SUBDIRS = pfc++ + +noinst_HEADERS = CStringBuffer.h \ + CInetAddress.h \ + PArgumentList.h \ + PException.h \ + PFile.h \ + PLogfile.h \ + PSocket.h \ + PString.h \ + PStringList.h \ + PUDPSocket.h diff --git a/lib/pfc++/include/Makefile.in b/lib/pfc++/include/Makefile.in new file mode 100644 index 0000000..6e43a9b --- /dev/null +++ b/lib/pfc++/include/Makefile.in @@ -0,0 +1,323 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +SUBDIRS = pfc++ + +noinst_HEADERS = CStringBuffer.h \ + CInetAddress.h \ + PArgumentList.h \ + PException.h \ + PFile.h \ + PLogfile.h \ + PSocket.h \ + PString.h \ + PStringList.h \ + PUDPSocket.h + +subdir = lib/pfc++/include +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +HEADERS = $(noinst_HEADERS) + + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/pfc++/include/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-recursive distclean distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive tags tags-recursive uninstall \ + uninstall-am uninstall-info-am uninstall-info-recursive \ + uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/pfc++/include/PArgumentList.h b/lib/pfc++/include/PArgumentList.h new file mode 100644 index 0000000..a1c9031 --- /dev/null +++ b/lib/pfc++/include/PArgumentList.h @@ -0,0 +1,266 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PARGUMENTLIST_H_ +#define _PARGUMENTLIST_H_ + + + +// Classes defined in this document +// --------------------------------- +// +class PArgumentList; +class PArgumentListItem; + + + +// Header includes +// --------------------------------- +// +#include "PStringList.h" + +#include +#include + +#ifndef NULL +#define NULL 0 +#endif + + +// Class definition +// --------------------------------- +// +class PArgumentList +{ +public: + + PArgumentList(); + PArgumentList(bool bIgnoreCase); + ~PArgumentList(); + + void SetIgnoreCase(bool bIgnore = true); + bool GetIgnoreCase(); + + /** + format: "-a:--name:-b=:-b=default value" + options are separated by ":" + + o "-a" -> short option, no value + o "--name" -> long option, no value + o a '=' marks -> this option requires a value. text after the '=' is treated as the default value (if no value found) + + short options maximum length is 1 character! short options may be combined + on the command-line (eg. "program -abcf file.txt"). + */ + // TODO: implement function + void AddOptions(const char *pszOptionString); + + void AddOption(const char cShortOption, bool bRequireValue = false, const char *pszDefaultValue = NULL); + void AddOption(const char *pszLongOption, bool bRequireValue = false, const char *pszDefaultValue = NULL); + void AddOption(const char cShortOption, const char *pszLongOption, bool bRequireValue = false, const char *pszDefaultValue = NULL); + + // TODO: implement function + bool RemoveOption(const char cShortOption, bool bRemoveLong = true); + // TODO: implement function + bool RemoveOption(const char *pszLongOption, bool bRemoveShort = true); + int RemoveAllOptions(); + + int ParseArguments(const char *pszArguments[], int nArguments); + // TODO: implement function + void ParseArgument(const char *pszArgument); + + + // enable & disable options manually + bool Enable(const char cShortOption, bool bEnable = true); + bool Enable(const char *pszLongOption, bool bEnable = true); + + bool Disable(const char cShortOption) { return Enable(cShortOption, false); } + bool Disable(const char *pszLongOption) { return Enable(pszLongOption, false); } + + // ask status + bool IsEnabled(const char cShortOption); + bool IsEnabled(const char *pszLongOption); + + // ask value + bool HasValue(const char cShortOption); + bool HasValue(const char *pszLongOption); + const char* GetValue(const char cShortOption, bool bReturnDefault = true); + const char* GetValue(const char *pszLongOption, bool bReturnDefault = true); + + const char* GetDefaultValue(const char cShortOption); + const char* GetDefaultValue(const char *pszLongOption); + + + int GetNumArguments(); + // TODO: implement function + int GetNumGoodArguments(); + int GetNumUnknownArguments() { return m_pUnknownArgumentsList->GetNumItems(); } + int GetNumUnknownValues() { return m_pUnknownValuesList->GetNumItems(); } + + PStringList* GetUnknownArgumentsList() { return m_pUnknownArgumentsList; } + PStringList* GetUnknownValuesList() { return m_pUnknownValuesList; } + + + // TODO: test + bool PickCurrentFirst(); + bool PickCurrentLast(); + bool PickCurrentNext(); + bool PickCurrentPrevious(); + + bool IsCurrentEqual(const char cShortOption); + bool IsCurrentEqual(const char *pszLongOption); + + const char GetCurrentShortOption(); + const char* GetCurrentLongOption(); + + bool EnableCurrent(bool bEnable = true); + bool DisableCurrent() { return EnableCurrent(false); } + + bool IsCurrentValid(); + bool IsCurrentEnabled(); + bool HasCurrentValue(); + + const char* GetCurrentValue(bool bReturnDefault = true); + const char* GetCurrentDefaultValue(); + // end to test + + +private: + + PArgumentListItem* GetItem(const char cShortOption); + PArgumentListItem* GetItem(const char *pszLongOption); + PArgumentListItem* GetItem(const char cShortOption, const char *pszLongOption); + + + bool m_bIgnoreCase; + + PStringList *m_pUnknownArgumentsList; + PStringList *m_pUnknownValuesList; + + PArgumentListItem *m_pFirstItem; + PArgumentListItem *m_pLastItem; + + PArgumentListItem *m_pCurrentItem; + + int m_nItems; +}; + + + + +class PArgumentListItem +{ +public: + + PArgumentListItem(const char cShortOption, const char *pszLongOption, bool bRequireValue, const char *pszDefaultValue); + ~PArgumentListItem(); + + void SetName(const char cShortOption) { m_cShortName = cShortOption; }; + void SetName(const char *pszLongOption); + + void SetValue(const char *pszValue); + void SetDefaultValue(const char *pszDefaultValue); + + void Enable(bool bEnable = true) { m_bIsEnabled = bEnable; } + void Disable() { m_bIsEnabled = false; } + + bool Equals(const char cShortOption, bool bIgnoreCase = false) + { + if(m_cShortName == 0 || cShortOption == 0) + return false; + + + // TODO: improve performance + if(bIgnoreCase == true) + { + if(toupper(m_cShortName) == toupper(cShortOption)) + return true; + else + return false; + } + else + { + if(m_cShortName == cShortOption) + return true; + else + return false; + } + } + + bool Equals(const char *pszLongOption, bool bIgnoreCase = false) + { + if(m_pszLongName == NULL || pszLongOption == NULL) + return false; + + int nCount; + + // TODO: improve performance + if(bIgnoreCase == true) + { + for(nCount = 0; pszLongOption[nCount] != '\0' && m_pszLongName[nCount] != '\0'; nCount++) + { + if(tolower(pszLongOption[nCount] != tolower(m_pszLongName[nCount]))) + return false; + } + + if(pszLongOption[nCount] == '\0' && m_pszLongName[nCount] == '\0') + return true; + else + return false; + } + else + { + if(strcmp(m_pszLongName, pszLongOption) == 0) + return true; + else + return false; + } + } + +private: + + friend class PArgumentList; + + char m_cShortName; + char *m_pszLongName; + + static const char *m_pszVoidValue; + char *m_pszValue; + char *m_pszDefaultValue; + + bool m_bRequireValue; + bool m_bIsEnabled; + + + PArgumentListItem *m_pNext; + PArgumentListItem *m_pPrevious; +}; + + +#endif // #ifndef _PARGUMENTLIST_H_ diff --git a/lib/pfc++/include/PException.h b/lib/pfc++/include/PException.h new file mode 100644 index 0000000..29ad858 --- /dev/null +++ b/lib/pfc++/include/PException.h @@ -0,0 +1,120 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PEXCEPTION_H_ +#define _PEXCEPTION_H_ + + + +// Classes defined in this document +// --------------------------------- +// +class PException; + + + +// Header includes +// --------------------------------- +// + + + +// Class definition +// --------------------------------- +// +class PException +{ +public: + + PException() + { + m_nErrorValue = 0; + m_szDescription[0] = '\0'; + } + + PException(int nErrorValue) + { + m_nErrorValue = nErrorValue; + m_szDescription[0] = '\0'; + } + + PException(const char *pszDescription) + { + m_nErrorValue = 0; + SetDescription(pszDescription); + } + + PException(int nErrorValue, const char *pszDescription) + { + m_nErrorValue = nErrorValue; + SetDescription(pszDescription); + } + + + + const char* GetDescription() + { + return m_szDescription; + } + + const int GetValue() + { + return m_nErrorValue; + } + + const int IsEqual(const int nErrorValue) + { + if(nErrorValue == m_nErrorValue) + return true; + else + return false; + } + + +protected: + + void SetDescription(const char *pszDescription) + { + int nCount; + int nBufferSize = sizeof(m_szDescription) - 1; + + // copy string, check for buffer overflow + for(nCount = 0; nCount < nBufferSize && *(pszDescription) != '\0'; nCount++, pszDescription++) + m_szDescription[nCount] = *(pszDescription); + + m_szDescription[nCount] = '\0'; + } + + int m_nErrorValue; + char m_szDescription[64]; +}; + + + +#endif // #ifndef _PEXCEPTION_H_ diff --git a/lib/pfc++/include/PFile.h b/lib/pfc++/include/PFile.h new file mode 100644 index 0000000..11e1974 --- /dev/null +++ b/lib/pfc++/include/PFile.h @@ -0,0 +1,74 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Wednesday, 16. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PFILE_H_ +#define _PFILE_H_ + + + +// Classes defined in this document +// --------------------------------- +// +class PFile; + + + +// Header includes +// --------------------------------- +// +#include "PException.h" + + + +// Class definition +// --------------------------------- +// + +class PFileException: public PException +{ +public: + + PFileException(int nErrorValue) + :PException(nErrorValue) + { + } + + PFileException(int nErrorValue, const char *pszDescription) + :PException(nErrorValue, pszDescription) + { + } + + PFileException() + :PException() + { + } +}; + + +#endif // #ifndef _PFILE_H_ diff --git a/lib/pfc++/include/PLogfile.h b/lib/pfc++/include/PLogfile.h new file mode 100644 index 0000000..3c66614 --- /dev/null +++ b/lib/pfc++/include/PLogfile.h @@ -0,0 +1,121 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Wednesday, 16. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PLOGFILE_H_ +#define _PLOGFILE_H_ + + + +// Classes defined in this document +// --------------------------------- +// +class PLogfile; + + + +// Header includes +// --------------------------------- +// +#include + +#include "PFile.h" +#include "CStringBuffer.h" +#include "CInetAddress.h" + +#include +#include + + + + +// Class definition +// --------------------------------- +// +class PLogfile +{ +public: + + PLogfile(const char *pszFilename, int nLevel); + ~PLogfile(); + + bool Open(); + bool ReOpen(); + void Close(); + + const char* GetFilename() { return m_pFileName->GetValue(); } + + void SetLogLevel(int nLevel); + int GetLogLevel() { return m_nLevel; }; + + bool CheckLevel(int nLevel) + { + if(nLevel > 0 && nLevel <= m_nLevel) + return true; + else + return false; + } + + bool Begin(int nLevel); + void Cancel(); + void End() { Flush(); } + void Flush(); + + bool Append(const char *pszMessage); + bool Append(const char cValue); + bool Append(int nValue); + bool Append(pfc::CInetAddress *pInetAddr); + bool WriteLine(const char *pszLine, int nLevel); + + + static const int c_LEVEL_NONE; // = 0; + static const int c_LEVEL_CRITICAL; // = 1; + static const int c_LEVEL_ERROR; // = 2; + static const int c_LEVEL_WARNING; // = 3; + static const int c_LEVEL_INFO; // = 4; + static const int c_LEVEL_DEBUG; // = 5; + + + +private: + + bool m_bStarted; + + int m_nLevel; + bool m_bIsOpen; + FILE *m_pFile; + + char m_szDateBuffer[20]; + + pfc::CStringBuffer *m_pLineBuffer; + PString *m_pFileName; +}; + + + +#endif // #ifndef _PLOGFILE_H_ diff --git a/lib/pfc++/include/PSocket.h b/lib/pfc++/include/PSocket.h new file mode 100644 index 0000000..830f056 --- /dev/null +++ b/lib/pfc++/include/PSocket.h @@ -0,0 +1,162 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PSOCKET_H_ +#define _PSOCKET_H_ + + + +// Classes defined in this document +// --------------------------------- +// +class PSocket; +class PSocketException; + + + +// Header includes +// --------------------------------- +// +#include "PException.h" + +#include + + + + + +// Class definition +// --------------------------------- +// +class PSocket +{ +public: + + PSocket(int nAddressFamily, int nType); + PSocket(PFC_SOCKET nExistingSocket); + virtual ~PSocket(); + + // TODO: ? virtual bool Listen(...) = 0; + // TODO: ? virtual bool accept(...) = 0; + virtual bool Bind(const char *pszIpAddress, pfc_inet_port nPort) = 0; + virtual bool Bind(pfc_inet_addr nIpAddress, pfc_inet_port nPort) = 0; + virtual bool Connect(pfc_inet_addr nIpAddress, pfc_inet_port nPort) = 0; + // TODO: virtual void Disconnect() = 0; + + virtual int Send(const char *pcBuffer, int nBufferSize) = 0; + virtual int Receive(char *pcBuffer, int nBufferSize) = 0; + + virtual pfc_inet_port GetLocalPort() = 0; + virtual pfc_inet_addr GetLocalAddress() = 0; + + virtual pfc_inet_port GetForeignPort() = 0; + virtual pfc_inet_addr GetForeignAddress() = 0; + + virtual PFC_FD GetDescriptor() + { + return m_nSocket; + } + + // TODO: virtual int GetOptions(...); + // TODO: virtual int SetOptions(...); + + // bool Wait(bool bInput = true, bool bOutput = true, bool bError = true); + bool WaitForInput(); + bool WaitForOutput(); + bool WaitForError(); + void SetWaitTimeout(unsigned int nMilliseconds); + int GetWaitTimeout() const { return (m_nTimeoutSeconds * 1000) + m_nTimeoutMilliseconds; } + + +protected: + + bool m_bIsBound; + PFC_SOCKET m_nSocket; + + // stuff for the "Wait" functions + fd_set m_sDescriptorSet; + + int m_nTimeoutSeconds; + int m_nTimeoutMilliseconds; + + timeval m_sTimeout; + timeval *m_pTimeout; +}; + + + +class PSocketException: public PException +{ +public: + PSocketException(int nErrorValue) + :PException(nErrorValue) + { + switch(nErrorValue) + { + case PFC_ERROR_INET_ADDR_INUSE: + SetDescription("The specified address is allready in use."); + break; + + case PFC_ERROR_INET_ADDR_NOTAVAIL: + SetDescription("The specified address is not available."); + break; + +#ifdef PFC_SYSTEM_TYPE_WINDOWS + case PFC_ERROR_INET_DOWN: + SetDescription("The network is down."); + break; + + case PFC_ERROR_INET_NOTINITIALISED: + SetDescription("The network is not initialized."); + break; +#endif + + case PFC_ERROR_INET_NOSOCKET: + SetDescription("The descriptor is no valid socket."); + break; + + default: + SetDescription("Unknown exception."); + break; + } + } + + PSocketException(int nErrorValue, const char *pszDescription) + :PException(nErrorValue, pszDescription) + { + } + + PSocketException() + :PException() + { + } +}; + + +#endif // #ifndef _PSOCKET_H_ diff --git a/lib/pfc++/include/PString.h b/lib/pfc++/include/PString.h new file mode 100644 index 0000000..b2d2a74 --- /dev/null +++ b/lib/pfc++/include/PString.h @@ -0,0 +1,139 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Sunday, 27. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PSTRING_H_ +#define _PSTRING_H_ + + + +// Classes defined in this document +// --------------------------------- +// +class PString; + + + +// Header includes +// --------------------------------- +// +#include +#include + +#if !defined NULL +#define NULL 0 +#endif + + +// Class definition +// --------------------------------- +// +class PString +{ +public: + + PString(int nMaxLength, const char *pszValue); + PString(const char *pszValue); + PString(const char *pValue, int nLength); + PString(const PString &pString); + ~PString(); + + int SetValue(const char *pszValue); + int SetValue(const char *pszValue, int nLength); + int SetValue(int nValue); + int SetValue(float fValue); + + const char* GetValue() const; + // DUMMY: int GetValueAsInt() const; + // DUMMY: float GetValueAsFloat() const; + // DUMMY: bool GetValueAsBool() const; + + // DUMMY: int GetCharAt(int nIndex) const; + // DUMMY: int GetValue(char *pszBuffer, int nBufferSize) const; + int GetLength() const { return m_nLength; } + int GetBufferSize() const { return m_nBufferSize; } + + int Compare(const char *pszString) const { return strcmp(m_pszString, pszString); } + int Compare(const PString *pString) const { return strcmp(m_pszString, pString->m_pszString); } + + bool Equals(const char *pszString) const { return Equals(m_pszString, pszString); } + bool Equals(const PString *pString) const { return Equals(m_pszString, pString->m_pszString); } + bool EqualsIgnoreCase(const char *pszString) const { return EqualsIgnoreCase(m_pszString, pszString); } + bool EqualsIgnoreCase(const PString *pString) const { return EqualsIgnoreCase(m_pszString, pString->m_pszString); } + + void ToUpperCase() { ToUpperCase(m_pszString); } + void ToLowerCase() { ToLowerCase(m_pszString); } + + // DUMMY: void Reverse() { Reverse(m_pszString); } + void Trim(bool bTrimRight = true, bool bTrimLeft = true); + // DUMMY: void Replace(const char cFromLetter, const char cToLetter); + + // DUMMY: int IndexOf(const char cLetter) const; + // DUMMY: int LastIndexOf(const char cLetter) const; + + + + // ---------------------------------------- + // static functions + + static int GetLength(const char *pszString); + + static bool Equals(const char *pszString1, const char *pszString2); + static bool EqualsIgnoreCase(const char *pszString1, const char *pszString2); + static int Compare(const char *pszString1, const char *pszString2) { return strcmp(pszString1, pszString2); } + + static void ToUpperCase(char *pszString); + static void ToLowerCase(char *pszString); + // DUMMY: static void Reverse(char *pszString); + static int Trim(char *pszString, bool bTrimRight = true, bool bTrimLeft = true); + // DUMMY: static int Trim(char *pszString, const char cTrimChar, bool bTrimRight = true, bool bTrimLeft = true); + // DUMMY: static int Replace(char *pszString, const char cFromLetter, const char cToLetter); + + // DUMMY: static int IndexOf(const char *pszString, const char cLetter); + // DUMMY: static int LastIndexOf(const char *pszString, const char cLetter); + + // DUMMY: static int GetValueAsInt(const char *pszString); + // DUMMY: static float GetValueAsFloat(const char *pszString); + // DUMMY: static bool GetValueAsBool(const char *pszString); + + static int ValueOf(int nValue, char *pszBuffer, int nBufferSize); + + +protected: + + int m_nLength; + int m_nBufferSize; + + char *m_pszString; +}; + + + + + +#endif // #ifndef _PSTRING_H_ diff --git a/lib/pfc++/include/PStringList.h b/lib/pfc++/include/PStringList.h new file mode 100644 index 0000000..eaf7b16 --- /dev/null +++ b/lib/pfc++/include/PStringList.h @@ -0,0 +1,129 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 21. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PSTRINGLIST_H_ +#define _PSTRINGLIST_H_ + + + +// Classes defined in this document +// --------------------------------- +// +class PStringListItem; +class PStringList; + + + +// Header includes +// --------------------------------- +// + +#include +#include + +#if !defined NULL +#define NULL 0 +#endif + + +// Class definition +// --------------------------------- +// +class PStringList +{ +public: + + PStringList(); + PStringList(bool bIgnoreCase, bool bUniqueItems); + ~PStringList(); + + bool AddItem(const char *pszString); + bool RemoveItem(const char *pszString); + int RemoveAllItems(); + + bool FindItem(const char *pszString); + bool FindItem(const char *pszString, bool bIgnoreCase); + + bool IsCurrentEqual(const char *pszString); + bool IsCurrentValid() + { + if(m_pCurrentItem != NULL) + return true; + else + return false; + } + + bool PickFirst(); + bool PickNext(); + + // TODO: implement function bool RemoveCurrent(); + + int GetNumItems() { return m_nItems; } + const char* GetCurrent(); + +protected: + + PStringListItem *m_pFirstItem; + PStringListItem *m_pLastItem; + + PStringListItem *m_pCurrentItem; + + bool m_bIgnoreCase; + bool m_bUniqueItems; + + int m_nItems; +}; + + + +class PStringListItem +{ +public: + + PStringListItem(const char *pszString); + ~PStringListItem(); + + bool Equals(const char *pszString, bool bIgnoreCase); + + int SetValue(const char *pszString); + const char* GetValue() { return m_pszString; } + + +protected: + + friend class PStringList; + + int m_nBufferSize; + char *m_pszString; + + PStringListItem *m_pNextItem; +}; + + +#endif // #ifndef _PSTRINGLIST_H_ diff --git a/lib/pfc++/include/PUDPSocket.h b/lib/pfc++/include/PUDPSocket.h new file mode 100644 index 0000000..e6bfd99 --- /dev/null +++ b/lib/pfc++/include/PUDPSocket.h @@ -0,0 +1,110 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PUDPSOCKET_H_ +#define _PUDPSOCKET_H_ + + + +// Classes defined in this document +// --------------------------------- +// +class PUDPSocket; + + + +// Header includes +// --------------------------------- +// +#include "PSocket.h" + +#include + + +// Class definition +// --------------------------------- +// +class PUDPSocket: public PSocket +{ +public: + + PUDPSocket(); + ~PUDPSocket(); + + virtual bool Bind(const char *pszIpAddress, pfc_inet_port nPort); + virtual bool Bind(pfc_inet_addr nIpAddress, pfc_inet_port nPort); + virtual bool Connect(pfc_inet_addr nIpAddress, pfc_inet_port nPort); + + virtual int Send(const char *pcBuffer, int nBufferSize); + int SendTo(const char *pcBuffer, int nBufferSize, pfc_inet_addr nIpAddress, pfc_inet_port nPort); + virtual int Receive(char *pcBuffer, int nBufferSize); + + virtual pfc_inet_port GetLocalPort() + { + return m_sLocalAddress.sin_port; + } + + virtual pfc_inet_addr GetLocalAddress() + { + return m_sLocalAddress.sin_addr.s_addr; + } + + virtual pfc_inet_port GetForeignPort() + { + return m_sForeignAddress.sin_port; + } + + virtual pfc_inet_addr GetForeignAddress() + { + return m_sForeignAddress.sin_addr.s_addr; + } + + // TODO: this is crap, remove + const char* GetForeignAddressString() + { + return inet_ntoa(m_sForeignAddress.sin_addr); + } + const char* GetLocalAddressString() + { + return inet_ntoa(m_sLocalAddress.sin_addr); + } + + +private: + + pfc_socklen_t m_nForeignAddressLength; + + struct sockaddr_in m_sLocalAddress; + struct sockaddr_in m_sForeignAddress; +}; + + + + +#endif // #ifndef _PUDPSOCKET_H_ diff --git a/lib/pfc++/include/pfc++/Makefile.am b/lib/pfc++/include/pfc++/Makefile.am new file mode 100644 index 0000000..e2901fd --- /dev/null +++ b/lib/pfc++/include/pfc++/Makefile.am @@ -0,0 +1,26 @@ +## Makefile for pfc library +## Copyright (C) 2001 Silvan Minghetti +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library 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 +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the +## Free Software Foundation, Inc., 59 Temple Place - Suite 330, +## Boston, MA 02111-1307, USA. +## +## Process this file with automake to produce Makefile.in + +noinst_HEADERS = file.h \ + inet.h \ + socket.h \ + string.h \ + system.h \ + types.h diff --git a/lib/pfc++/include/pfc++/Makefile.in b/lib/pfc++/include/pfc++/Makefile.in new file mode 100644 index 0000000..1abaf44 --- /dev/null +++ b/lib/pfc++/include/pfc++/Makefile.in @@ -0,0 +1,230 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +noinst_HEADERS = file.h \ + inet.h \ + socket.h \ + string.h \ + system.h \ + types.h + +subdir = lib/pfc++/include/pfc++ +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +HEADERS = $(noinst_HEADERS) + +DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/pfc++/include/pfc++/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-info-am + +.PHONY: GTAGS all all-am check check-am clean clean-generic distclean \ + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic tags uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/pfc++/include/pfc++/file.h b/lib/pfc++/include/pfc++/file.h new file mode 100644 index 0000000..9825567 --- /dev/null +++ b/lib/pfc++/include/pfc++/file.h @@ -0,0 +1,65 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 25. June 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PFC_FILE_H_ +#define _PFC_FILE_H_ + +#include + +#include +#include +#include + + +// begin windows specific +// ====================================================================== +#if defined PFC_SYSTEM_TYPE_WINDOWS + +#define PFC_MAX_PATH _MAX_PATH +#define FFC_MAX_FILENAME _MAX_FNAME + + +// begin unix specific +// ====================================================================== +#else +#include +#include +#include + +#define PFC_MAX_PATH _POSIX_PATH_MAX +#define PFC_MAX_FILENAME _POSIX_NAME_MAX + + +// end unix specific +// ====================================================================== +#endif + + + +#endif // _PFC_FILE_H_ diff --git a/lib/pfc++/include/pfc++/inet.h b/lib/pfc++/include/pfc++/inet.h new file mode 100644 index 0000000..acd5214 --- /dev/null +++ b/lib/pfc++/include/pfc++/inet.h @@ -0,0 +1,46 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 25. June 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PFC_INET_H_ +#define _PFC_INET_H_ + +#include + +typedef pfc_uint16 pfc_inet_port; +typedef pfc_uint32 pfc_inet_addr; + +#define PFC_INET_ADDR_ANY INADDR_ANY +#define PFC_INET_ADDR_NONE INADDR_NONE +#define PFC_INET_ADDR_LOOPBACK INADDR_LOOPBACK +#define PFC_INET_ADDR_BROADCAST INADDR_BROADCAST +#define PFC_INET_PORT_ANY 0 + + + +#endif // _PFC_INET_H_ diff --git a/lib/pfc++/include/pfc++/socket.h b/lib/pfc++/include/pfc++/socket.h new file mode 100644 index 0000000..8486174 --- /dev/null +++ b/lib/pfc++/include/pfc++/socket.h @@ -0,0 +1,108 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 25. June 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PFC_SOCKET_H_ +#define _PFC_SOCKET_H_ + +#include +#include + + + + +// begin windows specific +// ====================================================================== +#if defined PFC_SYSTEM_TYPE_WINDOWS + +#include + + +#define PFC_ERROR_INET_ADDR_INUSE WSAEADDRINUSE +#define PFC_ERROR_INET_ADDR_NOTAVAIL WSAEADDRNOTAVAIL +#define PFC_ERROR_INET_DOWN WSAENETDOWN +#define PFC_ERROR_INET_NOTINITIALISED WSANOTINITIALISED +#define PFC_ERROR_INET_NOSOCKET WSAENOTSOCK + +typedef SOCKET PFC_SOCKET; +typedef SOCKET PFC_FD; + +typedef SOCKET pfc_socket_t; +typedef int pfc_socklen_t; + + +// begin unix specific +// ====================================================================== +#elif defined PFC_SYSTEM_TYPE_UNIX + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + + +#define PFC_ERROR_INET_ADDR_INUSE EINVAL +#define PFC_ERROR_INET_ADDR_NOTAVAIL EACCES +#define PFC_ERROR_INET_DOWN 0 +#define PFC_ERROR_INET_NOTINITIALISED 0 +#define PFC_ERROR_INET_NOSOCKET ENOTSOCK + + +typedef int PFC_SOCKET; +typedef int PFC_FD; + + +typedef int pfc_socket_t; +typedef socklen_t pfc_socklen_t; + + +// end unix specific +// ====================================================================== +#endif + + + + +#define PFC_FD_INVALID -1 +#define PFC_SOCKET_INVALID -1 +#define PFC_SOCKET_ERROR -1 + + +#define PFC_WAIT_INFINITE 0xFFFFFFFF + + + + +#endif // _PFC_SOCKET_H_ diff --git a/lib/pfc++/include/pfc++/string.h b/lib/pfc++/include/pfc++/string.h new file mode 100644 index 0000000..c8a142a --- /dev/null +++ b/lib/pfc++/include/pfc++/string.h @@ -0,0 +1,39 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 25. June 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PFC_STRING_H_ +#define _PFC_STRING_H_ + +#ifndef NULL +#define NULL 0 +#endif + + +#endif // _PFC_STRING_H_ + diff --git a/lib/pfc++/include/pfc++/system.h b/lib/pfc++/include/pfc++/system.h new file mode 100644 index 0000000..e9a771c --- /dev/null +++ b/lib/pfc++/include/pfc++/system.h @@ -0,0 +1,55 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 25. June 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PFC_SYSTEM_H_ +#define _PFC_SYSTEM_H_ + + +#if defined WIN32 +#define PFC_SYSTEM_WINDOWS +#define PFC_SYSTEM_TYPE_WINDOWS + +#elif defined __linux__ +#define PFC_SYSTEM_LINUX +#define PFC_SYSTEM_TYPE_UNIX + +#elif defined __FreeBSD__ +#define PFC_SYSTEM_FREEBSD +#define PFC_SYSTEM_TYPE_UNIX + +#elif defined __NetBSD__ +#define PFC_SYSTEM_NETBSD +#define PFC_SYSTEM_TYPE_UNIX + +#else +#error Unknown operating system. Please check . +#endif + + +#endif // _PFC_SYSTEM_H_ diff --git a/lib/pfc++/include/pfc++/types.h b/lib/pfc++/include/pfc++/types.h new file mode 100644 index 0000000..8107444 --- /dev/null +++ b/lib/pfc++/include/pfc++/types.h @@ -0,0 +1,69 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 25. June 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#ifndef _PFC_TYPES_H_ +#define _PFC_TYPES_H_ + +#include + + +// begin windows specific types +// ====================================================================== +#if defined PFC_SYSTEM_TYPE_WINDOWS + +typedef signed __int8 pfc_int8; +typedef signed __int16 pfc_int16; +typedef signed __int32 pfc_int32; + +typedef unsigned __int8 pfc_uint8; +typedef unsigned __int16 pfc_uint16; +typedef unsigned __int32 pfc_uint32; + + +// begin linux specific types +// ====================================================================== +#else + +#include + +typedef int8_t pfc_int8; +typedef int16_t pfc_int16; +typedef int32_t pfc_int32; + +typedef u_int8_t pfc_uint8; +typedef u_int16_t pfc_uint16; +typedef u_int32_t pfc_uint32; + + +// end linux specific types +// ====================================================================== +#endif + + +#endif // _PFC_TYPES_H_ diff --git a/lib/pfc++/pfc++.dsp b/lib/pfc++/pfc++.dsp new file mode 100644 index 0000000..eceb424 --- /dev/null +++ b/lib/pfc++/pfc++.dsp @@ -0,0 +1,192 @@ +# Microsoft Developer Studio Project File - Name="pfc++" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=pfc++ - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "pfc++.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "pfc++.mak" CFG="pfc++ - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "pfc++ - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "pfc++ - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "pfc++ - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I ".\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x807 /d "NDEBUG" +# ADD RSC /l 0x807 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "pfc++ - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x807 /d "_DEBUG" +# ADD RSC /l 0x807 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "pfc++ - Win32 Release" +# Name "pfc++ - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\src\CInetAddress.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\CStringBuffer.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\PArgumentList.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\PLogfile.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\PSocket.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\PString.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\PStringList.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\PUDPSocket.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Group "pfc++" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=".\include\pfc++\file.h" +# End Source File +# Begin Source File + +SOURCE=".\include\pfc++\inet.h" +# End Source File +# Begin Source File + +SOURCE=".\include\pfc++\socket.h" +# End Source File +# Begin Source File + +SOURCE=".\include\pfc++\string.h" +# End Source File +# Begin Source File + +SOURCE=".\include\pfc++\system.h" +# End Source File +# Begin Source File + +SOURCE=".\include\pfc++\types.h" +# End Source File +# End Group +# Begin Source File + +SOURCE=.\include\CInetAddress.h +# End Source File +# Begin Source File + +SOURCE=.\include\CStringBuffer.h +# End Source File +# Begin Source File + +SOURCE=.\include\PArgumentList.h +# End Source File +# Begin Source File + +SOURCE=.\include\PException.h +# End Source File +# Begin Source File + +SOURCE=.\include\PFile.h +# End Source File +# Begin Source File + +SOURCE=.\include\PLogfile.h +# End Source File +# Begin Source File + +SOURCE=.\include\PSocket.h +# End Source File +# Begin Source File + +SOURCE=.\include\PString.h +# End Source File +# Begin Source File + +SOURCE=.\include\PStringList.h +# End Source File +# Begin Source File + +SOURCE=.\include\PUDPSocket.h +# End Source File +# End Group +# End Target +# End Project diff --git a/lib/pfc++/pfc++.dsw b/lib/pfc++/pfc++.dsw new file mode 100644 index 0000000..7c7d442 --- /dev/null +++ b/lib/pfc++/pfc++.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "pfc++"=".\pfc++.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/lib/pfc++/src/CInetAddress.cpp b/lib/pfc++/src/CInetAddress.cpp new file mode 100644 index 0000000..464045b --- /dev/null +++ b/lib/pfc++/src/CInetAddress.cpp @@ -0,0 +1,128 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 27. June 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#include "CInetAddress.h" + + +// start namespace pfc +// ====================================================================== + +namespace pfc +{ + // ================================================================== + + CInetAddress::CInetAddress() + { + m_nIpAddress = PFC_INET_ADDR_ANY; + } + + + // ================================================================== + + CInetAddress::CInetAddress(const char *pszIpAddress) + { + SetAddress(pszIpAddress); + } + + + // ================================================================== + + CInetAddress::~CInetAddress() + { + } + + + // ================================================================== + + void CInetAddress::SetAddress(pfc_inet_addr nIpAddress) + { + m_nIpAddress = nIpAddress; + } + + + // ================================================================== + + void CInetAddress::SetAddress(const char *pszIpAddress) + { + m_nIpAddress = ::inet_addr(pszIpAddress); + } + + + // ================================================================== + + bool CInetAddress::IsValid() + { + if(m_nIpAddress == PFC_INET_ADDR_ANY) + return false; + else + return true; + } + + + // ================================================================== + // NOTE: this function is just 'a quick & dirty hack' + + int CInetAddress::GetAddress(char *pszBuffer, int nBufferSize) + { + if(pszBuffer == NULL || nBufferSize < 16) + return 0; + + int nLength = 0; + int nPartLength = 0; + pfc_inet_addr nPart; + + nPart = (m_nIpAddress) & 0x000000FF; + nPartLength = ::PString::ValueOf((int) nPart, pszBuffer + nLength, nBufferSize - nLength); + nLength += nPartLength; + pszBuffer[nLength++] = '.'; + + nPart = (m_nIpAddress >> 8) & 0x000000FF; + nPartLength = ::PString::ValueOf((int) nPart, pszBuffer + nLength, nBufferSize - nLength); + nLength += nPartLength; + pszBuffer[nLength++] = '.'; + + nPart = (m_nIpAddress >> 16) & 0x000000FF; + nPartLength = ::PString::ValueOf((int) nPart, pszBuffer + nLength, nBufferSize - nLength); + nLength += nPartLength; + pszBuffer[nLength++] = '.'; + + nPart = (m_nIpAddress >> 24) & 0x000000FF; + nPartLength = ::PString::ValueOf((int) nPart, pszBuffer + nLength, nBufferSize - nLength); + nLength += nPartLength; + + return nLength; + } + + + +// ====================================================================== +// end namespace pfc +} + + diff --git a/lib/pfc++/src/CStringBuffer.cpp b/lib/pfc++/src/CStringBuffer.cpp new file mode 100644 index 0000000..4f4da33 --- /dev/null +++ b/lib/pfc++/src/CStringBuffer.cpp @@ -0,0 +1,176 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 27. June 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#include "CStringBuffer.h" +#include "CInetAddress.h" + + +// start namespace pfc +// ====================================================================== + +namespace pfc +{ + // ================================================================== + + CStringBuffer::CStringBuffer(int nBufferSize) + { + if(nBufferSize < 1) + m_nBufferSize = 33; + else + m_nBufferSize = (nBufferSize + 1); + + // TODO: check for malloc errors + m_pszBuffer = new char[ m_nBufferSize ]; + + SetLength(0); + } + + + // ================================================================== + + CStringBuffer::~CStringBuffer() + { + if(m_pszBuffer != NULL) + delete[] m_pszBuffer; + } + + + // ================================================================== + + int CStringBuffer::SetLength(int nLength) + { + if(nLength < 0) + m_nLength = 0; + else if(nLength >= m_nBufferSize) + m_nLength = (m_nBufferSize - 1); + else + m_nLength = nLength; + + m_nFree = (m_nBufferSize - m_nLength - 1); + m_pEnd = &m_pszBuffer[ m_nLength ]; + *(m_pEnd) = '\0'; + + return m_nLength; + } + + + // ================================================================== + + bool CStringBuffer::Append(char cValue) + { + if(m_nFree != 0) + { + *(m_pEnd) = cValue; + + m_pEnd++; + m_nFree--; + m_nLength++; + + *(m_pEnd) = '\0'; + + return true; + } + else + return false; + } + + + // ================================================================== + + bool CStringBuffer::Append(int nValue) + { + int nLength = ::PString::ValueOf(nValue, m_pEnd, m_nFree); + if(nLength > 0) + { + m_pEnd += nLength; + m_nLength += nLength; + m_nFree -= nLength; + + return true; + } + else + return false; + } + + + // ================================================================== + + bool CStringBuffer::Append(CInetAddress *pInetAddr) + { + int nLength = pInetAddr->GetAddress(m_pEnd, m_nFree); + if(nLength > 0) + { + m_pEnd += nLength; + m_nLength += nLength; + m_nFree -= nLength; + + return true; + } + else + return false; + } + + + // ================================================================== + + bool CStringBuffer::Append(const char *pszValue) + { + // buffer full? + if(m_nFree == 0) + return false; + + if(pszValue == NULL) + pszValue = "(null)"; + + for(/* no init*/; (m_nFree > 0) && (*(pszValue) != '\0'); m_nLength++, m_nFree--) + { + // copy string + *(m_pEnd) = *(pszValue); + + m_pEnd++; + pszValue++; + } + + // terminate buffer, recalculate free space + *(m_pEnd) = '\0'; + + // check, if string copied completly + if(*(pszValue) == '\0') + return true; + else + return false; + } + + + +// ====================================================================== +// end namespace pfc +} + + diff --git a/lib/pfc++/src/Makefile.am b/lib/pfc++/src/Makefile.am new file mode 100644 index 0000000..5cc5717 --- /dev/null +++ b/lib/pfc++/src/Makefile.am @@ -0,0 +1,31 @@ +## Makefile for pfc library +## Copyright (C) 2001 Silvan Minghetti +## +## This library is free software; you can redistribute it and/or +## modify it under the terms of the GNU Lesser General Public +## License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## +## This library 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 +## Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License along with this library; if not, write to the +## Free Software Foundation, Inc., 59 Temple Place - Suite 330, +## Boston, MA 02111-1307, USA. + + +noinst_LIBRARIES = libpfc++.a +libpfc___a_SOURCES = PArgumentList.cpp \ + PLogfile.cpp \ + PString.cpp \ + PStringList.cpp \ + PSocket.cpp \ + PUDPSocket.cpp \ + CStringBuffer.cpp \ + CInetAddress.cpp + +CXXFLAGS = -O2 -Wall +INCLUDES = -I../include diff --git a/lib/pfc++/src/Makefile.in b/lib/pfc++/src/Makefile.in new file mode 100644 index 0000000..bb4d927 --- /dev/null +++ b/lib/pfc++/src/Makefile.in @@ -0,0 +1,306 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +noinst_LIBRARIES = libpfc++.a +libpfc___a_SOURCES = PArgumentList.cpp \ + PLogfile.cpp \ + PString.cpp \ + PStringList.cpp \ + PSocket.cpp \ + PUDPSocket.cpp \ + CStringBuffer.cpp \ + CInetAddress.cpp + + +CXXFLAGS = -O2 -Wall +INCLUDES = -I../include +subdir = lib/pfc++/src +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libpfc___a_AR = $(AR) cru +libpfc___a_LIBADD = +am_libpfc___a_OBJECTS = PArgumentList.$(OBJEXT) PLogfile.$(OBJEXT) \ + PString.$(OBJEXT) PStringList.$(OBJEXT) PSocket.$(OBJEXT) \ + PUDPSocket.$(OBJEXT) CStringBuffer.$(OBJEXT) \ + CInetAddress.$(OBJEXT) +libpfc___a_OBJECTS = $(am_libpfc___a_OBJECTS) + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/CInetAddress.Po \ +@AMDEP_TRUE@ $(DEPDIR)/CStringBuffer.Po \ +@AMDEP_TRUE@ $(DEPDIR)/PArgumentList.Po $(DEPDIR)/PLogfile.Po \ +@AMDEP_TRUE@ $(DEPDIR)/PSocket.Po $(DEPDIR)/PString.Po \ +@AMDEP_TRUE@ $(DEPDIR)/PStringList.Po $(DEPDIR)/PUDPSocket.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +DIST_SOURCES = $(libpfc___a_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(libpfc___a_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/pfc++/src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status + +AR = ar + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libpfc++.a: $(libpfc___a_OBJECTS) $(libpfc___a_DEPENDENCIES) + -rm -f libpfc++.a + $(libpfc___a_AR) libpfc++.a $(libpfc___a_OBJECTS) $(libpfc___a_LIBADD) + $(RANLIB) libpfc++.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/CInetAddress.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/CStringBuffer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/PArgumentList.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/PLogfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/PSocket.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/PString.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/PStringList.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/PUDPSocket.Po@am__quote@ + +distclean-depend: + -rm -rf $(DEPDIR) + +.cpp.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CXXCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< + +.cpp.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CXXCOMPILE) -c -o $@ `cygpath -w $<` +CXXDEPMODE = @CXXDEPMODE@ +uninstall-info-am: + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) + +installdirs: + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +uninstall-am: uninstall-info-am + +.PHONY: GTAGS all all-am check check-am clean clean-generic \ + clean-noinstLIBRARIES distclean distclean-compile \ + distclean-depend distclean-generic distclean-tags distdir dvi \ + dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic tags uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/pfc++/src/PArgumentList.cpp b/lib/pfc++/src/PArgumentList.cpp new file mode 100644 index 0000000..6dad12d --- /dev/null +++ b/lib/pfc++/src/PArgumentList.cpp @@ -0,0 +1,842 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#include "PArgumentList.h" + +#include +#include + + + + +// ====================================================================== + +PArgumentList::PArgumentList() +{ + m_pFirstItem = NULL; + m_pLastItem = NULL; + m_pCurrentItem= NULL; + m_nItems = 0; + m_bIgnoreCase = false; + + m_pUnknownArgumentsList = new PStringList(m_bIgnoreCase, false); + m_pUnknownValuesList = new PStringList(m_bIgnoreCase, false); +} + + +// ====================================================================== + +PArgumentList::PArgumentList(bool bIgnoreCase) +{ + m_pFirstItem = NULL; + m_pLastItem = NULL; + m_pCurrentItem= NULL; + m_nItems = 0; + m_bIgnoreCase = bIgnoreCase; + + m_pUnknownArgumentsList = new PStringList(m_bIgnoreCase, false); + m_pUnknownValuesList = new PStringList(m_bIgnoreCase, false); +} + + + +// ====================================================================== + +PArgumentList::~PArgumentList() +{ + RemoveAllOptions(); + + delete m_pUnknownArgumentsList; + delete m_pUnknownValuesList; +} + + + +// ====================================================================== + +int PArgumentList::RemoveAllOptions() +{ + int nCount = 0; + PArgumentListItem *pNext = NULL; + PArgumentListItem *pCurrent = NULL; + + // remove all items, begin at end + for(pNext = m_pLastItem; pNext != NULL; nCount++) + { + pCurrent = pNext; + pNext = pNext->m_pPrevious; + + delete pCurrent; + } + + m_pFirstItem = NULL; + m_pLastItem = NULL; + m_pCurrentItem = NULL; + m_nItems = 0; + + // return number of items deleted + return nCount; +} + + + +// ====================================================================== + +bool PArgumentList::HasValue(const char cShortOption) +{ + PArgumentListItem *pItem = GetItem(cShortOption); + + if(pItem == NULL) + return false; + else if(pItem->m_pszValue != NULL) + return true; + else + return false; +} + + +// ====================================================================== + +bool PArgumentList::HasValue(const char *pszLongOption) +{ + PArgumentListItem *pItem = GetItem(pszLongOption); + + if(pItem == NULL) + return false; + else if(pItem->m_pszValue != NULL) + return true; + else + return false; +} + + + +// ====================================================================== + +void PArgumentList::AddOption(const char cShortOption, bool bRequireValue /* = false */, const char *pszDefaultValue /* = NULL */) +{ + AddOption(cShortOption, NULL, bRequireValue, pszDefaultValue); +} + + +// ====================================================================== + +void PArgumentList::AddOption(const char *pszLongOption, bool bRequireValue /* = false */, const char *pszDefaultValue /* = NULL */) +{ + AddOption((char) 0, pszLongOption, bRequireValue, pszDefaultValue); +} + +// ====================================================================== + +void PArgumentList::AddOption(const char cShortOption, const char *pszLongOption, bool bRequireValue /* = false */, const char *pszDefaultValue /* = NULL */) +{ + if(cShortOption == 0 && pszLongOption == NULL) + return; + + PArgumentListItem *pItem = GetItem(cShortOption, pszLongOption); + if(pItem != NULL) + { + // item allready exists + pItem->SetName(cShortOption); + pItem->SetName(pszLongOption); + + pItem->m_bRequireValue = bRequireValue; + pItem->SetDefaultValue(pszDefaultValue); + } + else + { + // add new item + pItem = new PArgumentListItem(cShortOption, pszLongOption, bRequireValue, pszDefaultValue); + + // add item to end of list + if(m_pFirstItem == NULL) + m_pFirstItem = pItem; + + pItem->m_pPrevious = m_pLastItem; + pItem->m_pNext = NULL; + + if(m_pLastItem != NULL) + m_pLastItem->m_pNext = pItem; + + m_pLastItem = pItem; + + if(m_nItems == 0) + m_pCurrentItem = pItem; + + // increment number of items + m_nItems++; + } +} + + +// ====================================================================== + +PArgumentListItem* PArgumentList::GetItem(const char cShortOption) +{ + if(cShortOption == 0) + return NULL; + + PArgumentListItem *pCurrent; + + for(pCurrent = m_pFirstItem; pCurrent != NULL; pCurrent = pCurrent->m_pNext) + { + if(pCurrent->Equals(cShortOption, m_bIgnoreCase) == true) + { + // item found + return pCurrent; + } + } + + // not found + return NULL; +} + + +// ====================================================================== + +PArgumentListItem* PArgumentList::GetItem(const char *pszLongOption) +{ + if(pszLongOption == NULL) + return NULL; + + PArgumentListItem *pCurrent; + + for(pCurrent = m_pFirstItem; pCurrent != NULL; pCurrent = pCurrent->m_pNext) + { + if(pCurrent->Equals(pszLongOption, m_bIgnoreCase) == true) + { + // item found + return pCurrent; + } + } + + // not found + return NULL; +} + + +// ====================================================================== + +PArgumentListItem* PArgumentList::GetItem(const char cShortOption, const char *pszLongOption) +{ + if(cShortOption == 0 && pszLongOption == NULL) + return NULL; + + PArgumentListItem *pCurrent; + + for(pCurrent = m_pFirstItem; pCurrent != NULL; pCurrent = pCurrent->m_pNext) + { + if((pCurrent->Equals(cShortOption, m_bIgnoreCase) == true) || (pCurrent->Equals(pszLongOption, m_bIgnoreCase) == true)) + { + // item found + return pCurrent; + } + } + + // not found + return NULL; +} + + +// ====================================================================== + +bool PArgumentList::Enable(const char cShortOption, bool bEnable /* = true */) +{ + PArgumentListItem *pItem = GetItem(cShortOption); + + if(pItem == NULL) + return false; + + pItem->Enable(bEnable); + + return true; +} + + +// ====================================================================== + +bool PArgumentList::Enable(const char *pszLongOption, bool bEnable /* = true */) +{ + PArgumentListItem *pItem = GetItem(pszLongOption); + + if(pItem == NULL) + return false; + + pItem->Enable(bEnable); + + return true; +} + + +// ====================================================================== + +const char* PArgumentList::GetValue(const char cShortOption, bool bReturnDefault /* = true */) +{ + PArgumentListItem *pItem = GetItem(cShortOption); + + if(pItem == NULL) + return NULL; + + if(pItem->m_pszValue != NULL) + return pItem->m_pszValue; + else if(bReturnDefault == true) + return pItem->m_pszDefaultValue; + else + return NULL; +} + + +// ====================================================================== + +const char* PArgumentList::GetDefaultValue(const char cShortOption) +{ + PArgumentListItem *pItem = GetItem(cShortOption); + + if(pItem == NULL) + return NULL; + + return pItem->m_pszDefaultValue; +} + + +// ====================================================================== + +const char* PArgumentList::GetDefaultValue(const char *pszLongOption) +{ + PArgumentListItem *pItem = GetItem(*pszLongOption); + + if(pItem == NULL) + return NULL; + + return pItem->m_pszDefaultValue; +} + + +// ====================================================================== + +const char* PArgumentList::GetValue(const char *pszLongOption, bool bReturnDefault /* = true */) +{ + PArgumentListItem *pItem = GetItem(pszLongOption); + + if(pItem == NULL) + return NULL; + + if(pItem->m_pszValue != NULL) + return pItem->m_pszValue; + else if(bReturnDefault == true) + return pItem->m_pszDefaultValue; + else + return NULL; +} + + +// ====================================================================== + +bool PArgumentList::IsEnabled(const char cShortOption) +{ + PArgumentListItem *pItem = GetItem(cShortOption); + + if(pItem == NULL) + return false; + else + return pItem->m_bIsEnabled; +} + + +// ====================================================================== + +bool PArgumentList::IsEnabled(const char *pszLongOption) +{ + PArgumentListItem *pItem = GetItem(pszLongOption); + + if(pItem == NULL) + return false; + else + return pItem->m_bIsEnabled; +} + + +// ====================================================================== + +int PArgumentList::ParseArguments(const char *pszArguments[], int nArguments) +{ + if(nArguments <= 0) + return 0; + + int nCount; + int nCharCount; + int nGoodArguments = 0; + char *pszValue = NULL; + char szSmallArgBuffer[3] = { '\0' }; + + PArgumentListItem *pLastRequireArg = NULL; + PArgumentListItem *pItem = NULL; + + m_pCurrentItem = m_pFirstItem; + + // TODO: improve performance, use pointers instead of array counters... + // TODO: strip '"' from values + + for(nCount = 0; nCount < nArguments; nCount++) + { + if(pszArguments[nCount] == NULL) + break; + + if(pszArguments[nCount][0] == '-' && pszArguments[nCount][1] == '-') + { + // long type argument + pLastRequireArg = NULL; + + // check for '=' + for(pszValue = (char*)&pszArguments[nCount][2]; (*(pszValue) != '\0') && (*(pszValue) != '='); pszValue++) + ; /* do nothing */ + + // found a value separated by '='? + if(*(pszValue) == '\0') + { + // no value found + pszValue = NULL; + } + else if(*(pszValue) == '=') + { + // split argument/value + *(pszValue) = '\0'; + pszValue++; + } + + + pItem = GetItem(&pszArguments[nCount][2]); + + if(pItem != NULL) + { + if(pszValue != NULL) + { + // found a value, save it + pItem->Enable(); + + if(pItem->m_bRequireValue == true) + pItem->SetValue(pszValue); + else + { + // this argument does not require a value + m_pUnknownValuesList->AddItem(pszValue); + } + + // restore our splitted argument/value + *(pszValue - 1) = '='; + } + else + { + // no value, enable it, if it does not require a value + if(pItem->m_bRequireValue == true) + pLastRequireArg = pItem; + else + pItem->Enable(); + } + } + else + { + // argument not found, add to list: unknown argument + // TODO: add to list + m_pUnknownArgumentsList->AddItem(pszArguments[nCount]); + + // restore our splitted argument/value + if(pszValue != NULL) + *(pszValue - 1) = '='; + } + } + else if(pszArguments[nCount][0] == '-') + { + // short type argument(s) + pLastRequireArg = NULL; + + // parse string + for(nCharCount = 1; pszArguments[nCount][nCharCount] != '\0'; nCharCount++) + { + if(pszArguments[nCount][nCharCount] == '=') + { + // found a value, save it + if(pLastRequireArg != NULL) + { + if(pLastRequireArg->m_bRequireValue == true) + pLastRequireArg->SetValue(&pszArguments[nCount][nCharCount + 1]); + else + { + // this argument does not require a value + m_pUnknownValuesList->AddItem(&pszArguments[nCount][nCharCount + 1]); + } + + pLastRequireArg = NULL; + } + else + { + // no argument takes this value + m_pUnknownValuesList->AddItem(&pszArguments[nCount][nCharCount + 1]); + } + + // break out, string parsed + break; + } + else + { + pItem = GetItem(pszArguments[nCount][nCharCount]); + if(pItem == NULL) + { + // add to list of unknown arguments + pLastRequireArg = NULL; + + szSmallArgBuffer[0] = '-'; + szSmallArgBuffer[1] = pszArguments[nCount][nCharCount]; + szSmallArgBuffer[2] = '\0'; + + m_pUnknownArgumentsList->AddItem(szSmallArgBuffer); + } + else + { + if(pItem->m_bRequireValue != true) + { + pLastRequireArg = NULL; + pItem->Enable(); + } + else + pLastRequireArg = pItem; + } + } + } + } + else + { + if(pLastRequireArg != NULL) + { + // found a value for an argument + pLastRequireArg->Enable(); + pLastRequireArg->SetValue(pszArguments[nCount]); + } + else + { + // does not belong to any argument + m_pUnknownValuesList->AddItem(pszArguments[nCount]); + } + + pLastRequireArg = NULL; + } + } + + + // return number of good arguments found + return nGoodArguments; +} + + +// ====================================================================== + +bool PArgumentList::PickCurrentFirst() +{ + m_pCurrentItem = m_pFirstItem; + + if(m_pCurrentItem != NULL) + return true; + else + return false; +} + + +// ====================================================================== + +bool PArgumentList::PickCurrentLast() +{ + m_pCurrentItem = m_pLastItem; + + if(m_pCurrentItem != NULL) + return true; + else + return false; +} + + +// ====================================================================== + +bool PArgumentList::PickCurrentNext() +{ + if(m_pCurrentItem != NULL) + { + m_pCurrentItem = m_pCurrentItem->m_pNext; + return true; + } + else + return false; +} + + +// ====================================================================== + +bool PArgumentList::PickCurrentPrevious() +{ + if(m_pCurrentItem != NULL) + { + m_pCurrentItem = m_pCurrentItem->m_pPrevious; + return true; + } + else + return false; +} + + +// ====================================================================== +bool PArgumentList::IsCurrentEqual(const char cShortOption) +{ + if(m_pCurrentItem == NULL) + return false; + else + return m_pCurrentItem->Equals(cShortOption, m_bIgnoreCase); +} + + +// ====================================================================== +bool PArgumentList::IsCurrentEqual(const char *pszLongOption) +{ + if(m_pCurrentItem == NULL) + return false; + else + return m_pCurrentItem->Equals(pszLongOption, m_bIgnoreCase); +} + + +// ====================================================================== +bool PArgumentList::EnableCurrent(bool bEnable /* = true */) +{ + if(m_pCurrentItem == NULL) + return false; + + m_pCurrentItem->Enable(bEnable); + + return true; +} + + +// ====================================================================== +bool PArgumentList::IsCurrentValid() +{ + if(m_pCurrentItem == NULL) + return false; + else + return true; +} + + +// ====================================================================== +bool PArgumentList::IsCurrentEnabled() +{ + if(m_pCurrentItem == NULL) + return false; + else + return m_pCurrentItem->m_bIsEnabled; +} + + +// ====================================================================== +bool PArgumentList::HasCurrentValue() +{ + if(m_pCurrentItem == NULL) + return false; + + if(m_pCurrentItem->m_pszValue == NULL) + return false; + else + return true; +} + + +// ====================================================================== +const char* PArgumentList::GetCurrentValue(bool bReturnDefault /* = true */) +{ + if(m_pCurrentItem == NULL) + return NULL; + + if(m_pCurrentItem->m_pszValue != NULL) + return m_pCurrentItem->m_pszValue; + else if(bReturnDefault == true) + return m_pCurrentItem->m_pszDefaultValue; + else + return NULL; +} + + +// ====================================================================== +const char* PArgumentList::GetCurrentDefaultValue() +{ + if(m_pCurrentItem == NULL) + return NULL; + + return m_pCurrentItem->m_pszDefaultValue; +} + + + + + + + + + + + +// ====================================================================== + +PArgumentListItem::PArgumentListItem(const char cShortOption, const char *pszLongOption, bool bRequireValue, const char *pszDefaultValue) +{ + m_bRequireValue = bRequireValue; + m_cShortName = cShortOption; + m_pszLongName = NULL; + m_pszValue = NULL; + m_pszDefaultValue = NULL; + m_bIsEnabled = false; + + SetName(pszLongOption); + SetDefaultValue(pszDefaultValue); + +} + +const char* PArgumentListItem::m_pszVoidValue = ""; + + + +// ====================================================================== + +PArgumentListItem::~PArgumentListItem() +{ + if(m_pszLongName != NULL) + delete[] m_pszLongName; + + if(m_pszValue != NULL) + delete[] m_pszValue; + + if(m_pszDefaultValue != NULL && m_pszDefaultValue != m_pszVoidValue) + delete[] m_pszDefaultValue; +} + + +// ====================================================================== + +void PArgumentListItem::SetName(const char *pszLongOption) +{ + // copy long option name + if(pszLongOption == NULL) + { + // free memory, if necessary + if(m_pszLongName != NULL) + delete[] m_pszLongName; + + m_pszLongName = NULL; + } + else + { + int nCount; + + // get string length + for(nCount = 0; pszLongOption[nCount] != '\0'; nCount++) + ; /* do nothing */ + + // allocate memory + m_pszLongName = new char[ (nCount + 1) ]; + + // copy string + for(nCount = 0; pszLongOption[nCount] != '\0'; nCount++) + m_pszLongName[nCount] = pszLongOption[nCount]; + m_pszLongName[nCount] = '\0'; + } +} + + +// ====================================================================== + +void PArgumentListItem::SetValue(const char *pszValue) +{ + if(pszValue == NULL) + { + // free memory, if necessary + if(m_pszValue != NULL) + delete[] m_pszValue; + + m_pszValue = NULL; + } + else + { + int nCount; + + // get string length + for(nCount = 0; pszValue[nCount] != '\0'; nCount++) + ; /* do nothing */ + + // allocate memory + m_pszValue = new char[ (nCount + 1) ]; + + // copy string + for(nCount = 0; pszValue[nCount] != '\0'; nCount++) + m_pszValue[nCount] = pszValue[nCount]; + m_pszValue[nCount] = '\0'; + } +} + + +// ====================================================================== + +void PArgumentListItem::SetDefaultValue(const char *pszDefaultValue) +{ + if(pszDefaultValue == NULL) + { + // free memory, if necessary + if(m_pszDefaultValue != NULL && m_pszDefaultValue != m_pszVoidValue) + delete[] m_pszDefaultValue; + + // the defaul value may not be NULL + // now it points to a value of "" + m_pszDefaultValue = (char*)m_pszVoidValue; + } + else + { + int nCount; + + // get string length + for(nCount = 0; pszDefaultValue[nCount] != '\0'; nCount++) + ; /* do nothing */ + + // allocate memory + m_pszDefaultValue = new char[ (nCount + 1) ]; + + // copy string + for(nCount = 0; pszDefaultValue[nCount] != '\0'; nCount++) + m_pszDefaultValue[nCount] = pszDefaultValue[nCount]; + m_pszDefaultValue[nCount] = '\0'; + } +} + + + + diff --git a/lib/pfc++/src/PLogfile.cpp b/lib/pfc++/src/PLogfile.cpp new file mode 100644 index 0000000..18b1458 --- /dev/null +++ b/lib/pfc++/src/PLogfile.cpp @@ -0,0 +1,260 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Wednesday, 16. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + +#include +#include + +#include "PLogfile.h" +#include "CStringBuffer.h" + + + +// ====================================================================== + +PLogfile::PLogfile(const char *pszFilename, int nLevel) +{ + if(pszFilename == NULL) + m_pFileName = new PString(PFC_MAX_PATH, "unnamed.log"); + else + m_pFileName = new PString(PFC_MAX_PATH, pszFilename); + + m_bIsOpen = false; + m_bStarted = false; + + if(Open() != true) + throw PFileException(); + + m_pLineBuffer = new pfc::CStringBuffer(256); + + SetLogLevel(nLevel); +} + + +// ====================================================================== + +PLogfile::~PLogfile() +{ + Close(); + + delete m_pFileName; + delete m_pLineBuffer; +} + + +// ====================================================================== + +void PLogfile::SetLogLevel(int nLevel) +{ + if(nLevel >= 0 && nLevel <= c_LEVEL_DEBUG) + m_nLevel = nLevel; + else + m_nLevel = c_LEVEL_DEBUG; +} + +// ====================================================================== + +const int PLogfile::c_LEVEL_NONE = 0; +const int PLogfile::c_LEVEL_CRITICAL = 1; +const int PLogfile::c_LEVEL_ERROR = 2; +const int PLogfile::c_LEVEL_WARNING = 3; +const int PLogfile::c_LEVEL_INFO = 4; +const int PLogfile::c_LEVEL_DEBUG = 5; + + + +// ====================================================================== + +bool PLogfile::Open() +{ + if(m_bIsOpen == true) + return true; + + #if defined PFC_SYSTEM_TYPE_WINDOWS + m_pFile = fopen(m_pFileName->GetValue(), "a"); + #elif defined PFC_SYSTEM_TYPE_UNIX + + mode_t mode_prev; + // TODO: this is stoopid, no need to set/unset umask for that... + mode_prev = umask(S_IWGRP | S_IWOTH); + + m_pFile = fopen(m_pFileName->GetValue(), "a"); + + // reset umask + umask(mode_prev); + #else + #error Unknown operating system. Only WIN32 / LINUX are recognized. + #endif + + if(m_pFile == NULL) + return false; + + m_bIsOpen = true; + + return true; +} + + +// ====================================================================== + +void PLogfile::Flush() +{ + if(m_bIsOpen == true && m_bStarted == true) + { + m_pLineBuffer->Append('\n'); + fwrite(m_pLineBuffer->GetCharPointer(), sizeof(char), m_pLineBuffer->GetLength(), m_pFile); + + fflush(m_pFile); + } + + m_pLineBuffer->Clear(); + m_bStarted = false; +} + + +// ====================================================================== + +void PLogfile::Close() +{ + if(m_bIsOpen != true) + return; + + Flush(); + fclose(m_pFile); + + m_bIsOpen = false; +} + + +// ====================================================================== + +bool PLogfile::ReOpen() +{ + this->Close(); + + return this->Open(); +} + + +// ====================================================================== + +bool PLogfile::Begin(int nLevel) +{ + if(CheckLevel(nLevel) != true) + return false; + + if(m_bStarted == true) + Flush(); + + m_pLineBuffer->Append('['); + m_pLineBuffer->Append(nLevel); + m_pLineBuffer->Append(']'); + m_pLineBuffer->Append(' '); + + time_t nTimestamp = time(NULL); + struct tm *pTime = localtime(&nTimestamp); + + if(pTime != NULL) + sprintf(m_szDateBuffer, "%04i-%02i-%02i %02i:%02i:%02i", pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday, pTime->tm_hour, pTime->tm_min, pTime->tm_sec); + else + strcpy(m_szDateBuffer, "0000-00-00 00:00:00"); + + m_pLineBuffer->Append(m_szDateBuffer); + m_pLineBuffer->Append("> "); + + m_bStarted = true; + return true; +} + + +// ====================================================================== + +void PLogfile::Cancel() +{ + m_bStarted = false; + m_pLineBuffer->Clear(); +} + + +// ====================================================================== + +bool PLogfile::WriteLine(const char *pszLine, int nLevel) +{ + if(Begin(nLevel) != true) + return false; + + m_pLineBuffer->Append(pszLine); + + Flush(); + + return true; +} + + +// ====================================================================== + +bool PLogfile::Append(const char *pszMessage) +{ + if(m_bStarted != true) + return false; + + return m_pLineBuffer->Append(pszMessage); +} + + +// ====================================================================== + +bool PLogfile::Append(const char cValue) +{ + if(m_bStarted != true) + return false; + + return m_pLineBuffer->Append(cValue); +} + + +// ====================================================================== + +bool PLogfile::Append(int nValue) +{ + if(m_bStarted != true) + return false; + + return m_pLineBuffer->Append(nValue); +} + + +// ====================================================================== + +bool PLogfile::Append(pfc::CInetAddress *pInetAddr) +{ + if(m_bStarted != true) + return false; + + return m_pLineBuffer->Append(pInetAddr); +} + diff --git a/lib/pfc++/src/PSocket.cpp b/lib/pfc++/src/PSocket.cpp new file mode 100644 index 0000000..104fa3d --- /dev/null +++ b/lib/pfc++/src/PSocket.cpp @@ -0,0 +1,173 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + +#include + +#include "PSocket.h" + +#include + + +// ====================================================================== + +PSocket::PSocket(int nAddressFamily, int nType) +{ + m_nSocket = socket(nAddressFamily, nType, 0); + + if(m_nSocket == PFC_SOCKET_INVALID) + { +#ifdef PFC_SYSTEM_TYPE_WINDOWS + throw PSocketException(WSAGetLastError()); +#else + throw PSocketException(errno); +#endif + } + + m_bIsBound = false; + + SetWaitTimeout(PFC_WAIT_INFINITE); +} + + +// ====================================================================== + +PSocket::PSocket(PFC_SOCKET nExistingSocket) +{ + // TODO: implement PSocket::PSocket(PFC_SOCKET nExistingSocket) +} + + +// ====================================================================== + +PSocket::~PSocket() +{ + if(m_nSocket != PFC_SOCKET_INVALID) + { + #ifdef PFC_SYSTEM_TYPE_WINDOWS + closesocket(m_nSocket); + #else + close(m_nSocket); + #endif + } +} + + +// ====================================================================== + +bool PSocket::WaitForInput() +{ + fd_set sReadSet; + + FD_ZERO(&sReadSet); + FD_SET(m_nSocket, &sReadSet); + + if(m_pTimeout != NULL) + { + m_sTimeout.tv_sec = m_nTimeoutSeconds; + m_sTimeout.tv_usec = m_nTimeoutMilliseconds; + } + + if(select(m_nSocket + 1, &sReadSet, NULL, NULL, m_pTimeout) == 1) + return true; + else + return false; +} + + +// ====================================================================== + +bool PSocket::WaitForOutput() +{ + fd_set sWriteSet; + + FD_ZERO(&sWriteSet); + FD_SET(m_nSocket, &sWriteSet); + + if(m_pTimeout != NULL) + { + m_sTimeout.tv_sec = m_nTimeoutSeconds; + m_sTimeout.tv_usec = m_nTimeoutMilliseconds; + } + + if(select(m_nSocket + 1, NULL, &sWriteSet, NULL, m_pTimeout) == 1) + return true; + else + return false; +} + + +// ====================================================================== + +bool PSocket::WaitForError() +{ + fd_set sErrorSet; + + FD_ZERO(&sErrorSet); + FD_SET(m_nSocket, &sErrorSet); + + if(m_pTimeout != NULL) + { + m_sTimeout.tv_sec = m_nTimeoutSeconds; + m_sTimeout.tv_usec = m_nTimeoutMilliseconds; + } + + if(select(m_nSocket + 1, NULL, NULL, &sErrorSet, m_pTimeout) == 1) + return true; + else + return false; +} + + +// ====================================================================== + +void PSocket::SetWaitTimeout(unsigned int nMilliseconds) +{ + if(nMilliseconds == PFC_WAIT_INFINITE) + { + m_nTimeoutSeconds = PFC_WAIT_INFINITE; + m_nTimeoutMilliseconds = 0; + + m_pTimeout = NULL; + } + else if(nMilliseconds <= 0) + { + m_nTimeoutSeconds = 0; + m_nTimeoutMilliseconds = 0; + m_pTimeout = &m_sTimeout; + } + else + { + m_nTimeoutSeconds = nMilliseconds / 1000; + m_nTimeoutMilliseconds = (nMilliseconds % 1000) * 1000; + m_pTimeout = &m_sTimeout; + } +} + + + + diff --git a/lib/pfc++/src/PString.cpp b/lib/pfc++/src/PString.cpp new file mode 100644 index 0000000..8e7ce01 --- /dev/null +++ b/lib/pfc++/src/PString.cpp @@ -0,0 +1,381 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Sunday, 27. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#include "PString.h" + + + +// ====================================================================== + +PString::PString(const char *pszValue) +{ + m_nBufferSize = PString::GetLength(pszValue); + m_nBufferSize += 1; // for terminating '\0' + m_pszString = new char[ m_nBufferSize ]; + + // TODO: check for malloc errors + + SetValue(pszValue, m_nBufferSize); +} + + +// ====================================================================== + +PString::PString(int nMaxLength, const char *pszValue) +{ + m_nBufferSize = PString::GetLength(pszValue); + + if(m_nBufferSize > nMaxLength) + m_nBufferSize = nMaxLength; + + m_nBufferSize += 1; // for terminating '\0' + m_pszString = new char[ m_nBufferSize ]; + + // TODO: check for malloc errors + + SetValue(pszValue, m_nBufferSize); +} + + +// ====================================================================== + +PString::PString(const char *pszValue, int nLength) +{ + if(nLength >= 0) + m_nBufferSize = nLength; + else + m_nBufferSize = 0; + + m_nBufferSize += 1; // for terminating '\0' + m_pszString = new char[ m_nBufferSize ]; + + // TODO: check for malloc errors + + SetValue(pszValue, m_nBufferSize); +} + + +// ====================================================================== + +PString::PString(const PString &pString) +{ + m_nBufferSize = pString.m_nBufferSize; + m_pszString = new char[ m_nBufferSize ]; + + SetValue(pString.m_pszString, pString.m_nLength); +} + + +// ====================================================================== + +PString::~PString() +{ + delete[] m_pszString; +} + + + +// ====================================================================== + +int PString::SetValue(const char *pszValue) +{ + return SetValue(pszValue, PString::GetLength(pszValue)); +} + + +// ====================================================================== + +const char* PString::GetValue() const +{ + return m_pszString; +} + + +// ====================================================================== + +int PString::SetValue(const char *pszValue, int nLength) +{ + if(pszValue == NULL || nLength <= 0) + { + m_pszString[0] = '\0'; + return 0; + } + else + { + int nCount; + + // copy string + for(nCount = 0; nCount < nLength && nCount < (m_nBufferSize - 1); nCount++) + m_pszString[nCount] = pszValue[nCount]; + + m_pszString[nCount] = '\0'; + + m_nLength = nCount; + return m_nLength; + } +} + + +// ====================================================================== +// static function + +int PString::GetLength(const char *pszString) +{ + if(pszString == NULL) + return 0; + + return strlen(pszString); +} + + +// ====================================================================== +// static function + +bool PString::Equals(const char *pszString1, const char *pszString2) +{ + if(pszString1 == NULL || pszString2 == NULL) + return false; + + if(strcmp(pszString1, pszString2) == 0) + return true; + else + return false; +} + + +// ====================================================================== +// static function + +bool PString::EqualsIgnoreCase(const char *pszString1, const char *pszString2) +{ + if(pszString1 == NULL || pszString2 == NULL) + return false; + + // TODO: improve performance + int nCount; + for(nCount = 0; pszString1[nCount] != '\0' && pszString2[nCount] != '\0'; nCount++) + { + if(tolower(pszString1[nCount]) != tolower(pszString2[nCount])) + return false; + } + + if(pszString1[nCount] == '\0' && pszString2[nCount] == '\0') + return true; + else + return false; +} + + +// ====================================================================== +// static function + +void PString::ToUpperCase(char *pszString) +{ + if(pszString == NULL) + return; + + while(*(pszString) != '\0') + { + *(pszString) = (char)toupper(*(pszString)); + + pszString++; + } +} + + +// ====================================================================== +// static function + +void PString::ToLowerCase(char *pszString) +{ + if(pszString == NULL) + return; + + while(*(pszString) != '\0') + { + *(pszString) = (char)tolower(*(pszString)); + + pszString++; + } +} + + +// ====================================================================== +// static function + +int PString::Trim(char *pszString, bool bTrimRight /* = true */, bool bTrimLeft /* = true */) +{ + if(pszString == NULL) + return 0; + + int nCount = 0; + char *pszTempOne; + char *pszTempTwo; + + if(bTrimRight == true) + { + // check for spaces & tabs + pszTempTwo = pszString; + for(nCount = 0; (*(pszTempTwo) == ' ') || (*(pszTempTwo) == '\t'); nCount++, pszTempTwo++) + ; /* do nothing */ + + if(nCount > 0) + { + if(*(pszTempTwo) == '\0') + { + // string contains only spaces + *(pszString) = '\0'; + return nCount; + } + else + { + // pszTempTwo is allready set by preceding loop + pszTempOne = pszString; + + // strip spaces & tabs + while(*(pszTempTwo) != '\0') + { + *(pszTempOne) = *(pszTempTwo); + + pszTempOne++; + pszTempTwo++; + } + } + } + } + + if(bTrimLeft == true) + { + pszTempTwo = pszString; + + if(*(pszTempTwo) != '\0') + { + // go to end + while(*(pszTempTwo) != '\0') + pszTempTwo++; + pszTempTwo--; + + // strip all spaces & tabs + while((*(pszTempTwo) == ' ') || (*(pszTempTwo) == '\t')) + { + *(pszTempTwo) = '\0'; + nCount++; + + if(pszTempTwo == pszString) + break; + + pszTempTwo--; + } + } + } + + return nCount; +} + + +// ====================================================================== +// static function + +int PString::ValueOf(int nValue, char *pszBuffer, int nBufferSize) +{ + if(pszBuffer == NULL || nBufferSize < 2) + return 0; + + int nCount = 0; + int nCurrent = 0; + + // for reversing + char cTemp; + char *pStart; + char *pEnd; + + if(nValue == 0) + { + pszBuffer[0] = '0'; + pszBuffer[1] = '\0'; + + return 1; + } + + if(nValue < 0) + { + pszBuffer[0] = '-'; + nCount++; + + // turn value to positive + nValue = -(int)nValue; + } + + // set start after the '-' + pStart = &pszBuffer[nCount]; + + + for(/* no init */; (nCount < (nBufferSize - 1)) && (nValue > 0); nCount++) + { + nCurrent = nValue % 10; // get current digit + nValue /= 10; // for next digit + + // convert to ascii char and append to string + pszBuffer[nCount] = (char) (nCurrent + '0'); + } + + if(nValue != 0) + { + // buffer to small + pszBuffer[0] = '\0'; + return 0; + } + else + { + // terminate string + pszBuffer[nCount] = '\0'; + } + + + // string is in reverse order, we might need to reverse it + if(nCount > 1) + { + pEnd = &pszBuffer[(nCount - 1)]; + + while(pStart < pEnd) + { + // swap chars + cTemp = *(pStart); + *(pStart) = *(pEnd); + *(pEnd) = cTemp; + + pStart++; + pEnd--; + } + } + + return nCount; +} + + diff --git a/lib/pfc++/src/PStringList.cpp b/lib/pfc++/src/PStringList.cpp new file mode 100644 index 0000000..da8020a --- /dev/null +++ b/lib/pfc++/src/PStringList.cpp @@ -0,0 +1,352 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Monday, 21. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#include "PStringList.h" + + + + +// ====================================================================== + +PStringList::PStringList() +{ + m_bIgnoreCase = false; + m_bUniqueItems = true; + + m_nItems = 0; + m_pFirstItem = NULL; + m_pLastItem = NULL; + m_pCurrentItem = NULL; +} + + +// ====================================================================== + +PStringList::PStringList(bool bIgnoreCase, bool bUniqueItems) +{ + m_bIgnoreCase = bIgnoreCase; + m_bUniqueItems = bUniqueItems; + + m_nItems = 0; + m_pFirstItem = NULL; + m_pLastItem = NULL; + m_pCurrentItem = NULL; +} + + +// ====================================================================== + +PStringList::~PStringList() +{ + RemoveAllItems(); +} + + +// ====================================================================== + +bool PStringList::AddItem(const char *pszString) +{ + if(pszString == NULL) + return false; + + if(m_bUniqueItems == true && FindItem(pszString) == true) + return true; + + PStringListItem *pNewItem = new PStringListItem(pszString); + + // add item to end of list + if(m_pFirstItem == NULL) + m_pFirstItem = pNewItem; + else if(m_pLastItem != NULL) + m_pLastItem->m_pNextItem = pNewItem; + + m_pLastItem = pNewItem; + + if(m_nItems == 0) + m_pCurrentItem = pNewItem; + + // increment number of elements + m_nItems++; + + return true; +} + + +// ====================================================================== + +bool PStringList::RemoveItem(const char *pszString) +{ + PStringListItem *pCurrent = NULL; + PStringListItem *pPrevious = NULL; + + for(pCurrent = m_pFirstItem; pCurrent != NULL; pCurrent = pCurrent->m_pNextItem) + { + if(pCurrent->Equals(pszString, m_bIgnoreCase) == true) + { + if(pCurrent->m_pNextItem == NULL) + m_pLastItem = pPrevious; + + if(pPrevious == NULL) + m_pFirstItem = pCurrent->m_pNextItem; + else + pPrevious->m_pNextItem = pCurrent->m_pNextItem; + + if(m_pCurrentItem == pCurrent) + m_pCurrentItem = pCurrent->m_pNextItem; + + delete pCurrent; + + m_nItems--; + + // success + return true; + } + + pPrevious = pCurrent; + } + + return false; +} + + +// ====================================================================== + +int PStringList::RemoveAllItems() +{ + int nCount; + + PStringListItem *pCurrent = NULL; + PStringListItem *pNext = NULL; + + // remove all elements + pNext = m_pFirstItem; + for(nCount = 0; pNext != NULL; nCount++) + { + pCurrent = pNext; + pNext = pNext->m_pNextItem; + + delete pCurrent; + } + + // update pointers & counter + m_pFirstItem = NULL; + m_pLastItem = NULL; + m_pCurrentItem = NULL; + m_nItems = 0; + + // return number of items deleted + return nCount; +} + + +// ====================================================================== + +bool PStringList::FindItem(const char *pszString) +{ + PStringListItem *pItem = NULL; + + for(pItem = m_pFirstItem; pItem != NULL; pItem = pItem->m_pNextItem) + { + if(pItem->Equals(pszString, m_bIgnoreCase) == true) + return true; + } + + // not found + return false; +} + + +// ====================================================================== + +bool PStringList::FindItem(const char *pszString, bool bIgnoreCase) +{ + PStringListItem *pItem = NULL; + + for(pItem = m_pFirstItem; pItem != NULL; pItem = pItem->m_pNextItem) + { + if(pItem->Equals(pszString, bIgnoreCase) == true) + return true; + } + + // not found + return false; +} + + +// ====================================================================== + +bool PStringList::PickFirst() +{ + if(m_pCurrentItem == NULL) + return false; + + m_pCurrentItem = m_pFirstItem; + + if(m_pCurrentItem != NULL) + return true; + else + return false; +} + + +// ====================================================================== + +bool PStringList::PickNext() +{ + if(m_pCurrentItem == NULL) + return false; + + m_pCurrentItem = m_pCurrentItem->m_pNextItem; + + if(m_pCurrentItem != NULL) + return true; + else + return false; +} + + +// ====================================================================== + +bool PStringList::IsCurrentEqual(const char *pszString) +{ + if(m_pCurrentItem == NULL) + return false; + else + return m_pCurrentItem->Equals(pszString, m_bIgnoreCase); +} + + +// ====================================================================== + +const char* PStringList::GetCurrent() +{ + if(m_pCurrentItem != NULL) + return m_pCurrentItem->m_pszString; + else + return NULL; +} + + + + + + + + + + + +// ====================================================================== + +PStringListItem::PStringListItem(const char *pszString) +{ + m_pNextItem = NULL; + m_nBufferSize = 0; + + SetValue(pszString); +} + + +// ====================================================================== + +PStringListItem::~PStringListItem() +{ + delete[] m_pszString; +} + + + + + +// ====================================================================== + + +int PStringListItem::SetValue(const char *pszString) +{ + int nCount; + + // get string length + for(nCount = 0; pszString[nCount] != '\0'; nCount++) + ; /* do nothing */ + + if((nCount + 1) > m_nBufferSize) + { + if(m_nBufferSize != 0) + delete[] m_pszString; + + m_nBufferSize = nCount + 1; + + // allocate some fresh'n fruity memory + m_pszString = new char[ m_nBufferSize ]; + } + + // copy string + for(nCount = 0; pszString[nCount] != '\0'; nCount++) + m_pszString[nCount] = pszString[nCount]; + m_pszString[nCount] = '\0'; + + return nCount; +} + + +// ====================================================================== + +bool PStringListItem::Equals(const char *pszString, bool bIgnoreCase) +{ + if(pszString == NULL) + return false; + + int nCount; + + // TODO: improve performance + if(bIgnoreCase == true) + { + for(nCount = 0; pszString[nCount] != '\0' && m_pszString[nCount] != '\0'; nCount++) + { + if(tolower(pszString[nCount] != tolower(m_pszString[nCount]))) + return false; + } + + if(pszString[nCount] == '\0' && m_pszString[nCount] == '\0') + return true; + else + return false; + } + else + { + if(strcmp(m_pszString, pszString) == 0) + return true; + else + return false; + } +} + + + + diff --git a/lib/pfc++/src/PUDPSocket.cpp b/lib/pfc++/src/PUDPSocket.cpp new file mode 100644 index 0000000..1c09e3d --- /dev/null +++ b/lib/pfc++/src/PUDPSocket.cpp @@ -0,0 +1,166 @@ +/* + +--------------------------------------------------------------------+ + | .............:: pastabrothers foundation classes ::............... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | This library is free software; you can redistribute it and/or | + | modify it under the terms of the GNU Lesser General Public | + | License as published by the Free Software Foundation; either | + | version 2.1 of the License, or (at your option) any later version. | + | | + | This library 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 | + | Lesser General Public License for more details. | + | | + | You should have received a copy of the GNU Lesser General Public | + | License along with this library; if not, write to the | + | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | + | Boston, MA 02111-1307, USA. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Portable C++ framework classes for linux/windows. | + +--------------------------------------------------------------------+ +*/ + + +#include "PUDPSocket.h" + + + + +// ====================================================================== + +PUDPSocket::PUDPSocket() +:PSocket(AF_INET, SOCK_DGRAM) +{ + // initialize local socket infos + m_sLocalAddress.sin_family = AF_INET; + m_sLocalAddress.sin_port = PFC_INET_PORT_ANY; + m_sLocalAddress.sin_addr.s_addr = PFC_INET_ADDR_ANY; + memset(&m_sLocalAddress.sin_zero, 0, sizeof(m_sLocalAddress.sin_zero)); + + // initialize foreign socket infos + m_sForeignAddress.sin_family = AF_INET; + m_sForeignAddress.sin_port = 0; + m_sForeignAddress.sin_addr.s_addr = 0; + memset(&m_sForeignAddress.sin_zero, 0, sizeof(m_sForeignAddress.sin_zero)); +} + + +// ====================================================================== + +PUDPSocket::~PUDPSocket() +{ +} + + +// ====================================================================== + +bool PUDPSocket::Bind(const char *pszIpAddress, pfc_inet_port nPort) +{ + return Bind(inet_addr(pszIpAddress), htons(nPort)); +} + + +// ====================================================================== + +bool PUDPSocket::Bind(pfc_inet_addr nIpAddress, pfc_inet_port nPort) +{ + if(m_nSocket != PFC_SOCKET_INVALID) + { + m_sLocalAddress.sin_port = nPort; + m_sLocalAddress.sin_addr.s_addr = nIpAddress; + + if(bind(m_nSocket, (struct sockaddr*) &m_sLocalAddress, sizeof(m_sLocalAddress)) == 0) + { + // successfully bound + m_bIsBound = true; + + return true; + } + else + { + // error + m_sLocalAddress.sin_addr.s_addr = 0; + m_sLocalAddress.sin_port = 0; + + return false; + } + } + + return false; +} + + +// ====================================================================== + +// TODO: implement bool PUDPSocket::Connect(pfc_inet_addr nIpAddress, pfc_inet_port nPort) +bool PUDPSocket::Connect(pfc_inet_addr nIpAddress, pfc_inet_port nPort) +{ + if(m_bIsBound != true) + { + if(Bind((pfc_inet_addr)PFC_INET_ADDR_ANY, (pfc_inet_port)PFC_INET_PORT_ANY) != true) + return false; + } + + return false; +} + + +// ====================================================================== + +int PUDPSocket::Send(const char *pcBuffer, int nBufferSize) +{ + if(m_bIsBound != true) + { + if(Bind((pfc_inet_addr)PFC_INET_ADDR_ANY, (pfc_inet_port)PFC_INET_PORT_ANY) != true) + return false; + } + + if(m_sForeignAddress.sin_addr.s_addr != 0 && m_sForeignAddress.sin_port != 0) + return sendto(m_nSocket, pcBuffer, nBufferSize, 0, (struct sockaddr*) &m_sForeignAddress, sizeof(m_sForeignAddress)); + else + return 0; +} + + +// ====================================================================== + +int PUDPSocket::SendTo(const char *pcBuffer, int nBufferSize, pfc_inet_addr nIpAddress, pfc_inet_port nPort) +{ + if(m_bIsBound != true) + { + if(Bind((pfc_inet_addr)PFC_INET_ADDR_ANY, (pfc_inet_port)PFC_INET_PORT_ANY) != true) + return false; + } + + if(nIpAddress != 0 && nPort != 0) + { + m_sForeignAddress.sin_addr.s_addr = nIpAddress; + m_sForeignAddress.sin_port = nPort; + + return sendto(m_nSocket, pcBuffer, nBufferSize, 0, (struct sockaddr*) &m_sForeignAddress, sizeof(m_sForeignAddress)); + } + else + return 0; +} + + +// ====================================================================== + +int PUDPSocket::Receive(char *pcBuffer, int nBufferSize) +{ + if(m_bIsBound != true) + return false; + + m_nForeignAddressLength = sizeof(m_sForeignAddress); + + return recvfrom(m_nSocket, pcBuffer, nBufferSize, 0, (struct sockaddr*) &m_sForeignAddress, &m_nForeignAddressLength); +} + + + diff --git a/missing b/missing new file mode 100755 index 0000000..0a7fb5a --- /dev/null +++ b/missing @@ -0,0 +1,283 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# 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, 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. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing 0.3 - GNU automake" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar ${1+"$@"} && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar ${1+"$@"} && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" ${1+"$@"} && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" ${1+"$@"} && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..4f58503 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/src/HLInfoList.cpp b/src/HLInfoList.cpp new file mode 100644 index 0000000..a94cd57 --- /dev/null +++ b/src/HLInfoList.cpp @@ -0,0 +1,205 @@ +/* + +--------------------------------------------------------------------+ + | ..........................:: HLMaster ::.......................... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | 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. | + | | + +--------------------------------------------------------------------+ + | Created.......: Friday, 2. November 2001 | + | Author........: Silvan Minghetti | + | Description...: Half-Life master-server deamon. | + +--------------------------------------------------------------------+ +*/ + + +#include "HLInfoList.h" + + + +// ====================================================================== + +HLInfoList::HLInfoList() +{ + m_pFirstItem = NULL; + m_pLastItem = NULL; + + m_nItems = 0; +} + + +// ====================================================================== + +HLInfoList::~HLInfoList() +{ + RemoveAllItems(); +} + + +// ====================================================================== + +int HLInfoList::RemoveAllItems() +{ + int nCount; + + HLInfoListItem *pCurrent = NULL; + HLInfoListItem *pNext = NULL; + + // remove all elements + pNext = m_pFirstItem; + for(nCount = 0; pNext != NULL; nCount++) + { + pCurrent = pNext; + pNext = pNext->m_pNextItem; + + delete pCurrent; + } + + // update pointers & counter + m_pFirstItem = NULL; + m_pLastItem = NULL; + m_nItems = 0; + + // return number of items deleted + return nCount; +} + + +// ====================================================================== + +int HLInfoList::RemoveAllUnusedItems() +{ + HLInfoListItem *pNext = NULL; + HLInfoListItem *pCurrent = NULL; + HLInfoListItem *pPrevious = NULL; + + // check all items in list + int nDeleted = 0; + pNext = m_pFirstItem; + + while(pNext != NULL) + { + pCurrent = pNext; + pNext = pNext->m_pNextItem; + + if(pCurrent->m_nReferenceCounter == 0) + { + // remove unused item + if(pCurrent->m_pNextItem == NULL) + m_pLastItem = pPrevious; + + if(pPrevious == NULL) + m_pFirstItem = pCurrent->m_pNextItem; + else + pPrevious->m_pNextItem = pCurrent->m_pNextItem; + + // delete current + delete pCurrent; + + m_nItems--; + nDeleted++; + } + else + { + // only change pPrevious, if we did not delete the current item + pPrevious = pCurrent; + } + } + + return nDeleted; +} + + +// ====================================================================== + +HLInfoListItem* HLInfoList::AddItem(const char *pszInfo) +{ + // TODO: insert alphanumerically sorted (speeds up searching) + HLInfoListItem *pNewItem; + + if(pszInfo == NULL) + return NULL; + + pNewItem = new HLInfoListItem(pszInfo); + + if(pNewItem == NULL) + return NULL; + + // add item to end of list + if(m_pFirstItem == NULL) + m_pFirstItem = pNewItem; + else if(m_pLastItem != NULL) + m_pLastItem->m_pNextItem = pNewItem; + + m_pLastItem = pNewItem; + + // increment number of elements + m_nItems++; + + // return the new item + return pNewItem; +} + + +// ====================================================================== + +HLInfoListItem* HLInfoList::GetItem(const char *pszInfo) +{ + HLInfoListItem *pTemp; + + for(pTemp = m_pFirstItem; pTemp != NULL; pTemp = pTemp->m_pNextItem) + { + if(pTemp->Equals(pszInfo) == true) + return pTemp; + } + + return NULL; +} + + + + + + +// ====================================================================== + +HLInfoListItem::HLInfoListItem(const char *pszInfo) +{ + if(pszInfo != NULL) + { + // copy string + int nCount; + + for(nCount = 0; (nCount < (int) sizeof(m_szInfoString) - 1) && pszInfo[nCount] != '\0'; nCount++) + m_szInfoString[nCount] = pszInfo[nCount]; + + m_szInfoString[nCount] = '\0'; + } + else + { + m_szInfoString[0] = 'n'; + m_szInfoString[1] = 'u'; + m_szInfoString[2] = 'l'; + m_szInfoString[3] = 'l'; + m_szInfoString[4] = '\0'; + } + + // initialize + m_nReferenceCounter = 0; + m_pListIndex = NULL; + m_pNextItem = NULL; +} diff --git a/src/HLMaster.cpp b/src/HLMaster.cpp new file mode 100644 index 0000000..ef097b2 --- /dev/null +++ b/src/HLMaster.cpp @@ -0,0 +1,1145 @@ +/* + +--------------------------------------------------------------------+ + | ..........................:: HLMaster ::.......................... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | 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. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Half-Life master-server deamon. | + +--------------------------------------------------------------------+ +*/ + +#include + +#include "HLMaster.h" +#include "HLServerList.h" +#include "PString.h" +#include "CStringBuffer.h" + +#include + + + +// ====================================================================== + +HLMaster::HLMaster(const char *pszIpAddress, unsigned short nPort, int nMaxHosts, PLogfile *pInfoLog, PLogfile *pAccessLog) +{ + // server socket + m_pServerSocket = new PUDPSocket(); + + if(m_pServerSocket->Bind(pszIpAddress, nPort) != true) + { + delete m_pServerSocket; + +#if defined PFC_SYSTEM_TYPE_WINDOWS + throw PSocketException(WSAGetLastError()); +#elif defined PFC_SYSTEM_TYPE_UNIX + throw PSocketException(errno); +#else +#error Unknown operating system. Only WIN32 / LINUX are recognized. +#endif + } + + // main server list + m_pServerList = new HLServerList(nMaxHosts, pInfoLog); + + + // server filter + m_pHostFilter = NULL; + m_pHostFilterFile = NULL; + + m_pHostListFile = NULL; + + // logfiles + m_pInfoLog = pInfoLog; + m_pAccessLog = pAccessLog; + + + m_nLastInterval = 0; + m_nLastRequest = 0; + m_nCurrentTimestamp = 0; + + m_bRequestQueueFinished = false; + + // initialize buffer stuff + m_nBufferLength = 0; + m_nForeignAddress = 0; + m_nForeignPort = 0; + + + SetServerId(0); + SetServerName(NULL); +} + + +// ====================================================================== + +HLMaster::~HLMaster() +{ + if(m_pHostFilter != NULL) + delete m_pHostFilter; + if(m_pHostFilterFile != NULL) + delete m_pHostFilterFile; + if(m_pHostListFile != NULL) + delete m_pHostListFile; + + delete m_pServerList; + delete m_pServerSocket; +} + + +// ====================================================================== +// WARNING: these times are calculated. Change only if you know what you do! +// +// In 300 seconds, 3000 servers can be queried for status info with a request +// interval of 10 seconds. 3000 servers is the limit of static servers. +// +const time_t HLMaster::c_CHECK_TIMEOUT = 9 * 60; // 9 minutes (540 seconds) +const time_t HLMaster::c_CHECK_INTERVAL = 5 * 60; // 5 minutes (300 seconds) +const time_t HLMaster::c_REQUEST_INTERVAL = 10; // 10 seconds + + +// ====================================================================== + +const char HLMaster::m_pPackage_Challenge[] = { '\xff', '\xff', '\xff', '\xff', 's', '\n' }; +const int HLMaster::m_nPkgSize_Challenge = sizeof(HLMaster::m_pPackage_Challenge); + +const char HLMaster::m_pPackage_Ping[] = { '\xff', '\xff', '\xff', '\xff', 'j', '\r', '\n', '\0' }; +const int HLMaster::m_nPkgSize_Ping = sizeof(HLMaster::m_pPackage_Ping); + +const char HLMaster::m_pPackage_Servername[]= { '\xff', '\xff', '\xff', '\xff', 'h', '\r', '\n' }; +const int HLMaster::m_nPkgSize_Servername = sizeof(HLMaster::m_pPackage_Servername); + +const char HLMaster::m_pPackage_List_Type1[]= { '\xff', '\xff', '\xff', '\xff', 'd', '\n' }; +const int HLMaster::m_nPkgSize_List_Type1 = sizeof(HLMaster::m_pPackage_List_Type1); + +const char HLMaster::m_pPackage_List_Type2[]= { '\xff', '\xff', '\xff', '\xff', 'f', '\r' }; +const int HLMaster::m_nPkgSize_List_Type2 = sizeof(HLMaster::m_pPackage_List_Type2); + +const char HLMaster::m_pPackage_List_Auth[] = { '\xff', '\xff', '\xff', '\xff', 'w', '\r', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' }; +const int HLMaster::m_nPkgSize_List_Auth = sizeof(HLMaster::m_pPackage_List_Auth); + +const char HLMaster::m_pPackage_Req_Details[]= { '\xff', '\xff', '\xff', '\xff', 'd', 'e', 't', 'a', 'i', 'l', 's' }; +const int HLMaster::m_nPkgSize_Req_Details = sizeof(HLMaster::m_pPackage_Req_Details); + +// ====================================================================== + +const char HLMaster::c_OSTYPE_UNKNOWN = 0; +const char HLMaster::c_OSTYPE_WINDOWS = 1; +const char HLMaster::c_OSTYPE_LINUX = 2; + + +// ====================================================================== + +void HLMaster::SetServerName(const char *pszName) +{ + if(pszName == NULL) + { + m_szServerName[0] = '\0'; + } + else + { + int nCount; + for(nCount = 0; nCount < ((int)sizeof(m_szServerName) - 1) && pszName[nCount] != '\0'; nCount++) + m_szServerName[nCount] = pszName[nCount]; + + m_szServerName[nCount] = '\0'; + } +} + + +// ====================================================================== + +int HLMaster::GetServerName(char *pszBuffer, int nBufferSize) +{ + if(nBufferSize < 1) + return 0; + + int nCount; + for(nCount = 0; nCount < (nBufferSize - 1) && m_szServerName[nCount] != '\0'; nCount++) + pszBuffer[nCount] = m_szServerName[nCount]; + + pszBuffer[nCount] = '\0'; + + return nCount; +} + + +// ====================================================================== + +void HLMaster::EnableHostFilter() +{ + if(m_pHostFilter == NULL) + m_pHostFilter = new HLServerFilterList(); +} + + +// ====================================================================== + +void HLMaster::DisableHostFilter() +{ + if(m_pHostFilter != NULL) + { + delete m_pHostFilter; + m_pHostFilter = NULL; + } +} + + +// ====================================================================== + +bool HLMaster::LoadHostFilter(const char *pszFilename) +{ + int nLoaded; + + if(m_pHostFilter == NULL) + m_pHostFilter = new HLServerFilterList(); + + if(m_pHostFilterFile == NULL) + m_pHostFilterFile = new PString(PFC_MAX_PATH, pszFilename); + else + m_pHostFilterFile->SetValue(pszFilename); + + nLoaded = m_pHostFilter->Load(m_pHostFilterFile->GetValue(), m_pInfoLog); + if(nLoaded >= 0) + { + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + m_pInfoLog->Append("Successfully loaded "); + m_pInfoLog->Append(nLoaded); + m_pInfoLog->Append(" filters from file <"); + m_pInfoLog->Append(m_pHostFilterFile->GetValue()); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } + + return true; + } + else + { + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_WARNING) == true) + { + m_pInfoLog->Append("Failed to load filters from file <"); + m_pInfoLog->Append(m_pHostFilterFile->GetValue()); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } + + return false; + } +} + + +// ====================================================================== + +bool HLMaster::LoadHosts(const char *pszFilename) +{ + int nLoaded = 0; + + if(m_pHostListFile == NULL) + m_pHostListFile = new PString(PFC_MAX_PATH, pszFilename); + else + m_pHostListFile->SetValue(pszFilename); + + nLoaded = m_pServerList->LoadHosts(m_pHostListFile->GetValue()); + if(nLoaded >= 0) + { + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + m_pInfoLog->Append("Successfully loaded "); + m_pInfoLog->Append(nLoaded); + m_pInfoLog->Append(" servers from file <"); + m_pInfoLog->Append(m_pHostListFile->GetValue()); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } + + return true; + } + else + { + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_WARNING) == true) + { + m_pInfoLog->Append("Failed to load servers from file <"); + m_pInfoLog->Append(m_pHostListFile->GetValue()); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } + + return false; + } +} + + +// ====================================================================== + +bool HLMaster::ReloadHostFilter() +{ + if(m_pHostFilter == NULL || m_pHostFilterFile == NULL) + return false; + + if(m_pHostFilter->Load(m_pHostFilterFile->GetValue()) >= 0) + return true; + else + return false; +} + + +// ====================================================================== + +bool HLMaster::ReloadHosts() +{ + if(m_pHostListFile == NULL) + return false; + + if(m_pServerList->LoadHosts(m_pHostListFile->GetValue()) >= 0) + return true; + else + return false; +} + + +// ====================================================================== + +time_t HLMaster::GetIntervalRemaining(time_t nTimestamp) +{ + if(nTimestamp == m_nLastInterval) + return HLMaster::c_CHECK_INTERVAL; + + // check for error + if(m_nLastInterval > nTimestamp) + m_nLastInterval = nTimestamp; + + // calculate remaining time + nTimestamp = (nTimestamp - m_nLastInterval); + + if(nTimestamp < HLMaster::c_CHECK_INTERVAL) + return (HLMaster::c_CHECK_INTERVAL - nTimestamp); + else + return 0; +} + + +// ====================================================================== + +time_t HLMaster::GetRequestIntervalRemaining(time_t nTimestamp) +{ + if(nTimestamp == m_nLastRequest) + return HLMaster::c_REQUEST_INTERVAL; + + // check for error + if(m_nLastRequest > nTimestamp) + m_nLastRequest = nTimestamp; + + // calculate remaining time + nTimestamp = (nTimestamp - m_nLastRequest); + + if(nTimestamp < HLMaster::c_REQUEST_INTERVAL) + return (HLMaster::c_REQUEST_INTERVAL - nTimestamp); + else + return 0; +} + + +// ====================================================================== + +void HLMaster::SendDetailsRequest(HLServerListItem *pItem) +{ + // send details request + + // create details request package + memcpy(m_szBuffer, m_pPackage_Req_Details, m_nPkgSize_Req_Details); + + m_pServerSocket->SendTo(m_szBuffer, m_nPkgSize_Req_Details, pItem->m_nIpAddress, pItem->m_nPort); +} + + +// ====================================================================== + +bool HLMaster::WaitForInput() +{ + bool bReady; + + time_t nCurrentTime; + time_t nTimeout; + time_t nRequestTimeout = HLMaster::c_CHECK_INTERVAL; + + time(&nCurrentTime); + + nTimeout = GetIntervalRemaining(nCurrentTime); + if(nTimeout == 0) + { + m_pServerList->CheckTimeout(nCurrentTime, this); + + m_nLastInterval = nCurrentTime; + nTimeout = HLMaster::c_CHECK_INTERVAL; + + m_bRequestQueueFinished = false; + } + + + if(m_pHostListFile != NULL && m_bRequestQueueFinished == false) + { + nRequestTimeout = GetRequestIntervalRemaining(nCurrentTime); + if(nRequestTimeout == 0) + { + m_bRequestQueueFinished = m_pServerList->RequestStatus(nCurrentTime, this); + if(m_bRequestQueueFinished == true) + { + // queue finished + nRequestTimeout = HLMaster::c_CHECK_INTERVAL; + } + else + { + nRequestTimeout = HLMaster::c_REQUEST_INTERVAL; + } + + m_nLastRequest = nCurrentTime; + } + } + + + if(m_pServerList->GetNumItems() > 0) + { + // wait until timeout + if(nRequestTimeout < nTimeout) + nTimeout = nRequestTimeout; + + m_pServerSocket->SetWaitTimeout(nTimeout * 1000); + + #ifdef _DEBUG + printf("Sleep for %d seconds...(num_hosts=%d)\n", (int)nTimeout, (int)m_pServerList->GetNumItems()); + #endif + bReady = m_pServerSocket->WaitForInput(); + } + else + { + // wait 'forever' + m_pServerSocket->SetWaitTimeout(PFC_WAIT_INFINITE); + + #ifdef _DEBUG + printf("Sleep for undefined amount of time (list is empty)...\n"); + #endif + bReady = m_pServerSocket->WaitForInput(); + + // reset interval + time(&m_nLastInterval); + time(&m_nLastRequest); + } + + + return bReady; +} + + +// ====================================================================== + +bool HLMaster::ReadInput() +{ + // read input + m_nBufferLength = m_pServerSocket->Receive(m_szBuffer, sizeof(m_szBuffer)); + + m_nForeignAddress = m_pServerSocket->GetForeignAddress(); + m_nForeignPort = m_pServerSocket->GetForeignPort(); + + m_nCurrentTimestamp = time(NULL); + + // read error? + if(m_nBufferLength < 0) + m_nBufferLength = 0; + + if(m_nBufferLength > 0) + return true; + else + return false; +} + + +// ====================================================================== + +void HLMaster::ProcessInput(time_t nTimestamp) +{ + if(m_nBufferLength <= 0) + return; + + // ignore stupid packages + if(m_nForeignAddress == PFC_INET_ADDR_ANY || m_nForeignAddress == PFC_INET_ADDR_BROADCAST) + { + // do not accept packages sent from a broadcast address + return; + } + if(m_nForeignAddress == m_pServerSocket->GetLocalAddress() && m_nForeignPort == m_pServerSocket->GetLocalPort()) + { + // do not accept packages sent from 'us' + return; + } + + + // check request + if(m_szBuffer[0] == 'q') + { + ProcessHeartbeat(); + } + else if((m_nBufferLength > 2) && (m_szBuffer[0] == '0') && (m_szBuffer[1] == 10)) + { + ProcessChallenge(); + } + else if(m_szBuffer[0] == 'b') + { + ProcessLogoff(); + } + else if(m_szBuffer[0] == 'c') + { + ProcessListRequest(); + } + else if(m_szBuffer[0] == 'e' || m_szBuffer[0] == '1') + { + if(m_nBufferLength < 5) + return; + + // NOTE: the '1' is used by a new protocol, which + // might send a filter request - but I'm not + // going to handle filgering right now. + ProcessEnhancedListRequest(); + } + else if(m_szBuffer[0] == 'v') + { + ProcessAuthServerListRequest(); + } + else if((*((unsigned int*) &m_szBuffer[0]) == 0xFFFFFFFF) && (m_szBuffer[4] == 'm')) + { + ProcessDetailsReply(); + } + else if(m_szBuffer[0] == 'g') + { + ProcessNameRequest(); + } + else if(m_szBuffer[0] == 'i') + { + ProcessPingRequest(); + } +#ifdef _DEBUG + else if(m_szBuffer[0] == 's') + { + // DEBUG ONLY - Log a snapshot of the + // current list + m_pServerList->LogSnapshot(); + } +#endif // _DEBUG + else + { + ProcessInvalidQuery(); + } +} + + + +// ====================================================================== + +void HLMaster::ProcessHeartbeat() +{ + // halflife-server sent heartbeat + if((m_pHostFilter != NULL) && (m_pHostFilter->IsAllowed(m_nForeignAddress) != true)) + return; + + HLServerListItem *pItem = m_pServerList->HeartBeat(m_nForeignAddress, m_nForeignPort, m_nCurrentTimestamp); + + if(pItem != NULL) + { + // send ack (challenge request), we will receive another packet after that... + + // create ack package + memcpy(m_szBuffer, m_pPackage_Challenge, m_nPkgSize_Challenge); + + // copy m_nChallenge to m_szBuffer + *((int*) (m_szBuffer + m_nPkgSize_Challenge)) = pItem->m_nChallengeId; + + m_pServerSocket->Send(m_szBuffer, m_nPkgSize_Challenge + sizeof(pItem->m_nChallengeId)); + } +} + + +// ====================================================================== + +void HLMaster::ProcessChallenge() +{ + if((m_pHostFilter != NULL) && (m_pHostFilter->IsAllowed(m_nForeignAddress) != true)) + return; + + // halflife-server sent challenge (after heartbeat) + if(ParseChallengeString(m_szBuffer + 2, m_nBufferLength - 2) == true) + { + m_pServerList->Challenge(m_nForeignAddress, m_nForeignPort, m_nCurrentTimestamp, m_nChallenge_Id, m_nChallenge_Protocol, m_nChallenge_Players, m_nChallenge_MaxPlayers, m_nChallenge_OsType, m_bChallenge_Dedicated, m_bChallenge_Password, m_bChallenge_Lan, m_szChallenge_GameDir, m_szChallenge_MapName); + } +} + + +// ====================================================================== + +bool HLMaster::ParseChallengeString(const char *pszChallenge, const int nChallengeSize) +{ + // reset temp challenge infos + m_szChallenge_VarName[0] = '\0'; + m_szChallenge_VarValue[0]= '\0'; + + m_nChallenge_Id = 0; + m_nChallenge_Protocol = 0; + + m_nChallenge_Players = 0; + m_nChallenge_MaxPlayers = 0; + + m_nChallenge_OsType = HLMaster::c_OSTYPE_UNKNOWN; + m_bChallenge_Dedicated = false; + m_bChallenge_Password = false; + m_bChallenge_Lan = false; + + m_szChallenge_GameDir[0] = '\0'; + m_szChallenge_MapName[0] = '\0'; + + + // parse challenge string + char *pcCurrent = (char*) pszChallenge; + + if(*(pcCurrent) == '\\') + { + // skip first '\' + pcCurrent++; + int nCount = 1; + + int nFilter = 0; + int nStringCount = 0; + + while(nCount < nChallengeSize) + { + // check for end of challenge string + if((nCount == nChallengeSize - 1) || *(pcCurrent) == 10 || *(pcCurrent) == 13 || *(pcCurrent) == '\0') + { + if(nFilter != 1) + break; + + // unexpected end of variable found + m_szChallenge_VarValue[nStringCount] = '\0'; + + nStringCount = 0; + nFilter = 2; + + // increment counters + nCount++; + pcCurrent++; + } + + if(nFilter == 0) + { + // name + if(*(pcCurrent) == '\\') + { + if(nStringCount == 0) + continue; + + // end of name found + m_szChallenge_VarName[nStringCount] = '\0'; + m_szChallenge_VarValue[0] = '\0'; + + nStringCount = 0; + nFilter++; + } + else if(nStringCount < ((int) sizeof(m_szChallenge_VarName) - 1)) + { + // append char to variable name + m_szChallenge_VarName[nStringCount] = *(pcCurrent); + nStringCount++; + } + + // increment counters + nCount++; + pcCurrent++; + } + else if(nFilter == 1) + { + // value + if(*(pcCurrent) == '\\') + { + // end of value found + m_szChallenge_VarValue[nStringCount] = '\0'; + + nStringCount = 0; + nFilter++; + } + else if(nStringCount < ((int) sizeof(m_szChallenge_VarValue) - 1)) + { + // append char to variable value + m_szChallenge_VarValue[nStringCount] = *(pcCurrent); + nStringCount++; + } + + // increment counters + nCount++; + pcCurrent++; + } + else if(nFilter == 2) + { + // name & value found, check and save it + if(strcmp(m_szChallenge_VarName, "protocol") == 0) // protocol + m_nChallenge_Protocol = (char) atoi(m_szChallenge_VarValue); + else if(strcmp(m_szChallenge_VarName, "challenge") == 0) // challenge id + m_nChallenge_Id = atoi(m_szChallenge_VarValue); + else if(strcmp(m_szChallenge_VarName, "players") == 0) // number of players + m_nChallenge_Players = atoi(m_szChallenge_VarValue); + else if(strcmp(m_szChallenge_VarName, "max") == 0) // max players + m_nChallenge_MaxPlayers = atoi(m_szChallenge_VarValue); + else if(strcmp(m_szChallenge_VarName, "gamedir") == 0) // gamedirectory + { + for(nStringCount = 0; nStringCount < ((int) sizeof(m_szChallenge_GameDir) - 1) && m_szChallenge_VarValue[nStringCount] != '\0'; nStringCount++) + m_szChallenge_GameDir[nStringCount] = m_szChallenge_VarValue[nStringCount]; + + m_szChallenge_GameDir[nStringCount] = '\0'; + nStringCount = 0; + } + else if(strcmp(m_szChallenge_VarName, "map") == 0) // mapname + { + for(nStringCount = 0; nStringCount < ((int) sizeof(m_szChallenge_MapName) - 1) && m_szChallenge_VarValue[nStringCount] != '\0'; nStringCount++) + m_szChallenge_MapName[nStringCount] = m_szChallenge_VarValue[nStringCount]; + + m_szChallenge_MapName[nStringCount] = '\0'; + nStringCount = 0; + } + else if(strcmp(m_szChallenge_VarName, "type") == 0) // type d=dedicated + { + if(*(m_szChallenge_VarValue) == 'd') + m_bChallenge_Dedicated = true; + else + m_bChallenge_Dedicated = false; + } + else if(strcmp(m_szChallenge_VarName, "password") == 0) // password protected? + { + if(*(m_szChallenge_VarValue) == '1') + m_bChallenge_Password = true; + else + m_bChallenge_Password = false; + } + else if(strcmp(m_szChallenge_VarName, "os") == 0) // w=windows, l=linux + { + if(*(m_szChallenge_VarValue) == 'w') + m_nChallenge_OsType = HLMaster::c_OSTYPE_WINDOWS; + else + m_nChallenge_OsType = HLMaster::c_OSTYPE_LINUX; + } + else if(strcmp(m_szChallenge_VarName, "lan") == 0) // lan? + { + if(*(m_szChallenge_VarValue) == '1') + m_bChallenge_Lan = true; + else + m_bChallenge_Lan = false; + } + else + { + // unknown variable + } + + + nFilter = 0; + } + } + + // finished parsing + return true; + } + else + { + // bad challenge string? + // has to begin with '\' + return false; + } +} + + +// ====================================================================== + +bool HLMaster::ParseDetailsString(const char *pszDetails, const int nDetailsSize) +{ + // reset temp challenge infos + m_nChallenge_Id = 0; + m_nChallenge_Protocol = 0; + + m_nChallenge_Players = 0; + m_nChallenge_MaxPlayers = 0; + + m_nChallenge_OsType = HLMaster::c_OSTYPE_UNKNOWN; + m_bChallenge_Dedicated = false; + m_bChallenge_Password = false; + m_bChallenge_Lan = false; + + m_szChallenge_GameDir[0] = '\0'; + m_szChallenge_MapName[0] = '\0'; + + + int nCount; + int nStringCount; + char* pcCurrent = (char*) pszDetails; + + // server ip/port (not interesting) + for(nCount = 0; (nCount < nDetailsSize) && (*(pcCurrent) != '\0'); nCount++, pcCurrent++) + ; // do nothing, just skip + pcCurrent++; + nCount++; + + // server name (not interesting) + for( ; (nCount < nDetailsSize) && (*(pcCurrent) != '\0'); nCount++, pcCurrent++) + ; // do nothing, just skip + pcCurrent++; + nCount++; + + // map name + for(nStringCount = 0; (nCount < nDetailsSize) && (*(pcCurrent) != '\0'); nCount++, pcCurrent++) + { + if(nStringCount < ((int)sizeof(m_szChallenge_MapName) - 1)) + m_szChallenge_MapName[nStringCount++] = *(pcCurrent); + } + m_szChallenge_MapName[nStringCount] = '\0'; + pcCurrent++; + nCount++; + + // game directory + for(nStringCount = 0; (nCount < nDetailsSize) && (*(pcCurrent) != '\0'); nCount++, pcCurrent++) + { + if(nStringCount < ((int)sizeof(m_szChallenge_GameDir) - 1)) + m_szChallenge_GameDir[nStringCount++] = *(pcCurrent); + } + m_szChallenge_GameDir[nStringCount] = '\0'; + pcCurrent++; + nCount++; + + // game name (not interesting) + for( ; (nCount < nDetailsSize) && (*(pcCurrent) != '\0'); nCount++, pcCurrent++) + ; // do nothing, just skip + pcCurrent++; + nCount++; + + // number of players + if(nCount < nDetailsSize) + { + m_nChallenge_Players = *(pcCurrent); + pcCurrent++; + nCount++; + } + + // max number of players + if(nCount < nDetailsSize) + { + m_nChallenge_MaxPlayers = *(pcCurrent); + pcCurrent++; + nCount++; + } + + // protocol version + if(nCount < nDetailsSize) + { + m_nChallenge_Protocol = *(pcCurrent); + pcCurrent++; + nCount++; + } + + // type of server (l=listen, d=dedicated) + if(nCount < nDetailsSize) + { + if(*(pcCurrent) == 'd') + m_bChallenge_Dedicated = true; + pcCurrent++; + nCount++; + } + + // os of server (l=linux, w=windows) + if(nCount < nDetailsSize) + { + if(*(pcCurrent) == 'l') + m_nChallenge_OsType = HLMaster::c_OSTYPE_LINUX; + else if(*(pcCurrent) == 'w') + m_nChallenge_OsType = HLMaster::c_OSTYPE_WINDOWS; + pcCurrent++; + nCount++; + } + + // password on server (0=no, 1=yes) + if(nCount < nDetailsSize) + { + if(*(pcCurrent) == 1) + m_bChallenge_Password = true; + pcCurrent++; + nCount++; + } + + + // there is some more - not interesting - stuff + // if we're not coming that far, there is an error... + if(nCount < nDetailsSize) + return true; + else + return false; +} + + +// ====================================================================== + +void HLMaster::ProcessDetailsReply() +{ + // server replied details packet + /* + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_DEBUG) == true) + { + m_pInfoLog->Append("ServerInfo (type=details) <"); + m_pInfoLog->Append(m_pServerSocket->GetForeignAddressString()); + m_pInfoLog->Append(':'); + m_pInfoLog->Append((int)ntohs(m_nForeignPort)); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } + */ + + if(m_nBufferLength <= 5) + return; + + if(ParseDetailsString(&m_szBuffer[5], m_nBufferLength - 5) == true) + { + m_pServerList->UpdateDetails(m_nForeignAddress, m_nForeignPort, m_nCurrentTimestamp, m_nChallenge_Protocol, m_nChallenge_Players, m_nChallenge_MaxPlayers, m_nChallenge_OsType, m_bChallenge_Dedicated, m_bChallenge_Password, m_bChallenge_Lan, m_szChallenge_GameDir, m_szChallenge_MapName); + } +} + + +// ====================================================================== + +void HLMaster::ProcessLogoff() +{ + // halflife-server sent logoff + if((m_pHostFilter != NULL) && (m_pHostFilter->IsAllowed(m_nForeignAddress) != true)) + return; + + if(m_pServerList->Logoff(m_nForeignAddress, m_nForeignPort) != true) + return; + + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + m_pInfoLog->Append("ServerInfo (type=logoff) <"); + m_pInfoLog->Append(m_pServerSocket->GetForeignAddressString()); + m_pInfoLog->Append(':'); + m_pInfoLog->Append((int)ntohs(m_nForeignPort)); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } +} + + +// ====================================================================== + +void HLMaster::ProcessListRequest() +{ + // client asks for: list (binary format, quakeworld protcol) + if(m_pAccessLog != NULL && m_pAccessLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + m_pAccessLog->Append("Request (type=list1) <"); + m_pAccessLog->Append(m_pServerSocket->GetForeignAddressString()); + m_pAccessLog->Append(':'); + m_pAccessLog->Append((int)ntohs(m_nForeignPort)); + m_pAccessLog->Append('>'); + + m_pAccessLog->End(); + } + + int nSize = 0; + + memcpy(m_szBuffer, m_pPackage_List_Type1, m_nPkgSize_List_Type1); + + // get the list + nSize = m_pServerList->FillPacket_Quakeworld(m_szBuffer + m_nPkgSize_List_Type1, sizeof(m_szBuffer) - m_nPkgSize_List_Type1); + + m_pServerSocket->Send(m_szBuffer, m_nPkgSize_List_Type1 + nSize); +} + + +void HLMaster::ProcessAuthServerListRequest() +{ + // the halflife ingame browser ask's for a list of + // auth servers. + /* + if(m_pAccessLog != NULL && m_pAccessLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + m_pAccessLog->Append("Request (type=authlist) <"); + m_pAccessLog->Append(m_pServerSocket->GetForeignAddressString()); + m_pAccessLog->Append(':'); + m_pAccessLog->Append((int)ntohs(m_nForeignPort)); + m_pAccessLog->Append('>'); + + m_pAccessLog->End(); + } + */ + + // normally, we would send a list of auth servers + // but we actually don't know'em so we just send zero's + memcpy(m_szBuffer, m_pPackage_List_Auth, m_nPkgSize_List_Auth); + + m_pServerSocket->Send(m_szBuffer, m_nPkgSize_List_Auth); +} + +// ====================================================================== + +void HLMaster::ProcessEnhancedListRequest() +{ + // client asks for: list (binary format, halflife protocol, up to 65535 servers) + int nSize = 0; + int nSkip = 0; + + bool bHasMore = false; + unsigned short nSkippedItems = 0; + + + // check, how many items to skip (primitive, but works for now) + if(m_nBufferLength >= 3) + nSkip = ntohs(*((unsigned short*) &m_szBuffer[1])); + +#ifdef _DEBUG + if(m_pAccessLog != NULL && m_pAccessLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + m_pAccessLog->Append("Request (type=list2 skip="); + m_pAccessLog->Append(nSkip); + m_pAccessLog->Append(") <"); + m_pAccessLog->Append(m_pServerSocket->GetForeignAddressString()); + m_pAccessLog->Append(':'); + m_pAccessLog->Append((int)ntohs(m_nForeignPort)); + m_pAccessLog->Append('>'); + + m_pAccessLog->End(); + } +#else + if(m_pAccessLog != NULL && m_pAccessLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + m_pAccessLog->Append("Request (type=list2) <"); + m_pAccessLog->Append(m_pServerSocket->GetForeignAddressString()); + m_pAccessLog->Append(':'); + m_pAccessLog->Append((int)ntohs(m_nForeignPort)); + m_pAccessLog->Append('>'); + + m_pAccessLog->End(); + } +#endif + + // create packet + memcpy(m_szBuffer, m_pPackage_List_Type2, m_nPkgSize_List_Type2); + + // get the list + // skip 4 bytes (required for num items, \0\0) + nSize = m_pServerList->FillPacket_Halflife(nSkip, &m_szBuffer[(m_nPkgSize_List_Type2 + 4)], (sizeof(m_szBuffer) - m_nPkgSize_List_Type2 - 4), &nSkippedItems, &bHasMore); + + // write the 4 bytes skipped before + if(bHasMore == true) + { + // write number of items to skip into packet + *((unsigned short*) &m_szBuffer[m_nPkgSize_List_Type2]) = htons(nSkippedItems); + } + else + { + // 0 marks the end of the server list + *((unsigned short*) &m_szBuffer[m_nPkgSize_List_Type2]) = 0; + } + m_szBuffer[m_nPkgSize_List_Type2 + 2] = 0; + m_szBuffer[m_nPkgSize_List_Type2 + 3] = 0; + + + m_pServerSocket->Send(m_szBuffer, m_nPkgSize_List_Type2 + nSize + 4); +} + + +// ====================================================================== + +void HLMaster::ProcessNameRequest() +{ + // client asks for: servername + int nSize = 0; + + if(m_pAccessLog != NULL && m_pAccessLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + m_pAccessLog->Append("Request (type=servername) <"); + m_pAccessLog->Append(m_pServerSocket->GetForeignAddressString()); + m_pAccessLog->Append(':'); + m_pAccessLog->Append((int)ntohs(m_nForeignPort)); + m_pAccessLog->Append('>'); + + m_pAccessLog->End(); + } + + // create packet + memcpy(m_szBuffer, m_pPackage_Servername, m_nPkgSize_Servername); + + // append name + nSize = GetServerName(&m_szBuffer[m_nPkgSize_Servername], sizeof(m_szBuffer) - m_nPkgSize_Servername); + // GetServerName() returns size without terminating '\0' + nSize ++; + + // append "\r\n\0" + memcpy(&m_szBuffer[m_nPkgSize_Servername + nSize], "\r\n", sizeof("\r\n")); + + m_pServerSocket->Send(m_szBuffer, (m_nPkgSize_Servername + nSize + sizeof("\r\n"))); +} + + +// ====================================================================== + +void HLMaster::ProcessPingRequest() +{ + if(m_pAccessLog != NULL && m_pAccessLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + m_pAccessLog->Append("Request (type=ping) <"); + m_pAccessLog->Append(m_pServerSocket->GetForeignAddressString()); + m_pAccessLog->Append(':'); + m_pAccessLog->Append((int)ntohs(m_nForeignPort)); + m_pAccessLog->Append('>'); + + m_pAccessLog->End(); + } + + // client asks for: ping + // NOTE: im not shure about that + m_pServerSocket->Send(m_pPackage_Ping, m_nPkgSize_Ping); +} + + +// ====================================================================== + +void HLMaster::ProcessInvalidQuery() +{ + // invalid query, ignore + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_DEBUG) == true) + { + m_pInfoLog->Append("Invalid query <"); + m_pInfoLog->Append(m_pServerSocket->GetForeignAddressString()); + m_pInfoLog->Append(':'); + m_pInfoLog->Append((int)ntohs(m_nForeignPort)); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } +} + + + diff --git a/src/HLServerFilterList.cpp b/src/HLServerFilterList.cpp new file mode 100644 index 0000000..8f9ddde --- /dev/null +++ b/src/HLServerFilterList.cpp @@ -0,0 +1,529 @@ +/* + +--------------------------------------------------------------------+ + | ..........................:: HLMaster ::.......................... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | 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. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Half-Life master-server deamon. | + +--------------------------------------------------------------------+ +*/ + + + +#include "HLServerFilterList.h" +#include "PSocket.h" +#include "CStringBuffer.h" + +#include +#include + + +// ====================================================================== + +HLServerFilterList::HLServerFilterList() +{ + m_nItems = 0; + m_pFirstItem = NULL; + m_bOrderAllow = false; + m_bDefaultAllow = false; +} + +// ====================================================================== + +HLServerFilterList::~HLServerFilterList() +{ + RemoveAll(); +} + + + +// ====================================================================== + +int HLServerFilterList::Load(const char *pszFilename, PLogfile *pLogfile /* = NULL */) +{ + if(pszFilename == NULL) + return -1; + + + FILE *pFile; + char szBuffer[64]; + char *pBuffer; + bool bLastLineFinished; + + int nCount; + int nLoaded; + bool bAllow; + char szIpAddress[16]; + char szNetmask[16]; + + pfc_inet_addr nIpAddress; + pfc_inet_addr nNetmask; + + + pFile = fopen(pszFilename, "r"); + if(pFile != NULL) + { + // reset filter + RemoveAll(); + + SetOrderDeny(); + SetDefaultDeny(); + + + nLoaded = 0; + bLastLineFinished = true; + + while(feof(pFile) == 0) + { + if(fgets(szBuffer, sizeof(szBuffer), pFile) == NULL) + break; + + if(szBuffer[0] == '\0') + { + // blank line, this shouldnt happen + bLastLineFinished = true; + continue; + } + + pBuffer = szBuffer + (strlen(szBuffer) - 1); + if(*(pBuffer) == '\n') + { + // skip, we're continuing a long line... + if(bLastLineFinished == false) + { + bLastLineFinished = true; + continue; + } + else + bLastLineFinished = true; + } + else + { + // skip, we're continuing a long line... + if(bLastLineFinished == false) + continue; + else + bLastLineFinished = false; + } + + + for(pBuffer = szBuffer; (*(pBuffer) != '\0') && ((*(pBuffer) == ' ') || (*(pBuffer) == '\t') || (*(pBuffer) == '\n') || (*(pBuffer) == '\r')); pBuffer++) + ; // do nothing, just skip whitespaces, newlines, carriage returns + + // skip comments + if((*(pBuffer) == '\0') || (*(pBuffer) == '#')) + continue; + + if(strncmp("deny", pBuffer, (sizeof("deny") - 1)) == 0) + { + bAllow = false; + pBuffer += sizeof("deny"); + } + else if(strncmp("allow", pBuffer, (sizeof("allow") - 1)) == 0) + { + bAllow = true; + pBuffer += sizeof("allow"); + } + else if(strncmp("order", pBuffer, (sizeof("order") - 1)) == 0) + { + pBuffer += sizeof("order"); + + for( /* no init*/ ; (*(pBuffer) != '\0') && ((*(pBuffer) == ' ') || (*(pBuffer) == '\t') || (*(pBuffer) == '\n') || (*(pBuffer) == '\r')); pBuffer++) + ; // do nothing, just skip whitespaces, newlines, carriage returns + + if(strncmp("allow", pBuffer, (sizeof("allow") - 1)) == 0) + { + if(pLogfile != NULL) + pLogfile->WriteLine("Loaded filter rule (order=allow)", PLogfile::c_LEVEL_DEBUG); + + SetOrderAllow(); + } + else if(strncmp("deny", pBuffer, (sizeof("deny") - 1)) == 0) + { + if(pLogfile != NULL) + pLogfile->WriteLine("Loaded filter rule (order=deny)", PLogfile::c_LEVEL_DEBUG); + + SetOrderDeny(); + } + + continue; + } + else if(strncmp("default", pBuffer, (sizeof("default") - 1)) == 0) + { + pBuffer += sizeof("default"); + + for( /* no init*/ ; (*(pBuffer) != '\0') && ((*(pBuffer) == ' ') || (*(pBuffer) == '\t') || (*(pBuffer) == '\n') || (*(pBuffer) == '\r')); pBuffer++) + ; // do nothing, just skip whitespaces, newlines, carriage returns + + if(strncmp("allow", pBuffer, (sizeof("allow") - 1)) == 0) + { + if(pLogfile != NULL) + pLogfile->WriteLine("Loaded filter rule (default=allow)", PLogfile::c_LEVEL_DEBUG); + + SetDefaultAllow(); + } + else if(strncmp("deny", pBuffer, (sizeof("deny") - 1)) == 0) + { + if(pLogfile != NULL) + pLogfile->WriteLine("Loaded filter rule (default=deny)", PLogfile::c_LEVEL_DEBUG); + + SetDefaultDeny(); + } + + continue; + } + else + { + // no default, just error + continue; + } + + + for( /* no init*/ ; (*(pBuffer) != '\0') && ((*(pBuffer) == ' ') || (*(pBuffer) == '\t') || (*(pBuffer) == '\n') || (*(pBuffer) == '\r')); pBuffer++) + ; // do nothing, just skip whitespaces, newlines, carriage returns + + // skip comments + if((*(pBuffer) == '\0') || (*(pBuffer) == '#')) + continue; + + // read ip + for(nCount = 0; nCount < 15; pBuffer++) + { + if(*(pBuffer) == '.' || isdigit(*(pBuffer))) + { + szIpAddress[nCount] = *(pBuffer); + nCount++; + } + else + break; + } + szIpAddress[nCount] = '\0'; + + // skip bad ip's + if(szIpAddress[0] == '\0') + continue; + + for( /* no init*/ ; (*(pBuffer) != '\0') && ((*(pBuffer) == ' ') || (*(pBuffer) == '\t') || (*(pBuffer) == '\n') || (*(pBuffer) == '\r') || (*(pBuffer) == '/')); pBuffer++) + ; // do nothing, just skip whitespaces, newlines, carriage returns, ':' + + + if((*(pBuffer) == '\0') || (*(pBuffer) == '#')) + { + // no netmask specified + szNetmask[0] = '\0'; + } + else + { + // read netmask + for(nCount = 0; nCount < 15; pBuffer++) + { + if(*(pBuffer) == '.' || isdigit(*(pBuffer))) + { + szNetmask[nCount] = *(pBuffer); + nCount++; + } + else + break; + } + szNetmask[nCount] = '\0'; + } + + + // use default netmask, if none supplied + if(szNetmask[0] == '\0') + strcpy(szNetmask, "255.255.255.255"); + + nIpAddress = inet_addr(szIpAddress); + nNetmask = inet_addr(szNetmask); + + + if(pLogfile != NULL && pLogfile->Begin(PLogfile::c_LEVEL_DEBUG) == true) + { + if(bAllow == true) + pLogfile->Append("Loaded filter (type=allow) <"); + else + pLogfile->Append("Loaded filter (type=deny) <"); + + pLogfile->Append(szIpAddress); + pLogfile->Append('/'); + pLogfile->Append(szNetmask); + pLogfile->Append('>'); + + pLogfile->End(); + } + + // add filter + AddHost(bAllow, nIpAddress, nNetmask); + + // increment number of successfully loaded entries + nLoaded++; + } + + fclose(pFile); + return nLoaded; + } + else + { + // could not open file + return -1; + } +} + + +// ====================================================================== + +bool HLServerFilterList::AddHost(bool bAllow, pfc_inet_addr nIpAddress) +{ + return AddHost(bAllow, nIpAddress, 0xFFFFFFFF); +} + + +// ====================================================================== + +bool HLServerFilterList::AddDefaultHost(bool bAllow) +{ + return AddHost(bAllow, (pfc_inet_addr) 0x00000000, (pfc_inet_addr) 0x00000000); +} + + +// ====================================================================== + +bool HLServerFilterList::AddHost(bool bAllow, const char *pszIpAddress) +{ + return AddHost(bAllow, inet_addr(pszIpAddress), 0xFFFFFFFF); +} + + +// ====================================================================== + +bool HLServerFilterList::AddHost(bool bAllow, const char *pszIpAddress, const char *pszNetMask) +{ + return AddHost(bAllow, inet_addr(pszIpAddress), inet_addr(pszNetMask)); +} + + +// ====================================================================== + +bool HLServerFilterList::AddHost(bool bAllow, pfc_inet_addr nIpAddress, pfc_inet_addr nNetMask) +{ + // do not allow two identical entries + if(Exists(bAllow, nIpAddress, nNetMask) == true) + return true; + + HLServerFilterList_Item *pNewItem = new HLServerFilterList_Item(bAllow, nIpAddress, nNetMask); + + if(pNewItem == NULL) + return false; + + // add item to top of list + pNewItem->m_pNextItem = m_pFirstItem; + m_pFirstItem = pNewItem; + + // increment number of elements + m_nItems++; + + // success + return true; +} + + +// ====================================================================== + +bool HLServerFilterList::Exists(bool bAllow, pfc_inet_addr nIpAddress, pfc_inet_addr nNetMask) +{ + // search element, begin at top of list + HLServerFilterList_Item *pCurrent; + + for(pCurrent = m_pFirstItem; pCurrent != NULL; pCurrent = pCurrent->m_pNextItem) + { + if(pCurrent->m_bAllow == bAllow && pCurrent->m_nIpAddress == nIpAddress && pCurrent->m_nNetMask == nNetMask) + return true; + } + + // not found + return false; +} + + +// ====================================================================== + +bool HLServerFilterList::RemoveHost(bool bAllow, pfc_inet_addr nIpAddress) +{ + return RemoveHost(bAllow, nIpAddress, 0xFFFFFFFF); +} + + +// ====================================================================== + +bool HLServerFilterList::RemoveDefaultHost(bool bAllow) +{ + return RemoveHost(bAllow, (pfc_inet_addr) 0xFFFFFFFF, (pfc_inet_addr) 0xFFFFFFFF); +} + + +// ====================================================================== + +bool HLServerFilterList::RemoveHost(bool bAllow, const char *pszIpAddress) +{ + return RemoveHost(bAllow, inet_addr(pszIpAddress), 0xFFFFFFFF); +} + + +// ====================================================================== + +bool HLServerFilterList::RemoveHost(bool bAllow, const char *pszIpAddress, const char *pszNetMask) +{ + return RemoveHost(bAllow, inet_addr(pszIpAddress), inet_addr(pszNetMask)); +} + + +// ====================================================================== + +bool HLServerFilterList::RemoveHost(bool bAllow, pfc_inet_addr nIpAddress, pfc_inet_addr nNetMask) +{ + HLServerFilterList_Item *pCurrent = NULL; + HLServerFilterList_Item *pPrevious = NULL; + + for(pCurrent = m_pFirstItem; pCurrent != NULL; pCurrent = pCurrent->m_pNextItem) + { + if(pCurrent->m_bAllow == bAllow && pCurrent->m_nIpAddress == nIpAddress && pCurrent->m_nNetMask == nNetMask) + { + if(pPrevious == NULL) + m_pFirstItem = pCurrent->m_pNextItem; + else + pPrevious->m_pNextItem = pCurrent->m_pNextItem; + + delete pCurrent; + + m_nItems--; + + // success + return true; + } + + pPrevious = pCurrent; + } + + return false; +} + + +// ====================================================================== + +int HLServerFilterList::RemoveAll() +{ + int nCount; + HLServerFilterList_Item *pCurrent; + HLServerFilterList_Item *pNext; + + // remove all elements + pNext = m_pFirstItem; + for(nCount = 0; pNext != NULL; nCount++) + { + pCurrent = pNext; + pNext = pNext->m_pNextItem; + + delete pCurrent; + } + + // reset pointers & counter + m_pFirstItem = NULL; + m_nItems = 0; + + // return number of items deleted + return nCount; +} + + + +// ====================================================================== + +bool HLServerFilterList::IsAllowed(const char *pszIpAddress) +{ + return IsAllowed(inet_addr(pszIpAddress)); +} + + +// ====================================================================== + +bool HLServerFilterList::IsAllowed(pfc_inet_addr nIpAddress) +{ + // search element, begin at top of list + HLServerFilterList_Item *pCurrent; + bool bFound = false; + + + for(pCurrent = m_pFirstItem; pCurrent != NULL; pCurrent = pCurrent->m_pNextItem) + { + if(pCurrent->m_nMaskedIpAddress == (nIpAddress & pCurrent->m_nNetMask)) + { + if(pCurrent->m_bAllow == true) + { + if(m_bOrderAllow == true) // order: allow, deny - found allow rule + return true; + else + bFound = true; // maybe there is a deny rule... + } + else + { + if(m_bOrderAllow == false) // order: deny, allow - found deny rule + return false; + else + bFound = true; // maybe there is an allow rule... + } + } + } + + + if(bFound == true) + { + if(m_bOrderAllow == true) // order: allow, deny - no allow rule found, but deny rule was found + return false; + else // order: deny, allow - no deny rule found, but allow rule was found + return true; + } + else + { + // no rule found, return default + return m_bDefaultAllow; + } +} + + + + + + + +// ====================================================================== + +HLServerFilterList_Item::HLServerFilterList_Item(bool bAllow, pfc_inet_addr nIpAddress, pfc_inet_addr nNetMask) +{ + m_bAllow = bAllow; + m_nIpAddress = nIpAddress; + m_nNetMask = nNetMask; + + m_nMaskedIpAddress = nIpAddress & nNetMask; +} + + + + diff --git a/src/HLServerList.cpp b/src/HLServerList.cpp new file mode 100644 index 0000000..e4da92d --- /dev/null +++ b/src/HLServerList.cpp @@ -0,0 +1,1200 @@ +/* + +--------------------------------------------------------------------+ + | ..........................:: HLMaster ::.......................... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | 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. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Half-Life master-server deamon. | + +--------------------------------------------------------------------+ +*/ + + +#include "HLServerList.h" +#include "HLMaster.h" +#include "CInetAddress.h" + +#include +#include +#include +#include +#include + + + +// ====================================================================== + +HLServerList::HLServerList(int nMaxItems, PLogfile *pInfoLog) +{ + if(nMaxItems > 0 && nMaxItems <= 60000) + m_nMaxItems = nMaxItems; + else + m_nMaxItems = 200; + + m_pInfoLog = pInfoLog; + + // TODO: if memory allocation fails, this will lead to a very nice error + m_pGameList = new HLInfoList(); + m_pMapList = new HLInfoList(); + + m_pHeadDummyItem = new HLServerListItem(0xFFFFFFFF, 0xFFFF); + m_pTailDummyItem = new HLServerListItem(0xFFFFFFFF, 0xFFFF); + + m_pHeadDummyItem->m_pNextItem = m_pTailDummyItem; + m_pHeadDummyItem->m_pPreviousItem = m_pTailDummyItem; + + m_pTailDummyItem->m_pNextItem = m_pHeadDummyItem; + m_pTailDummyItem->m_pPreviousItem = m_pHeadDummyItem; + + m_pFirstItem = m_pHeadDummyItem; + m_pLastItem = m_pTailDummyItem; + + m_pRequestIndex = m_pHeadDummyItem; + m_pUnknownIndex = m_pTailDummyItem; + + m_nItems = 0; + m_nSkipRequests = 0; + + // initialize challenge number (should be random) + m_nChallengeSeed = (int) &m_pHeadDummyItem; +} + + +// ====================================================================== + +HLServerList::~HLServerList() +{ + RemoveAllItems(); + + delete m_pGameList; + delete m_pMapList; + + delete m_pHeadDummyItem; + delete m_pTailDummyItem; +} + + + +// ====================================================================== + +HLServerListItem* HLServerList::AddItem(pfc_inet_addr nIpAddress, pfc_inet_port nPort) +{ + HLServerListItem *pNewItem; + + if(m_nItems >= m_nMaxItems) + return NULL; + + if(nIpAddress != 0 && nPort != 0) + { + pNewItem = new HLServerListItem(nIpAddress, nPort); + + if(pNewItem == NULL) + return NULL; + + // check index + if(m_pRequestIndex == m_pUnknownIndex) + m_pRequestIndex = pNewItem; + + // add item as first unknown item + pNewItem->m_pPreviousItem = m_pUnknownIndex->m_pPreviousItem; + pNewItem->m_pNextItem = m_pUnknownIndex; + + m_pUnknownIndex->m_pPreviousItem->m_pNextItem = pNewItem; + m_pUnknownIndex->m_pPreviousItem = pNewItem; + + m_pUnknownIndex = pNewItem; + + // increment number of elements + m_nItems++; + + // return the new item + return pNewItem; + } + + return NULL; +} + + +// ====================================================================== + +bool HLServerList::RemoveItem(pfc_inet_addr nIpAddress, pfc_inet_port nPort) +{ + HLServerListItem *pItem = Find(nIpAddress, nPort); + + if(pItem == NULL) + return false; + + RemoveItem(pItem); + return true; +} + + +// ====================================================================== + +int HLServerList::RemoveAllItems() +{ + int nDeleted = 0; + HLServerListItem *pCurrent = m_pFirstItem->m_pNextItem; + + // remove all elements + for(nDeleted = 0; pCurrent != m_pLastItem; nDeleted++) + { + // dont let the destructor decrement usage counters + // we will remove all items anyway + pCurrent->m_pGame = NULL; + pCurrent->m_pMap = NULL; + + // delete current + pCurrent = pCurrent->m_pNextItem; + delete pCurrent->m_pPreviousItem; + } + + m_pRequestIndex = m_pFirstItem; + m_pUnknownIndex = m_pLastItem; + m_nItems = 0; + + m_pGameList->RemoveAllItems(); + m_pMapList->RemoveAllItems(); + + // return number of items deleted + // this should match initial m_nItems! + return nDeleted; +} + + +// ====================================================================== + +int HLServerList::RemoveAllStaticItems() +{ + int nDeleted = 0; + HLServerListItem *pCurrent = m_pFirstItem->m_pNextItem; + + // check all items in list + while(pCurrent != m_pLastItem) + { + if(pCurrent->m_nType == HLServerListItem::c_TYPE_DYNAMIC) + { + pCurrent = pCurrent->m_pNextItem; + continue; + } + + // delete current + pCurrent = pCurrent->m_pNextItem; + + RemoveItem(pCurrent->m_pPreviousItem); + nDeleted++; + } + + + return nDeleted; +} + + + +// ====================================================================== + +int HLServerList::RemoveAllDynamicItems() +{ + int nDeleted = 0; + HLServerListItem *pCurrent = m_pFirstItem->m_pNextItem; + + // check all items in list + while(pCurrent != m_pLastItem) + { + if(pCurrent->m_nType != HLServerListItem::c_TYPE_DYNAMIC) + { + pCurrent = pCurrent->m_pNextItem; + continue; + } + + // delete current + pCurrent = pCurrent->m_pNextItem; + + RemoveItem(pCurrent->m_pPreviousItem); + nDeleted++; + } + + + return nDeleted; +} + + +// ====================================================================== + +void HLServerList::RemoveItem(HLServerListItem *pItem) +{ + // unlink item + pItem->m_pPreviousItem->m_pNextItem = pItem->m_pNextItem; + pItem->m_pNextItem->m_pPreviousItem = pItem->m_pPreviousItem; + + // check gametype index + if(pItem->m_pGame != NULL && pItem->m_pGame->m_pListIndex == pItem && pItem->m_pGame == pItem->m_pNextItem->m_pGame) + { + // update the index, if the next item is of the same type + pItem->m_pGame->m_pListIndex = pItem->m_pNextItem; + } + // NOTE: if there is no next item and the item is on the index, + // we would actually have to set the index to NULL - but + // since the destructor resets the index to NULL, if there + // are no more reference, everything should be ok. (unless there + // is a bug of course :-) + + // NOTE: maps are currently not indexed + + // check first unknown item index + if(pItem == m_pUnknownIndex) + m_pUnknownIndex = pItem->m_pNextItem; + + // check request index + if(pItem == m_pRequestIndex) + m_pRequestIndex = pItem->m_pNextItem; + + // delete + delete pItem; + + m_nItems--; +} + + +// ====================================================================== + +void HLServerList::ResortItem(HLServerListItem *pItem) +{ + // check first unknown item index + if(m_pUnknownIndex == pItem) + m_pUnknownIndex = pItem->m_pNextItem; + + // check request index + if(m_pRequestIndex == pItem) + m_pRequestIndex = pItem->m_pNextItem; + + // unlink + pItem->m_pPreviousItem->m_pNextItem = pItem->m_pNextItem; + pItem->m_pNextItem->m_pPreviousItem = pItem->m_pPreviousItem; + + if(pItem->m_pGame->m_pListIndex == NULL) + { + // relink at top of the list + pItem->m_pNextItem = m_pFirstItem->m_pNextItem; + pItem->m_pPreviousItem = m_pFirstItem; + } + else + { + // relink as first indexed item + pItem->m_pNextItem = pItem->m_pGame->m_pListIndex; + pItem->m_pPreviousItem = pItem->m_pGame->m_pListIndex->m_pPreviousItem; + } + + // update surrounding items + pItem->m_pNextItem->m_pPreviousItem = pItem; + pItem->m_pPreviousItem->m_pNextItem = pItem; + + // set index to current item + pItem->m_pGame->m_pListIndex = pItem; +} + + +// ====================================================================== + +HLServerListItem* HLServerList::Find(pfc_inet_addr nIpAddress, pfc_inet_port nPort) +{ + HLServerListItem *pCurrent = m_pFirstItem->m_pNextItem; + + while(pCurrent != m_pLastItem) + { + if(pCurrent->m_nIpAddress == nIpAddress && pCurrent->m_nPort == nPort) + return pCurrent; + + pCurrent = pCurrent->m_pNextItem; + } + + return NULL; +} + + +// ====================================================================== + +int HLServerList::GetRandomChallenge(int nSeed1, int nSeed2) +{ + m_nChallengeSeed = ((m_nChallengeSeed + 123456) ^ (nSeed1 + nSeed2)) + m_nItems; + int nNewChallenge = m_nChallengeSeed; + + nNewChallenge <<= 8; + nNewChallenge ^= nSeed1; + nNewChallenge ^= nSeed2; + + return nNewChallenge; +} + + +// ====================================================================== + +int HLServerList::LoadHosts(const char *pszFilename) +{ + if(pszFilename == NULL) + return -1; + + HLServerListItem *pItem = NULL; + + FILE *pFile; + char szBuffer[64]; + char *pBuffer; + bool bLastLineFinished; + + int nCount; + int nLoaded; + char nType; + char szIpAddress[16]; + char szPort[6]; + + time_t nTimestamp = time(NULL) - HLMaster::c_CHECK_INTERVAL - 5; + + + pfc_inet_addr nIpAddress; + pfc_inet_port nPort; + + pFile = fopen(pszFilename, "r"); + if(pFile != NULL) + { + // remove all static hosts from list, before adding new ones + RemoveAllStaticItems(); + + + nLoaded = 0; + bLastLineFinished = true; + + while(feof(pFile) == 0) + { + if(fgets(szBuffer, sizeof(szBuffer), pFile) == NULL) + break; + + if(szBuffer[0] == '\0') + { + // blank line, this shouldnt happen + bLastLineFinished = true; + continue; + } + + pBuffer = szBuffer + (strlen(szBuffer) - 1); + if(*(pBuffer) == '\n') + { + // skip, we're continuing a long line... + if(bLastLineFinished == false) + { + bLastLineFinished = true; + continue; + } + else + bLastLineFinished = true; + } + else + { + // skip, we're continuing a long line... + if(bLastLineFinished == false) + continue; + else + bLastLineFinished = false; + } + + + for(pBuffer = szBuffer; (*(pBuffer) != '\0') && ((*(pBuffer) == ' ') || (*(pBuffer) == '\t') || (*(pBuffer) == '\n') || (*(pBuffer) == '\r')); pBuffer++) + ; // do nothing, just skip whitespaces, newlines, carriage returns + + // skip comments + if((*(pBuffer) == '\0') || (*(pBuffer) == '#')) + continue; + + if(strncmp("nocheck", pBuffer, (sizeof("nocheck") - 1)) == 0) + { + nType = HLServerListItem::c_TYPE_STATIC_NOCHECK; + pBuffer += sizeof("nocheck"); + } + else if(strncmp("check", pBuffer, (sizeof("check") - 1)) == 0) + { + nType = HLServerListItem::c_TYPE_STATIC_CHECK; + pBuffer += sizeof("check"); + } + else + { + // default to "check" + nType = HLServerListItem::c_TYPE_STATIC_CHECK; + } + + for( /* no init*/ ; (*(pBuffer) != '\0') && ((*(pBuffer) == ' ') || (*(pBuffer) == '\t') || (*(pBuffer) == '\n') || (*(pBuffer) == '\r')); pBuffer++) + ; // do nothing, just skip whitespaces, newlines, carriage returns + + // skip comments + if((*(pBuffer) == '\0') || (*(pBuffer) == '#')) + continue; + + // read ip + for(nCount = 0; nCount < 15; pBuffer++) + { + if(*(pBuffer) == '.' || isdigit(*(pBuffer))) + { + szIpAddress[nCount] = *(pBuffer); + nCount++; + } + else + break; + } + szIpAddress[nCount] = '\0'; + + // skip bad ip's + if(szIpAddress[0] == '\0') + continue; + + for( /* no init*/ ; (*(pBuffer) != '\0') && ((*(pBuffer) == ' ') || (*(pBuffer) == '\t') || (*(pBuffer) == '\n') || (*(pBuffer) == '\r') || (*(pBuffer) == ':')); pBuffer++) + ; // do nothing, just skip whitespaces, newlines, carriage returns, ':' + + + if((*(pBuffer) == '\0') || (*(pBuffer) == '#')) + { + // no port specified + szPort[0] = '\0'; + } + else + { + // read port + for(nCount = 0; nCount < 5; pBuffer++) + { + if(isdigit(*(pBuffer))) + { + szPort[nCount] = *(pBuffer); + nCount++; + } + else + break; + } + szPort[nCount] = '\0'; + } + + if(szPort[0] == '\0') + { + // no port specified, default to 27015 + strcpy(szPort, "27015"); + } + + // ok, got em all, now check em... + nIpAddress = inet_addr(szIpAddress); + nPort = htons(atoi(szPort)); + + + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_DEBUG) == true) + { + if(nType == HLServerListItem::c_TYPE_STATIC_CHECK) + m_pInfoLog->Append("Loaded server (type=check) <"); + else + m_pInfoLog->Append("Loaded server (type=nocheck) <"); + + m_pInfoLog->Append(szIpAddress); + m_pInfoLog->Append(':'); + m_pInfoLog->Append(szPort); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } + + pItem = Find(nIpAddress, nPort); + if(pItem == NULL) + { + // not found, add + pItem = AddItem(nIpAddress, nPort); + } + else + { + if(pItem->m_nType == HLServerListItem::c_TYPE_DYNAMIC && m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + if(nType == HLServerListItem::c_TYPE_STATIC_CHECK) + m_pInfoLog->Append("Convert (event=load from=dynamic to=check) <"); + else + m_pInfoLog->Append("Convert (event=load from=dynamic to=nocheck) <"); + + m_pInfoLog->Append(szIpAddress); + m_pInfoLog->Append(':'); + m_pInfoLog->Append(szPort); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } + + // NOTE: if it's not a dynamic host, but it looks like + // it's appearing twice in the config-file. + } + + if(pItem != NULL) + { + pItem->SetType(nType); + + pItem->m_nBadChecks = 2; + pItem->m_nLastHeartbeat = nTimestamp; + } + + // increment number of successfully loaded entries + nLoaded++; + + // check limit + if(nLoaded == 3000) + { + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_WARNING) == true) + { + m_pInfoLog->Append("Maximum number of loadable servers reached (3000)."); + m_pInfoLog->End(); + } + + break; + } + } + + fclose(pFile); + return nLoaded; + } + else + { + // could not open file + return -1; + } +} + + +// ====================================================================== + +HLServerListItem* HLServerList::HeartBeat(pfc_inet_addr nIpAddress, pfc_inet_port nPort, time_t nTimestamp) +{ + HLServerListItem *pItem; + + pItem = Find(nIpAddress, nPort); + if(pItem == NULL) + { + // not found, add + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + pfc::CInetAddress tempInetAddr; + tempInetAddr.SetAddress(nIpAddress); + + m_pInfoLog->Append("ServerInfo (type=newheartbeat) <"); + m_pInfoLog->Append(&tempInetAddr); + m_pInfoLog->Append(':'); + m_pInfoLog->Append((int)ntohs(nPort)); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } + + pItem = AddItem(nIpAddress, nPort); + + + if(pItem != NULL) + { + // get a fresh, random id + pItem->m_nChallengeId = GetRandomChallenge((int)&pItem, (int)nTimestamp); + } + } + + if(pItem != NULL) + { + // found, update timestamp + pItem->m_nLastHeartbeat = nTimestamp; + + // increment badchecks + // if a host does not send back the correct challenge after + // sending a heartbeat, it's a sux0r host + pItem->m_nBadChecks++; + } + + return pItem; +} + + +// ====================================================================== + +bool HLServerList::Logoff(pfc_inet_addr nIpAddress, pfc_inet_port nPort) +{ + HLServerListItem *pItem = Find(nIpAddress, nPort); + + if(pItem == NULL || pItem->m_nType != HLServerListItem::c_TYPE_DYNAMIC) + return false; + + RemoveItem(pItem); + + return true; +} + + +// ====================================================================== + +HLServerListItem* HLServerList::Challenge(pfc_inet_addr nIpAddress, pfc_inet_port nPort, time_t nTimestamp, const int nChallengeId, const char nProtocol, const char nPlayers, const char nMaxPlayers, const char nOsType, const bool bDedicated, const bool bPassword, const bool bLan, const char *pszGameDir, const char *pszMapName) +{ + HLServerListItem *pItem; + pfc::CInetAddress tempInetAddr; + + pItem = Find(nIpAddress, nPort); + if(pItem == NULL) + { + // not found, invalid host, reject + return NULL; + } + + if(pItem->m_nChallengeId != nChallengeId) + { + // aiii, bad challenge id, reject + // NOTE: we could remove the host right now + return NULL; + } + + // update host infos + pItem->m_nLastHeartbeat = nTimestamp; + pItem->m_nBadChecks = 0; + + pItem->m_nProtocol = nProtocol; + pItem->m_nPlayers = nPlayers; + pItem->m_nMaxPlayers = nMaxPlayers; + pItem->m_nOsType = nOsType; + pItem->m_bDedicated = bDedicated; + pItem->m_bPassword = bPassword; + pItem->m_bLan = bLan; + + SetGameDir(pItem, pszGameDir); + SetMapName(pItem, pszMapName); + + + if(pItem->m_nType == HLServerListItem::c_TYPE_STATIC_CHECK) + { + // convert to dynamic host + pItem->SetType(HLServerListItem::c_TYPE_DYNAMIC); + + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + m_pInfoLog->Append("Convert (event=challenge from=check to=dynamic) <"); + + tempInetAddr.SetAddress(pItem->m_nIpAddress); + m_pInfoLog->Append(&tempInetAddr); + m_pInfoLog->Append(':'); + m_pInfoLog->Append((int)ntohs(pItem->m_nPort)); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } + } + + // successfully updated infos + return pItem; +} + + +// ====================================================================== + +HLServerListItem* HLServerList::UpdateDetails(pfc_inet_addr nIpAddress, pfc_inet_port nPort, time_t nTimestamp, const char nProtocol, const char nPlayers, const char nMaxPlayers, const char nOsType, const bool bDedicated, const bool bPassword, const bool bLan, const char *pszGameDir, const char *pszMapName) +{ + HLServerListItem *pItem; + + pItem = Find(nIpAddress, nPort); + if(pItem == NULL) + { + // not found, invalid host, reject + return NULL; + } + + if(pItem->m_nType != HLServerListItem::c_TYPE_STATIC_CHECK) + { + // invalid host type, reject + return NULL; + } + + // update host infos + pItem->m_nLastHeartbeat = nTimestamp; + pItem->m_nBadChecks = 0; + + pItem->m_nProtocol = nProtocol; + pItem->m_nPlayers = nPlayers; + pItem->m_nMaxPlayers = nMaxPlayers; + pItem->m_nOsType = nOsType; + pItem->m_bDedicated = bDedicated; + pItem->m_bPassword = bPassword; + pItem->m_bLan = bLan; + + SetGameDir(pItem, pszGameDir); + SetMapName(pItem, pszMapName); + + + // successfully updated infos + return pItem; +} + + +// ====================================================================== + +void HLServerList::SetGameDir(HLServerListItem *pItem, const char *pszGameDir) +{ + if(pszGameDir != NULL && pszGameDir[0] != '\0') + { + if(pItem->m_pGame != NULL) + { + if(pItem->m_pGame->Equals(pszGameDir) == true) + return; + + // gametype changed + pItem->m_pGame->DecrementUsage(); + + // check index + if(pItem->m_pGame->m_pListIndex != NULL && pItem->m_pGame == pItem->m_pNextItem->m_pGame) + pItem->m_pGame->m_pListIndex = pItem->m_pNextItem; + } + + // update gamedirectory + pItem->m_pGame = m_pGameList->GetItem(pszGameDir); + + if(pItem->m_pGame == NULL) + pItem->m_pGame = m_pGameList->AddItem(pszGameDir); + + if(pItem != NULL) + pItem->m_pGame->IncrementUsage(); + + // resort item + ResortItem(pItem); + } + else if(pItem->m_pGame != NULL) + { + pItem->m_pGame->DecrementUsage(); + + // check index + if(pItem->m_pGame->m_pListIndex != NULL && pItem->m_pGame == pItem->m_pNextItem->m_pGame) + pItem->m_pGame->m_pListIndex = pItem->m_pNextItem; + + pItem->m_pGame = NULL; + + // resort list + ResortItem(pItem); + } +} + + +// ====================================================================== + +void HLServerList::SetMapName(HLServerListItem *pItem, const char *pszMapName) +{ + if(pszMapName != NULL && pszMapName[0] != '\0') + { + if(pItem->m_pMap != NULL) + { + if(pItem->m_pMap->Equals(pszMapName) == true) + return; + + // map changed + pItem->m_pMap->DecrementUsage(); + } + + // update map + pItem->m_pMap = m_pMapList->GetItem(pszMapName); + + if(pItem->m_pMap == NULL) + pItem->m_pMap = m_pMapList->AddItem(pszMapName); + + if(pItem != NULL) + pItem->m_pMap->IncrementUsage(); + } + else if(pItem->m_pMap != NULL) + { + pItem->m_pMap->DecrementUsage(); + pItem->m_pMap = NULL; + } +} + + +// ====================================================================== + +bool HLServerList::RequestStatus(time_t nTimestamp, HLMaster *pMaster) +{ + int nCount; + const int nLimit = 100; + HLServerListItem *pCurrent = m_pRequestIndex->m_pNextItem; + + + // check at most 100 items + for(nCount = 0; pCurrent != m_pLastItem && nCount < nLimit; pCurrent = pCurrent->m_pNextItem) + { + if(pCurrent->m_nType != HLServerListItem::c_TYPE_STATIC_CHECK) + continue; + + // increment counter only for static items + nCount++; + + // check timestamp + if(pCurrent->m_nLastHeartbeat == 0 || pCurrent->m_nLastHeartbeat > nTimestamp) + pCurrent->m_nLastHeartbeat = nTimestamp; + + if((nTimestamp - pCurrent->m_nLastHeartbeat) < HLMaster::c_CHECK_INTERVAL) + continue; + + if(pCurrent->m_nBadChecks > 288) // 1 Day + { + // check every 4 hours + if((pCurrent->m_nBadChecks % 48) == 0) + { + pMaster->SendDetailsRequest(pCurrent); + } + } + else if(pCurrent->m_nBadChecks > 6) // 30 Minutes + { + // check every 20 minutes + if((pCurrent->m_nBadChecks % 4) == 0) + { + pMaster->SendDetailsRequest(pCurrent); + } + } + else + { + // check now + pMaster->SendDetailsRequest(pCurrent); + } + + pCurrent->m_nBadChecks++; + } + + + if(nCount == nLimit && pCurrent != m_pLastItem) + { + // limit reached and there are some more + m_pRequestIndex = pCurrent; + return false; + } + else + { + // finished the queue + m_pRequestIndex = m_pFirstItem; + return true; + } +} + +// ====================================================================== + +int HLServerList::CheckTimeout(time_t nTimestamp, HLMaster *pMaster) +{ + int nDeleted = 0; + pfc::CInetAddress tempInetAddr; + HLServerListItem *pCurrent = m_pFirstItem->m_pNextItem; + + // check all items in list + while(pCurrent != m_pLastItem) + { + // do not check static, nocheck hosts + // keep static hosts 1 week before deleting them + if((pCurrent->m_nType == HLServerListItem::c_TYPE_STATIC_NOCHECK) || (pCurrent->m_nType == HLServerListItem::c_TYPE_STATIC_CHECK && pCurrent->m_nBadChecks < 2016)) + { + pCurrent = pCurrent->m_pNextItem; + continue; + } + + // check timestamp + if(pCurrent->m_nLastHeartbeat == 0 || pCurrent->m_nLastHeartbeat > nTimestamp) + pCurrent->m_nLastHeartbeat = nTimestamp; + + + // check if we should delete that bastard + if((nTimestamp - pCurrent->m_nLastHeartbeat) >= HLMaster::c_CHECK_TIMEOUT) + { + // remove server (timed out) + if(m_pInfoLog != NULL && m_pInfoLog->Begin(PLogfile::c_LEVEL_INFO) == true) + { + m_pInfoLog->Append("Timeout (type="); + if(pCurrent->m_nType == HLServerListItem::c_TYPE_STATIC_CHECK) + m_pInfoLog->Append("check) <"); + else + m_pInfoLog->Append("dynamic) <"); + + tempInetAddr.SetAddress(pCurrent->m_nIpAddress); + m_pInfoLog->Append(&tempInetAddr); + + m_pInfoLog->Append(':'); + m_pInfoLog->Append(ntohs(pCurrent->m_nPort)); + m_pInfoLog->Append('>'); + + m_pInfoLog->End(); + } + + // delete current + pCurrent = pCurrent->m_pNextItem; + + RemoveItem(pCurrent->m_pPreviousItem); + nDeleted++; + } + else + { + pCurrent = pCurrent->m_pNextItem; + } + } + + + // clean up game/map list + m_pGameList->RemoveAllUnusedItems(); + m_pMapList->RemoveAllUnusedItems(); + + return nDeleted; +} + + +// ====================================================================== + +int HLServerList::FillPacket_Quakeworld(char *pBuffer, int nBufferSize) +{ + int nCount; + int nSize; + HLServerListItem *pCurrent = m_pFirstItem->m_pNextItem; + + unsigned int *pInt = (unsigned int*) pBuffer; + unsigned short *pShort= (unsigned short*) (pBuffer + 4); + + + if(nBufferSize < 1 || m_nItems == 0) + return 0; + + // create packet + // send max 230 ip's (gamespy limitation) + for(nCount = 0, nSize = 0; pCurrent != m_pLastItem && (nSize + 6) < nBufferSize && nCount < 230; pCurrent = pCurrent->m_pNextItem) + { + // skip timed out servers + if(pCurrent->m_nBadChecks > 1 && pCurrent->m_nType != HLServerListItem::c_TYPE_STATIC_NOCHECK) + continue; + + // copy host to buffer + *(pInt) = pCurrent->m_nIpAddress; + *(pShort) = pCurrent->m_nPort; + + // adjust buffer pointers + pBuffer += 6; + pInt = (unsigned int*) pBuffer; + pShort = (unsigned short*) (pBuffer + 4); + + // increment counters + nCount++; + nSize += 6; + } + + return nSize; +} + + +// ====================================================================== + +int HLServerList::FillPacket_Halflife(int nSkip, char *pBuffer, int nBufferSize, unsigned short *pnSkipped /* = NULL */, bool *pbHasMore /* = NULL */) +{ + int nSize; + int nCount; + int nTotalSkipped; + + HLServerListItem *pCurrent = m_pFirstItem->m_pNextItem; + + unsigned int *pInt = (unsigned int*) pBuffer; + unsigned short *pShort= (unsigned short*) (pBuffer + 4); + + + if(nBufferSize < 1 || m_nItems == 0 || nSkip >= m_nItems) + return 0; + + // skip if necessary + for(nCount = 0; pCurrent != m_pLastItem && nCount < nSkip; pCurrent = pCurrent->m_pNextItem) + { + // do not count timed out servers + if(pCurrent->m_nBadChecks < 2 || pCurrent->m_nType == HLServerListItem::c_TYPE_STATIC_NOCHECK) + nCount++; + } + nTotalSkipped = nCount; + + + // copy to buffer + for(nCount = 0, nSize = 0; pCurrent != m_pLastItem && (nSize + 6) < nBufferSize; pCurrent = pCurrent->m_pNextItem) + { + // skip timed out servers + if(pCurrent->m_nBadChecks > 1 && pCurrent->m_nType != HLServerListItem::c_TYPE_STATIC_NOCHECK) + continue; + + // copy host to buffer + *(pInt) = pCurrent->m_nIpAddress; + *(pShort) = pCurrent->m_nPort; + + // adjust buffer pointers + pBuffer += 6; + pInt = (unsigned int*) pBuffer; + pShort = (unsigned short*) (pBuffer + 4); + + // increment counters + nCount++; + nSize += 6; + } + + // tell, if it was the last item + if(pbHasMore != NULL) + { + if(pCurrent != m_pLastItem && nCount > 0) + *(pbHasMore) = true; + else + *(pbHasMore) = false; + } + + // tell, how many items got skipped + if(pnSkipped != NULL) + *(pnSkipped) = nCount + nTotalSkipped; + + return nSize; +} + + +// ====================================================================== +#ifdef _DEBUG +int HLServerList::LogSnapshot() +{ + int nCount; + FILE *pFile; + + HLServerListItem *pCurrent = m_pFirstItem->m_pNextItem; + + // open snapshot.log + pFile = fopen("snapshot.log", "w"); + + if(pFile == 0) + return -1; + + // write header + fputs("Type BadChecks Gametype\tMap\tChallenge-Id\tPlayers\tMay-Players\n", pFile); + fputs("----------------------------------------------------------------------\n\n", pFile); + + // parse list + for(nCount = 0; pCurrent != m_pLastItem; pCurrent = pCurrent->m_pNextItem) + { + if(pCurrent->m_nType == HLServerListItem::c_TYPE_DYNAMIC) + fputs("Dynamic ", pFile); + else if(pCurrent->m_nType == HLServerListItem::c_TYPE_STATIC_CHECK) + fputs("Static (check) ", pFile); + else if(pCurrent->m_nType == HLServerListItem::c_TYPE_STATIC_NOCHECK) + fputs("Static (nocheck) ", pFile); + else + fputs(" ", pFile); + + fprintf(pFile, "%04d ", pCurrent->m_nBadChecks); + + if(pCurrent->m_pGame != NULL) + fputs(pCurrent->m_pGame->m_szInfoString, pFile); + else + fputs("", pFile); + + fputs("\t", pFile); + if(pCurrent->m_pMap != NULL) + fputs(pCurrent->m_pMap->m_szInfoString, pFile); + else + fputs("", pFile); + + fprintf(pFile, "\t%010d\t%d\t%d\n", pCurrent->m_nChallengeId, pCurrent->m_nPlayers, pCurrent->m_nMaxPlayers); + } + + + fclose(pFile); + + return nCount; +} +#endif // _DEBUG + + + + +// ====================================================================== + +HLServerListItem::HLServerListItem(pfc_inet_addr nIpAddress, pfc_inet_port nPort) +{ + m_nIpAddress = nIpAddress; + m_nPort = nPort; + + m_nChallengeId = 0; + m_nLastHeartbeat = 0; + m_nProtocol = 0; + m_nPlayers = 0; + m_nMaxPlayers = 0; + + m_nOsType = 0; + m_bDedicated = false; + m_bPassword = false; + m_bLan = false; + + m_nType = c_TYPE_DYNAMIC; + m_nBadChecks = 1; + + m_pMap = NULL; + m_pGame = NULL; + + m_pNextItem = NULL; + m_pPreviousItem = NULL; +} + +const char HLServerListItem::c_TYPE_DYNAMIC = 0; +const char HLServerListItem::c_TYPE_STATIC_CHECK = 1; +const char HLServerListItem::c_TYPE_STATIC_NOCHECK = 2; + + +// ====================================================================== + +HLServerListItem::~HLServerListItem() +{ + if(m_pMap != NULL) + m_pMap->DecrementUsage(); + if(m_pGame != NULL) + m_pGame->DecrementUsage(); +} + + +// ====================================================================== + +// TODO: update to use HLInfoList +/* +int HLServerListItem::GetMapName(char *pBuffer, const int nBufferSize) +{ + if(nBufferSize < 1 || m_pMap == NULL) + return 0; + + int nCount; + + // copy string + for(nCount = 0; nCount < (nBufferSize - 1) && m_szMapName[nCount] != '\0'; nCount++) + pBuffer[nCount] = m_szMapName[nCount]; + + pBuffer[nCount] = '\0'; + + return nCount; +} + +// ====================================================================== + +// TODO: update to use HLInfoList +int HLServerListItem::GetGameDir(char *pBuffer, const int nBufferSize) +{ + if(nBufferSize < 1 || m_pGame == NULL) + return 0; + + int nCount; + + // copy string + for(nCount = 0; nCount < (nBufferSize - 1) && m_szGameDir[nCount] != '\0'; nCount++) + pBuffer[nCount] = m_szGameDir[nCount]; + + pBuffer[nCount] = '\0'; + + return nCount; +} + +*/ + diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..5c1ee72 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,33 @@ +## Makefile for hlmaster +## Copyright (C) 2001 Silvan Minghetti +## +## 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, 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. +## +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = hlmaster +hlmaster_SOURCES = main.cpp \ + HLMaster.cpp \ + HLServerList.cpp \ + HLServerFilterList.cpp \ + HLInfoList.cpp + + +CXXFLAGS = -O2 -Wall +INCLUDES = -I../include -I../lib/pfc++/include + +hlmaster_LDFLAGS = -s +hlmaster_LDADD = ../lib/pfc++/src/libpfc++.a diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..0163923 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,318 @@ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AMTAR = @AMTAR@ +AWK = @AWK@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +EXEEXT = @EXEEXT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ + +bin_PROGRAMS = hlmaster +hlmaster_SOURCES = main.cpp \ + HLMaster.cpp \ + HLServerList.cpp \ + HLServerFilterList.cpp \ + HLInfoList.cpp + + +CXXFLAGS = -O2 -Wall +INCLUDES = -I../include -I../lib/pfc++/include + +hlmaster_LDFLAGS = -s +hlmaster_LDADD = ../lib/pfc++/src/libpfc++.a +subdir = src +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = hlmaster$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + +am_hlmaster_OBJECTS = main.$(OBJEXT) HLMaster.$(OBJEXT) \ + HLServerList.$(OBJEXT) HLServerFilterList.$(OBJEXT) \ + HLInfoList.$(OBJEXT) +hlmaster_OBJECTS = $(am_hlmaster_OBJECTS) +hlmaster_DEPENDENCIES = ../lib/pfc++/src/libpfc++.a + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/HLInfoList.Po $(DEPDIR)/HLMaster.Po \ +@AMDEP_TRUE@ $(DEPDIR)/HLServerFilterList.Po \ +@AMDEP_TRUE@ $(DEPDIR)/HLServerList.Po $(DEPDIR)/main.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +DIST_SOURCES = $(hlmaster_SOURCES) +DIST_COMMON = Makefile.am Makefile.in +SOURCES = $(hlmaster_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +hlmaster$(EXEEXT): $(hlmaster_OBJECTS) $(hlmaster_DEPENDENCIES) + @rm -f hlmaster$(EXEEXT) + $(CXXLINK) $(hlmaster_LDFLAGS) $(hlmaster_OBJECTS) $(hlmaster_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/HLInfoList.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/HLMaster.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/HLServerFilterList.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/HLServerList.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/main.Po@am__quote@ + +distclean-depend: + -rm -rf $(DEPDIR) + +.cpp.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CXXCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< + +.cpp.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CXXCOMPILE) -c -o $@ `cygpath -w $<` +CXXDEPMODE = @CXXDEPMODE@ +uninstall-info-am: + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) + +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic distclean distclean-compile distclean-depend \ + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-binPROGRAMS install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..48961c5 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,970 @@ +/* + +--------------------------------------------------------------------+ + | ..........................:: HLMaster ::.......................... | + +--------------------------------------------------------------------+ + | Copyright (C) 2001 Silvan Minghetti | + | | + | 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. | + | | + +--------------------------------------------------------------------+ + | Created.......: Thursday, 10. May 2001 | + | Author........: Silvan Minghetti | + | Description...: Half-Life master-server deamon. | + +--------------------------------------------------------------------+ +*/ + +// my includes +// ====================================================================== +#include "PString.h" +#include "PStringList.h" +#include "PLogfile.h" +#include "PArgumentList.h" +#include "PUDPSocket.h" +#include "CInetAddress.h" + +#include "HLMaster.h" +#include "HLServerList.h" +#include "HLServerFilterList.h" + + +// general includes +// ====================================================================== +#include +#include +#include + +#include + +// begin windows specific +// ====================================================================== +#if defined PFC_SYSTEM_TYPE_WINDOWS +#include +#include + +WSADATA wsaData; + + +// begin linux specific +// ====================================================================== +#elif defined PFC_SYSTEM_TYPE_UNIX +#include +#include +#include +#include +#include +#include + + +// end linux specific +// ====================================================================== +#endif + + +#define VERSION_MAJOR 0 +#define VERSION_MINOR 9 +#define VERSION_PATCH 3 + +#define DEFAULT_SERVERNAME "HLMaster 0.9.3" + + + +// function prototypes +// ====================================================================== +void print_usage(); +void print_version(); + + +// begin unix specific +// ====================================================================== +#ifdef PFC_SYSTEM_TYPE_UNIX + +int daemon_start(); + +bool pidfile_create(const char *pszFilename); +bool pidfile_remove(); + +bool sig_install_handlers(); +bool sig_restore_handlers(); + +void sig_block_all_init(); +bool sig_block_all_install(); +bool sig_block_all_restore(); + +void sig_block_reload_init(); +bool sig_block_reload_install(); +bool sig_block_reload_restore(); + +sigset_t g_sig_blockmask_all; +sigset_t g_sig_blockmask_reload; +sigset_t g_sig_blockmask_original; + +static void sig_handle_TERM(int nSignal); +static void sig_handle_HUP(int nSignal); + + +PString *g_pPidFile = NULL; + + +// end unix specific +// ====================================================================== +#endif + + + + +// global variables +// ====================================================================== +PLogfile *g_pInfoLog = NULL; +PLogfile *g_pAccessLog = NULL; + +HLMaster *g_pMaster = NULL; + +bool g_bIsDaemon = false; +bool g_bIsPrivate = false; + +volatile bool g_bIsRunning = false; +volatile bool g_bRequestReload = false; + + + + +// main +// ====================================================================== + +int main(int argc, char *argv[]) +{ + PArgumentList *pArgs = new PArgumentList(); + pArgs->AddOption('a', "ip-address", true, "0.0.0.0"); + pArgs->AddOption('p', "port", true, "27010"); + pArgs->AddOption('h', "help"); + pArgs->AddOption('V', "version"); + pArgs->AddOption('n', "log-level", true, "4"); + pArgs->AddOption('m', "max-servers", true, "200"); + pArgs->AddOption('f', "server-filter", true); + pArgs->AddOption('l', "server-list", true); + pArgs->AddOption('s', "master-name", true); + pArgs->AddOption('c', "closed", false); + pArgs->AddOption('I', "info-log", true, "info.log"); + pArgs->AddOption('A', "access-log", true, "access.log"); + + #if defined PFC_SYSTEM_TYPE_UNIX + pArgs->AddOption('P', "pid-file", true); + pArgs->AddOption('d', "no-daemon"); + pArgs->AddOption('u', "user", true); + pArgs->AddOption('g', "group", true); + #endif + + pArgs->ParseArguments((const char**) &argv[1], (argc - 1)); + + + // check for --help + if(pArgs->IsEnabled('h') == true) + { + print_usage(); + return 0; + } + + // check for --version + if(pArgs->IsEnabled('V') == true) + { + print_version(); + return 0; + } + + // check for unrecognzied options + if(pArgs->GetNumUnknownArguments() > 0) + { + printf("Usage: hlmaster [OPTION]...\n"); + + printf("\n"); + printf("Unrecognized option(s):\n"); + + PStringList *pStrings = pArgs->GetUnknownArgumentsList(); + for(pStrings->PickFirst(); pStrings->IsCurrentValid() == true; pStrings->PickNext()) + printf(" %s\n", pStrings->GetCurrent()); + + printf("\n"); + printf("Try 'hlmaster --help' for more options.\n"); + + return 1; + } + + + +#ifdef PFC_SYSTEM_TYPE_WINDOWS + if(WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) + { + fprintf(stderr, "Error: Required version 2 of Winsock not available\n"); + return 1; + } + +#elif defined PFC_SYSTEM_TYPE_UNIX + // check for group switching + if(pArgs->IsEnabled('g') == true) + { + struct group *grp_entry; + + grp_entry = getgrnam(pArgs->GetValue('g')); + if(grp_entry != NULL) + { + if(setgid(grp_entry->gr_gid) != 0) + { + fprintf(stderr, "Error: Cannot run as group \"%s\". Permission denied.\n", pArgs->GetValue('g')); + return 1; + } + + if(getgid() != grp_entry->gr_gid) + { + fprintf(stderr, "Error: Cannot run as group \"%s\". Setgid failed.\n", pArgs->GetValue('g')); + return 1; + } + } + else + { + fprintf(stderr, "Error: Cannot run as group \"%s\". Group does not exist.\n", pArgs->GetValue('g')); + return 1; + } + } + + // check for user switching + if(pArgs->IsEnabled('u') == true) + { + struct passwd *pwd_entry; + + pwd_entry = getpwnam(pArgs->GetValue('u')); + if(pwd_entry != NULL) + { + if(setuid(pwd_entry->pw_uid) != 0) + { + fprintf(stderr, "Error: Cannot run as user \"%s\". Permission denied.\n", pArgs->GetValue('u')); + return 1; + } + + if(getuid() != pwd_entry->pw_uid) + { + fprintf(stderr, "Error: Cannot run as user \"%s\". Setuid failed.\n", pArgs->GetValue('u')); + return 1; + } + } + else + { + fprintf(stderr, "Error: Cannot run as user \"%s\". User does not exist.\n", pArgs->GetValue('u')); + return 1; + } + } + + // check for daemon mode + if(pArgs->IsEnabled('d') == true) + g_bIsDaemon = false; + else + g_bIsDaemon = true; + + if(g_bIsDaemon == true) + { + int nDaemonStatus = 0; + const char *pChar; + + // check filenames for absolute paths + if(pArgs->IsEnabled('I') == true) + { + pChar = pArgs->GetValue('I'); + + if(pChar[0] != '/') + { + fprintf(stderr, "Error: Path to info-log does not look absolute <%s>\n", pChar); + fprintf(stderr, "Absolute paths are required in daemon mode (eg. /var/log/hlmaster/info.log)\n"); + return 1; + } + } + if(pArgs->IsEnabled('A') == true) + { + pChar = pArgs->GetValue('A'); + + if(pChar[0] != '/') + { + fprintf(stderr, "Error: Path to access-log does not look absolute <%s>\n", pChar); + fprintf(stderr, "Absolute paths are required in daemon mode (eg. /var/log/hlmaster/access.log)\n"); + return 1; + } + } + if(pArgs->IsEnabled('P') == true) + { + pChar = pArgs->GetValue('P'); + + if(pChar[0] != '/') + { + fprintf(stderr, "Error: Path to pid-file does not look absolute <%s>\n", pChar); + fprintf(stderr, "Absolute paths are required in daemon mode (eg. /var/run/hlmaster.pid)\n"); + return 1; + } + } + + + // enter daemon mode + nDaemonStatus = daemon_start(); + if(nDaemonStatus != 0) + { + if(nDaemonStatus == 1) + { + fprintf(stderr, "Error: Could not fork to daemon.\n"); + return 1; + } + else if(nDaemonStatus == 2) + { + // parent, exit + return 0; + } + } + // now we are in the child process + } + + if(pArgs->IsEnabled('P') == true) + { + pidfile_create(pArgs->GetValue('P')); + } + + if(sig_install_handlers() != true) + { + if(g_bIsDaemon != true) + fprintf(stderr, "Error: Could not install signal handlers.\n"); + + return 1; + } + sig_block_all_init(); + sig_block_reload_init(); + +#else +#error Unknown operating system. Only WIN32 / LINUX are recognized. +#endif // PFC_SYSTEM_TYPE_UNIX + + + + // check for info_log + if(pArgs->IsEnabled('I') == true) + { + try + { + g_pInfoLog = new PLogfile(pArgs->GetValue('I'), atoi(pArgs->GetValue('n'))); + } + catch(PFileException ex) + { + if(g_bIsDaemon != true) + fprintf(stderr, "Error: Could not open logfile <%s>\n", pArgs->GetValue('I')); + + ex.GetValue(); + return 1; + } + + g_pInfoLog->WriteLine("Log started", PLogfile::c_LEVEL_INFO); + } + + + // check for access_log + if(pArgs->IsEnabled('A') == true) + { + + #if defined PFC_SYSTEM_TYPE_WINDOWS + if(g_pInfoLog != NULL && (PString::EqualsIgnoreCase(g_pInfoLog->GetFilename(), pArgs->GetValue('A')) == true)) + #elif defined PFC_SYSTEM_TYPE_UNIX + if(g_pInfoLog != NULL && (PString::Equals(g_pInfoLog->GetFilename(), pArgs->GetValue('A')) == true)) + #endif + { + // access && info log are equal + g_pAccessLog = g_pInfoLog; + } + else + { + try + { + g_pAccessLog = new PLogfile(pArgs->GetValue('A'), PLogfile::c_LEVEL_INFO); + } + catch(PFileException ex) + { + if(g_bIsDaemon != true) + fprintf(stderr, "Error: Could not open logfile <%s>\n", pArgs->GetValue('A')); + + ex.GetValue(); + return 1; + } + } + } + + + + try + { + g_pMaster = new HLMaster(pArgs->GetValue('a'), atoi(pArgs->GetValue('p')), atoi(pArgs->GetValue('m')), g_pInfoLog, g_pAccessLog); + } + catch(PSocketException ex) + { + if(g_bIsDaemon != true) + fprintf(stderr, "Error: Could not bind to network interface/port <%s:%s>\n", pArgs->GetValue('a'), pArgs->GetValue('p')); + + if(g_pInfoLog != NULL && g_pInfoLog->Begin(PLogfile::c_LEVEL_CRITICAL) == true) + { + g_pInfoLog->Append("Could not bind to network interface/port <"); + g_pInfoLog->Append(pArgs->GetValue('a')); + g_pInfoLog->Append(':'); + g_pInfoLog->Append(pArgs->GetValue('p')); + g_pInfoLog->Append('>'); + + g_pInfoLog->End(); + } + + ex.GetValue(); + return 1; + } + + // set servername + if(pArgs->IsEnabled('s') == true) + { + pfc::CStringBuffer *pNameBuffer = new pfc::CStringBuffer(64); + + pNameBuffer->Append(DEFAULT_SERVERNAME); + pNameBuffer->Append(" - "); + pNameBuffer->Append(pArgs->GetValue('s')); + + g_pMaster->SetServerName(pNameBuffer->GetCharPointer()); + delete pNameBuffer; + } + else + g_pMaster->SetServerName(DEFAULT_SERVERNAME); + + + + // check for closed mode + g_bIsPrivate = pArgs->IsEnabled('c'); + if(g_bIsPrivate == true) + { + // yep, private + g_pMaster->EnableHostFilter(); + HLServerFilterList *pFilter = g_pMaster->GetHostFilter(); + + pFilter->SetOrderDeny(); + pFilter->SetDefaultDeny(); + + if(g_pInfoLog != NULL) + g_pInfoLog->WriteLine("Closed mode enabled", PLogfile::c_LEVEL_INFO); + } + else if(pArgs->IsEnabled('f') == true) + { + // load banlist + g_pMaster->LoadHostFilter(pArgs->GetValue('f')); + } + + + // load hostlist + if(pArgs->IsEnabled('l') == true) + { + g_pMaster->LoadHosts(pArgs->GetValue('l')); + } + else if(g_bIsPrivate == true) + { + // cannot be in private mode without + // having a host-list. we would have nothing to do! + if(g_bIsDaemon != true) + fprintf(stderr, "Error: Cannot enable closed mode without loading a list of gameservers (--server-list)\n"); + + if(g_pInfoLog != NULL) + g_pInfoLog->WriteLine("Cannot enable closed mode without loading a list of gameservers (--server-list)", PLogfile::c_LEVEL_ERROR); + + return 1; + } + + + + // we do not need the argument list anymore + delete pArgs; + pArgs = NULL; + + + // run the server + g_bIsRunning = true; + while(true) + { + if(g_pMaster->WaitForInput() == true) + { + if(g_pMaster->ReadInput() != true) + continue; + + // check for reload + #if defined PFC_SYSTEM_TYPE_UNIX + sig_block_reload_install(); + #endif + + if(g_bRequestReload == true) + { + if(g_bIsDaemon != true) + printf("Configuration reload requested by signal.\n"); + + if(g_pInfoLog != NULL) + g_pInfoLog->WriteLine("Configuration reload requested by signal.", PLogfile::c_LEVEL_INFO); + + g_pMaster->ReloadHostFilter(); + g_pMaster->ReloadHosts(); + + g_bRequestReload = false; + } + + // process request + g_pMaster->ProcessInput(); + + #if defined PFC_SYSTEM_TYPE_UNIX + sig_block_reload_restore(); + #endif + } + } + g_bIsRunning = false; + + + + // destroy master-server + delete g_pMaster; + + + // close logfiles + if(g_pAccessLog != NULL) + { + if(g_pAccessLog != g_pInfoLog) + delete g_pAccessLog; + + g_pAccessLog = NULL; + } + if(g_pInfoLog != NULL) + { + delete g_pInfoLog; + g_pInfoLog = NULL; + } + + // cleanup + #if defined PFC_SYSTEM_TYPE_WINDOWS + WSACleanup(); + + #elif defined PFC_SYSTEM_TYPE_UNIX + pidfile_remove(); + + sig_restore_handlers(); + #endif + + // success + return 0; +} + + + + +// Begin unix specific +// ====================================================================== +#ifdef PFC_SYSTEM_TYPE_UNIX + +int daemon_start() +{ + pid_t pidDaemon = 0; + + // fork and exit parent + pidDaemon = fork(); + + if(pidDaemon < 0) + { + // fork error + return 1; + } + else if(pidDaemon == 0) + { + // child process + // do nothing + } + else + { + // parent + // exit so we get a new daddy (PID 1 -> init) + return 2; + } + + + // get session leader + setsid(); + + // change working dir to root + chdir("/"); + + // unset umask + umask(0); + + + // close all open filehandles + close(fileno(stdin)); + close(fileno(stdout)); + close(fileno(stderr)); + + // success + return 0; +} + + +// ====================================================================== + +bool pidfile_create(const char *pszFilename) +{ + // copy filename + + if(g_pPidFile == NULL) + g_pPidFile = new PString(PFC_MAX_PATH, pszFilename); + else + { + // pidfile allready exists + return false; + } + + + mode_t mode_prev; + // TODO: errorhandling + + FILE * fpPidfile = NULL; + + // set umask (-rw-r--r--) + mode_prev = umask(S_IWGRP | S_IWOTH); + + fpPidfile = fopen(g_pPidFile->GetValue(), "w"); + + // reset umask + umask(mode_prev); + + if(fpPidfile != NULL) + { + // write our process id to file + fprintf(fpPidfile, "%d\n", getpid()); + + fclose(fpPidfile); + } + else + { + // error + return 1; + } + + // success + return 0; +} + + +// ====================================================================== + +bool pidfile_remove() +{ + // TODO: errorhandling + if(g_pPidFile == NULL) + return false; + + if(unlink(g_pPidFile->GetValue()) == 0) + { + // success + delete g_pPidFile; + g_pPidFile = NULL; + + return 0; + } + else + { + // error + return 1; + } +} + +// ====================================================================== + +bool sig_install_handlers() +{ + struct sigaction new_action; + + new_action.sa_handler = sig_handle_HUP; + new_action.sa_flags = 0; + new_action.sa_flags |= SA_RESTART; + + sigemptyset(&new_action.sa_mask); + sigaddset(&new_action.sa_mask, SIGHUP); + sigaddset(&new_action.sa_mask, SIGUSR1); + sigaddset(&new_action.sa_mask, SIGUSR2); + + if(sigaction(SIGHUP, &new_action, NULL) < 0) + return false; + if(sigaction(SIGUSR1, &new_action, NULL) < 0) + return false; + if(sigaction(SIGUSR2, &new_action, NULL) < 0) + return false; + + + new_action.sa_handler = sig_handle_TERM; + new_action.sa_flags = 0; + + sigemptyset(&new_action.sa_mask); + sigaddset(&new_action.sa_mask, SIGTERM); + sigaddset(&new_action.sa_mask, SIGQUIT); + sigaddset(&new_action.sa_mask, SIGINT); + + if(sigaction(SIGTERM, &new_action, NULL) < 0) + return false; + if(sigaction(SIGQUIT, &new_action, NULL) < 0) + return false; + if(sigaction(SIGINT, &new_action, NULL) < 0) + return false; + + return true; +} + + +// ====================================================================== + +bool sig_restore_handlers() +{ + if(signal(SIGHUP, SIG_DFL) == SIG_ERR) + return false; + if(signal(SIGUSR1, SIG_DFL) == SIG_ERR) + return false; + if(signal(SIGUSR2, SIG_DFL) == SIG_ERR) + return false; + if(signal(SIGTERM, SIG_DFL) == SIG_ERR) + return false; + if(signal(SIGQUIT, SIG_DFL) == SIG_ERR) + return false; + if(signal(SIGINT, SIG_DFL) == SIG_ERR) + return false; + + return true; +} + + +// ====================================================================== + +void sig_block_all_init() +{ + // initialize signal mask + sigemptyset(&g_sig_blockmask_all); + sigemptyset(&g_sig_blockmask_original); + + sigaddset(&g_sig_blockmask_all, SIGTERM); + sigaddset(&g_sig_blockmask_all, SIGQUIT); + sigaddset(&g_sig_blockmask_all, SIGINT); + + sigaddset(&g_sig_blockmask_all, SIGHUP); + sigaddset(&g_sig_blockmask_all, SIGUSR1); + sigaddset(&g_sig_blockmask_all, SIGUSR2); +} + + +// ====================================================================== + +void sig_block_reload_init() +{ + // initialize signal mask + sigemptyset(&g_sig_blockmask_reload); + sigemptyset(&g_sig_blockmask_original); + + sigaddset(&g_sig_blockmask_reload, SIGHUP); + sigaddset(&g_sig_blockmask_reload, SIGUSR1); + sigaddset(&g_sig_blockmask_reload, SIGUSR2); +} + + +// ====================================================================== + +inline bool sig_block_all_install() +{ + sigemptyset(&g_sig_blockmask_original); + + // install signal block mask + if(sigprocmask(SIG_BLOCK, &g_sig_blockmask_all, &g_sig_blockmask_original) < 0) + { + // error + return false; + } + + // success + return true; +} + + +// ====================================================================== + +inline bool sig_block_reload_install() +{ + sigemptyset(&g_sig_blockmask_original); + + // install signal block mask + if(sigprocmask(SIG_BLOCK, &g_sig_blockmask_reload, &g_sig_blockmask_original) < 0) + { + // error + return false; + } + + // success + return true; +} + + +// ====================================================================== + +inline bool sig_block_all_restore() +{ + if(sigprocmask(SIG_SETMASK, &g_sig_blockmask_original, NULL) < 0) + return false; + else + return true; +} + + +// ====================================================================== + +inline bool sig_block_reload_restore() +{ + if(sigprocmask(SIG_SETMASK, &g_sig_blockmask_original, NULL) < 0) + return false; + else + return true; +} + + +// ====================================================================== + +static void sig_handle_HUP(int nSignal) +{ + if(g_bIsRunning != true) + return; + + if(nSignal == SIGHUP || nSignal == SIGUSR1) + { + // request reloading of banlist, hostlist + g_bRequestReload = true; + } + + if(nSignal == SIGHUP || nSignal == SIGUSR2) + { + // reload logfiles + if(g_pInfoLog != NULL) + g_pInfoLog->ReOpen(); + + if(g_pAccessLog != NULL) + g_pAccessLog->ReOpen(); + } +} + + +// ====================================================================== + +static void sig_handle_TERM(int nSignal) +{ + if(g_bIsRunning == true && g_pInfoLog != NULL) + { + if(nSignal == SIGTERM) + g_pInfoLog->WriteLine("Received termination signal (SIGTERM).", PLogfile::c_LEVEL_INFO); + else if(nSignal == SIGQUIT) + g_pInfoLog->WriteLine("Received termination signal (SIGQUIT).", PLogfile::c_LEVEL_INFO); + else if(nSignal == SIGINT) + g_pInfoLog->WriteLine("Received termination signal (SIGINT).", PLogfile::c_LEVEL_INFO); + else + g_pInfoLog->WriteLine("Received termination signal (unknown).", PLogfile::c_LEVEL_INFO); + } + + if(g_bIsRunning == true) + { + // destroy master-server + delete g_pMaster; + + // close logfiles + if(g_pAccessLog != NULL) + { + if(g_pAccessLog != g_pInfoLog) + delete g_pAccessLog; + + g_pAccessLog = NULL; + } + if(g_pInfoLog != NULL) + { + delete g_pInfoLog; + g_pInfoLog = NULL; + } + + // remove pidfile + pidfile_remove(); + } + + exit(128 + nSignal); +} + + +// end linux specific +// ====================================================================== +#endif + + + +// ====================================================================== + +void print_usage() +{ + printf("HLMaster %d.%d.%d - A Half-Life master-server daemon\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); + printf("Usage: hlmaster [OPTION]...\n"); + printf("\n"); + + printf("Startup:\n"); + printf(" -V, --version display the version of hlmaster and exit.\n"); + printf(" -h, --help display this help.\n"); + printf(" -n, --log-level=LEVEL set log level. (0-5, default 4)\n"); +#if defined PFC_SYSTEM_TYPE_UNIX + printf(" -d, --no-daemon do not go to background after startup.\n"); + printf(" -u, --user=USER run hlmaster as USER.\n"); + printf(" -g, --group=GROUP run hlmaster as GROUP.\n"); +#endif + printf("\n"); + + printf("Settings:\n"); + printf(" -a, --ip-address=ADDRESS set ip address to listen on. (default 0.0.0.0)\n"); + printf(" -p, --port=PORT set port to listen on. (default 27010)\n"); + printf(" -s, --master-name=NAME set the master-server name.\n"); + printf(" -m, --max-servers=NUM set maximum NUM of game-servers. (default 200)\n"); + printf(" -f, --server-filter=FILE load server filter-list from FILE.\n"); + printf(" -l, --server-list=FILE load game-servers from FILE.\n"); + printf(" -c, --closed do not accept any heartbeats. (default off)\n"); + printf("\n"); + + printf("Logging:\n"); +#if defined PFC_SYSTEM_TYPE_UNIX + printf(" -P, --pid-file=FILE write process id (PID) to FILE.\n"); +#endif + printf(" -I, --info-log=FILE log general information to FILE.\n"); + printf(" -A, --access-log=FILE log access information to FILE.\n"); + + printf("\n"); + printf("Mail bug-reports and suggestions to .\n"); + printf("Check http://hlmaster.sourceforge.net for newest version.\n"); +} + + +// ====================================================================== + +void print_version() +{ + printf("HLMaster version %d.%d.%d --- Copyright (c) 2001 Silvan Minghetti\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); + printf("\n"); + printf("This program is distributed in the hope that it will be useful,\n"); + printf("but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); + printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"); + printf("GNU General Public License for more details.\n"); + printf("\n"); + printf("Written by Silvan Minghetti .\n"); + printf("Check http://hlmaster.sourceforge.net for newest version.\n"); +} + diff --git a/stamp-h.in b/stamp-h.in new file mode 100644 index 0000000..9788f70 --- /dev/null +++ b/stamp-h.in @@ -0,0 +1 @@ +timestamp diff --git a/win32/HLMaster.exe b/win32/HLMaster.exe new file mode 100755 index 0000000000000000000000000000000000000000..123fca9a94344cf8e3a4807ce52f12d5ee21912a GIT binary patch literal 81920 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 literal 0 HcmV?d00001