pax_global_header00006660000000000000000000000064113056264440014517gustar00rootroot0000000000000052 comment=fbb1d3787244bbc32ebd36ee6ab7be9174dc4d16 hawknl-1.6.8+dfsg2/000077500000000000000000000000001130562644400140205ustar00rootroot00000000000000hawknl-1.6.8+dfsg2/Build_Everything.dsp000066400000000000000000000072101130562644400177730ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="Build_Everything" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Build_Everything - 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 "Build_Everything.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 "Build_Everything.mak" CFG="Build_Everything - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Build_Everything - Win32 Release" (based on\ "Win32 (x86) Console Application") !MESSAGE "Build_Everything - Win32 Debug" (based on\ "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Build_Everything - 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 "samples\Release" # PROP Intermediate_Dir "samples\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 /MD /W3 /GX /O2 /I "include\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /machine:I386 # ADD 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 /nologo /subsystem:console /machine:I386 /out:"lib\async.exe" !ELSEIF "$(CFG)" == "Build_Everything - 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 "samples\Debug" # PROP Intermediate_Dir "samples\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 /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD 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 /nologo /subsystem:console /debug /machine:I386 /out:"lib\async.exe" /pdbtype:sept !ENDIF # Begin Target # Name "Build_Everything - Win32 Release" # Name "Build_Everything - Win32 Debug" # Begin Group "Program Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\samples\async.c # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/COPYING000066400000000000000000000613041130562644400150570ustar00rootroot00000000000000 GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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 library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 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! hawknl-1.6.8+dfsg2/English.lproj/000077500000000000000000000000001130562644400165365ustar00rootroot00000000000000hawknl-1.6.8+dfsg2/English.lproj/InfoPlist.strings000066400000000000000000000010221130562644400220530ustar00rootroot00000000000000/* Localized versions of Info.plist keys */ CFBundleName = "HawkNL"; CFBundleShortVersionString = "HawkNL version 1.6b1"; CFBundleGetInfoString = "HawkNL version 1.6b1, Copyright 2002, Hawk Software."; NSHumanReadableCopyright = "Copyright 2002, Hawk Software."; hawknl-1.6.8+dfsg2/HawkNL.dsp000066400000000000000000000151361130562644400156620ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="HawkNL" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=HawkNL - 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 "HawkNL.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 "HawkNL.mak" CFG="HawkNL - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "HawkNL - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "HawkNL - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "HawkNL - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "HawkNL__" # PROP BASE Intermediate_Dir "HawkNL__" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "src\Release" # PROP Intermediate_Dir "src\Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W4 /GX /O2 /I "include\\" /I "src\win32\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 pthreadVCE.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 wsock32.lib /nologo /version:1.6 /subsystem:windows /dll /map /machine:I386 /out:"lib\HawkNL.dll" /libpath:"src\win32\\" # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE=$(InputPath) PostBuild_Cmds=copy src\Release\*.lib \ lib\ copy \ src\win32\*.dll lib\ # End Special Build Tool !ELSEIF "$(CFG)" == "HawkNL - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "HawkNL_0" # PROP BASE Intermediate_Dir "HawkNL_0" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "src\Debug" # PROP Intermediate_Dir "src\Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W4 /Gm /GX /Zi /Od /I "include\\" /I "src\win32\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 pthreadVCE.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 wsock32.lib /nologo /version:0.5 /subsystem:windows /dll /map /debug /machine:I386 /out:"lib\HawkNL.dll" /pdbtype:sept /libpath:"src\win32\\" # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE=$(InputPath) PostBuild_Cmds=copy src\Debug\*.lib \ lib\ copy \ src\win32\*.dll lib\ # End Special Build Tool !ENDIF # Begin Target # Name "HawkNL - Win32 Release" # Name "HawkNL - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\src\condition.c # End Source File # Begin Source File SOURCE=.\src\crc.c # ADD CPP /Za # End Source File # Begin Source File SOURCE=.\src\err.c # End Source File # Begin Source File SOURCE=.\src\errorstr.c !IF "$(CFG)" == "HawkNL - Win32 Release" # ADD CPP /Ze !ELSEIF "$(CFG)" == "HawkNL - Win32 Debug" !ENDIF # End Source File # Begin Source File SOURCE=.\src\group.c # End Source File # Begin Source File SOURCE=.\src\ipx.c # End Source File # Begin Source File SOURCE=.\src\loopback.c # End Source File # Begin Source File SOURCE=.\src\mutex.c # End Source File # Begin Source File SOURCE=.\src\nl.c !IF "$(CFG)" == "HawkNL - Win32 Release" # ADD CPP /Ze !ELSEIF "$(CFG)" == "HawkNL - Win32 Debug" # PROP Intermediate_Dir "src\Debug" # ADD CPP /Ze !ENDIF # End Source File # Begin Source File SOURCE=.\src\nltime.c # End Source File # Begin Source File SOURCE=.\src\sock.c # End Source File # Begin Source File SOURCE=.\src\thread.c # End Source File # End Group # Begin Group "Include Files" # PROP Default_Filter ".h" # Begin Source File SOURCE=.\src\ipx.h # End Source File # Begin Source File SOURCE=.\src\loopback.h # End Source File # Begin Source File SOURCE=.\include\nl.h # End Source File # Begin Source File SOURCE=.\src\nlinternal.h # End Source File # Begin Source File SOURCE=.\src\parallel.h # End Source File # Begin Source File SOURCE=.\src\serial.h # End Source File # Begin Source File SOURCE=.\src\sock.h # End Source File # Begin Source File SOURCE=.\src\wsock.h # End Source File # End Group # Begin Group "Doc Files" # PROP Default_Filter ".txt" # Begin Source File SOURCE=.\src\NLchanges.txt # End Source File # Begin Source File SOURCE=.\src\readme.txt # PROP Exclude_From_Build 1 # End Source File # End Group # Begin Source File SOURCE=.\src\hawknl.def # End Source File # End Target # End Project hawknl-1.6.8+dfsg2/HawkNL.dsw000066400000000000000000000114761130562644400156740ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 5.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "Build_Everything"=.\Build_Everything.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name HawkNL End Project Dependency Begin Project Dependency Project_Dep_Name Test_async End Project Dependency Begin Project Dependency Project_Dep_Name Test_broadcast End Project Dependency Begin Project Dependency Project_Dep_Name Test_buffer End Project Dependency Begin Project Dependency Project_Dep_Name Test_getfile End Project Dependency Begin Project Dependency Project_Dep_Name Test_max End Project Dependency Begin Project Dependency Project_Dep_Name Test_multicast End Project Dependency Begin Project Dependency Project_Dep_Name HawkNL_static End Project Dependency Begin Project Dependency Project_Dep_Name Test_clientserver End Project Dependency Begin Project Dependency Project_Dep_Name Test_timer End Project Dependency Begin Project Dependency Project_Dep_Name Test_thread_pool End Project Dependency Begin Project Dependency Project_Dep_Name Test_overrun End Project Dependency }}} ############################################################################### Project: "HawkNL"=.\HawkNL.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "HawkNL_static"=.\HawkNL_static.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "Test_async"=.\Test_async.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name HawkNL End Project Dependency }}} ############################################################################### Project: "Test_broadcast"=.\Test_broadcast.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name HawkNL End Project Dependency }}} ############################################################################### Project: "Test_buffer"=.\Test_buffer.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name HawkNL End Project Dependency }}} ############################################################################### Project: "Test_clientserver"=.\Test_clientserver.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name HawkNL End Project Dependency }}} ############################################################################### Project: "Test_getfile"=.\Test_getfile.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name HawkNL End Project Dependency }}} ############################################################################### Project: "Test_max"=.\Test_max.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name HawkNL End Project Dependency }}} ############################################################################### Project: "Test_multicast"=.\Test_multicast.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name HawkNL End Project Dependency }}} ############################################################################### Project: "Test_overrun"=.\Test_overrun.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name HawkNL End Project Dependency }}} ############################################################################### Project: "Test_thread_pool"=.\Test_thread_pool.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name HawkNL End Project Dependency }}} ############################################################################### Project: "Test_timer"=.\Test_timer.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name HawkNL End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### hawknl-1.6.8+dfsg2/HawkNL.mcp000066400000000000000000005235051130562644400156570ustar00rootroot00000000000000cool(hCodeWarrior Project4G8] "Kp/ =JorldRe s  athL stubceLiQ@@SL C 2MPLF<DtimeSbo__~F Hel!"#$Y\%:&O'a()*+, -6.^/w0123456789:+;6<B=Q>`?g@qA~BCDEFGHIJKLM.N;OLPYQdRsSTUVWXYZ[\]^_+`9aDbJcPdUe`fhgsh{ijklmnopqrstu6vIwZxoyyynjq JavaClasses.jarZIP MWZP%     % jZ j] FLj:@jZ^` jZ j] FLj:@jZ^`  %   Merge Out????APPLDLGXckidProjWSPC JavaClasses.jarZIP MWZP??? Monaco( ( __starta.out@ MacHeaders.h package package.sym SystemClassesBundleDcۯ89K:;!jlxwok *&JS%'+,)#.$/(-3 6<=TU>a2N7bd5?er^]\mpin R@ f01VWg " cvutsOQABPDELFGHI_CqM4XYZ[h` Merge Out????APPLDLGXckidProjWSPCS ansi_prefix.mac.hhhAlex Hme::a.out????APPLX????U {__starta.zipZIP JAVAJAVAMetrowerks Java@F EDF;[01vhdlg  x6ROOTGRUPSources FILE FILEFILEFILEFILEFILEFILEFILEFILEGRUP Mac LibrariesFILEFILE FILE FILEFILE GRUP ANSI LibraryFILE FILE FILEFILE FILEڰ@ڰpŇ0owerks:CW DeŇ0ing Cache:Debug HawkNL.68K.Libbbbbb????????????__sta__starta.outE.EXE@mainHello World PPC????APPL@X???? __startHello World PPC????APPL@X????V P'CODE' 'DATA' 'PICT' a.out@U {nm =VNjl IPqpHPSJavaClasses.jarZIP MWZP__start00f`LN A0 UNuHYO o"o,/XXX*t`D@g HHԀ`(X@@g 0H@HԀ`XX$ݱ(SJnXOL`NuH $@ ,& g@JfB,0HIJB;?=KLMNOPQRSTUVWXYZ[@\9<]^_`abc/0q12+.345*|i-j6rgsabck7}89~:;t<=>?@{,ABluCDKLvMNGJOPQFmInRwhxdefoSTUVWyXYZ[\H]^pz_` (E  ! "'#$%&)      !"#$%&'()*+,-./012345678a.outE.EXE@Hello WorldSourcesMac LibrariesANSI LibraryHello World.cInterfaceLibMathLibMSL RuntimePPC.LibMSL C.PPC.Lib:Hello World PPCLib Import PPCBalloon HelpMW C/C++ PPCMW Pascal PPCRezPPCAsmXCOFF Import PPCPEF Import PPCMSL SIOUX.PPC.LibHello World 68KMSL C.68K Fa(4i_8d).LibMSL SIOUX.68K.LibMacOS.lib:a.out:Lib Import 68KMPW Import 68KMW C/C++ 68KPEF Import 68KHello World68K.cMathLib68K Fa(4i_8d).LibMSL Runtime68K.LibMSL C++.68K Fa(4i_8d).LibHello World PPC:a.outMW Pascal 68K:MSL C:Bin:MSL C.68K Fa(4i_8d).Lib:MSL C:Bin:MSL SIOUX.68K.Lib:MacOS 68K:MacOS.lib:Hello World68K.c:MacOS 68K:MathLib68K:MathLib68K (Model Far):MathLib68K Fa(4i_8d).Lib:Runtime:Runtime 68K:MSL Runtime68K.Lib:MSL C++:Bin:MSL C++.68K Fa(4i_8d).Lib:Hello World.c:MacOS Common:InterfaceLib:MacOS Common:MathLib:Runtime:Runtime PPC:MSL RuntimePPC.Lib:MSL C:Bin:MSL C.PPC.Lib:MSL C:Bin:MSL SIOUX.PPC.LibMacOS 68K LinkerMacOS PPC LinkerCustom KeywordsAccess PathsTarget SettingsFile MappingsBuild ExtrasDebugger Target68K CodeGen68K Disassembler68K Linker68K ProjectC/C++ CompilerC/C++ WarningsCFM68KFTP PanelIR OptimizerPascal CompilerPascal WarningsRez CompilerPPC CodeGenPPC DisassemblerPPC LinkerPPC PEFPPC ProjectPPCAsm Panel:HelloWorld 68K68K Global OptimizerPPC Global OptimizerSource TreesDebugger RuntimeOutput FlagsPerl PanelPackager PanelHelloWorld-Carbon:HelloWorldCarbonCarbon.rCarbonLibMSL C.Carbon.LibMSL SIOUX.Carbon.LibTest 68KTest PPCTest-Carbontest.cGUSI_SIOUX.PPC.LibGUSI_MSL.PPC.LibGUSI_Core.PPC.LibPPCToolLibs.oThreadsLibcrc.cerr.cnl.cerrorstr.cgroup.cloopback.cmutex.cthread.cHawkNL PPC:HawkNL PPC:HawkNL.PPC.Lib:HawkNL.68K.LibHawkNL 68KHawkNL.Carbon.Lib:HawkNL.Carbon.LibHawkNL Carbonsock.cGUSIConfig.cpOpenTransportLibOpenTransportExtnPPC.oOpenTptInternetLibOpenTptInetPPC.o:HawkNL.bare.PPC.Lib:HawkNL.bare.68K.Lib0nmain0d@n0main__start???? bcdefghirrrrstuvwss Hel0 "Kp/ =JorldRe   athL stubQ@ MSL C.PPC.LibMPLF@MSL RuntimePPC.bMPLF__L+pfF Hel`pHello WorldSourcesMac brsANSI LibraryHello World.cIntfabMathLibMSL RuntimePPC.LibMSL.Pib:Hello World PPCLib Import PBon HelpMW C/C++ PPCMW Pascal PRPCAsmXCOFF Import PPCPEF ImporPPL SIOUX.PPC.Lib jZ j] FLj:@jZ^` MacOS PPC LinkerHawkNL PPC PPC:iYmain~iYUV W Xbcdefghirsssii Hel0 "Kp/ =JorldRe   athL stubQ@ MSL C.PPC.LibMPLF@MSL RuntimePPC.bMPLF__L+pfF Hel`pHello WorldSourcesMac brsANSI LibraryHello World.cIntfabMathLibMSL RuntimePPC.LibMSL.Pib:Hello World PPCLib Import PBon HelpMW C/C++ PPCMW Pascal PRPCAsmXCOFF Import PPCPEF ImporPPL SIOUX.PPC.Lib MacOS PPC LinkerHawkNL Carbon: a.out????APPLX????U { @:@::GUSI2:lib:sktop Folder:CVS:atrt:GUSI2:lib::include:::GUSI2:include:p Folder:CVS:atrt:GUSI2:include:@:MacOS Support:@:MSL:werks Standard Library:@ a.outE.EXE@MSIEhttp://java.sun.com/products/jdk/1.1/docs/api/epLN AC UNuHYO o"o,/XXX*t`D@g HHԀ`(X@@g 0H@HԀ`XX$ݱ(SJnXOL`NuH $@ ,& g@JfB,0=ti~[` ~[`~ ,~[`~[`@Y H=~[`\~>-et~[`^t~[`_ ,En~[`c~[`Z y=~[`.~?(-rM~[`Jt~[` ,bu~[` M~[`Zx1555=bu~[`~?p-~[`r~[` ,~[`~[`GZ=sm~[`c~?-@e~[`egPre~[`f ,sm~[`j~[`[ Extr=di~[` 0~@-in~[` L ~[` ,~[` O~[`m[xpCal=ot~[` ~@P-~[` P~[` }ra~[` ;~[` dta~[`Z ~@{de~[`_ ~[`e\ =~[` -~[` WSequ~[` ,~[` [Debure~[`\X !<=~[` f~A-re~[` !h~[` ,ri~[` ~[`\tTra=la~[` ~A`-!~[` eft1~[` ,nA~[` ~[`]=Au~[`4 *~A-~[`6 FtrTo~[`7 ,ll~[`; I~[`A]helf_=0L~[`] ~A-se~[`_ "~[`` ,Er~[`d ~[`j]ety=Sq~[` ~B@-~[` o~[` ,io~[` ~[`/^Proc=sI~[`K X~B-pt~[`M tekT~[`N }Ta~[` w;h~[` zn#~[` ~B{de~[` QT~[`P'CODE' 'DATA' 'PICT' @:@::GUSI2:lib:sktop Folder:CVS:atrt:GUSI2:lib::include::Desktop Folder:CVS:atrt:HawkNL:include:::GUSI2:include:p Folder:CVS:atrt:GUSI2:include:@:MacOS Support:@:MSL:werks Standard Library:@MRJApplication__start__sta__start MSIEInternet ExplorerIexplore.exe????APPL迀iYnll蝠~[`nw9,~[`nl{~[`n=~[`ol-~[`ol~[`ow:,~[`ol|~[`o=kT~[`o;m-~[`o=m~[`o>w;,~[`oCm|P~[`oIXme=~[`oem:-bk~[`ogm;~[`ohw<,~[`ommE|~[`osl2=~[`omc-~[`omg~[`ow=,~[`om~[`o=~[`om}(-~[`on ps~[`ow>,ps~[`onh~[`pYX=~[`pun}-~[`pwn52s~[`pxw?,~[`p}n8i~[`pcH=~[`pnv}-~[`pn~[`pw@,~[`pn~[`p=vu~[`pn~ -~[`pn~[`pwA, ~[`pnk~[`p`=~[`pn~p-~[`pnT~[`pwB,l~[`pnl~[`q=~[`qo>~-~[`qoZ~[`q wC,~[`q%o]m~[`q+=~[`qGo-~[`qIo~[`qJwD}~[`qPo;w~[`qQo~[`qopp{~[`qtp~[`qz=~[`qp-n~[`qp~[`qwL,~[`qq8~[`q=~[`qq -o~[`qq~[`qwM,~[`qq0 ~[`q@ =bo~[`qq3-p~[`qq7~[`qwN,~[`qqx ~[`qP'CODE' 'DATA' 'PICT' ~[`qwM,~[`qq0 ~[`q@ =bo~[`qq3-p~[`qq7~[`qwN,~[`qqx ~[`qmainiYmain~iY  XOL`NuH $@ ,& g@JfB,0?PDREFMGHIJP'CODE' 'DATA' 'PICT'http://java.sun.com/products/jdk/1.1/docs/api/dCarbon????APPL@X???? JBoundApp????WINDnull JBoundApp????WINDnull MSIEInternet ExplorerIexplore.exej]0j:@jZ j] FLj:@jZ^`0 Rp` f Rr`@kf`g&F&SGR7n`7n<7n>p0 RpB0p0 RpB0p0 RpB0pX@@RE Emp0 RB0L N^NuSetupLabelMenuNV/N~UO/.?<N060&N^NuInitDialogNV(/ $n j^C( Pp5"QUO/ Hxp.*/Nx0UO/ Hxp.+/Nb0UO/ Hxp.,/NL0UO/ Hxp.-/N60UO/ Hxp../N 0UO/ Hxp.//N 0UO/ Hxp.0/N0UO/ Hxp.1/N0UO/ Hx p.2/N0UO/ Hx p.3/N0UO/ Hx 0.4R@H/N0A6pRJf@(A6C)p.(.UO/ Hx Hn(N0$_N^NuPutDataNV$/ $n j^C$ Pp5"QUO/ HxHnNr0n&UO/ HxHnNZ0n'UO/ HxHnNB0n(UO/ HxHnN*0n)UO/ HxHnN0n*UO/ HxHnN0n+UO/ HxHnN0n,UO/ HxHnN0n-UO/ Hx HnN0n.UO/ Hx HnN0n/UO/ Hx HnN0 .S=@0UO/ Hx Hn$?<N0A%C2p.$.p.$A$B0A$"j^"Qp5"Qp$_N^NuGetDataNVH0&n$n vxz|~BnBnBnBnBnBn R"S)(????APPL迀iYnll蝠~[`nw9,~[`nl{~[`n=~[`ol-~[`ol~[`ow:,~[`ol|~[`o=kT~[`o;m-~[`o=m~[`o>w;,~[`oCm|P~[`oIXme=~[`oem:-bk~[`ogm;~[`ohw<,~[`ommE|~[`osl2=~[`omc-~[`omg~[`ow=,~[`om~[`o=~[`om}(-~[`on ps~[`ow>,ps~[`onh~[`pYX=~[`pun}-~[`pwn52s~[`pxw?,~[`p}n8i~[`pcH=~[`pnv}-~[`pn~[`pw@,~[`pn~[`p=vu~[`pn~ -~[`pn~[`pwA, ~[`pnk~[`p`=~[`pn~p-~[`pnT~[`pwB,l~[`pnl~[`q=~[`qo>~-~[`qoZ~[`q wC,~[`q%o]m~[`q+=~[`qGo-~[`qIo~[`qJwD}~[`qPo;w~[`qQo~[`qopp{~[`qtp~[`qz=~[`qp-n~[`qp~[`qwL,~[`qq8~[`q=~[`qq -o~[`qq~[`qwM,~[`qq0 ~[`q@ =bo~[`qq3-p~[`qq7~[`qwN,~[`qqx ~[`q0 Rpdhp Rrdhk pg&F&SGR7nd7n<7n>p0 RpB0p0 RpB0p0 RpB0pX@@RE Emp0 RB0L N^NuSetupLabelMenuNV/N~UO/.?<N060&N^NuInitDialogNV(/ $n j^C( Pp5"QUO/ Hxp.*/Nx0UO/ Hxp.+/Nb0UO/ Hxp.,/NL0UO/ Hxp.-/N60UO/ Hxp../N 0UO/ Hxp.//N 0UO/ Hxp.0/N0UO/ Hxp.1/N0UO/ Hx p.2/N0UO/ Hx p.3/N0UO/ Hx 0.4R@H/N0A6pRJf@(A6C)p.(.UO/ Hx Hn(N0$_N^NuPutDataNV$/ $n j^C$ Pp5"QUO/ HxHnNr0n&UO/ HxHnNZ0n'UO/ HxHnNB0n(UO/ HxHnN*0n)UO/ HxHnN0n*UO/ HxHnN0n+UO/ HxHnN0n,UO/ HxHnN0n-UO/ Hx HnN0n.UO/ Hx HnN0n/UO/ Hx HnN0 .S=@0UO/ Hx Hn$?<N0A%C2p.$.p.$A$B0A$"j^"Qp5"Qp$_N^NuGetDataNVH0&n$n vxz|~BnBnBnBnBnBn R"S)(Hello World:Project MiscHello World:EditorHello World:FontHello World:MIPS CodeGenHello World:MIPS Linker PanelHello World:MIPS ProjectHello World:MrC[pp] Hello World:MrC[pp] CodeGenHello World:MrC[pp] WarningsHello World:Magic Cap Class CompilerHello World:Magic Cap LinkerHello World:Magic Cap ProjectHello World:Project ExtrasHello World:Custom KeywordsHello World:Access PathsHello World:Build ExtrasHello World:VCS SetupHello World:68K CodeGenHello World:68K DisassemblerHello World:68K LinkerHello World:68K ProjectHello World:C/C++ CompilerHello World:C/C++ WarningsHello World:CFM68KHello World:IR OptimizerHello World:Java ProjectHello World:Pascal CompilerHello World:Pascal WarningsHello World:PPC CodeGenHello World:PPC DisassemblerHello World:PPC LinkerHello World:PPC PEFHello World:PPC ProjectHello World:PPCAsm PanelHello World:Rez CompilerHello World:WinRC CompilerHello World:x86 CodeGenHello World:x86 LinkerHello World:x86 ProjectHello World:Target SettingsHello World:File MappingsProject File ListHello World 68K:Custom KeywordsHello World 68K:Access PathsHello World 68K:Target SettingsHello World 68K:File MappingsHello World 68K:Build ExtrasHello World 68K:68K CodeGenHello World 68K:68K DisassemblerHello World 68K:68K LinkerHello World 68K:68K ProjectHello World 68K:C/C++ CompilerHello World 68K:C/C++ WarningsHello World 68K:CFM68KHello World 68K:IR OptimizerHello World 68K:MacOS Merge PanelHello World 68K:Pascal CompilerHello World 68K:Pascal WarningsHello World 68K:PPC CodeGenHello World 68K:PPC DisassemblerHello World 68K:PPC LinkerHello World 68K:PPC PEFHello World 68K:PPC ProjectHello World 68K:PPCAsm PanelHello World 68K:Rez CompilerHello World 68K:WinRC CompilerHello World 68K:x86 CodeGenHello World 68K:x86 LinkerHello World 68K:x86 ProjectHello World:MacOS Merge PanelHello World PPC:Custom KeywordsHello World PPC:Access PathsHello World PPC:Target SettingsHello World PPC:File MappingsHello World PPC:Build ExtrasHello World PPC:68K CodeGenHello World PPC:68K DisassemblerHello World PPC:68K LinkerHello World PPC:68K ProjectHello World PPC:C/C++ CompilerHello World PPC:C/C++ WarningsHello World PPC:CFM68KHello World PPC:IR OptimizerHello World PPC:MacOS Merge PanelHello World PPC:Pascal CompilerHello World PPC:Pascal WarningsHello World PPC:PPC CodeGenHello World PPC:PPC DisassemblerHello World PPC:PPC LinkerHello World PPC:PPC PEFHello World PPC:PPC ProjectHello World PPC:PPCAsm PanelHello World PPC:Rez CompilerHello World PPC:WinRC CompilerHello World PPC:x86 CodeGenHello World PPC:x86 LinkerHello World PPC:x86 ProjectHello World 68K:Java OutputHello World 68K:Java ProjectHello World 68K:Java VMHello World PPC:Java OutputHello World PPC:Java ProjectHello World PPC:Java VMHello World 68K:Java LanguageHello World PPC:Java LanguageHello World 68K:Debugger TargetHello World 68K:FTP PanelHello World 68K:JavaDoc ProjectHello World 68K:x86 Exceptions PanelHello World PPC:Debugger TargetHello World PPC:FTP PanelHello World PPC:JavaDoc ProjectHello World PPC:x86 Exceptions PanelHello World 68K:68K Global OptimizerHello World 68K:Java Command LineHello World 68K:Java MacOS SettingsHello World 68K:PPC Global OptimizerHello World 68K:x86 Global OptimizerHello World PPC:68K Global OptimizerHello World PPC:Java Command LineHello World PPC:Java MacOS SettingsHello World PPC:PPC Global OptimizerHello World PPC:x86 Global OptimizerHello World 68K:Source TreesHello World 68K:Debugger RuntimeHello World 68K:Output FlagsHello World 68K:Perl PanelHello World PPC:Source TreesHello World PPC:Debugger RuntimeHello World PPC:Output FlagsHello World PPC:Perl PanelHello World 68K:Remote DebugHello World 68K:Auto-targetHello World 68K:Java MRJAppBuilderHello World 68K:Packager PanelHello World 68K:x86 DisassemblerHello World PPC:Remote DebugHello World PPC:Auto-targetHello World PPC:Java MRJAppBuilderHello World PPC:Packager PanelHello World PPC:x86 DisassemblerHelloWorld-Carbon:Source TreesHelloWorld-Carbon:Access PathsHelloWorld-Carbon:Debugger RuntimeHelloWorld-Carbon:Target SettingsHelloWorld-Carbon:File MappingsHelloWorld-Carbon:Build ExtrasHelloWorld-Carbon:Debugger TargetHelloWorld-Carbon:Remote DebugHelloWorld-Carbon:Auto-targetHelloWorld-Carbon:Custom KeywordsHelloWorld-Carbon:68K CodeGenHelloWorld-Carbon:68K DisassemblerHelloWorld-Carbon:68K Global OptimizerHelloWorld-Carbon:68K LinkerHelloWorld-Carbon:68K ProjectHelloWorld-Carbon:C/C++ CompilerHelloWorld-Carbon:C/C++ WarningsHelloWorld-Carbon:CFM68KHelloWorld-Carbon:FTP PanelHelloWorld-Carbon:Java Command LineHelloWorld-Carbon:Java LanguageHelloWorld-Carbon:Java MRJAppBuilderHelloWorld-Carbon:Java OutputHelloWorld-Carbon:Java ProjectHelloWorld-Carbon:JavaDoc ProjectHelloWorld-Carbon:MacOS Merge PanelHelloWorld-Carbon:Output FlagsHelloWorld-Carbon:Packager PanelHelloWorld-Carbon:PPC CodeGenHelloWorld-Carbon:PPC DisassemblerHelloWorld-Carbon:PPC Global OptimizerHelloWorld-Carbon:PPC LinkerHelloWorld-Carbon:PPC PEFHelloWorld-Carbon:PPC ProjectHelloWorld-Carbon:PPCAsm PanelHelloWorld-Carbon:Rez CompilerHelloWorld-Carbon:WinRC CompilerHelloWorld-Carbon:x86 CodeGenHelloWorld-Carbon:x86 DisassemblerHelloWorld-Carbon:x86 Exceptions PanelHelloWorld-Carbon:x86 Global OptimizerHelloWorld-Carbon:x86 LinkerHelloWorld-Carbon:x86 ProjectTest 68K:Source TreesTest 68K:Access PathsTest 68K:Debugger RuntimeTest 68K:Target SettingsTest 68K:File MappingsTest 68K:Build ExtrasTest 68K:Debugger TargetTest 68K:Remote DebugTest 68K:Auto-targetTest 68K:Custom KeywordsTest 68K:68K CodeGenTest 68K:68K DisassemblerTest 68K:68K Global OptimizerTest 68K:68K LinkerTest 68K:68K ProjectTest 68K:C/C++ CompilerTest 68K:C/C++ WarningsTest 68K:CFM68KTest 68K:FTP PanelTest 68K:Java Command LineTest 68K:Java LanguageTest 68K:Java MRJAppBuilderTest 68K:Java OutputTest 68K:Java ProjectTest 68K:JavaDoc ProjectTest 68K:MacOS Merge PanelTest 68K:Output FlagsTest 68K:Packager PanelTest 68K:PPC CodeGenTest 68K:PPC DisassemblerTest 68K:PPC Global OptimizerTest 68K:PPC LinkerTest 68K:PPC PEFTest 68K:PPC ProjectTest 68K:PPCAsm PanelTest 68K:Rez CompilerTest 68K:WinRC CompilerTest 68K:x86 CodeGenTest 68K:x86 DisassemblerTest 68K:x86 Exceptions PanelTest 68K:x86 Global OptimizerTest 68K:x86 LinkerTest 68K:x86 ProjectTest PPC:Source TreesTest PPC:Access PathsTest PPC:Debugger RuntimeTest PPC:Target SettingsTest PPC:File MappingsTest PPC:Build ExtrasTest PPC:Debugger TargetTest PPC:Remote DebugTest PPC:Auto-targetTest PPC:Custom KeywordsTest PPC:68K CodeGenTest PPC:68K DisassemblerTest PPC:68K Global OptimizerTest PPC:68K LinkerTest PPC:68K ProjectTest PPC:C/C++ CompilerTest PPC:C/C++ WarningsTest PPC:CFM68KTest PPC:FTP PanelTest PPC:Java Command LineTest PPC:Java LanguageTest PPC:Java MRJAppBuilderTest PPC:Java OutputTest PPC:Java ProjectTest PPC:JavaDoc ProjectTest PPC:MacOS Merge PanelTest PPC:Output FlagsTest PPC:Packager PanelTest PPC:PPC CodeGenTest PPC:PPC DisassemblerTest PPC:PPC Global OptimizerTest PPC:PPC LinkerTest PPC:PPC PEFTest PPC:PPC ProjectTest PPC:PPCAsm PanelTest PPC:Rez CompilerTest PPC:WinRC CompilerTest PPC:x86 CodeGenTest PPC:x86 DisassemblerTest PPC:x86 Exceptions PanelTest PPC:x86 Global OptimizerTest PPC:x86 LinkerTest PPC:x86 ProjectTest-Carbon:Source TreesTest-Carbon:Access PathsTest-Carbon:Debugger RuntimeTest-Carbon:Target SettingsTest-Carbon:File MappingsTest-Carbon:Build ExtrasTest-Carbon:Debugger TargetTest-Carbon:Remote DebugTest-Carbon:Auto-targetTest-Carbon:Custom KeywordsTest-Carbon:68K CodeGenTest-Carbon:68K DisassemblerTest-Carbon:68K Global OptimizerTest-Carbon:68K LinkerTest-Carbon:68K ProjectTest-Carbon:C/C++ CompilerTest-Carbon:C/C++ WarningsTest-Carbon:CFM68KTest-Carbon:FTP PanelTest-Carbon:Java Command LineTest-Carbon:Java LanguageTest-Carbon:Java MRJAppBuilderTest-Carbon:Java OutputTest-Carbon:Java ProjectTest-Carbon:JavaDoc ProjectTest-Carbon:MacOS Merge PanelTest-Carbon:Output FlagsTest-Carbon:Packager PanelTest-Carbon:PPC CodeGenTest-Carbon:PPC DisassemblerTest-Carbon:PPC Global OptimizerTest-Carbon:PPC LinkerTest-Carbon:PPC PEFTest-Carbon:PPC ProjectTest-Carbon:PPCAsm PanelTest-Carbon:Rez CompilerTest-Carbon:WinRC CompilerTest-Carbon:x86 CodeGenTest-Carbon:x86 DisassemblerTest-Carbon:x86 Exceptions PanelTest-Carbon:x86 Global OptimizerTest-Carbon:x86 LinkerTest-Carbon:x86 ProjectHawkNL PPC:Source TreesHawkNL PPC:Access PathsHawkNL PPC:Debugger RuntimeHawkNL PPC:Target SettingsHawkNL PPC:File MappingsHawkNL PPC:Build ExtrasHawkNL PPC:Debugger TargetHawkNL PPC:Remote DebugHawkNL PPC:Auto-targetHawkNL PPC:Custom KeywordsHawkNL PPC:68K CodeGenHawkNL PPC:68K DisassemblerHawkNL PPC:68K Global OptimizerHawkNL PPC:68K LinkerHawkNL PPC:68K ProjectHawkNL PPC:C/C++ CompilerHawkNL PPC:C/C++ WarningsHawkNL PPC:CFM68KHawkNL PPC:FTP PanelHawkNL PPC:Java Command LineHawkNL PPC:Java LanguageHawkNL PPC:Java MRJAppBuilderHawkNL PPC:Java OutputHawkNL PPC:Java ProjectHawkNL PPC:JavaDoc ProjectHawkNL PPC:MacOS Merge PanelHawkNL PPC:Output FlagsHawkNL PPC:Packager PanelHawkNL PPC:PPC CodeGenHawkNL PPC:PPC DisassemblerHawkNL PPC:PPC Global OptimizerHawkNL PPC:PPC LinkerHawkNL PPC:PPC PEFHawkNL PPC:PPC ProjectHawkNL PPC:PPCAsm PanelHawkNL PPC:Rez CompilerHawkNL PPC:WinRC CompilerHawkNL PPC:x86 CodeGenHawkNL PPC:x86 DisassemblerHawkNL PPC:x86 Exceptions PanelHawkNL PPC:x86 Global OptimizerHawkNL PPC:x86 LinkerHawkNL PPC:x86 ProjectHawkNL 68K:Source TreesHawkNL 68K:Access PathsHawkNL 68K:Debugger RuntimeHawkNL 68K:Target SettingsHawkNL 68K:File MappingsHawkNL 68K:Build ExtrasHawkNL 68K:Debugger TargetHawkNL 68K:Remote DebugHawkNL 68K:Auto-targetHawkNL 68K:Custom KeywordsHawkNL 68K:68K CodeGenHawkNL 68K:68K DisassemblerHawkNL 68K:68K Global OptimizerHawkNL 68K:68K LinkerHawkNL 68K:68K ProjectHawkNL 68K:C/C++ CompilerHawkNL 68K:C/C++ WarningsHawkNL 68K:CFM68KHawkNL 68K:FTP PanelHawkNL 68K:Java Command LineHawkNL 68K:Java LanguageHawkNL 68K:Java MRJAppBuilderHawkNL 68K:Java OutputHawkNL 68K:Java ProjectHawkNL 68K:JavaDoc ProjectHawkNL 68K:MacOS Merge PanelHawkNL 68K:Output FlagsHawkNL 68K:Packager PanelHawkNL 68K:PPC CodeGenHawkNL 68K:PPC DisassemblerHawkNL 68K:PPC Global OptimizerHawkNL 68K:PPC LinkerHawkNL 68K:PPC PEFHawkNL 68K:PPC ProjectHawkNL 68K:PPCAsm PanelHawkNL 68K:Rez CompilerHawkNL 68K:WinRC CompilerHawkNL 68K:x86 CodeGenHawkNL 68K:x86 DisassemblerHawkNL 68K:x86 Exceptions PanelHawkNL 68K:x86 Global OptimizerHawkNL 68K:x86 LinkerHawkNL 68K:x86 ProjectHawkNL.Carbon.Lib:Source TreesHawkNL.Carbon.Lib:Access PathsHawkNL.Carbon.Lib:Debugger RuntimeHawkNL.Carbon.Lib:Target SettingsHawkNL.Carbon.Lib:File MappingsHawkNL.Carbon.Lib:Build ExtrasHawkNL.Carbon.Lib:Debugger TargetHawkNL.Carbon.Lib:Remote DebugHawkNL.Carbon.Lib:Auto-targetHawkNL.Carbon.Lib:Custom KeywordsHawkNL.Carbon.Lib:68K CodeGenHawkNL.Carbon.Lib:68K DisassemblerHawkNL.Carbon.Lib:68K Global OptimizerHawkNL.Carbon.Lib:68K LinkerHawkNL.Carbon.Lib:68K ProjectHawkNL.Carbon.Lib:C/C++ CompilerHawkNL.Carbon.Lib:C/C++ WarningsHawkNL.Carbon.Lib:CFM68KHawkNL.Carbon.Lib:FTP PanelHawkNL.Carbon.Lib:Java Command LineHawkNL.Carbon.Lib:Java LanguageHawkNL.Carbon.Lib:Java MRJAppBuilderHawkNL.Carbon.Lib:Java OutputHawkNL.Carbon.Lib:Java ProjectHawkNL.Carbon.Lib:JavaDoc ProjectHawkNL.Carbon.Lib:MacOS Merge PanelHawkNL.Carbon.Lib:Output FlagsHawkNL.Carbon.Lib:Packager PanelHawkNL.Carbon.Lib:PPC CodeGenHawkNL.Carbon.Lib:PPC DisassemblerHawkNL.Carbon.Lib:PPC Global OptimizerHawkNL.Carbon.Lib:PPC LinkerHawkNL.Carbon.Lib:PPC PEFHawkNL.Carbon.Lib:PPC ProjectHawkNL.Carbon.Lib:PPCAsm PanelHawkNL.Carbon.Lib:Rez CompilerHawkNL.Carbon.Lib:WinRC CompilerHawkNL.Carbon.Lib:x86 CodeGenHawkNL.Carbon.Lib:x86 DisassemblerHawkNL.Carbon.Lib:x86 Exceptions PanelHawkNL.Carbon.Lib:x86 Global OptimizerHawkNL.Carbon.Lib:x86 LinkerHawkNL.Carbon.Lib:x86 ProjectHawkNL Carbon:Source TreesHawkNL Carbon:Access PathsHawkNL Carbon:Debugger RuntimeHawkNL Carbon:Target SettingsHawkNL Carbon:File MappingsHawkNL Carbon:Build ExtrasHawkNL Carbon:Debugger TargetHawkNL Carbon:Remote DebugHawkNL Carbon:Auto-targetHawkNL Carbon:Custom KeywordsHawkNL Carbon:68K CodeGenHawkNL Carbon:68K DisassemblerHawkNL Carbon:68K Global OptimizerHawkNL Carbon:68K LinkerHawkNL Carbon:68K ProjectHawkNL Carbon:C/C++ CompilerHawkNL Carbon:C/C++ WarningsHawkNL Carbon:CFM68KHawkNL Carbon:FTP PanelHawkNL Carbon:Java Command LineHawkNL Carbon:Java LanguageHawkNL Carbon:Java MRJAppBuilderHawkNL Carbon:Java OutputHawkNL Carbon:Java ProjectHawkNL Carbon:JavaDoc ProjectHawkNL Carbon:MacOS Merge PanelHawkNL Carbon:Output FlagsHawkNL Carbon:Packager PanelHawkNL Carbon:PPC CodeGenHawkNL Carbon:PPC DisassemblerHawkNL Carbon:PPC Global OptimizerHawkNL Carbon:PPC LinkerHawkNL Carbon:PPC PEFHawkNL Carbon:PPC ProjectHawkNL Carbon:PPCAsm PanelHawkNL Carbon:Rez CompilerHawkNL Carbon:WinRC CompilerHawkNL Carbon:x86 CodeGenHawkNL Carbon:x86 DisassemblerHawkNL Carbon:x86 Exceptions PanelHawkNL Carbon:x86 Global OptimizerHawkNL Carbon:x86 LinkerHawkNL Carbon:x86 Project,=L3pVt 5   ; Vr9Tg 1!I"b#{$%&' ()*%+E,b-@./01??2 3 14P5o67( 89: ;!<L;B=]>u?@AB0C+D4!E-=F8[G;{H>IJKL M0N KOgPQRS TU V% ;WfI WX xYer Z [ \jo ] ^ _ <` Wa sb c d e f g h 3i Qj qk l m n o p *q Or ts tp u v whA )xP Kyan ozx.ma { | } ~/utLm A^z>` >a:^~&Ef#Ba.Lbx5Jd0Law&:K`v#8Nd~!6Pn8Mc|&7Lbx     $=Vs+C` !"-#G$f%~&'()* + , :- [. r/ 0 1 2 3 4!5! 6!A7!b8!y9!:!;!<!=!>"?")@"DA"\B"sC"D"E"F"G"H#I#(J#BK#TL#iM#N#O#P#Q#R$S$$T$<U$VV$mW$X$Y$Z$[$\%]%^%3_%J`%fa%b%c%d%e%f&g&h&:i&Sj&kk&l&m&n&o&p'q'#r'9s'Pt'ju'v'w'x'y'z'{(|(.}(I~(f(~(((()))+)C)[)u)))))**4*S*v****++6+X+v++++,,=,V,r,,,,--:-^-}---..#.=.[.z..../"/I/f/////00.0L0g0000011.1K1h1}11112 2'2E2e2222233(3B3]3x333344- @:@::GUSI2:lib:sktop Folder:CVS:atrt:GUSI2:lib::include::MacOS Support:@:MSL:werks Standard Library:@::GUSI2:include:@MRJApplication MacOS PPC LinkerAPPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.bhcPdgP \Balloon Help3jP* 'TEXT.cMW C/C++ PPCTEXT.c++MW C/C++ PPCTEXT.ccMW C/C++ PPCTEXT.cpMW C/C++ PPCTEXT.cppMW C/C++ PPCTEXT.expTEXT.hMW C/C++ PPCTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.rRezTEXT.shcPdgP \PPCAsmn Hel3jP* 'XCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPMacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KRSRC`TEXT.bhcPdgP \Balloon Help3jP* 'TEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pMW Pascal 68KTEXT.pasMW Pascal 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.rRezTEXT.segv "(h@v X|N 0+d*v 0X3Udocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docPWin32 x86 Linker TEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.poclhjj:MW Pascal x86oP@(xTEXT.paslhjj:MW Pascal x86oP@(xTEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.rcMW WinRCTEXT.res++"(h@v X|WinRes Import*v 0X3I.doc.libLib Import x86.objObj Import x86 MC LinkerCLUS.defss`TRezJava Heln(:@MMCHMMLB.docv "(h@v X|Lib Import 68K*v 0X3IMPLF.docv "(h@v X|Lib Import 68K*v 0X3IOBJ .docv "(h@v X|MPW Import 68K*v 0X3ITEXT.cMC C/C++TEXT.c++v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.cc+v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.clsMC Class CompilerTEXT.cp+v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.cppv "(h@v X|MW C/C++ 68K*v 0X3ITEXT.defTEXT.docTEXT.hTEXT.pch++"(h@v X|MW Pascal 68K*v 0X3ITEXT.pas++"(h@v X|MW Pascal 68K*v 0X3ITEXT.pchMC C/C++TEXT.pch++"(h@v X|MW C/C++ 68K*v 0X3ITEXT.ts Java LinkerAPPL:v>n`Tn(:`Appl:v>n`Tn(:`Clss.class`TMW Java Heln(*MWCD:v>n`Tn(:`RSRC:v>n`Tn(:`TEXT.bhn`TBalloon Helpn(*TEXT.htmlhoP@(!TEXT.java`TMW Java Heln(*TEXT.ripss`TRezJava Heln(*ZIP .zipss`TMW Java Heln(*docu:v>n`Tn(:`rsrc:v>n`Tn(:`.class`TMW Java Heln(*.zipss`TMW Java Heln(* MIPS LinkerTEXT.c~n`TMW C/C++ MIPSn(wHTEXT.c++n`TMW C/C++ MIPSn(wHTEXT.cc+n`TMW C/C++ MIPSn(wHTEXT.cp+n`TMW C/C++ MIPSn(wHTEXT.cppn`TMW C/C++ MIPSn(wHTEXT.hppn`TMW C/C++ MIPSn(wHTEXT.pchn`TMW C/C++ MIPSn(wHTEXT.pch++`TMW C/C++ MIPSn(wHNoneMMPr@MacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KPLob`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pMW Pascal 68KTEXT.pasMW Pascal 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.ppuMW Pascal 68KTEXT.rRezTEXT.segdocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docP.rsrc`MacOS MergeAPPL`Appl`RSRC`TEXT.bhBalloon HelpTEXT.rRezrsrc`shlbMacOS PPC LinkerAPPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ PPCTEXT.c++MW C/C++ PPCTEXT.ccMW C/C++ PPCTEXT.cpMW C/C++ PPCTEXT.cppMW C/C++ PPCTEXT.expTEXT.hMW C/C++ PPCTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.ppuMW Pascal PPCTEXT.rRezTEXT.sPPCAsmXCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPJava LinkerAPPL`Appl`COkMW JavaClssMW JavaJjrf.jrfMWCD`RSRC`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaTEXT.mfTEXT.rRezZIP MW Java@ZipFMW Javadocu`rsrc`.classMW Java.jar@.javaMW Java.zipMW JavaWin32 x86 LinkerTEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.ccMW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.defTEXT.hMW C/C++ x86TEXT.pMW Pascal x86TEXT.pasMW Pascal x86TEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.ppuMW Pascal x86TEXT.rcMW WinRCTEXT.resWinRes Import.docP.libLib Import x86.objObj Import x86MW JavaDoc Linker COkMW JavaDocClssMW JavaDocRSRCRez`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaDocTEXT.rRezZIP MW JavaDoc@ZipFMW JavaDocrsrcRez`.classMW JavaDoc.zipMW JavaDocTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.ppuMW Pascal PPCTEXT.rRezTEXT.sPPCAsmXCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPJava LinkerAPPL`Appl`COkMW JavaClssMW JavaJjrf.jrfMWCD`RSRC`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaTEXT.mfTEXT.rRezZIP MW Java@ZipFMW Javadocu`rsrc`.classMW Java.jar@.javaMW Java.zipMW JavaWin32 x86 LinkerTEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.ccMW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.defTEXT.hMW C/C++ x86TEXT.pMW Pascal x86TEXT.pasMW Pascal x86TEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.ppuMW Pascal x86TEXT.rcMW WinRCTEXT.resWinRes Import.docP.libLib Import x86.objObj Import x86MW JavaDoc Linker COkMW JavaDocClssMW JavaDocRSRCRez`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaDocTEXT.rRezZIP MW JavaDoc@ZipFMW JavaDocrsrcRez`.classMW JavaDoc.zipMW JavaDoc MacOS PPC LinkerAPPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.bhcPdgP \Balloon Help3jP* 'TEXT.cMW C/C++ PPCTEXT.c++MW C/C++ PPCTEXT.ccMW C/C++ PPCTEXT.cpMW C/C++ PPCTEXT.cppMW C/C++ PPCTEXT.expTEXT.hMW C/C++ PPCTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.rRezTEXT.shcPdgP \PPCAsmn Hel3jP* 'XCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPMacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KRSRC`TEXT.bhcPdgP \Balloon Help3jP* 'TEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pMW Pascal 68KTEXT.pasMW Pascal 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.rRezTEXT.segv "(h@v X|N 0+d*v 0X3Udocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docPWin32 x86 Linker TEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.poclhjj:MW Pascal x86oP@(xTEXT.paslhjj:MW Pascal x86oP@(xTEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.rcMW WinRCTEXT.res++"(h@v X|WinRes Import*v 0X3I.doc.libLib Import x86.objObj Import x86 MC LinkerCLUS.defss`TRezJava Heln(:@MMCHMMLB.docv "(h@v X|Lib Import 68K*v 0X3IMPLF.docv "(h@v X|Lib Import 68K*v 0X3IOBJ .docv "(h@v X|MPW Import 68K*v 0X3ITEXT.cMC C/C++TEXT.c++v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.cc+v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.clsMC Class CompilerTEXT.cp+v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.cppv "(h@v X|MW C/C++ 68K*v 0X3ITEXT.defTEXT.docTEXT.hTEXT.pch++"(h@v X|MW Pascal 68K*v 0X3ITEXT.pas++"(h@v X|MW Pascal 68K*v 0X3ITEXT.pchMC C/C++TEXT.pch++"(h@v X|MW C/C++ 68K*v 0X3ITEXT.ts Java LinkerAPPL:v>n`Tn(:`Appl:v>n`Tn(:`Clss.class`TMW Java Heln(*MWCD:v>n`Tn(:`RSRC:v>n`Tn(:`TEXT.bhn`TBalloon Helpn(*TEXT.htmlhoP@(!TEXT.java`TMW Java Heln(*TEXT.ripss`TRezJava Heln(*ZIP .zipss`TMW Java Heln(*docu:v>n`Tn(:`rsrc:v>n`Tn(:`.class`TMW Java Heln(*.zipss`TMW Java Heln(* MIPS LinkerTEXT.c~n`TMW C/C++ MIPSn(wHTEXT.c++n`TMW C/C++ MIPSn(wHTEXT.cc+n`TMW C/C++ MIPSn(wHTEXT.cp+n`TMW C/C++ MIPSn(wHTEXT.cppn`TMW C/C++ MIPSn(wHTEXT.hppn`TMW C/C++ MIPSn(wHTEXT.pchn`TMW C/C++ MIPSn(wHTEXT.pch++`TMW C/C++ MIPSn(wHNoneMMPr@MacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KPLob`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pMW Pascal 68KTEXT.pasMW Pascal 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.ppuMW Pascal 68KTEXT.rRezTEXT.segdocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docP.rsrc`MacOS MergeAPPL`Appl`RSRC`TEXT.bhBalloon HelpTEXT.rRezrsrc`shlbMacOS PPC LinkerAPPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ PPCTEXT.c++MW C/C++ PPCTEXT.ccMW C/C++ PPCTEXT.cpMW C/C++ PPCTEXT.cppMW C/C++ PPCTEXT.expTEXT.hMW C/C++ PPCTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.ppuMW Pascal PPCTEXT.rRezTEXT.sPPCAsmXCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPJava LinkerAPPL`Appl`COkMW JavaClssMW JavaJjrf.jrfMWCD`RSRC`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaTEXT.mfTEXT.rRezZIP MW Java@ZipFMW Javadocu`rsrc`.classMW Java.jar@.javaMW Java.zipMW JavaWin32 x86 LinkerTEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.ccMW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.defTEXT.hMW C/C++ x86TEXT.pMW Pascal x86TEXT.pasMW Pascal x86TEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.ppuMW Pascal x86TEXT.rcMW WinRCTEXT.resWinRes Import.docP.libLib Import x86.objObj Import x86MW JavaDoc Linker COkMW JavaDocClssMW JavaDocRSRCRez`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaDocTEXT.rRezZIP MW JavaDoc@ZipFMW JavaDocrsrcRez`.classMW JavaDoc.zipMW JavaDoc MacOS PPC LinkerAPPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.bhcPdgP \Balloon Help3jP* 'TEXT.cMW C/C++ PPCTEXT.c++MW C/C++ PPCTEXT.ccMW C/C++ PPCTEXT.cpMW C/C++ PPCTEXT.cppMW C/C++ PPCTEXT.expTEXT.hMW C/C++ PPCTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.rRezTEXT.shcPdgP \PPCAsmn Hel3jP* 'XCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPMacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KRSRC`TEXT.bhcPdgP \Balloon Help3jP* 'TEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pMW Pascal 68KTEXT.pasMW Pascal 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.rRezTEXT.segv "(h@v X|N 0+d*v 0X3Udocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docPWin32 x86 Linker TEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.poclhjj:MW Pascal x86oP@(xTEXT.paslhjj:MW Pascal x86oP@(xTEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.rcMW WinRCTEXT.res++"(h@v X|WinRes Import*v 0X3I.doc.libLib Import x86.objObj Import x86 MC LinkerCLUS.defss`TRezJava Heln(:@MMCHMMLB.docv "(h@v X|Lib Import 68K*v 0X3IMPLF.docv "(h@v X|Lib Import 68K*v 0X3IOBJ .docv "(h@v X|MPW Import 68K*v 0X3ITEXT.cMC C/C++TEXT.c++v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.cc+v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.clsMC Class CompilerTEXT.cp+v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.cppv "(h@v X|MW C/C++ 68K*v 0X3ITEXT.defTEXT.docTEXT.hTEXT.pch++"(h@v X|MW Pascal 68K*v 0X3ITEXT.pas++"(h@v X|MW Pascal 68K*v 0X3ITEXT.pchMC C/C++TEXT.pch++"(h@v X|MW C/C++ 68K*v 0X3ITEXT.ts Java LinkerAPPL:v>n`Tn(:`Appl:v>n`Tn(:`Clss.class`TMW Java Heln(*MWCD:v>n`Tn(:`RSRC:v>n`Tn(:`TEXT.bhn`TBalloon Helpn(*TEXT.htmlhoP@(!TEXT.java`TMW Java Heln(*TEXT.ripss`TRezJava Heln(*ZIP .zipss`TMW Java Heln(*docu:v>n`Tn(:`rsrc:v>n`Tn(:`.class`TMW Java Heln(*.zipss`TMW Java Heln(* MIPS LinkerTEXT.c~n`TMW C/C++ MIPSn(wHTEXT.c++n`TMW C/C++ MIPSn(wHTEXT.cc+n`TMW C/C++ MIPSn(wHTEXT.cp+n`TMW C/C++ MIPSn(wHTEXT.cppn`TMW C/C++ MIPSn(wHTEXT.hppn`TMW C/C++ MIPSn(wHTEXT.pchn`TMW C/C++ MIPSn(wHTEXT.pch++`TMW C/C++ MIPSn(wHNoneMMPr@MacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KPLob`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pMW Pascal 68KTEXT.pasMW Pascal 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.ppuMW Pascal 68KTEXT.rRezTEXT.segdocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docP.rsrc`MacOS MergeAPPL`Appl`RSRC`TEXT.bhBalloon HelpTEXT.rRezrsrc`shlbMacOS PPC LinkerAPPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ PPCTEXT.c++MW C/C++ PPCTEXT.ccMW C/C++ PPCTEXT.cpMW C/C++ PPCTEXT.cppMW C/C++ PPCTEXT.expTEXT.hMW C/C++ PPCTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.ppuMW Pascal PPCTEXT.rRezTEXT.sPPCAsmXCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPJava LinkerAPPL`Appl`COkMW JavaClssMW JavaJjrf.jrfMWCD`RSRC`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaTEXT.mfTEXT.rRezZIP MW Java@ZipFMW Javadocu`rsrc`.classMW Java.jar@.javaMW Java.zipMW JavaWin32 x86 LinkerTEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.ccMW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.defTEXT.hMW C/C++ x86TEXT.pMW Pascal x86TEXT.pasMW Pascal x86TEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.ppuMW Pascal x86TEXT.rcMW WinRCTEXT.resWinRes Import.docP.libLib Import x86.objObj Import x86MW JavaDoc Linker COkMW JavaDocClssMW JavaDocRSRCRez`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaDocTEXT.rRezZIP MW JavaDoc@ZipFMW JavaDocrsrcRez`.classMW JavaDoc.zipMW JavaDocW8mstrmstlImstn((mstiRYmstrPmstlmstn P pref{ Z0pref Jprefn pref prefyW.pref.prefPprefpref pref" prefZm  pref* prefa vpref>pref prefmVpref )pprefd8pref prefX6prefL pref-vpref(8prefC@ pref_pref9^  pref^&<pref&o'prefvh (pref!$.pref "( pref8#R$prefV$v pref%*pref&+nJpref'+Lmtgl,mpsiP(msti0@PLst^x* x mtsl:^mtpl mtpsqmtpiFpref?h prefq8@zvpref!MAprefHBpref1?Cpref.D prefE prefLFprefVGGprefLH>prefmI'pref JkprefzKprefLpref)YMHprefN;prefO52prefYP7prefHQDprefR AbprefC2SXpref9T pref>Upref@Vg pref';W pref/XprefYprefaZpref/[ .prefg\ pref] "pref ^ pref8_ pref ` prefo/a prefgbprefc!:jprefd4vprefJ_e prefJfZYprefI]gnprefJRhT?VprefI2iprefJѲj! prefJgk^iprefJklprefJprefJ-t JprefJu26prefJvprefJ-wprefJxaoprefJy}prefJ z 2prefJ_{YprefJL|prefJ }bprefJy~9prefJ prefJn XprefJ l prefJT prefJ vprefJbprefI% prefIl .prefI prefJN"prefJв prefIpprefJprefJ B prefJXmHprefJjprefJ@>prefO prefO,~prefOprefO\1?VprefOENprefO prefO΅!prefOprefOYprefOZ prefO prefO2 prefOlMprefOQprefO~G%>prefO &prefOprefOB prefOX2prefO^prefOܔ)prefO22prefO=EprefOT%prefO4jFUbprefOiprefOJgprefO!prefO4 prefO% prefOsprefO'prefOpprefO'.4.prefO) prefO04@"prefO%prefO&!prefOFprefO4b prefO\f?prefOfQjprefOThawknl-1.6.8+dfsg2/HawkNL.opt000066400000000000000000003330001130562644400156670ustar00rootroot00000000000000ࡱ> }  I"#$%&'()*,-./012346789:;<=>@ABCDEFGHrKLMNOPQRSUVWXYZ[\]_`abcdefgijklmnopqtuvwxyz{|Root EntrymiWorkspace State  Browser Editor test_getfile)D:\MyProjects\HawkNL1.68\Test_getfile.dsptest_multicast+D:\MyProjects\HawkNL1.68\Test_multicast.dsp test_async'D:\MyProjects\HawkNL1.68\Test_async.dsp test_overrun)D:\MyProjects\HawkNL1.68\Test_overrun.dsptest_broadcast+D:\MyProjects\HawkNL1.68\Test_broadcast.dspbuild_everything-D:\MyProjects\HawkNL1.68\Build_Everything.dsptest_clientserver.D:\MyProjects\HawkNL1.68\Test_clientserver.dsp test_timer'D:\MyProjects\HawkNL1.68\Test_timer.dsptest_thread_pool-D:\MyProjects\HawkNL1.68\Test_thread_pool.dsphawknl#D:\MyProjects\HawkNL1.68\HawkNL.dsp test_buffer(D:\MyProjects\HawkNL1.68\Test_buffer.dsptest_max%D:\MyProjects\HawkNL1.68\Test_max.dsp hawknl_static*D:\MyProjects\HawkNL1.68\HawkNL_static.dspqtr7,rwr7/rr7?rr7Frr7crr7nrr7rr7r s7r8s7r?s7r_s7sus7-sxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777etfile)D:\MyProjects\HawkNL1.68\Test_getfile.dsptest_multicast+D:\MyProjects\HawkNL1.68\Test_multicast.dsp test_async'D:\MyProjects\HawkNL1.68\Test_async.dsp test_overrun)D:\MyProjects\HawkNL1.68\Test_overrun.dsptest_broadcast+D:\MyProjects\HawkNL1.68\Test_broadcast.dspbuild_everything-D:\MyProjects\HawkNL1.68\Build_Everything.dsptest_clientserver.D:\MyProjects\HawkNL1.68\Test_clientserver.dsp test_timer'D:\MyProjects\HawkNL1.68\Test_timer.dsptest_thread_pool-D:\MyProjects\HawkNL1.68\Test_thread_pool.dsphawknl#D:\MyProjects\HawkNL1.68\HawkNL.dsp test_buffer(D:\MyProjects\HawkNL1.68\Test_buffer.dsptest_max%D:\MyProjects\HawkNL1.68\Test_max.dsp hawknl_static*D:\MyProjects\HawkNL1.68\HawkNL_static.dspqtr7,rwr7/rr7?rr7Frr7crr7nrr7rr7r s7r8s7r?s7r_s7sus7-sxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777MLJLetfile)D:\MyProjects\HawkNL1.68\Test_getfile.dsptest_multicast+D:\MyProjects\HawkNL1.68\Test_multicast.dsp test_async'D:\MyProjects\HawkNL1.68\Test_async.dsp test_overrun)D:\MyProjects\HawkNL1.68\Test_overrun.dsptest_broadcast+D:\MyProjects\HawkNL1.68\Test_broadcast.dspbuild_everything-D:\MyProjects\HawkNL1.68\Build_Everything.dsptest_clientserver.D:\MyProjects\HawkNL1.68\Test_clientserver.dsp test_timer'D:\MyProjects\HawkNL1.68\Test_timer.dsptest_thread_pool-D:\MyProjects\HawkNL1.68\Test_thread_pool.dsphawknl#D:\MyProjects\HawkNL1.68\HawkNL.dsp test_buffer(D:\MyProjects\HawkNL1.68\Test_buffer.dsptest_max%D:\MyProjects\HawkNL1.68\Test_max.dsp hawknl_static*D:\MyProjects\HawkNL1.68\HawkNL_static.dspqtr7,rwr7/rr7?rr7Frr7crr7nrr7rr7r s7r8s7r?s7r_s7sus7-sxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777Workspace Window" !IPI_Build_Everything* +IPI_HawkNL 5IPI_HawkNL_static$?Build_Everything ClassViewHawkNL classesHawkNL_static classesFileView!Workspace 'HawkNL': 13 project(s)HawkNL_static files!Workspace 'HawkNL': 13 project(s)InfoViewDeveloper Products Visual C++Visual C++ TutorialsTutorials OrientationVisual C++ Programmer's GuideBeginning Your ProgramCreating a Win32 DLLCompiling and Linking How Do I ...Create a Release Build Debugging-Debugging Techniques, Problems, and SolutionsVisual C++ Samples SDK Samples Win32 Samples$Platform, SDK, and DDK Documentation Platform SDKBuilding Applications Tools GuideTuning+Performance Tuning Win32-based ApplicationsPROFILEFix Build ErrorsSample Profile Command LinesOverview: Creating a Win32 DLLReitp: RichEdit Test Program$How Can I Debug an Access Violation?$How Can I Debug an Access Violation?-Debugging Techniques, Problems, and SolutionsFileView_s7sus7-sxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777Y BUILD_EVERYTHING - WIN32 RELEASEBuild_Everything.dspCProject BUILD_EVERYTHING - WIN32 RELEASE Build_Everything - Win32 ReleaseBuild_Everything - Win32 DebugSSBR CTargetItem Build_Everything - Win32 ReleaseBuild_Everything - Win32 DebugSSBR Program Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBR Test_asyncCProjectDependencySSBRTest_broadcastCProjectDependencySSBR Test_bufferCProjectDependencySSBR Test_getfileCProjectDependencySSBRTest_maxCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777YHawkNL - Win32 Release HawkNL.dspCProjectHawkNL - Win32 ReleaseHawkNL - Win32 ReleaseHawkNL - Win32 DebugSSBR CTargetItemHawkNL - Win32 ReleaseHawkNL - Win32 DebugSSBR Source Files CProjGroupSSBRDJW Include Files CProjGroupSSBRDJW Doc Files CProjGroupSSBRDJWdepCDependencyContainerSSBRDJWDJWDJWependencySSBRTest_broadcastCProjectDependencySSBR Test_bufferCProjectDependencySSBR Test_getfileCProjectDependencySSBRTest_maxCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777YHawkNL_static - Win32 DebugHawkNL_static.dspCProjectHawkNL_static - Win32 DebugHawkNL_static - Win32 ReleaseHawkNL_static - Win32 DebugSSBR CTargetItemHawkNL_static - Win32 ReleaseHawkNL_static - Win32 DebugSSBR Source Files CProjGroupSSBRDJW Include Files CProjGroupSSBRDJW Doc Files CProjGroupSSBRDJWdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRDJWDJWDJWpendencySSBR Test_getfileCProjectDependencySSBRTest_maxCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777IPI_Test_asyncJIPI_Test_broadcast&TIPI_Test_buffer ^IPI_Test_clientserver,hYTest_async - Win32 ReleaseTest_async.dspCProjectTest_async - Win32 ReleaseTest_async - Win32 ReleaseTest_async - Win32 DebugSSBR CTargetItemTest_async - Win32 ReleaseTest_async - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWnerSSBRDJWDJWDJWpendencySSBR Test_getfileCProjectDependencySSBRTest_maxCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777YTEST_BROADCAST - WIN32 RELEASETest_broadcast.dspCProjectTEST_BROADCAST - WIN32 RELEASETest_broadcast - Win32 ReleaseTest_broadcast - Win32 DebugSSBR CTargetItemTest_broadcast - Win32 ReleaseTest_broadcast - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWySSBR Test_getfileCProjectDependencySSBRTest_maxCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777YTEST_BUFFER - WIN32 RELEASETest_buffer.dspCProjectTEST_BUFFER - WIN32 RELEASETest_buffer - Win32 ReleaseTest_buffer - Win32 DebugSSBR CTargetItemTest_buffer - Win32 ReleaseTest_buffer - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWileSSBRDJWDJWDJWySSBR Test_getfileCProjectDependencySSBRTest_maxCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777YTEST_CLIENTSERVER - WIN32 DEBUGTest_clientserver.dspCProjectTEST_CLIENTSERVER - WIN32 DEBUG!Test_clientserver - Win32 ReleaseTest_clientserver - Win32 DebugSSBR CTargetItem!Test_clientserver - Win32 ReleaseTest_clientserver - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWest_getfileCProjectDependencySSBRTest_maxCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777IPI_Test_getfile"sIPI_Test_max~IPI_Test_multicast&IPI_Test_overrun"YTest_getfile - Win32 ReleaseTest_getfile.dspCProjectTest_getfile - Win32 ReleaseTest_getfile - Win32 ReleaseTest_getfile - Win32 DebugSSBR CTargetItemTest_getfile - Win32 ReleaseTest_getfile - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWcyFileSSBRDJWDJWDJWest_getfileCProjectDependencySSBRTest_maxCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777YTest_max - Win32 Release Test_max.dspCProjectTest_max - Win32 ReleaseTest_max - Win32 ReleaseTest_max - Win32 DebugSSBR CTargetItemTest_max - Win32 ReleaseTest_max - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWJWDJWcyFileSSBRDJWDJWDJWest_getfileCProjectDependencySSBRTest_maxCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777YTest_multicast - Win32 DebugTest_multicast.dspCProjectTest_multicast - Win32 DebugTest_multicast - Win32 ReleaseTest_multicast - Win32 DebugSSBR CTargetItemTest_multicast - Win32 ReleaseTest_multicast - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWSBRDJWDJWDJWest_getfileCProjectDependencySSBRTest_maxCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777YTEST_OVERRUN - WIN32 RELEASETest_overrun.dspCProjectTEST_OVERRUN - WIN32 RELEASETest_overrun - Win32 ReleaseTest_overrun - Win32 DebugSSBR CTargetItemTest_overrun - Win32 ReleaseTest_overrun - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWDJWDJWest_getfileCProjectDependencySSBRTest_maxCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777IPI_Test_thread_pool*IPI_Test_timerIPI_ ClassView Window"Y Test_thread_pool - Win32 ReleaseTest_thread_pool.dspCProject Test_thread_pool - Win32 Release Test_thread_pool - Win32 Release NL_LOOP_BACKTest_thread_pool - Win32 DebugNL_IPXSSBR CTargetItem Test_thread_pool - Win32 ReleaseTest_thread_pool - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777YTEST_TIMER - WIN32 DEBUGTest_timer.dspCProjectTEST_TIMER - WIN32 DEBUGTest_timer - Win32 Release"D:\MyProjects\HawkNL\lib\timer.exeTest_timer - Win32 Debug"D:\MyProjects\HawkNL\lib\timer.exeSSBR CTargetItemTest_timer - Win32 ReleaseTest_timer - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777Y Build_EverythingHawkNL HawkNL_static Test_asyncTest_broadcast Test_bufferTest_clientserver Test_getfileTest_maxTest_multicast Test_overrunTest_thread_pool Test_timerlib\timer.exeSSBR CTargetItemTest_timer - Win32 ReleaseTest_timer - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777  CClsFldSlobBuild_EverythingHawkNL HawkNL_static Test_asyncTest_broadcast Test_bufferTest_clientserver Test_getfileTest_maxTest_multicast Test_overrunTest_thread_pool Test_timerSSBR CTargetItemTest_timer - Win32 ReleaseTest_timer - Win32 DebugSSBR Source Files CProjGroupSSBRDJWHawkNLCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWCProjectDependencySSBRTest_multicastCProjectDependencySSBR HawkNL_staticCProjectDependencySSBRTest_clientserverCProjectDependencySSBR Test_timerCProjectDependencySSBRTest_thread_poolCProjectDependencySSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777DebuggerDocuments @ Control-C@ Control-BreakDatatype MisalignmentAccess Violation In Page Error No MemoryIllegal Instruction%Noncontinuable Exception&Invalid DispositionArray Bounds ExceededFloat Denormal OperandFloat Divide by ZeroFloat Inexact ResultFloat Invalid OperationFloat OverflowFloat Stack CheckFloat UnderflowInteger Divide by ZeroInteger OverflowPrivileged InstructionStack Overflow5 DLL Not FoundBDLL Initialization FailedcsmMicrosoft C++ ExceptionsocklockWatch1Watch2Watch3Watch4SSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777NoneQD:-QWQ @lpmr @l.\src\NLchanges.txt&{3486698D-49EB-11CF-BF46-00AA004C12E2},Array Bounds ExceededFloat Denormal OperandFloat Divide by ZeroFloat Inexact ResultFloat Invalid OperationFloat OverflowFloat Stack CheckFloat UnderflowInteger Divide by ZeroInteger OverflowPrivileged InstructionStack Overflow5 DLL Not FoundBDLL Initialization FailedcsmMicrosoft C++ ExceptionsocklockWatch1Watch2Watch3Watch4SSBR Test_overrunCProjectDependencySSBRdepCDependencyContainerSSBRDJWdepCDependencyContainerSSBRnl.hCDependencyFileSSBRDJWDJWDJWxs70szs72s~s76ss7^ss7bss7ds t7st7s t7s't7sXt7tct7tt7Ett7_tt7jtt7tt7tu7t%u7t(u7t*u7t.u7teu7uiu7!uku7#uu7uu7uu7uu7uv7uv7uHv7vfv7vqv7)vv7fvv7mvv7vv7vv7vv7vv7vw7vw7v w7vxw70w{w73ww7Cww7Jww7{ww7ww7wx7w!x7wMx7xXx7xx7=xx7[xx7fxx7xx7x y7x#y7x&y7x(y7x,y7xay7yey7ygy7yy7|yy7yy7yy7yz7yz7yDz7ybz7zmz7%zz7Qzz7\zz7zz7zz7z7{7z>{7z^{7{t{7,{w{7/{y{71{}{75{{7P{{7T{{7V{|7{|7{|7{|7{P|7|[|7||7=||7[||7f||7||7|}7|$}7|'}7|)}7|-}7|V}7}Z}7}\}7}}7]}}7`}}7p}}7w}}7}}7}~7}(~7}3~7}e~7~l~7$~~7D~~7S~~7V~~7X~~7\~~7~~7~~7~!7~$7~47~;7~X7c77E7c7n777#797<7>7@7D7F7^7`7d7f7j7"7A7E7G̀7Ѐ77777R7 |747N7U7WÁ7{ʁ7777Ɂ7ԁG7R7 h7 7V7eׂ7777ʂ7т,737Y7`7j7"q7)7O7V7l7oux/pQ7u777I7L7{737g7777Մv7.7f7w77ԅ$7܅T7 7L7p7w7777ɆC7N77Sه7777777҇<7>7Z7|74~767U7qĈ7|777ˈ7͈#7ۈI7P7R7 d7g7i7!m7%7Y7]7_܉7߉777hawknl-1.6.8+dfsg2/HawkNL.pbproj/000077500000000000000000000000001130562644400164375ustar00rootroot00000000000000hawknl-1.6.8+dfsg2/HawkNL.pbproj/ian.pbxuser000066400000000000000000000113431130562644400206220ustar00rootroot00000000000000// !$*UTF8*$! { 0867D690FE84028FC02AAC07 = { activeBuildStyle = 4F0BB7EC011F40E904CA0E50; activeTarget = 0867D69CFE84028FC02AAC07; addToTargets = ( 0867D69CFE84028FC02AAC07, ); perUserDictionary = { PBXPerProjectTemplateStateSaveDate = 44646888; PBXWorkspaceContents = ( { LeftSlideOut = { Split0 = { Split0 = { NavCount = 1; NavGeometry0 = { Frame = "{{0, 0}, {572, 525}}"; NavBarVisible = YES; }; }; SplitCount = 1; Tab0 = { Debugger = { Split0 = { SplitCount = 2; }; SplitCount = 1; TabCount = 2; }; LauncherConfigVersion = 7; }; Tab1 = { LauncherConfigVersion = 3; Runner = { }; }; TabCount = 4; }; SplitCount = 1; Tab1 = { OptionsSetName = "Hierarchy, all classes"; }; Tab3 = { SplitCount = 2; }; TabCount = 6; }; }, ); PBXWorkspaceGeometries = ( { ContentSize = "{856, 572}"; LeftSlideOut = { ActiveTab = 0; Collapsed = NO; Frame = "{{0, 23}, {856, 549}}"; Split0 = { Collapsed = NO; Frame = "{{284, 0}, {572, 549}}"; Split0 = { Frame = "{{0, 24}, {572, 525}}"; }; SplitCount = 1; Tab0 = { Debugger = { Collapsed = NO; Frame = "{{0, 0}, {572, 214}}"; Split0 = { Frame = "{{0, 24}, {572, 190}}"; Split0 = { Frame = "{{0, 0}, {279, 190}}"; }; Split1 = { DebugVariablesTableConfiguration = ( Name, 63.80298, Value, 86.07401, Summary, 108.123, ); Frame = "{{288, 0}, {284, 190}}"; }; SplitCount = 2; }; SplitCount = 1; Tab0 = { Frame = "{{0, 0}, {100, 50}}"; }; Tab1 = { Frame = "{{0, 0}, {100, 50}}"; }; TabCount = 2; TabsVisible = YES; }; Frame = "{{0, 0}, {572, 214}}"; LauncherConfigVersion = 7; }; Tab1 = { Frame = "{{0, 0}, {572, 125}}"; LauncherConfigVersion = 3; Runner = { Frame = "{{0, 0}, {572, 125}}"; }; }; Tab2 = { BuildMessageFrame = "{{0, 0}, {574, 64}}"; BuildTranscriptFrame = "{{0, 73}, {574, 56}}"; Frame = "{{0, 0}, {572, 127}}"; }; Tab3 = { Frame = "{{0, 0}, {572, 265}}"; }; TabCount = 4; TabsVisible = YES; }; SplitCount = 1; Tab0 = { Frame = "{{0, 0}, {260, 549}}"; GroupTreeTableConfiguration = ( TargetStatusColumn, 18, MainColumn, 227, ); }; Tab1 = { ClassesFrame = "{{0, 0}, {247, 330}}"; ClassesTreeTableConfiguration = ( PBXBookColumnIdentifier, 20, PBXClassColumnIdentifier, 204, ); Frame = "{{0, 0}, {245, 549}}"; MembersFrame = "{{0, 339}, {247, 210}}"; MembersTreeTableConfiguration = ( PBXBookColumnIdentifier, 20, PBXMethodColumnIdentifier, 203, ); }; Tab2 = { Frame = "{{0, 0}, {226, 549}}"; }; Tab3 = { Frame = "{{0, 0}, {191, 549}}"; Split0 = { Frame = "{{0, 0}, {191, 265}}"; TargetTreeTableConfiguration = ( ActiveTarget, 16, TargetName, 159, ); }; Split1 = { BuildStyleTreeTableConfiguration = ( IsActive, 16, Name, 160, ); Frame = "{{0, 274}, {191, 275}}"; }; SplitCount = 2; }; Tab4 = { ExecutableTreeTableConfiguration = ( ActiveExecutable, 16, ExecutableName, 158, ); Frame = "{{0, 0}, {191, 549}}"; }; Tab5 = { BreakpointsTreeTableConfiguration = ( breakpointColumn, 197, enabledColumn, 31, ); Frame = "{{0, 0}, {250, 549}}"; }; TabCount = 6; TabsVisible = YES; }; StatusViewVisible = YES; Template = F5F68CF101725D4C0D7A8F4C; ToolbarVisible = YES; WindowLocation = "{52, 112}"; }, ); PBXWorkspaceStateSaveDate = 44646888; }; projectwideBuildSettings = { }; wantsIndex = 1; wantsSCM = -1; }; 0867D69CFE84028FC02AAC07 = { activeExec = 0; }; } hawknl-1.6.8+dfsg2/HawkNL.pbproj/project.pbxproj000066400000000000000000000300271130562644400215150ustar00rootroot00000000000000// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 38; objects = { 034768DDFF38A45A11DB9C8B = { children = ( 034768DEFF38A45A11DB9C8B, ); isa = PBXGroup; name = Products; refType = 4; }; 034768DEFF38A45A11DB9C8B = { isa = PBXFrameworkReference; path = HawkNL.framework; refType = 3; }; //030 //031 //032 //033 //034 //080 //081 //082 //083 //084 0867D690FE84028FC02AAC07 = { buildStyles = ( 4F0BB7EC011F40E904CA0E50, 4F0BB7ED011F40E904CA0E50, ); isa = PBXProject; mainGroup = 0867D691FE84028FC02AAC07; productRefGroup = 034768DDFF38A45A11DB9C8B; projectDirPath = ""; targets = ( 0867D69CFE84028FC02AAC07, ); }; 0867D691FE84028FC02AAC07 = { children = ( F554C4A4021DCFC901A80101, F5A3E15402A93C3B01AD4D1F, 089C1665FE841158C02AAC07, 0867D69AFE84028FC02AAC07, 034768DDFF38A45A11DB9C8B, ); isa = PBXGroup; name = HawkNL; refType = 4; }; 0867D69AFE84028FC02AAC07 = { children = ( ); isa = PBXGroup; name = "External Frameworks and Libraries"; refType = 4; }; 0867D69CFE84028FC02AAC07 = { buildPhases = ( 0867D69DFE84028FC02AAC07, 0867D69EFE84028FC02AAC07, 0867D69FFE84028FC02AAC07, 0867D6A0FE84028FC02AAC07, 0867D6A2FE84028FC02AAC07, F554C4A7021DD00C01A80101, ); buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_VERSION = A; HEADER_SEARCH_PATHS = ""; INSTALL_PATH = "$(HOME)/Library/Frameworks"; LIBRARY_SEARCH_PATHS = ""; OPTIMIZATION_CFLAGS = "-funroll-all-loops -ffast-math -fomit-frame-pointer -O2 "; OTHER_CFLAGS = "-DMACOSX -D_REENTRANT"; OTHER_LDFLAGS = "-seg1addr 0x40000000"; PRODUCT_NAME = HawkNL; SECTORDER_FLAGS = ""; WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; WRAPPER_EXTENSION = framework; }; dependencies = ( ); isa = PBXFrameworkTarget; name = HawkNL; productInstallPath = "$(HOME)/Library/Frameworks"; productName = HawkNL; productReference = 034768DEFF38A45A11DB9C8B; productSettingsXML = " CFBundleDevelopmentRegion English CFBundleExecutable HawkNL CFBundleIconFile CFBundleIdentifier CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleShortVersionString 1.6b1 CFBundleSignature ???? CFBundleVersion 1.6b1 CSResourcesFileMapped "; shouldUseHeadermap = 1; }; 0867D69DFE84028FC02AAC07 = { buildActionMask = 2147483647; files = ( F554C4A6021DCFC901A80101, F5A3E18202A93C3B01AD4D1F, F5A3E18A02A93C3B01AD4D1F, F5A3E18C02A93C3B01AD4D1F, F5A3E19002A93C3B01AD4D1F, ); isa = PBXHeadersBuildPhase; }; 0867D69EFE84028FC02AAC07 = { buildActionMask = 2147483647; files = ( 089C1668FE841158C02AAC07, ); isa = PBXResourcesBuildPhase; }; 0867D69FFE84028FC02AAC07 = { buildActionMask = 2147483647; files = ( F5A3E17702A93C3B01AD4D1F, F5A3E17802A93C3B01AD4D1F, F5A3E17902A93C3B01AD4D1F, F5A3E17A02A93C3B01AD4D1F, F5A3E17B02A93C3B01AD4D1F, F5A3E18102A93C3B01AD4D1F, F5A3E18702A93C3B01AD4D1F, F5A3E18802A93C3B01AD4D1F, F5A3E18B02A93C3B01AD4D1F, F5A3E18F02A93C3B01AD4D1F, F5A3E19102A93C3B01AD4D1F, ); isa = PBXSourcesBuildPhase; }; 0867D6A0FE84028FC02AAC07 = { buildActionMask = 2147483647; files = ( ); isa = PBXFrameworksBuildPhase; }; 0867D6A2FE84028FC02AAC07 = { buildActionMask = 2147483647; files = ( ); isa = PBXRezBuildPhase; }; 089C1665FE841158C02AAC07 = { children = ( 089C1666FE841158C02AAC07, ); isa = PBXGroup; name = Resources; refType = 4; }; 089C1666FE841158C02AAC07 = { children = ( 089C1667FE841158C02AAC07, ); isa = PBXVariantGroup; name = InfoPlist.strings; refType = 4; }; 089C1667FE841158C02AAC07 = { fileEncoding = 10; isa = PBXFileReference; name = English; path = English.lproj/InfoPlist.strings; refType = 4; }; 089C1668FE841158C02AAC07 = { fileRef = 089C1666FE841158C02AAC07; isa = PBXBuildFile; settings = { }; }; //080 //081 //082 //083 //084 //4F0 //4F1 //4F2 //4F3 //4F4 4F0BB7EC011F40E904CA0E50 = { buildRules = ( ); buildSettings = { COPY_PHASE_STRIP = NO; OPTIMIZATION_CFLAGS = "-O0"; }; isa = PBXBuildStyle; name = Development; }; 4F0BB7ED011F40E904CA0E50 = { buildRules = ( ); buildSettings = { COPY_PHASE_STRIP = YES; }; isa = PBXBuildStyle; name = Deployment; }; //4F0 //4F1 //4F2 //4F3 //4F4 //F50 //F51 //F52 //F53 //F54 F554C4A4021DCFC901A80101 = { children = ( F554C4A5021DCFC901A80101, ); isa = PBXGroup; path = include; refType = 4; }; F554C4A5021DCFC901A80101 = { isa = PBXFileReference; path = nl.h; refType = 4; }; F554C4A6021DCFC901A80101 = { fileRef = F554C4A5021DCFC901A80101; isa = PBXBuildFile; settings = { ATTRIBUTES = ( Public, ); }; }; F554C4A7021DD00C01A80101 = { buildActionMask = 2147483647; files = ( ); generatedFileNames = ( ); isa = PBXShellScriptBuildPhase; neededFileNames = ( ); shellPath = /bin/sh; shellScript = "# make frameworks directory if it doesn't already exist\nmkdir -p ~/Library/Frameworks\n# delete the old framework\nrm -rf ~/Library/Frameworks/HawkNL.framework\n# copy framework to its home\n/Developer/Tools/CpMac -r $SYMROOT/HawkNL.framework ~/Library/Frameworks/HawkNL.framework\n# precompile header for speedier compiles\n/usr/bin/cc -precomp ~/Library/Frameworks/HawkNL.framework/Headers/nl.h -o ~/Library/Frameworks/HawkNL.framework/Headers/nl.p"; }; F5A3E15402A93C3B01AD4D1F = { children = ( F5A3E15502A93C3B01AD4D1F, F5A3E15602A93C3B01AD4D1F, F5A3E15702A93C3B01AD4D1F, F5A3E15802A93C3B01AD4D1F, F5A3E15902A93C3B01AD4D1F, F5A3E15A02A93C3B01AD4D1F, F5A3E15B02A93C3B01AD4D1F, F5A3E15C02A93C3B01AD4D1F, F5A3E15D02A93C3B01AD4D1F, F5A3E15E02A93C3B01AD4D1F, F5A3E15F02A93C3B01AD4D1F, F5A3E16002A93C3B01AD4D1F, F5A3E16102A93C3B01AD4D1F, F5A3E16202A93C3B01AD4D1F, F5A3E16302A93C3B01AD4D1F, F5A3E16402A93C3B01AD4D1F, F5A3E16502A93C3B01AD4D1F, F5A3E16602A93C3B01AD4D1F, F5A3E16702A93C3B01AD4D1F, F5A3E16802A93C3B01AD4D1F, F5A3E16902A93C3B01AD4D1F, F5A3E16A02A93C3B01AD4D1F, F5A3E16B02A93C3B01AD4D1F, F5A3E16C02A93C3B01AD4D1F, F5A3E16D02A93C3B01AD4D1F, F5A3E16E02A93C3B01AD4D1F, F5A3E16F02A93C3B01AD4D1F, F5A3E17602A93C3B01AD4D1F, ); isa = PBXGroup; path = src; refType = 4; }; F5A3E15502A93C3B01AD4D1F = { isa = PBXFileReference; path = condition.c; refType = 4; }; F5A3E15602A93C3B01AD4D1F = { isa = PBXFileReference; path = crc.c; refType = 4; }; F5A3E15702A93C3B01AD4D1F = { isa = PBXFileReference; path = err.c; refType = 4; }; F5A3E15802A93C3B01AD4D1F = { isa = PBXFileReference; path = errorstr.c; refType = 4; }; F5A3E15902A93C3B01AD4D1F = { isa = PBXFileReference; path = group.c; refType = 4; }; F5A3E15A02A93C3B01AD4D1F = { isa = PBXFileReference; path = gusiconfig.cp; refType = 4; }; F5A3E15B02A93C3B01AD4D1F = { isa = PBXFileReference; path = hawknl.def; refType = 4; }; F5A3E15C02A93C3B01AD4D1F = { isa = PBXFileReference; path = hawknl.exp; refType = 4; }; F5A3E15D02A93C3B01AD4D1F = { isa = PBXFileReference; path = ipx.c; refType = 4; }; F5A3E15E02A93C3B01AD4D1F = { isa = PBXFileReference; path = ipx.h; refType = 4; }; F5A3E15F02A93C3B01AD4D1F = { isa = PBXFileReference; path = loopback.c; refType = 4; }; F5A3E16002A93C3B01AD4D1F = { isa = PBXFileReference; path = loopback.h; refType = 4; }; F5A3E16102A93C3B01AD4D1F = { isa = PBXFileReference; path = makefile.linux; refType = 4; }; F5A3E16202A93C3B01AD4D1F = { isa = PBXFileReference; path = makefile.mingw; refType = 4; }; F5A3E16302A93C3B01AD4D1F = { isa = PBXFileReference; path = makefile.osx; refType = 4; }; F5A3E16402A93C3B01AD4D1F = { isa = PBXFileReference; path = makefile.solaris; refType = 4; }; F5A3E16502A93C3B01AD4D1F = { isa = PBXFileReference; path = mutex.c; refType = 4; }; F5A3E16602A93C3B01AD4D1F = { isa = PBXFileReference; path = nl.c; refType = 4; }; F5A3E16702A93C3B01AD4D1F = { isa = PBXFileReference; path = nlchanges.txt; refType = 4; }; F5A3E16802A93C3B01AD4D1F = { isa = PBXFileReference; path = nlinternal.h; refType = 4; }; F5A3E16902A93C3B01AD4D1F = { isa = PBXFileReference; path = nltime.c; refType = 4; }; F5A3E16A02A93C3B01AD4D1F = { isa = PBXFileReference; path = parallel.h; refType = 4; }; F5A3E16B02A93C3B01AD4D1F = { isa = PBXFileReference; path = readme.txt; refType = 4; }; F5A3E16C02A93C3B01AD4D1F = { isa = PBXFileReference; path = serial.h; refType = 4; }; F5A3E16D02A93C3B01AD4D1F = { isa = PBXFileReference; path = sock.c; refType = 4; }; F5A3E16E02A93C3B01AD4D1F = { isa = PBXFileReference; path = sock.h; refType = 4; }; F5A3E16F02A93C3B01AD4D1F = { isa = PBXFileReference; path = thread.c; refType = 4; }; F5A3E17602A93C3B01AD4D1F = { isa = PBXFileReference; path = wsock.h; refType = 4; }; F5A3E17702A93C3B01AD4D1F = { fileRef = F5A3E15502A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E17802A93C3B01AD4D1F = { fileRef = F5A3E15602A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E17902A93C3B01AD4D1F = { fileRef = F5A3E15702A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E17A02A93C3B01AD4D1F = { fileRef = F5A3E15802A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E17B02A93C3B01AD4D1F = { fileRef = F5A3E15902A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E18102A93C3B01AD4D1F = { fileRef = F5A3E15F02A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E18202A93C3B01AD4D1F = { fileRef = F5A3E16002A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E18702A93C3B01AD4D1F = { fileRef = F5A3E16502A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E18802A93C3B01AD4D1F = { fileRef = F5A3E16602A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E18A02A93C3B01AD4D1F = { fileRef = F5A3E16802A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E18B02A93C3B01AD4D1F = { fileRef = F5A3E16902A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E18C02A93C3B01AD4D1F = { fileRef = F5A3E16A02A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E18F02A93C3B01AD4D1F = { fileRef = F5A3E16D02A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E19002A93C3B01AD4D1F = { fileRef = F5A3E16E02A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; F5A3E19102A93C3B01AD4D1F = { fileRef = F5A3E16F02A93C3B01AD4D1F; isa = PBXBuildFile; settings = { }; }; }; rootObject = 0867D690FE84028FC02AAC07; } hawknl-1.6.8+dfsg2/HawkNL_static.dsp000066400000000000000000000104211130562644400172210ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="HawkNL_static" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=HawkNL_static - 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 "HawkNL_static.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 "HawkNL_static.mak" CFG="HawkNL_static - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "HawkNL_static - Win32 Release" (based on\ "Win32 (x86) Static Library") !MESSAGE "HawkNL_static - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe !IF "$(CFG)" == "HawkNL_static - 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 "src/Release_static" # PROP Intermediate_Dir "src/Release_static" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W4 /GX /O2 /I "include\\" /I "src\win32\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "WIN_STATIC_LIB" /YX /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"lib\NLstatic.lib" !ELSEIF "$(CFG)" == "HawkNL_static - 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 "src/Debug_static" # PROP Intermediate_Dir "src/Debug_static" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MDd /W4 /GX /Z7 /Od /I "include\\" /I "src\win32\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "WIN_STATIC_LIB" /YX /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"lib\NLstatic.lib" !ENDIF # Begin Target # Name "HawkNL_static - Win32 Release" # Name "HawkNL_static - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\src\condition.c # End Source File # Begin Source File SOURCE=.\src\crc.c # ADD CPP /Za /W4 # End Source File # Begin Source File SOURCE=.\src\err.c # End Source File # Begin Source File SOURCE=.\src\errorstr.c # ADD CPP /W4 # End Source File # Begin Source File SOURCE=.\src\group.c # ADD CPP /W4 # End Source File # Begin Source File SOURCE=.\src\ipx.c # ADD CPP /W4 # End Source File # Begin Source File SOURCE=.\src\loopback.c # End Source File # Begin Source File SOURCE=.\src\mutex.c # End Source File # Begin Source File SOURCE=.\src\nl.c # ADD CPP /W4 # End Source File # Begin Source File SOURCE=.\src\nltime.c # End Source File # Begin Source File SOURCE=.\src\sock.c # ADD CPP /W4 # End Source File # Begin Source File SOURCE=.\src\thread.c # End Source File # End Group # Begin Group "Include Files" # PROP Default_Filter ".h" # Begin Source File SOURCE=.\src\ipx.h # End Source File # Begin Source File SOURCE=.\src\loopback.h # End Source File # Begin Source File SOURCE=.\include\nl.h # End Source File # Begin Source File SOURCE=.\src\nlinternal.h # End Source File # Begin Source File SOURCE=.\src\parallel.h # End Source File # Begin Source File SOURCE=.\src\serial.h # End Source File # Begin Source File SOURCE=.\src\sock.h # End Source File # Begin Source File SOURCE=.\src\wsock.h # End Source File # End Group # Begin Group "Doc Files" # PROP Default_Filter ".txt" # Begin Source File SOURCE=.\src\NLchanges.txt # End Source File # Begin Source File SOURCE=.\src\readme.txt # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/README.macintosh000066400000000000000000000027421130562644400166710ustar00rootroot00000000000000Using HawkNL on Macintosh: (pre-MacOSX) The included Codewarrior 6 project file, HawkNK.mcp, is provided to compile the lib binaries. The test/mac contains all the gusi libs linked in the right order, plus the config file for GUSI set to use opentransport, and the opentransport libs, and the threadlib so all you should have to do is use its .mcp project file as a base (the link order *MUST* be as shown - add any new files to the bottom or it wont work) In order to compile HawkNL (which uses POSIX calls) on Macintosh you will have to obtain the GUSI2 posix compatibility lib from sourceforge.net see: http://sourceforge.net/projects/gusi/ Once you have downloaded the GUSI files (i grabbed 2.18 myself) simply copy the GUSI folder into your Metrowerks folder, and rename it to GUSI2. (I'm assuming here that you have put the HawkNL folder there - but you can put the both of them wherever, you must however ensure that you put both the HawkNL and GUSI2 folders into the same folder or the project file will need to be updated with new pathing information) One important caveat. Do not click the "Always search user paths" option in the project access paths screen or it WONT WORK! (ask me how I know) NOTE: A successfull build will result in 49 link errors, these relate to the GUSI posix calls overloading calls which are found in later libraries (ie the default macOS ones), they can be ignored safely. Using HawkNL on MacOS X: Use the makefile 'makefile.osx'.hawknl-1.6.8+dfsg2/Test_async.dsp000066400000000000000000000071651130562644400166550ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="Test_async" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Test_async - 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 "Test_async.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 "Test_async.mak" CFG="Test_async - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Test_async - Win32 Release" (based on\ "Win32 (x86) Console Application") !MESSAGE "Test_async - Win32 Debug" (based on\ "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Test_async - 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 "samples\Release" # PROP Intermediate_Dir "samples\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 /MD /W3 /GX /O2 /I "include\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /machine:I386 # ADD 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 pthreadVCE.lib /nologo /subsystem:console /machine:I386 /out:"lib\async.exe" /libpath:"src\win32\\" !ELSEIF "$(CFG)" == "Test_async - 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 "samples\Debug" # PROP Intermediate_Dir "samples\Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD 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 pthreadVCE.lib /nologo /subsystem:console /debug /machine:I386 /out:"lib\async.exe" /pdbtype:sept /libpath:"src\win32\\" !ENDIF # Begin Target # Name "Test_async - Win32 Release" # Name "Test_async - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\samples\async.c # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/Test_broadcast.dsp000066400000000000000000000071751130562644400175030ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="Test_broadcast" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Test_broadcast - 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 "Test_broadcast.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 "Test_broadcast.mak" CFG="Test_broadcast - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Test_broadcast - Win32 Release" (based on\ "Win32 (x86) Console Application") !MESSAGE "Test_broadcast - Win32 Debug" (based on\ "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Test_broadcast - 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 "samples\Release" # PROP Intermediate_Dir "samples\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 /MD /W3 /GX /O2 /I "include\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /machine:I386 # ADD 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 /nologo /subsystem:console /machine:I386 /out:"lib\broadcast.exe" !ELSEIF "$(CFG)" == "Test_broadcast - 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 "samples\Debug" # PROP Intermediate_Dir "samples\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 /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD 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 /nologo /subsystem:console /debug /machine:I386 /out:"lib\broadcast.exe" /pdbtype:sept !ENDIF # Begin Target # Name "Test_broadcast - Win32 Release" # Name "Test_broadcast - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\samples\broadcast.c # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/Test_buffer.dsp000066400000000000000000000071231130562644400170030ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="Test_buffer" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Test_buffer - 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 "Test_buffer.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 "Test_buffer.mak" CFG="Test_buffer - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Test_buffer - Win32 Release" (based on\ "Win32 (x86) Console Application") !MESSAGE "Test_buffer - Win32 Debug" (based on\ "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Test_buffer - 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 "samples\Release" # PROP Intermediate_Dir "samples\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 /MD /W3 /GX /O2 /I "include\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /machine:I386 # ADD 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 /nologo /subsystem:console /machine:I386 /out:"lib\buffer.exe" !ELSEIF "$(CFG)" == "Test_buffer - 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 "samples\Debug" # PROP Intermediate_Dir "samples\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 /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD 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 /nologo /subsystem:console /debug /machine:I386 /out:"lib\buffer.exe" /pdbtype:sept !ENDIF # Begin Target # Name "Test_buffer - Win32 Release" # Name "Test_buffer - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\samples\buffer.c # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/Test_clientserver.dsp000066400000000000000000000074251130562644400202440ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="Test_clientserver" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Test_clientserver - 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 "Test_clientserver.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 "Test_clientserver.mak" CFG="Test_clientserver - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Test_clientserver - Win32 Release" (based on\ "Win32 (x86) Console Application") !MESSAGE "Test_clientserver - Win32 Debug" (based on\ "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Test_clientserver - 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 "samples\Release" # PROP Intermediate_Dir "samples\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 /MD /W3 /GX /O2 /I "include\\" /I "src\win32\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /machine:I386 # ADD 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 pthreadVCE.lib /nologo /subsystem:console /machine:I386 /out:"lib\clientserver.exe" /libpath:"src\win32\\" !ELSEIF "$(CFG)" == "Test_clientserver - 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 "samples\Debug" # PROP Intermediate_Dir "samples\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 /c # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "include\\" /I "src\win32\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD 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 pthreadVCE.lib /nologo /subsystem:console /debug /machine:I386 /out:"lib\clientserver.exe" /pdbtype:sept /libpath:"src\win32\\" !ENDIF # Begin Target # Name "Test_clientserver - Win32 Release" # Name "Test_clientserver - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\samples\clientserver.c # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/Test_getfile.dsp000066400000000000000000000071411130562644400171510ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="Test_getfile" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Test_getfile - 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 "Test_getfile.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 "Test_getfile.mak" CFG="Test_getfile - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Test_getfile - Win32 Release" (based on\ "Win32 (x86) Console Application") !MESSAGE "Test_getfile - Win32 Debug" (based on\ "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Test_getfile - 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 "samples\Release" # PROP Intermediate_Dir "samples\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 /MD /W3 /GX /O2 /I "include\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /machine:I386 # ADD 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 /nologo /subsystem:console /machine:I386 /out:"lib\getfile.exe" !ELSEIF "$(CFG)" == "Test_getfile - 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 "samples\Debug" # PROP Intermediate_Dir "samples\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 /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD 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 /nologo /subsystem:console /debug /machine:I386 /out:"lib\getfile.exe" /pdbtype:sept !ENDIF # Begin Target # Name "Test_getfile - Win32 Release" # Name "Test_getfile - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\samples\getfile.c # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/Test_max.dsp000066400000000000000000000070461130562644400163230ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="Test_max" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Test_max - 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 "Test_max.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 "Test_max.mak" CFG="Test_max - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Test_max - Win32 Release" (based on\ "Win32 (x86) Console Application") !MESSAGE "Test_max - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Test_max - 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 "samples\Release" # PROP Intermediate_Dir "samples\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 /MD /W3 /GX /O2 /I "include\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /machine:I386 # ADD 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 /nologo /subsystem:console /machine:I386 /out:"lib\max.exe" !ELSEIF "$(CFG)" == "Test_max - 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 "samples\Debug" # PROP Intermediate_Dir "samples\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 /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD 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 /nologo /subsystem:console /debug /machine:I386 /out:"lib\max.exe" /pdbtype:sept !ENDIF # Begin Target # Name "Test_max - Win32 Release" # Name "Test_max - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\samples\max.c # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/Test_multicast.dsp000066400000000000000000000072251130562644400175420ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="Test_multicast" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Test_multicast - 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 "Test_multicast.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 "Test_multicast.mak" CFG="Test_multicast - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Test_multicast - Win32 Release" (based on\ "Win32 (x86) Console Application") !MESSAGE "Test_multicast - Win32 Debug" (based on\ "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Test_multicast - 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 "samples\Release" # PROP Intermediate_Dir "samples\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 /MD /W3 /GX /O2 /I "include\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /machine:I386 # ADD 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 wsock32.lib /nologo /subsystem:console /machine:I386 /out:"lib\multicast.exe" !ELSEIF "$(CFG)" == "Test_multicast - 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 "samples\Debug" # PROP Intermediate_Dir "samples\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 /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD 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 wsock32.lib /nologo /subsystem:console /debug /machine:I386 /out:"lib\multicast.exe" /pdbtype:sept !ENDIF # Begin Target # Name "Test_multicast - Win32 Release" # Name "Test_multicast - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\samples\multicast.c # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/Test_overrun.dsp000066400000000000000000000071411130562644400172320ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="Test_overrun" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Test_overrun - 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 "Test_overrun.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 "Test_overrun.mak" CFG="Test_overrun - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Test_overrun - Win32 Release" (based on\ "Win32 (x86) Console Application") !MESSAGE "Test_overrun - Win32 Debug" (based on\ "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Test_overrun - 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 "samples\Release" # PROP Intermediate_Dir "samples\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 /MD /W3 /GX /O2 /I "include\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /machine:I386 # ADD 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 /nologo /subsystem:console /machine:I386 /out:"lib\overrun.exe" !ELSEIF "$(CFG)" == "Test_overrun - 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 "samples\Debug" # PROP Intermediate_Dir "samples\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 /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD 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 /nologo /subsystem:console /debug /machine:I386 /out:"lib\overrun.exe" /pdbtype:sept !ENDIF # Begin Target # Name "Test_overrun - Win32 Release" # Name "Test_overrun - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\samples\overrun.c # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/Test_thread_pool.dsp000066400000000000000000000075061130562644400200370ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="Test_thread_pool" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Test_thread_pool - 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 "Test_thread_pool.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 "Test_thread_pool.mak" CFG="Test_thread_pool - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Test_thread_pool - Win32 Release" (based on\ "Win32 (x86) Console Application") !MESSAGE "Test_thread_pool - Win32 Debug" (based on\ "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Test_thread_pool - 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 "samples\Release" # PROP Intermediate_Dir "samples\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 /MD /W3 /GX /O2 /I "include\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /machine:I386 # ADD 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 /nologo /subsystem:console /map /machine:I386 /out:"lib\threadpool.exe" !ELSEIF "$(CFG)" == "Test_thread_pool - 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 "samples\Debug" # PROP Intermediate_Dir "samples\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 /c # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "include\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD 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 /nologo /subsystem:console /debug /machine:I386 /out:"lib\threadpool.exe" /pdbtype:sept # SUBTRACT LINK32 /map !ENDIF # Begin Target # Name "Test_thread_pool - Win32 Release" # Name "Test_thread_pool - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\samples\threadpool.c !IF "$(CFG)" == "Test_thread_pool - Win32 Release" # SUBTRACT CPP /Fr !ELSEIF "$(CFG)" == "Test_thread_pool - Win32 Debug" !ENDIF # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/Test_timer.dsp000066400000000000000000000071051130562644400166520ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="Test_timer" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=Test_timer - 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 "Test_timer.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 "Test_timer.mak" CFG="Test_timer - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "Test_timer - Win32 Release" (based on\ "Win32 (x86) Console Application") !MESSAGE "Test_timer - Win32 Debug" (based on\ "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "Test_timer - 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 "samples\Release" # PROP Intermediate_Dir "samples\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 /MD /W3 /GX /O2 /I "include\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /machine:I386 # ADD 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 /nologo /subsystem:console /machine:I386 /out:"lib\timer.exe" !ELSEIF "$(CFG)" == "Test_timer - 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 "samples\Debug" # PROP Intermediate_Dir "samples\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 /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD 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 /nologo /subsystem:console /debug /machine:I386 /out:"lib\timer.exe" /pdbtype:sept !ENDIF # Begin Target # Name "Test_timer - Win32 Release" # Name "Test_timer - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter ".c" # Begin Source File SOURCE=.\samples\timer.c # End Source File # End Group # End Target # End Project hawknl-1.6.8+dfsg2/include/000077500000000000000000000000001130562644400154435ustar00rootroot00000000000000hawknl-1.6.8+dfsg2/include/HawkNL.pas000066400000000000000000000454751130562644400173130ustar00rootroot00000000000000(* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html *) (* 4th of September 2001 - Added Kylix support ( though untested ) Added NL_VERSION_STRING Added NLVoid type declaration Dominique Louis 14th of February 2002 - Added FreePascal Support ( though untested ) 07th of March 2002 - Made sure the header compiles. 2002/08/25 Sly - Updated to version 1.62 5 September 2002 - Updated to version 1.63, Phil Frisbie, Jr. 7 October 2002 - Updated to version 1.64, Phil Frisbie, Jr. *) unit HawkNL; {$IFDEF FPC} {$PACKRECORDS 4} {$ENDIF FPC} interface const NL_MAJOR_VERSION = 1; NL_MINOR_VERSION = 68; NL_VERSION_STRING = 'HawkNL 1.68'; type NLbyte = ShortInt; NLubyte = Byte; NLshort = SmallInt; NLushort = Word; NLlong = LongInt; NLulong = LongWord; NLint = Integer; NLuint = Cardinal; NLsizei = Integer; NLenum = Cardinal; NLflags = Cardinal; NLboolean = ByteBool; NLfloat = Single; NLclampf = Single; NLdouble = Double; NLclampd = Double; NLcstr = PChar; NLvoid = Pointer; NLsocket = integer; (* multithread *) NLThreadFunc = function(data: Pointer): Pointer; cdecl; NLthreadID = Pointer; NLmutex = Pointer; NLcond = Pointer; PNLaddress = ^NLaddress; NLaddress = record addr: array[0..31] of NLubyte; (* large enough to hold IPv6 address *) driver: NLenum; (* driver type, not used yet *) valid: NLboolean; (* set to NL_TRUE when address is valid *) end; TNLtime = record seconds: NLlong; (* seconds since 12:00AM, 1 January, 1970 *) mseconds: NLlong; (* milliseconds added to the seconds *) useconds: NLlong; (* microseconds added to the seconds *) end; const NL_MAX_STRING_LENGTH = 256; NL_MAX_GROUPS = 128; NL_MAX_GROUP_SOCKETS = 8192; NL_MAX_PACKET_LENGTH = 16384; { Boolean values } NL_INVALID = -1; NL_FALSE = 0; NL_TRUE = 1; { Network types } { Only one can init at a time } NL_IP = $0003; { all platforms } NL_LOOP_BACK = $0004; { all platforms, for single player client/server emulation with no network} NL_IPX = $0005; { Windows and Linux? } NL_SERIAL = $0006; { Windows and Linux only? } NL_MODEM = $0007; { Windows and Linux only? } NL_PARALLEL = $0008; { Windows and Linux only? } { Connection types } NL_RELIABLE = $0010; { NL_IP (TCP), NL_IPX (SPX), NL_LOOP_BACK } NL_UNRELIABLE = $0011; { NL_IP (UDP), NL_IPX, NL_LOOP_BACK } NL_RELIABLE_PACKETS = $0012; { NL_IP (TCP), NL_IPX (SPX), NL_LOOP_BACK } NL_BROADCAST = $0013; { NL_IP (UDP), NL_IPX, or NL_LOOP_BACK broadcast packets } NL_MULTICAST = $0014; { NL_IP (UDP) multicast } NL_RAW = $0015; { NL_SERIAL or NL_PARALLEL } { TCP/IP specific aliases for connection types } NL_TCP = NL_RELIABLE; NL_TCP_PACKETS = NL_RELIABLE_PACKETS; NL_UDP = NL_UNRELIABLE; NL_UDP_BROADCAST = NL_BROADCAST; NL_UDP_MULTICAST = NL_MULTICAST; { nlGetString } NL_VERSION = $0020; { the version string } NL_NETWORK_TYPES = $0021; { space delimited list of available network types } NL_CONNECTION_TYPES = $0022; { space delimited list of available connection types } { nlGetInteger, nlClear } NL_PACKETS_SENT = $0030; { total packets sent since last nlClear } NL_BYTES_SENT = $0031; { total bytes sent since last nlClear } NL_AVE_BYTES_SENT = $0032; { average bytes sent per second for the last 8 seconds } NL_HIGH_BYTES_SENT = $0033; { highest bytes per second ever sent } NL_PACKETS_RECEIVED = $0034; { total packets received since last nlClear } NL_BYTES_RECEIVED = $0035; { total bytes received since last nlClear } NL_AVE_BYTES_RECEIVED = $0036; { average bytes received per second for the last 8 seconds } NL_HIGH_BYTES_RECEIVED = $0037; { highest bytes per second ever received } NL_ALL_STATS = $0038; { nlClear only, clears out all counters } NL_OPEN_SOCKETS = $0039; { number of open sockets } { nlEnable, nlDisable } NL_BLOCKING_IO = $0040; { set IO to blocking, default is NL_FALSE for non-blocking IO } NL_SOCKET_STATS = $0041; { enable collection of socket read/write statistics, default disabled } NL_BIG_ENDIAN_DATA = $0042; { enable big endian data for nlSwap* and read/write macros, default enabled } NL_LITTLE_ENDIAN_DATA = $0043; { enable little endian data for nlSwap* and read/write macros, default disabled } { nlPollGroup } NL_READ_STATUS = $0050; { poll the read status for all sockets in the group } NL_WRITE_STATUS = $0051; { poll the write status for all sockets in the group } { nlHint, advanced network settings for experienced developers} NL_LISTEN_BACKLOG = $0060; { TCP, SPX: the backlog of connections for listen } NL_MULTICAST_TTL = $0061; { UDP : The multicast TTL value. Default : 1 } NL_REUSE_ADDRESS = $0062; { TCP, UDP : Allow IP address to be reused. Default : NL_FALSE } NL_TCP_NO_DELAY = $0063; { disable Nagle algorithm, only do this for a TCP/IP socket sending small packets } { errors } NL_NO_NETWORK = $0100; { no network was found on init } NL_OUT_OF_MEMORY = $0101; { a malloc failed } NL_INVALID_ENUM = $0102; { function called with an invalid NLenum } NL_INVALID_SOCKET = $0103; { socket is not valid, or has been terminated } NL_INVALID_PORT = $0104; { the port could not be opened } NL_INVALID_TYPE = $0105; { the network type is not available } NL_SYSTEM_ERROR = $0106; { a system error occurred, call nlGetSystemError } NL_SOCK_DISCONNECT = $0107; { the socket should be closed because of a connection loss or error } NL_NOT_LISTEN = $0108; { the socket has not been set to listen } NL_CON_REFUSED = $010a; { connection refused } NL_NO_PENDING = $010c; { there are no pending connections to accept } NL_BAD_ADDR = $010d; { the address or port are not valid } NL_MESSAGE_END = $010f; { the end of a reliable stream (TCP) message has been reached } NL_NULL_POINTER = $0110; { a NULL pointer was passed to a function } NL_INVALID_GROUP = $0111; { the group is not valid, or has been destroyed } NL_OUT_OF_GROUPS = $0112; { out of internal group objects } NL_OUT_OF_GROUP_SOCKETS = $0113; { the group has no more room for sockets } NL_BUFFER_SIZE = $0114; { the buffer was too small to store the data, retry with a larger buffer } NL_PACKET_SIZE = $0115; { the size of the packet exceeds NL_MAX_PACKET_LENGTH or the protocol max } NL_WRONG_TYPE = $0116; { the function does not support the socket type } NL_CON_PENDING = $0117; { a non-blocking connection is still pending } NL_SELECT_NET_ERROR = $0118; { a network is already selected, call nlShutDown and nlInit first } NL_PACKET_SYNC = $011a; { the NL_RELIABLE_PACKET stream is out of sync } NL_TLS_ERROR = $011b; { thread local storage could not be created } NL_TIMED_OUT = $011c; { the function timed out } NL_SOCKET_NOT_FOUND = $011d; { the socket was not found in the group } NL_STRING_OVER_RUN = $011e; { the string is not null terminated, or is longer than NL_MAX_STRING_LENGTH } NL_MUTEX_RECURSION = $011f; { the mutex was recursivly locked or unlocked } { for backwards compatability } NL_SOCKET_ERROR = NL_SYSTEM_ERROR; NL_CON_TERM = NL_SOCK_DISCONNECT; { standard multicast TTL settings as recommended by the } { white paper at http://www.ipmulticast.com/community/whitepapers/howipmcworks.html } NL_TTL_LOCAL = 1; { local LAN only } NL_TTL_SITE = 15; { this site } NL_TTL_REGION = 63; { this region } NL_TTL_WORLD = 127; { the world } { Low level API, a thin layer over Sockets or other network provider } function nlListen(socket: NLsocket):NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlAcceptConnection(socket: NLsocket): NLsocket; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlOpen(port: NLushort; tipo: NLenum): NLsocket; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlConnect(socket: NLsocket; var address: NLaddress): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlClose(socket: NLsocket): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlRead(socket: NLsocket; var buffer; nbytes: NLint): NLint; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlWrite(socket: NLsocket; const buffer; nbytes: NLint): NLint; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetSocketStat(socket: NLsocket; name: NLenum): NLlong; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlClearSocketStat(socket: NLsocket; name: NLenum): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlPollGroup(group: NLint; name: NLenum; var sockets: NLsocket; number: NLint; timeout: NLint):NLint; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlHint(name: NLenum; arg: NLint): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; { Address management API } function nlAddrToString(var address: NLaddress;straddr: PChar): PChar; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlStringToAddr(straddr: PChar; var address: NLaddress): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetRemoteAddr(socket: NLsocket; var address: NLaddress): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlSetRemoteAddr(socket: NLsocket; var address: NLaddress): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetLocalAddr(socket: NLsocket; var address: NLaddress): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetAllLocalAddr(var count: NLint): PNLaddress; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlSetLocalAddr(const address: NLaddress): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetNameFromAddr(var address: NLaddress; name: PChar): PChar; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetNameFromAddrAsync(var address: NLaddress; name: PChar): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetAddrFromName(name: PChar; var address: NLaddress): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetAddrFromNameAsync(name: PChar; var address: NLaddress): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlAddrCompare(var address1, address2: NLaddress): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetPortFromAddr(var address: NLaddress): NLushort; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlSetAddrPort(var address: NLaddress; port: NLushort): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; { Group management API } function nlGroupCreate: NLint; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGroupDestroy(group: NLint): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGroupAddSocket(group: NLint; socket: NLsocket): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGroupGetSockets(group: NLint; var sockets: NLsocket; var number: NLint): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGroupDeleteSocket(group: NLint; socket: NLsocket): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; { Multithreading API } function nlThreadCreate(func: NLThreadFunc; data: Pointer; joinable: NLboolean): NLthreadID; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; procedure nlThreadYield; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlThreadJoin(threadID: NLthreadID; status: PPointer): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlMutexInit(var mutex: NLmutex): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlMutexLock(var mutex: NLmutex): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlMutexUnlock(var mutex: NLmutex): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlMutexDestroy(var mutex: NLmutex): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlCondInit(var cond: NLcond): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlCondWait(var cond: NLcond; timeout: NLint): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlCondSignal(var cond: NLcond): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlCondBroadcast(var cond: NLcond): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlCondDestroy(var cond: NLcond): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; { Time API } function nlTime(var ts: TNLtime): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; { Misc. API } function nlInit: NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; procedure nlShutdown; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlSelectNetwork(network: NLenum): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetString(name: NLenum): PChar; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetInteger(name: NLenum): NLlong; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetBoolean(name: NLenum): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlClear(name: NLenum): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetError: NLenum; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetErrorStr(err: NLenum): PChar; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetSystemError: NLint; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetSystemErrorStr(err: NLint): PChar; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlEnable(name: NLenum): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlDisable(name: NLenum): NLboolean; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetCRC16(var data: PChar; len: NLint): NLushort; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlGetCRC32(var data: PChar; len: NLint): NLulong; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlSwaps(x: NLushort): NLushort; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlSwapl(x: NLulong): NLulong; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlSwapf(f: NLfloat): NLfloat; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; function nlSwapd(d: NLdouble): NLdouble; {$IFDEF WIN32} stdcall {$ELSE} cdecl {$ENDIF}; implementation const {$IFDEF WIN32} HAWKNL_DLL = 'HawkNL.dll'; {$ENDIF} {$IFDEF LINUX} HAWKNL_DLL = 'libNL.so'; {$ENDIF} function nlListen; external HAWKNL_DLL; function nlAcceptConnection; external HAWKNL_DLL; function nlOpen; external HAWKNL_DLL; function nlConnect; external HAWKNL_DLL; function nlClose; external HAWKNL_DLL; function nlRead; external HAWKNL_DLL; function nlWrite; external HAWKNL_DLL; function nlGetSocketStat; external HAWKNL_DLL; function nlClearSocketStat; external HAWKNL_DLL; function nlPollGroup; external HAWKNL_DLL; function nlHint; external HAWKNL_DLL; { Address management API } function nlAddrToString; external HAWKNL_DLL; function nlStringToAddr; external HAWKNL_DLL; function nlGetRemoteAddr; external HAWKNL_DLL; function nlSetRemoteAddr; external HAWKNL_DLL; function nlGetLocalAddr; external HAWKNL_DLL; function nlGetAllLocalAddr; external HAWKNL_DLL; function nlSetLocalAddr; external HAWKNL_DLL; function nlGetNameFromAddr; external HAWKNL_DLL; function nlGetNameFromAddrAsync; external HAWKNL_DLL; function nlGetAddrFromName; external HAWKNL_DLL; function nlGetAddrFromNameAsync; external HAWKNL_DLL; function nlAddrCompare; external HAWKNL_DLL; function nlGetPortFromAddr; external HAWKNL_DLL; function nlSetAddrPort; external HAWKNL_DLL; { Group management API } function nlGroupCreate; external HAWKNL_DLL; function nlGroupDestroy; external HAWKNL_DLL; function nlGroupAddSocket; external HAWKNL_DLL; function nlGroupGetSockets; external HAWKNL_DLL; function nlGroupDeleteSocket; external HAWKNL_DLL; { Multithreading API } function nlThreadCreate; external HAWKNL_DLL; procedure nlThreadYield; external HAWKNL_DLL; function nlThreadJoin; external HAWKNL_DLL; function nlMutexInit; external HAWKNL_DLL; function nlMutexLock; external HAWKNL_DLL; function nlMutexUnlock; external HAWKNL_DLL; function nlMutexDestroy; external HAWKNL_DLL; function nlCondInit; external HAWKNL_DLL; function nlCondWait; external HAWKNL_DLL; function nlCondSignal; external HAWKNL_DLL; function nlCondBroadcast; external HAWKNL_DLL; function nlCondDestroy; external HAWKNL_DLL; { Time API } function nlTime; external HAWKNL_DLL; { Misc. API } function nlInit; external HAWKNL_DLL; procedure nlShutdown; external HAWKNL_DLL; function nlSelectNetwork; external HAWKNL_DLL; function nlGetString; external HAWKNL_DLL; function nlGetInteger; external HAWKNL_DLL; function nlGetBoolean; external HAWKNL_DLL; function nlClear; external HAWKNL_DLL; function nlGetError; external HAWKNL_DLL; function nlGetErrorStr; external HAWKNL_DLL; function nlGetSystemError; external HAWKNL_DLL; function nlGetSystemErrorStr; external HAWKNL_DLL; function nlEnable; external HAWKNL_DLL; function nlDisable; external HAWKNL_DLL; function nlGetCRC16; external HAWKNL_DLL; function nlGetCRC32; external HAWKNL_DLL; function nlSwaps; external HAWKNL_DLL; function nlSwapl; external HAWKNL_DLL; function nlSwapf; external HAWKNL_DLL; function nlSwapd; external HAWKNL_DLL; end. hawknl-1.6.8+dfsg2/include/nl.h000066400000000000000000000524211130562644400162310ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #ifndef NL_H #define NL_H #include /* for strcpy, strlen, and memcpy in macros */ #ifdef __cplusplus extern "C" { #endif #define NL_MAJOR_VERSION 1 #define NL_MINOR_VERSION 68 #define NL_VERSION_STRING "HawkNL 1.68" /* define NL_SAFE_COPY for Sparc and other processors that do not allow non-aligned memory access. Needed for read* and write* macros */ /*#define NL_SAFE_COPY */ /* undefine this to remove IPX code, Windows only */ #define NL_INCLUDE_IPX /* undefine this to remove loopback code */ #define NL_INCLUDE_LOOPBACK /* undefine this to remove serial code */ #define NL_INCLUDE_SERIAL /* undefine this to remove modem code */ #define NL_INCLUDE_MODEM /* undefine this to remove parallel code */ #define NL_INCLUDE_PARALLEL #if defined (WIN32) || defined (WIN64) || defined (_WIN32_WCE) #define WINDOWS_APP #endif /* use native Windows threads and remove IPX support for WinCE */ /* also, many CE devices will not allow non-aligned memory access */ #if defined (_WIN32_WCE) #define NL_WIN_THREADS #define NL_SAFE_COPY #undef NL_INCLUDE_IPX #endif #ifdef WINDOWS_APP /* define NL_WIN_THREADS to use native Windows threads instead of pthreads */ #define NL_WIN_THREADS #ifdef _MSC_VER #pragma warning (disable:4514) /* disable "unreferenced inline function has been removed" warning */ #endif /* _MSC_VER */ /* The default build for Windows is as a DLL. */ /* If you want a static library, define WIN_STATIC_LIB. */ #ifdef WIN_STATIC_LIB #define NL_EXP #else #if defined (__LCC__) #define NL_EXP extern #else #define NL_EXP __declspec(dllexport) #endif /* __LCC__ */ #endif /* WIN_STATIC_LIB */ #define NL_APIENTRY __stdcall #define NL_CALLBACK __cdecl #ifdef __GNUC__ #define NL_INLINE extern __inline__ #else #define NL_INLINE __inline #endif /* __GNUC__ */ #else /* !WINDOWS_APP */ #define NL_EXP extern #define NL_APIENTRY #define NL_CALLBACK #ifdef __GNUC__ #define NL_INLINE extern __inline__ #else #define NL_INLINE inline /* assuming C99 compliant compiler */ #endif /* __GNUC__ */ #endif /* !WINDOWS_APP */ /* Any more needed here? */ #if defined WIN32 || defined WIN64 || defined __i386__ || defined __alpha__ || defined __mips__ #define NL_LITTLE_ENDIAN #else #define NL_BIG_ENDIAN #endif /* How do we detect Solaris 64 and Linux 64 bit? */ #if defined WIN64 #define IS_64_BIT #endif /* 8 bit */ typedef char NLbyte; typedef unsigned char NLubyte; typedef unsigned char NLboolean; /* 16 bit */ typedef short NLshort; typedef unsigned short NLushort; /* 32 bit */ typedef float NLfloat; #ifdef IS_64_BIT typedef int NLlong; /* Longs are 64 bit on a 64 bit CPU, but integers are still 32 bit. */ typedef unsigned int NLulong; /* This is, of course, not true on Windows (yet another exception), */ /* but it does not hurt. */ #else typedef long NLlong; typedef unsigned long NLulong; #endif /* 64 bit */ typedef double NLdouble; /* multithread */ typedef void *(*NLThreadFunc)(void *data); typedef void *NLthreadID; typedef struct nl_mutex_t *NLmutex; typedef struct nl_cond_t *NLcond; /* misc. */ typedef int NLint; typedef unsigned int NLuint; typedef unsigned int NLenum; typedef void NLvoid; typedef NLlong NLsocket; /* NOTE: NLchar is only to be used for external strings that might be unicode */ #if defined _UNICODE typedef wchar_t NLchar; #else typedef char NLchar; #endif typedef struct _NLaddress { NLubyte addr[32]; /* large enough to hold IPv6 address */ NLenum driver; /* driver type, not used yet */ NLboolean valid; /* set to NL_TRUE when address is valid */ } NLaddress; /* for backwards compatability */ #if !defined(address_t) typedef struct _NLaddress address_t; #endif typedef struct _NLtime { NLlong seconds; /* seconds since 12:00AM, 1 January, 1970 */ NLlong mseconds; /* milliseconds added to the seconds */ NLlong useconds; /* microseconds added to the seconds */ } NLtime; /* max string size limited to 256 (255 plus NULL termination) for MacOS */ #define NL_MAX_STRING_LENGTH 256 /* max packet size for NL_UNRELIABLE and NL_RELIABLE_PACKETS */ #define NL_MAX_PACKET_LENGTH 16384 /* max number groups and sockets per group */ #define NL_MAX_GROUPS 128 #if defined (macintosh) /* WARNING: Macs only allow up to 32K of local data, don't exceed 4096 */ /* Does NOT apply to Mac OSX */ #define NL_MAX_GROUP_SOCKETS 4096 #else /* max number of sockets per group NL will handle */ #define NL_MAX_GROUP_SOCKETS 8192 #endif #define NL_INVALID (-1) /* Boolean values */ #define NL_FALSE ((NLboolean)(0)) #define NL_TRUE ((NLboolean)(1)) /* Network types */ /* Only one can be selected at a time */ #define NL_IP 0x0003 /* all platforms */ #define NL_IPV6 0x0004 /* not yet implemented, IPv6 address family */ #define NL_LOOP_BACK 0x0005 /* all platforms, for single player client/server emulation with no network */ #define NL_IPX 0x0006 /* Windows only */ #define NL_SERIAL 0x0007 /* not yet implemented, Windows and Linux only? */ #define NL_MODEM 0x0008 /* not yet implemented, Windows and Linux only? */ #define NL_PARALLEL 0x0009 /* not yet implemented, Windows and Linux only? */ /* Connection types */ #define NL_RELIABLE 0x0010 /* NL_IP (TCP), NL_IPX (SPX), NL_LOOP_BACK */ #define NL_UNRELIABLE 0x0011 /* NL_IP (UDP), NL_IPX, NL_LOOP_BACK */ #define NL_RELIABLE_PACKETS 0x0012 /* NL_IP (TCP), NL_IPX (SPX), NL_LOOP_BACK */ #define NL_BROADCAST 0x0013 /* NL_IP (UDP), NL_IPX, or NL_LOOP_BACK broadcast packets */ #define NL_UDP_MULTICAST 0x0014 /* NL_IP (UDP) multicast */ #define NL_RAW 0x0015 /* NL_SERIAL or NL_PARALLEL */ /* TCP/IP specific aliases for connection types */ #define NL_TCP NL_RELIABLE #define NL_TCP_PACKETS NL_RELIABLE_PACKETS #define NL_UDP NL_UNRELIABLE #define NL_UDP_BROADCAST NL_BROADCAST /* for backwards compatability */ #define NL_MULTICAST NL_UDP_MULTICAST /* nlGetString */ #define NL_VERSION 0x0020 /* the version string */ #define NL_NETWORK_TYPES 0x0021 /* space delimited list of available network types */ #define NL_CONNECTION_TYPES 0x0022 /* space delimited list of available connection types */ /* only valid AFTER nlSelectNetwork */ /* nlGetInteger, nlGetSocketStat, nlClear */ #define NL_PACKETS_SENT 0x0030 /* total packets sent since last nlClear */ #define NL_BYTES_SENT 0x0031 /* total bytes sent since last nlClear */ #define NL_AVE_BYTES_SENT 0x0032 /* average bytes sent per second for the last 8 seconds */ #define NL_HIGH_BYTES_SENT 0x0033 /* highest bytes per second ever sent */ #define NL_PACKETS_RECEIVED 0x0034 /* total packets received since last nlClear */ #define NL_BYTES_RECEIVED 0x0035 /* total bytes received since last nlClear */ #define NL_AVE_BYTES_RECEIVED 0x0036 /* average bytes received per second for the last 8 seconds */ #define NL_HIGH_BYTES_RECEIVED 0x0037 /* highest bytes per second ever received */ #define NL_ALL_STATS 0x0038 /* nlClear only, clears out all counters */ #define NL_OPEN_SOCKETS 0x0039 /* number of open sockets */ /* nlEnable, nlDisable */ #define NL_BLOCKING_IO 0x0040 /* set IO to blocking, default is NL_FALSE for non-blocking IO */ #define NL_SOCKET_STATS 0x0041 /* enable collection of socket read/write statistics, default disabled */ #define NL_BIG_ENDIAN_DATA 0x0042 /* enable big endian data for nlSwap* and read/write macros, default enabled */ #define NL_LITTLE_ENDIAN_DATA 0x0043 /* enable little endian data for nlSwap* and read/write macros, default disabled */ #define NL_MULTIPLE_DRIVERS 0x0044 /* enable multiple drivers to be selected */ /* nlPollGroup */ #define NL_READ_STATUS 0x0050 /* poll the read status for all sockets in the group */ #define NL_WRITE_STATUS 0x0051 /* poll the write status for all sockets in the group */ #define NL_ERROR_STATUS 0x0052 /* poll the error status for all sockets in the group */ /* nlHint, advanced network settings for experienced developers */ #define NL_LISTEN_BACKLOG 0x0060 /* TCP, SPX: the backlog of connections for listen */ #define NL_MULTICAST_TTL 0x0061 /* UDP : The multicast TTL value. Default : 1 */ #define NL_REUSE_ADDRESS 0x0062 /* TCP, UDP : Allow IP address to be reused. Default : NL_FALSE */ #define NL_TCP_NO_DELAY 0x0063 /* TCP : disable Nagle algorithm, arg != 0 to disable, 0 to enable */ /* errors */ #define NL_NO_ERROR 0x0000 /* no error is stored */ #define NL_NO_NETWORK 0x0100 /* no network was found on init */ #define NL_OUT_OF_MEMORY 0x0101 /* out of memory */ #define NL_INVALID_ENUM 0x0102 /* function called with an invalid NLenum */ #define NL_INVALID_SOCKET 0x0103 /* socket is not valid, or has been terminated */ #define NL_INVALID_PORT 0x0104 /* the port could not be opened */ #define NL_INVALID_TYPE 0x0105 /* the network type is not available */ #define NL_SYSTEM_ERROR 0x0106 /* a system error occurred, call nlGetSystemError */ #define NL_SOCK_DISCONNECT 0x0107 /* the socket should be closed because of a connection loss or error */ #define NL_NOT_LISTEN 0x0108 /* the socket has not been set to listen */ #define NL_CON_REFUSED 0x0109 /* connection refused, or socket already connected */ #define NL_NO_PENDING 0x010a /* there are no pending connections to accept */ #define NL_BAD_ADDR 0x010b /* the address or port are not valid */ #define NL_MESSAGE_END 0x010c /* the end of a reliable stream (TCP) message has been reached */ #define NL_NULL_POINTER 0x010d /* a NULL pointer was passed to a function */ #define NL_INVALID_GROUP 0x010e /* the group is not valid, or has been destroyed */ #define NL_OUT_OF_GROUPS 0x010f /* out of internal group objects */ #define NL_OUT_OF_GROUP_SOCKETS 0x0110 /* the group has no more room for sockets */ #define NL_BUFFER_SIZE 0x0111 /* the buffer was too small to store the data, retry with a larger buffer */ #define NL_PACKET_SIZE 0x0112 /* the size of the packet exceeds NL_MAX_PACKET_LENGTH or the protocol max */ #define NL_WRONG_TYPE 0x0113 /* the function does not support the socket type */ #define NL_CON_PENDING 0x0114 /* a non-blocking connection is still pending */ #define NL_SELECT_NET_ERROR 0x0115 /* a network is already selected, and NL_MULTIPLE_DRIVERS is not enabled, call nlShutDown and nlInit first */ #define NL_PACKET_SYNC 0x0116 /* the NL_RELIABLE_PACKET stream is out of sync */ #define NL_TLS_ERROR 0x0117 /* thread local storage could not be created */ #define NL_TIMED_OUT 0x0118 /* the function timed out */ #define NL_SOCKET_NOT_FOUND 0x0119 /* the socket was not found in the group */ #define NL_STRING_OVER_RUN 0x011a /* the string is not null terminated, or is longer than NL_MAX_STRING_LENGTH */ #define NL_MUTEX_RECURSION 0x011b /* the mutex was recursivly locked */ #define NL_MUTEX_OWNER 0x011c /* the mutex is not owned by thread */ /* for backwards compatability */ #define NL_SOCKET_ERROR NL_SYSTEM_ERROR #define NL_CON_TERM NL_SOCK_DISCONNECT /* standard multicast TTL settings as recommended by the */ /* white paper at http://www.ipmulticast.com/community/whitepapers/howipmcworks.html */ #define NL_TTL_LOCAL 1 /* local LAN only */ #define NL_TTL_SITE 15 /* this site */ #define NL_TTL_REGION 63 /* this region */ #define NL_TTL_WORLD 127 /* the world */ /* Low level API, a thin layer over Sockets or other network provider. */ NL_EXP NLboolean NL_APIENTRY nlListen(NLsocket socket); NL_EXP NLsocket NL_APIENTRY nlAcceptConnection(NLsocket socket); NL_EXP NLsocket NL_APIENTRY nlOpen(NLushort port, NLenum type); NL_EXP NLboolean NL_APIENTRY nlConnect(NLsocket socket, const NLaddress *address); NL_EXP NLboolean NL_APIENTRY nlClose(NLsocket socket); NL_EXP NLint NL_APIENTRY nlRead(NLsocket socket, /*@out@*/ NLvoid *buffer, NLint nbytes); NL_EXP NLint NL_APIENTRY nlWrite(NLsocket socket, const NLvoid *buffer, NLint nbytes); NL_EXP NLlong NL_APIENTRY nlGetSocketStat(NLsocket socket, NLenum name); NL_EXP NLboolean NL_APIENTRY nlClearSocketStat(NLsocket socket, NLenum name); NL_EXP NLint NL_APIENTRY nlPollGroup(NLint group, NLenum name, /*@out@*/ NLsocket *sockets, NLint number, NLint timeout); NL_EXP NLboolean NL_APIENTRY nlHint(NLenum name, NLint arg); /* Address management API */ NL_EXP /*@null@*/ NLchar* NL_APIENTRY nlAddrToString(const NLaddress *address, /*@returned@*/ /*@out@*/ NLchar *string); NL_EXP NLboolean NL_APIENTRY nlStringToAddr(const NLchar *string, /*@out@*/ NLaddress *address); NL_EXP NLboolean NL_APIENTRY nlGetRemoteAddr(NLsocket socket, /*@out@*/ NLaddress *address); NL_EXP NLboolean NL_APIENTRY nlSetRemoteAddr(NLsocket socket, const NLaddress *address); NL_EXP NLboolean NL_APIENTRY nlGetLocalAddr(NLsocket socket, /*@out@*/ NLaddress *address); NL_EXP NLaddress* NL_APIENTRY nlGetAllLocalAddr(/*@out@*/ NLint *count); NL_EXP NLboolean NL_APIENTRY nlSetLocalAddr(const NLaddress *address); NL_EXP /*@null@*/ NLchar* NL_APIENTRY nlGetNameFromAddr(const NLaddress *address, /*@returned@*/ /*@out@*/ NLchar *name); NL_EXP NLboolean NL_APIENTRY nlGetNameFromAddrAsync(const NLaddress *address, /*@out@*/ NLchar *name); NL_EXP NLboolean NL_APIENTRY nlGetAddrFromName(const NLchar *name, /*@out@*/ NLaddress *address); NL_EXP NLboolean NL_APIENTRY nlGetAddrFromNameAsync(const NLchar *name, /*@out@*/ NLaddress *address); NL_EXP NLboolean NL_APIENTRY nlAddrCompare(const NLaddress *address1, const NLaddress *address2); NL_EXP NLushort NL_APIENTRY nlGetPortFromAddr(const NLaddress *address); NL_EXP NLboolean NL_APIENTRY nlSetAddrPort(NLaddress *address, NLushort port); /* Group management API */ NL_EXP NLint NL_APIENTRY nlGroupCreate(void); NL_EXP NLboolean NL_APIENTRY nlGroupDestroy(NLint group); NL_EXP NLboolean NL_APIENTRY nlGroupAddSocket(NLint group, NLsocket socket); NL_EXP NLboolean NL_APIENTRY nlGroupGetSockets(NLint group, /*@out@*/ NLsocket *sockets, /*@in@*/ NLint *number); NL_EXP NLboolean NL_APIENTRY nlGroupDeleteSocket(NLint group, NLsocket socket); /* Multithreading API */ NL_EXP NLthreadID NL_APIENTRY nlThreadCreate(NLThreadFunc func, void *data, NLboolean joinable); NL_EXP void NL_APIENTRY nlThreadYield(void); NL_EXP NLboolean NL_APIENTRY nlThreadJoin(NLthreadID threadID, void **status); NL_EXP NLboolean NL_APIENTRY nlMutexInit(NLmutex *mutex); NL_EXP NLboolean NL_APIENTRY nlMutexLock(NLmutex *mutex); NL_EXP NLboolean NL_APIENTRY nlMutexUnlock(NLmutex *mutex); NL_EXP NLboolean NL_APIENTRY nlMutexDestroy(NLmutex *mutex); NL_EXP NLboolean NL_APIENTRY nlCondInit(NLcond *cond); NL_EXP NLboolean NL_APIENTRY nlCondWait(NLcond *cond, NLint timeout); NL_EXP NLboolean NL_APIENTRY nlCondSignal(NLcond *cond); NL_EXP NLboolean NL_APIENTRY nlCondBroadcast(NLcond *cond); NL_EXP NLboolean NL_APIENTRY nlCondDestroy(NLcond *cond); /* Time API */ NL_EXP NLboolean NL_APIENTRY nlTime(NLtime *ts); /* Misc. API */ NL_EXP NLboolean NL_APIENTRY nlInit(void); NL_EXP void NL_APIENTRY nlShutdown(void); NL_EXP NLboolean NL_APIENTRY nlSelectNetwork(NLenum network); NL_EXP const /*@observer@*//*@null@*/ NLchar* NL_APIENTRY nlGetString(NLenum name); NL_EXP NLlong NL_APIENTRY nlGetInteger(NLenum name); NL_EXP NLboolean NL_APIENTRY nlGetBoolean(NLenum name); NL_EXP NLboolean NL_APIENTRY nlClear(NLenum name); NL_EXP NLenum NL_APIENTRY nlGetError(void); NL_EXP const /*@observer@*/ NLchar* NL_APIENTRY nlGetErrorStr(NLenum err); NL_EXP NLint NL_APIENTRY nlGetSystemError(void); NL_EXP const /*@observer@*/ NLchar* NL_APIENTRY nlGetSystemErrorStr(NLint err); NL_EXP NLboolean NL_APIENTRY nlEnable(NLenum name); NL_EXP NLboolean NL_APIENTRY nlDisable(NLenum name); NL_EXP NLushort NL_APIENTRY nlGetCRC16(NLubyte *data, NLint len); NL_EXP NLulong NL_APIENTRY nlGetCRC32(NLubyte *data, NLint len); NL_EXP NLushort NL_APIENTRY nlSwaps(NLushort x); NL_EXP NLulong NL_APIENTRY nlSwapl(NLulong x); NL_EXP NLfloat NL_APIENTRY nlSwapf(NLfloat f); NL_EXP NLdouble NL_APIENTRY nlSwapd(NLdouble d); /* macros for writing/reading packet buffers */ /* NOTE: these also endian swap the data as needed */ /* write* or read* (buffer *, count, data [, length]) */ #ifdef NL_SAFE_COPY #define writeShort(x, y, z) {NLushort nl_temps = nlSwaps(z); memcpy((char *)&x[y], (char *)&nl_temps, 2); y += 2;} #define writeLong(x, y, z) {NLulong nl_templ = nlSwapl(z); memcpy((char *)&x[y], (char *)&nl_templ, 4); y += 4;} #define writeFloat(x, y, z) {NLfloat nl_tempf = nlSwapf(z); memcpy((char *)&x[y], (char *)&nl_tempf, 4); y += 4;} #define writeDouble(x, y, z) {NLdouble nl_tempd = nlSwapd(z); memcpy((char *)&x[y], (char *)&nl_tempd, 8); y += 8;} #define readShort(x, y, z) {memcpy((char *)&z, (char *)&x[y], 2); z = nlSwaps(z); y += 2;} #define readLong(x, y, z) {memcpy((char *)&z, (char *)&x[y], 4); z = nlSwapl(z); y += 4;} #define readFloat(x, y, z) {memcpy((char *)&z, (char *)&x[y], 4); z = nlSwapf(z); y += 4;} #define readDouble(x, y, z) {memcpy((char *)&z, (char *)&x[y], 8); z = nlSwapd(z); y += 8;} #else /* !NL_SAFE_COPY */ #define writeShort(x, y, z) {*((NLushort *)((NLbyte *)&x[y])) = nlSwaps(z); y += 2;} #define writeLong(x, y, z) {*((NLulong *)((NLbyte *)&x[y])) = nlSwapl(z); y += 4;} #define writeFloat(x, y, z) {*((NLfloat *)((NLbyte *)&x[y])) = nlSwapf(z); y += 4;} #define writeDouble(x, y, z) {*((NLdouble *)((NLbyte *)&x[y])) = nlSwapd(z); y += 8;} #define readShort(x, y, z) {z = nlSwaps(*(NLushort *)((NLbyte *)&x[y])); y += 2;} #define readLong(x, y, z) {z = nlSwapl(*(NLulong *)((NLbyte *)&x[y])); y += 4;} #define readFloat(x, y, z) {z = nlSwapf(*(NLfloat *)((NLbyte *)&x[y])); y += 4;} #define readDouble(x, y, z) {z = nlSwapd(*(NLdouble *)((NLbyte *)&x[y])); y += 8;} #endif /* !NL_SAFE_COPY */ #define writeByte(x, y, z) (*(NLbyte *)&x[y++] = (NLbyte)z) #define writeBlock(x, y, z, a) {memcpy((char *)&x[y], (char *)z, a);y += a;} #define readByte(x, y, z) (z = *(NLbyte *)&x[y++]) #define readBlock(x, y, z, a) {memcpy((char *)z, (char *)&x[y], a);y += a;} #ifdef _UNICODE #include #define writeString(x, y, z) writeStringWC(x, &y, z) #define readString(x, y, z) readStringWC(x, &y, z) NL_INLINE void writeStringWC(NLbyte *x, NLint *y, NLchar *z) { int len = (int)wcstombs(&x[*y], z, (size_t)NL_MAX_STRING_LENGTH); if(len == NL_MAX_STRING_LENGTH) { /* must null terminate string */ x[*y + NL_MAX_STRING_LENGTH] = '\0'; *y += NL_MAX_STRING_LENGTH; } else if(len > 0) { *y += (len + 1); } else { /* there was an error in wcstombs, so just add a 0 length string to the buffer */ x[*y] = '\0'; *y++; } } NL_INLINE void readStringWC(NLbyte *x, NLint *y, NLchar *z) { int len = (int)mbstowcs(z, &x[*y], (size_t)NL_MAX_STRING_LENGTH); if(len == NL_MAX_STRING_LENGTH) { /* must null terminate string */ z[NL_MAX_STRING_LENGTH] = L'\0'; } else if(len < 0) { /* must null terminate string */ z[0] = L'\0'; } *y += (strlen((char *)&x[*y]) + 1); } #else /* !_UNICODE */ #define writeString(x, y, z) {strcpy((char *)&x[y], (char *)z); y += (strlen((char *)z) + 1);} #define readString(x, y, z) {strcpy((char *)z, (char *)&x[y]); y += (strlen((char *)z) + 1);} #endif /* !_UNICODE */ #ifdef __cplusplus } /* extern "C" */ #endif #endif /* NL_H */ hawknl-1.6.8+dfsg2/makefile.linux000066400000000000000000000001441130562644400166550ustar00rootroot00000000000000all: cd src;\ make -f makefile.linux install: cd src;\ make -f makefile.linux install hawknl-1.6.8+dfsg2/samples/000077500000000000000000000000001130562644400154645ustar00rootroot00000000000000hawknl-1.6.8+dfsg2/samples/async.c000066400000000000000000000130401130562644400167430ustar00rootroot00000000000000/* Sample program for the HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) */ /* Test the asynchronous calls nlGetNameFromAddrAsync and nlGetAddrFromNameAsync */ /* To test UNICODE on Windows NT/2000/XP, define UNICODE and _UNICODE in your compiler settings and recompile HawkNL. Then uncomment both the defines below and compile this program. */ //#define _UNICODE //#define UNICODE #include #include #include #include "nl.h" #ifdef WINDOWS_APP #define WIN32_LEAN_AND_MEAN #include #include #define sleep(x) Sleep((DWORD)(1000 * (x))) #else #include #endif #ifndef _INC_TCHAR #ifdef _UNICODE #define TEXT(x) L##x #define _tmain wmain #define _tprintf wprintf #define _stprintf swprintf #define _tcslen wcslen #ifdef WINDOWS_APP #define _ttoi _wtoi #else /* !WINDOWS_APP*/ #define _ttoi wtoi #endif /* !WINDOWS_APP*/ #else /* !UNICODE */ #define TEXT(x) x #define _tmain main #define _tprintf printf #define _stprintf sprintf #define _tcslen strlen #endif /* !UNICODE */ #endif /* _INC_TCHAR */ static void printErrorExit(void) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { _tprintf(TEXT("System error: %s\n"), nlGetSystemErrorStr(nlGetSystemError())); } else { _tprintf(TEXT("HawkNL error: %s\n"), nlGetErrorStr(err)); } nlShutdown(); exit(EXIT_FAILURE); } #if defined (_WIN32_WCE) int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd ) #else int _tmain(int argc, NLchar **argv) #endif { NLchar name1[NL_MAX_STRING_LENGTH] = TEXT("www.hawksoft.com:80"); NLchar name2[NL_MAX_STRING_LENGTH] = TEXT("www.flipcode.com"); NLchar name3[NL_MAX_STRING_LENGTH] = TEXT("www.amd.com"); NLchar name4[NL_MAX_STRING_LENGTH] = TEXT("www.3dfx.com"); NLchar name5[NL_MAX_STRING_LENGTH] = TEXT("192.156.136.22"); NLaddress addr1, addr2, addr3, addr4, addr5; NLchar ip1[] = TEXT("1.2.3.4"); NLchar ip2[] = TEXT("64.28.67.72:80"); NLchar ip3[] = TEXT("66.218.74.1"); NLchar ip4[] = TEXT("216.200.197.161"); NLchar ip5[] = TEXT("64.28.67.150"); NLchar string[NL_MAX_STRING_LENGTH]; if(nlInit() == NL_FALSE) printErrorExit(); _tprintf(TEXT("nlGetString(NL_VERSION) = %s\n\n"), nlGetString(NL_VERSION)); if(nlSelectNetwork(NL_IP) == NL_FALSE) printErrorExit(); _tprintf(TEXT("Resolve address from name, start:\n")); nlGetAddrFromNameAsync(name1, &addr1); nlGetAddrFromNameAsync(name2, &addr2); nlGetAddrFromNameAsync(name3, &addr3); nlGetAddrFromNameAsync(name4, &addr4); nlGetAddrFromNameAsync(name5, &addr5); while(1 == 1) { int count = 0; static int sec = 0; _tprintf(TEXT("%d second(s)\n"), sec); if(addr1.valid == NL_TRUE) { _tprintf(TEXT("%s resolves to %s\n"), name1, nlAddrToString(&addr1, string)); count++; } if(addr2.valid == NL_TRUE) { _tprintf(TEXT("%s resolves to %s\n"), name2, nlAddrToString(&addr2, string)); count++; } if(addr3.valid == NL_TRUE) { _tprintf(TEXT("%s resolves to %s\n"), name3, nlAddrToString(&addr3, string)); count++; } if(addr4.valid == NL_TRUE) { _tprintf(TEXT("%s resolves to %s\n"), name4, nlAddrToString(&addr4, string)); count++; } if(addr5.valid == NL_TRUE) { _tprintf(TEXT("%s resolves to %s\n"), name5, nlAddrToString(&addr5, string)); count++; } if(count == 5) { /* we are done */ break; } _tprintf(TEXT("\n")); sleep(1); sec++; } _tprintf(TEXT("Done\n\n")); _tprintf(TEXT("Resolve name from address, start:\n")); nlStringToAddr(ip1, &addr1); nlStringToAddr(ip2, &addr2); nlStringToAddr(ip3, &addr3); nlStringToAddr(ip4, &addr4); nlStringToAddr(ip5, &addr5); nlGetNameFromAddrAsync(&addr1, name1); nlGetNameFromAddrAsync(&addr2, name2); nlGetNameFromAddrAsync(&addr3, name3); nlGetNameFromAddrAsync(&addr4, name4); nlGetNameFromAddrAsync(&addr5, name5); while(1 == 1) { int count = 0; static int sec = 0; _tprintf(TEXT("%d second(s)\n"), sec); if(_tcslen(name1) > 0) { _tprintf(TEXT("%s resolves to %s\n"), ip1, name1); count++; } if(_tcslen(name2) > 0) { _tprintf(TEXT("%s resolves to %s\n"), ip2, name2); count++; } if(_tcslen(name3) > 0) { _tprintf(TEXT("%s resolves to %s\n"), ip3, name3); count++; } if(_tcslen(name4) > 0) { _tprintf(TEXT("%s resolves to %s\n"), ip4, name4); count++; } if(_tcslen(name5) > 0) { _tprintf(TEXT("%s resolves to %s\n"), ip5, name5); count++; } if(count == 5) { /* we are done */ break; } _tprintf(TEXT("\n")); sleep(1); sec++; } _tprintf(TEXT("Done\n")); nlShutdown(); return 0; } hawknl-1.6.8+dfsg2/samples/broadcast.c000066400000000000000000000062151130562644400175760ustar00rootroot00000000000000/* Sample program for the HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) */ /* This app shows how to broadcast on a LAN. Choose the network type to use with the command line: broadcast NL_IP The default is NL_IP. Valid network types are: NL_IP, NL_IPX, and NL_LOOP_BACK */ #include #include #include #include "nl.h" #if defined WIN32 || defined WIN64 #define WIN32_LEAN_AND_MEAN #include #define sleep(x) Sleep((DWORD)(1000 * (x))) #else #include #endif static void printErrorExit(void) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { printf("System error: %s\n", nlGetSystemErrorStr(nlGetSystemError())); } else { printf("HawkNL error: %s\n", nlGetErrorStr(err)); } nlShutdown(); exit(EXIT_FAILURE); } static void mainTestLoop(NLsocket sock) { while(1 == 1) { NLbyte buffer[100]; NLbyte string[NL_MAX_STRING_LENGTH]; NLaddress addr; char hello[] = "Hello"; if(nlWrite(sock, (NLvoid *)hello, (NLint)sizeof(hello)) == NL_INVALID) { printErrorExit(); } while(nlRead(sock, (NLvoid *)buffer, (NLint)sizeof(buffer)) > 0) { nlGetRemoteAddr(sock, &addr); buffer[99] = (NLbyte)0; printf("received %s from %s, packet #%d\n", buffer, nlAddrToString(&addr, string), nlGetInteger(NL_PACKETS_RECEIVED)); } sleep(1); } } int main(int argc, char **argv) { NLsocket sock; NLaddress addr, *alladdr; NLbyte string[NL_MAX_STRING_LENGTH]; NLenum type = NL_IP; /* default network type */ NLint count; if(nlInit() == NL_FALSE) printErrorExit(); printf("nlGetString(NL_VERSION) = %s\n\n", nlGetString(NL_VERSION)); printf("nlGetString(NL_NETWORK_TYPES) = %s\n\n", nlGetString(NL_NETWORK_TYPES)); if (argc == 2) { if(strcmp(argv[1], "NL_IPX") == 0) { type = NL_IPX; } else if(strcmp(argv[1], "NL_LOOP_BACK") == 0) { type = NL_LOOP_BACK; } } if(nlSelectNetwork(type) == NL_FALSE) printErrorExit(); /* list all the local addresses */ alladdr = nlGetAllLocalAddr(&count); if(alladdr != NULL) { printf("local %d addresses are:\n", count); while(count-- > 0) { printf(" %s\n", nlAddrToString(alladdr++, string)); } } else { printErrorExit(); } printf("\n"); nlEnable(NL_SOCKET_STATS); /* enable reuse address to run two or more copies on one machine */ nlHint(NL_REUSE_ADDRESS, NL_TRUE); /* create a client socket */ sock = nlOpen(25000, NL_BROADCAST); if(sock == NL_INVALID) printErrorExit(); nlGetLocalAddr(sock, &addr); printf("socket address is %s\n", nlAddrToString(&addr, string)); mainTestLoop(sock); nlShutdown(); return 0; } hawknl-1.6.8+dfsg2/samples/buffer.c000066400000000000000000000115161130562644400171050ustar00rootroot00000000000000/* Sample program for the HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) */ /* This app tests the swap and read/write buffer macros */ /* To test UNICODE on Windows NT/2000/XP, define UNICODE and _UNICODE in your compiler settings and recompile HawkNL. Then uncomment both the defines below and compile this program. */ //#define _UNICODE //#define UNICODE #include #include #include #include "nl.h" #ifdef WINDOWS_APP #define WIN32_LEAN_AND_MEAN #include #include #endif #ifndef _INC_TCHAR #ifdef _UNICODE #define TEXT(x) L##x #define _tmain wmain #define _tprintf wprintf #define _stprintf swprintf #define _tcslen wcslen #ifdef WINDOWS_APP #define _ttoi _wtoi #else /* !WINDOWS_APP*/ #define _ttoi wtoi #endif /* !WINDOWS_APP*/ #else /* !UNICODE */ #define TEXT(x) x #define _tmain main #define _tprintf printf #define _stprintf sprintf #define _tcslen strlen #endif /* !UNICODE */ #endif /* _INC_TCHAR */ static void printErrorExit(void) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { _tprintf(TEXT("System error: %s\n"), nlGetSystemErrorStr(nlGetSystemError())); } else { _tprintf(TEXT("HawkNL error: %s\n"), nlGetErrorStr(err)); } nlShutdown(); exit(EXIT_FAILURE); } #if defined (_WIN32_WCE) int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd ) #else int _tmain(int argc, NLchar **argv) #endif { NLbyte buffer[NL_MAX_STRING_LENGTH]; NLint count = 0; NLbyte b = (NLbyte)99; NLushort s = 0x1122; NLulong l = 0x11223344; NLfloat f = 12.3141592651f; NLdouble d = 123.12345678901234; NLchar string[NL_MAX_STRING_LENGTH] = TEXT("Hello"); NLbyte block[] = {9,8,7,6,5,4,3,2,1,0}; if(nlInit() == NL_FALSE) printErrorExit(); nlEnable(NL_BIG_ENDIAN_DATA); _tprintf(TEXT("nl_big_endian_data = %d\n"), nlGetBoolean(NL_BIG_ENDIAN_DATA)); _tprintf(TEXT("nlGetString(NL_VERSION) = %s\n\n"), nlGetString(NL_VERSION)); _tprintf(TEXT("nlGetString(NL_NETWORK_TYPES) = %s\n\n"), nlGetString(NL_NETWORK_TYPES)); if(nlSelectNetwork(NL_IP) == NL_FALSE) printErrorExit(); _tprintf(TEXT("Short number: %#x, "), s); s = nlSwaps(s); _tprintf(TEXT("swapped: %#x, "), s); s = nlSwaps(s); _tprintf(TEXT("swapped back: %#x\n"), s); _tprintf(TEXT("Long number: %#lx, "), l); l = nlSwapl(l); _tprintf(TEXT("swapped: %#lx, "), l); l = nlSwapl(l); _tprintf(TEXT("swapped back: %#lx\n"), l); _tprintf(TEXT("Float number: %.10f, "), f); f = nlSwapf(f); _tprintf(TEXT("swapped: %.10f, "), f); f = nlSwapf(f); _tprintf(TEXT("swapped back: %.10f\n"), f); _tprintf(TEXT("Double number: %.14f, "), d); d = nlSwapd(d); _tprintf(TEXT("swapped: %.24f, "), d); d = nlSwapd(d); _tprintf(TEXT("swapped back: %.14f\n"), d); _tprintf(TEXT("\n")); _tprintf(TEXT("write byte %d to buffer\n"), b); _tprintf(TEXT("write short %#x to buffer\n"), s); _tprintf(TEXT("write long %#lx to buffer\n"), l); _tprintf(TEXT("write float %f to buffer\n"), f); _tprintf(TEXT("write double %.14f to buffer\n"), d); _tprintf(TEXT("write string %s to buffer\n"), string); _tprintf(TEXT("write block %d%d%d%d%d%d%d%d%d%d to buffer\n"), block[0] , block[1], block[2], block[3], block[4], block[5], block[6] , block[7], block[8], block[9]); _tprintf(TEXT("\n")); writeByte(buffer, count, b); writeShort(buffer, count, s); writeLong(buffer, count, l); writeFloat(buffer, count, f); writeDouble(buffer, count, d); writeString(buffer, count, string); writeBlock(buffer, count, block, 10); /* reset count to zero to read from start of buffer */ count = 0; readByte(buffer, count, b); readShort(buffer, count, s); readLong(buffer, count, l); readFloat(buffer, count, f); readDouble(buffer, count, d); readString(buffer, count, string); readBlock(buffer, count, block, 10); _tprintf(TEXT("read byte %d from buffer\n"), b); _tprintf(TEXT("read short %#x from buffer\n"), s); _tprintf(TEXT("read long %#lx from buffer\n"), l); _tprintf(TEXT("read float %f from buffer\n"), f); _tprintf(TEXT("read double %.14f from buffer\n"), d); _tprintf(TEXT("read string %s from buffer\n"), string); _tprintf(TEXT("read block %d%d%d%d%d%d%d%d%d%d from buffer\n"), block[0] , block[1], block[2], block[3], block[4], block[5], block[6] , block[7], block[8], block[9]); nlShutdown(); return 0; } hawknl-1.6.8+dfsg2/samples/clientserver.c000066400000000000000000000163541130562644400203460ustar00rootroot00000000000000/* Sample program for the HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) */ /* This app shows a multithreaded client/server app. Choose the network type to use with the command line: clientserver NL_IP The default is NL_IP. Valid network types are: NL_IP, NL_IPX, and NL_LOOP_BACK */ #include #include #include #include "nl.h" #if defined WIN32 || defined WIN64 #define WIN32_LEAN_AND_MEAN #include #define sleep(x) Sleep(1000 * (x)) #else #include #endif NLmutex printmutex; NLboolean shutdown = NL_FALSE; void printErrorExit(void) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { printf("System error: %s\n", nlGetSystemErrorStr(nlGetSystemError())); } else { printf("HawkNL error: %s\n", nlGetErrorStr(err)); } nlShutdown(); exit(1); } #define MAX_CLIENTS 10 NLenum socktype = NL_RELIABLE_PACKETS; NLushort serverport = 25000; static void *mainServerLoop(void *s) { NLsocket sock = *(NLsocket *)s; NLsocket client[MAX_CLIENTS]; NLint clientnum = 0; NLbyte string[NL_MAX_STRING_LENGTH]; NLint group; memset(client, 0, sizeof(client)); group = nlGroupCreate(); while(1) { NLint i, count; NLbyte buffer[128]; NLsocket s[MAX_CLIENTS]; NLsocket newsock; /* check for shutdown */ if(shutdown == NL_TRUE) { printf("SERVER: shutting down\n"); return NULL; } /* check for a new client */ newsock = nlAcceptConnection(sock); if(newsock != NL_INVALID) { NLaddress addr; nlGetRemoteAddr(newsock, &addr); client[clientnum] = newsock; /* add socket to the group */ nlGroupAddSocket(group, newsock); nlMutexLock(&printmutex); printf("SERVER:Client %d connected from %s on socket %d\n", clientnum, nlAddrToString(&addr, string), newsock); nlMutexUnlock(&printmutex); clientnum++; } else { NLint err = nlGetError(); if( err == NL_SYSTEM_ERROR || err == NL_NOT_LISTEN) { printf("\n\nServer shutdown!!!!!!!!!!!!!\n"); printErrorExit(); } } /* check for incoming messages */ count = nlPollGroup(group, NL_READ_STATUS, s, MAX_CLIENTS, 0); if(count == NL_INVALID) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { printf("nlPollGroup system error: %s\n", nlGetSystemErrorStr(nlGetSystemError())); } else { printf("nlPollGroup HawkNL error: %s\n", nlGetErrorStr(err)); } } if(count > 0) { nlMutexLock(&printmutex); printf("\n\n!!!!!!!!!count = %d\n", count); nlMutexUnlock(&printmutex); } /* loop through the clients and read the packets */ for(i=0;i 0) { buffer[127] = 0; /* null terminate the char string */ printf("SERVER:socket %d sent %s\n", s[i], buffer); /* send to the whole group */ nlWrite(group, buffer, strlen(buffer) + 1); } nlMutexUnlock(&printmutex); if(readlen == NL_INVALID) { NLenum err = nlGetError(); if( err == NL_MESSAGE_END || err == NL_SOCK_DISCONNECT) { nlGroupDeleteSocket(group, s[i]); nlClose(s[i]); nlMutexLock(&printmutex); printf("SERVER:socket %d closed\n", s[i]); nlMutexUnlock(&printmutex); clientnum--; } } } nlThreadYield(); } return 0; } static void *mainClientLoop(void *s) { NLsocket sock[MAX_CLIENTS]; NLaddress addr; NLint i, count = 4; NLbyte str[256]; sleep(1); /* create the client sockets */ for(i=0;i 0) { for(i=0;i 0) { printf("\"%s\",", str); } nlMutexUnlock(&printmutex); } sleep(1); } /* create the client sockets */ nlMutexLock(&printmutex); for(i=0;i 0 do begin nlGetRemoteAddr(sock, addr); buffer[99] := #0; Writeln(Format('received %s from %s, packet #%d', [buffer, nlAddrToString(addr, str), nlGetInteger(NL_PACKETS_RECEIVED)])); end; Sleep(1000); end; end; var sock: NLsocket; addr: NLaddress; alladdr: PNLaddress; str: array [0..NL_MAX_STRING_LENGTH - 1] of Char; networkType: NLenum; (* default network type *) count: NLint; begin networkType := NL_IP; if not nlInit() then printErrorExit(); Writeln('nlGetString(NL_VERSION) = ', nlGetString(NL_VERSION)); Writeln; Writeln('nlGetString(NL_NETWORK_TYPES) = ', nlGetString(NL_NETWORK_TYPES)); WriteLn; if ParamCount >= 1 then begin if ParamStr(1) = 'NL_IPX' then networkType := NL_IPX else if ParamStr(1) = 'NL_LOOP_BACK' then networkType := NL_LOOP_BACK; end; if not nlSelectNetwork(networkType) then printErrorExit(); (* list all the local addresses *) Writeln('local addresses are:'); alladdr := nlGetAllLocalAddr(count); while count > 0 do begin Writeln(' ', nlAddrToString(alladdr^, str)); alladdr := PNLaddress(Integer(alladdr) + SizeOf(NLaddress)); count := count - 1; end; Writeln; nlEnable(NL_SOCKET_STATS); (* enable reuse address to run two or more copies on one machine *) nlHint(NL_REUSE_ADDRESS, NL_TRUE); (* create a client socket *) sock := nlOpen(25000, NL_BROADCAST); if sock = NL_INVALID then printErrorExit(); nlGetLocalAddr(sock, addr); Writeln('socket address is ', nlAddrToString(addr, str)); mainTestLoop(sock); nlShutdown(); end. hawknl-1.6.8+dfsg2/samples/delphi/eqtest.dpr000066400000000000000000000017641130562644400207550ustar00rootroot00000000000000program eqtest; {$APPTYPE CONSOLE} uses HawkNL; const {$J+} command: array [0..3] of NLubyte = ($FF, $FF, $09, $00); {$J-} port = 24252; server = 'status.everquest.com'; var sock: NLsocket; addr: NLaddress; buffer: array [0..1023] of Char; count: NLint; begin if not nlInit() then Halt(1); if not nlSelectNetwork(NL_IP) then begin nlShutdown(); Halt(1); end; nlEnable(NL_BLOCKING_IO); (* create server the address *) nlGetAddrFromName(server, addr); nlSetAddrPort(addr, port); (* create the socket *) sock := nlOpen(0, NL_UNRELIABLE); (* UDP *) if sock = NL_INVALID then begin nlShutdown(); Halt(1); end; (* set the destination address *) nlSetRemoteAddr(sock, addr); (* send the message *) nlWrite(sock, command, SizeOf(NLulong)); (* read the reply *) count := nlRead(sock, buffer, SizeOf(buffer)); if count > 0 then Writeln('Banner is: ', PChar(@buffer[4])); nlShutdown(); end. hawknl-1.6.8+dfsg2/samples/delphi/max.dpr000066400000000000000000000056331130562644400202340ustar00rootroot00000000000000(* Sample program for the HawkNL cross platform network library Copyright (C) 2001-2002 Phil Frisbie, Jr. (phil@hawksoft.com) *) (* This app opens up UDP/TCP sockets until the system cannot open up any more, or it hits the NL_MAX_INT_SOCKETS limit. On a Windows NT 4.0 server with 256 MB of RAM, it can open up 64511 UDP sockets and 7926 connected TCP sockets, and on Windows 95 it can open up 252 UDP sockets. *) program max; {$APPTYPE CONSOLE} uses SysUtils, HawkNL; procedure printErrorExit; var err: NLenum; begin err := nlGetError(); if err = NL_SYSTEM_ERROR then Writeln('System error: ', nlGetSystemErrorStr(nlGetSystemError())) else Writeln('HawkNL error: ', nlGetErrorStr(err)); nlShutdown(); Halt(1); end; var sock, serversock, s: NLsocket; address, serveraddr: NLaddress; alladdr: PNLaddress; group, count: NLint; str: array [0..NL_MAX_STRING_LENGTH - 1] of Char; begin if not nlInit() then printErrorExit(); Writeln('nlGetString(NL_VERSION) = ', nlGetString(NL_VERSION)); Writeln('nlGetString(NL_NETWORK_TYPES) = ', nlGetString(NL_NETWORK_TYPES)); if not nlSelectNetwork(NL_IP) then printErrorExit(); (* list all the local addresses *) Writeln('local addresses are:'); alladdr := nlGetAllLocalAddr(count); while count > 0 do begin Writeln(' ', nlAddrToString(alladdr^, str)); alladdr := PNLaddress(Integer(alladdr) + SizeOf(NLaddress)); count := count - 1; end; Writeln; Writeln('Testing UDP sockets'); Writeln; while true do begin (* create a client socket *) sock := nlOpen(0, NL_UNRELIABLE); (* let the system assign the port number *) if sock = NL_INVALID then Break; nlGetLocalAddr(sock, address); Write(Format('Socket: %d, port: %d'#13, [sock, nlGetPortFromAddr(address)])); end; Writeln; Writeln(Format('Opened %d sockets', [nlGetInteger(NL_OPEN_SOCKETS)])); nlShutdown(); if not nlInit() then printErrorExit(); if not nlSelectNetwork(NL_IP) then printErrorExit(); Writeln('Testing TCP connected sockets'); Writeln; serversock := nlOpen(1258, NL_RELIABLE); nlListen(serversock); nlGetLocalAddr(serversock, serveraddr); nlSetAddrPort(serveraddr, 1258); group := nlGroupCreate(); nlGroupAddSocket(group, serversock); while true do begin (* create a client socket *) sock := nlOpen(0, NL_RELIABLE); (* let the system assign the port number *) if sock = NL_INVALID then Break; nlConnect(sock, serveraddr); Write('Socket1: ', sock, #13); if nlPollGroup(group, NL_READ_STATUS, s, 1, 1000) <> 1 then Break; sock := nlAcceptConnection(serversock); if sock = NL_INVALID then Break; Write('Socket2: ', sock, #13); end; Writeln; Writeln(Format('Opened %d sockets', [nlGetInteger(NL_OPEN_SOCKETS)])); nlShutdown(); end. hawknl-1.6.8+dfsg2/samples/delphi/test.dpr000066400000000000000000000075471130562644400204340ustar00rootroot00000000000000program test; {$APPTYPE CONSOLE} uses Windows, SysUtils, HawkNL; procedure printErrorExit; var err: NLenum; begin err := nlGetError(); if err = NL_SYSTEM_ERROR then Writeln('System error: ', nlGetSystemErrorStr(nlGetSystemError())) else Writeln('HawkNL error: ', nlGetErrorStr(err)); nlShutdown(); Halt(1); end; const MAX_CLIENTS = 10; procedure mainServerLoop(sock: NLsocket); var client: array [0..MAX_CLIENTS - 1] of NLsocket; clientnum: NLint; str: array [0..NL_MAX_STRING_LENGTH - 1] of Char; newsock: NLsocket; addr: NLaddress; i, j: NLint; buffer: array [0..127] of Char; begin clientnum := 0; FillChar(client, SizeOf(client), 0); while true do begin (* check for a new client *) newsock := nlAcceptConnection(sock); if newsock <> NL_INVALID then begin nlGetRemoteAddr(newsock, addr); client[clientnum] := newsock; Writeln(Format('Client %d connected from %s', [clientnum, nlAddrToString(addr, str)])); clientnum := clientnum + 1; end else begin if nlGetError() = NL_SYSTEM_ERROR then printErrorExit(); end; (* loop through the clients and read the packets *) for i := 0 to clientnum - 1 do begin if nlRead(client[i], buffer, SizeOf(buffer)) > 0 then begin buffer[127] := #0; (* null terminate the char string *) Writeln(Format('Client %d sent %s', [i, buffer])); for j := 0 to clientnum - 1 do begin if i <> j then nlWrite(client[j], buffer, StrLen(buffer)); end; end; end; Sleep(0); end; end; procedure mainClientLoop(sock: NLsocket); var buffer: array [0..127] of Char; begin while true do begin FillChar(buffer, SizeOf(buffer), 0); Readln(buffer); nlWrite(sock, buffer, StrLen(buffer) + 1); while nlRead(sock, buffer, SizeOf(buffer)) > 0 do Writeln(buffer); Sleep(0); end; end; var isserver: NLboolean; serversock: NLsocket; clientsock: NLsocket; addr: NLaddress; server: PChar; networkType: NLenum; str: array [0..NL_MAX_STRING_LENGTH - 1] of Char; begin isserver := NL_FALSE; server := '127.0.0.1:25000'; networkType := NL_UNRELIABLE; (* Change this to NL_RELIABLE for reliable connection *) if not nlInit() then printErrorExit(); Writeln('nlGetString(NL_VERSION) = ', nlGetString(NL_VERSION)); Writeln; Writeln('nlGetString(NL_NETWORK_TYPES) = ', nlGetString(NL_NETWORK_TYPES)); Writeln; if not nlSelectNetwork(NL_IP) then printErrorExit(); if ParamCount >= 1 then begin if ParamStr(1) = '-s' then (* server mode *) isserver := NL_TRUE; end; if isserver then begin (* create a server socket *) serversock := nlOpen(25000, networkType); (* just a random port number ;) *) if serversock = NL_INVALID then printErrorExit(); if not nlListen(serversock) then (* let's listen on this socket *) begin nlClose(serversock); printErrorExit(); end; nlGetLocalAddr(serversock, addr); Writeln('Server address is ', nlAddrToString(addr, str)); mainServerLoop(serversock); end else begin (* create a client socket *) clientsock := nlOpen(0, networkType); (* let the system assign the port number *) nlGetLocalAddr(clientsock, addr); Writeln('our address is ', nlAddrToString(addr, str)); if clientsock = NL_INVALID then printErrorExit(); (* create the NLaddress *) nlStringToAddr(server, addr); Writeln('Address is ', nlAddrToString(addr, str)); (* now connect *) if not nlConnect(clientsock, addr) then begin nlClose(clientsock); printErrorExit(); end; mainClientLoop(clientsock); end; nlShutdown(); end. hawknl-1.6.8+dfsg2/samples/eqtest.c000066400000000000000000000024011130562644400171320ustar00rootroot00000000000000/* the EverQuest protocol is documented at http://everquest.station.sony.com/support/general/server_status_protocal.jsp*/ #include #include "nl.h" int main(int argc, char **argv) { NLsocket sock; NLaddress addr; NLbyte server[] = "status.everquest.com"; NLushort port = 24252; NLbyte command[] = {0xFF, 0xFF, 0x09, 0x00}; NLenum type = NL_UNRELIABLE; /* UDP */ NLbyte buffer[1024]; NLint count; if(!nlInit()) return 1; if(!nlSelectNetwork(NL_IP)) { nlShutdown(); return 1; } nlEnable(NL_BLOCKING_IO); /* create server the address */ nlGetAddrFromName(server, &addr); nlSetAddrPort(&addr, port); /* create the socket */ sock = nlOpen(0, type); if(sock == NL_INVALID) { nlShutdown(); return 1; } /* set the destination address */ nlSetRemoteAddr(sock, &addr); /* send the message */ nlWrite(sock, (NLvoid *)command, (NLint)sizeof(NLulong)); /* read the reply */ count = nlRead(sock, (NLvoid *)buffer, (NLint)sizeof(buffer)); if(count > 0) { printf("Banner is: %s\n", &buffer[4]); } nlShutdown(); return 0; } hawknl-1.6.8+dfsg2/samples/getfile.c000066400000000000000000000126301130562644400172510ustar00rootroot00000000000000/* Sample program for the HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) */ /* This sample app uses a non-blocking TCP socket to connect to a web server and download a file. Usage: getfile www.hawksoft.com /links.shtml c:\links.html | | | |server name |full path |local file */ #include #include #include #include #include #include "nl.h" #if defined WIN32 || defined WIN64 #include #define open _open #define write _write #define close _close #define O_BINARY _O_BINARY #define O_CREAT _O_CREAT #define O_TRUNC _O_TRUNC #define O_RDWR _O_RDWR #define S_IWRITE _S_IWRITE #define S_IREAD _S_IREAD #else #include #define O_BINARY 0 #endif static void printErrorExit(void) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { NLint e = nlGetSystemError(); printf("System error: %s\n", nlGetSystemErrorStr(e)); } else { printf("HawkNL error # %d: %s\n", err, nlGetErrorStr(err)); } nlShutdown(); exit(EXIT_FAILURE); } int main(int argc, char **argv) { NLsocket sock; NLaddress addr; NLbyte buffer[4096]; int f; NLint count, total = 0; NLint crfound = 0; NLint lffound = 0; if (argc != 4) { printf("\nSyntax: getfile ServerName FullPath LocalFile\n"); return 1; } if(nlInit() == NL_FALSE) printErrorExit(); if(nlSelectNetwork(NL_IP) == NL_FALSE) printErrorExit(); nlEnable(NL_SOCKET_STATS); nlGetAddrFromName(argv[1], &addr); /* use the standard HTTP port */ nlSetAddrPort(&addr, 80); printf("Server address is %s\n\n", nlAddrToString(&addr, buffer)); /* open the socket and connect to the server */ sock = nlOpen(0, NL_RELIABLE); if(sock == NL_INVALID) printErrorExit(); if(nlConnect(sock, &addr) == NL_FALSE) { printErrorExit(); } printf("Connected\n"); /* open the local file */ f = open(argv[3], O_BINARY|O_CREAT|O_TRUNC|O_RDWR, S_IWRITE | S_IREAD); if(f < 0) { printf("Could not open local file\n"); printErrorExit(); } /* now let's ask for the file */ #ifdef TEST_GZIP /* this is for my own personal use to test compressed web pages */ sprintf(buffer, "GET %s HTTP/1.1\r\nHost:%s\nAccept: */*\r\nAccept-Encoding: gzip\r\nUser-Agent: HawkNL sample program Getfile\r\n\r\n" , argv[2], argv[1]); #else sprintf(buffer, "GET %s HTTP/1.0\r\nHost:%s\nAccept: */*\r\nUser-Agent: HawkNL sample program Getfile\r\n\r\n" , argv[2], argv[1]); #endif while(nlWrite(sock, (NLvoid *)buffer, (NLint)strlen(buffer)) < 0) { if(nlGetError() == NL_CON_PENDING) { nlThreadYield(); continue; } close(f); printErrorExit(); } /* receive the file and write it locally */ while(1 == 1) { count = nlRead(sock, (NLvoid *)buffer, (NLint)sizeof(buffer) - 1); if(count < 0) { NLint err = nlGetError(); /* is the connection closed? */ if(err == NL_MESSAGE_END) { break; } else { close(f); printErrorExit(); } } total += count; if(count > 0) { /* parse out the HTTP header */ if(lffound < 2) { int i; for(i=0;i #include #include #include "nl.h" #if defined WIN32 || defined WIN64 #define WIN32_LEAN_AND_MEAN #include #define sleep(x) Sleep(1000 * (x)) #endif void printErrorExit(void) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { printf("System error: %s\n", nlGetSystemErrorStr(nlGetSystemError())); } else { printf("HawkNL error: %s\n", nlGetErrorStr(err)); } nlShutdown(); exit(1); } #define MAX_CLIENTS 10 void mainServerLoop(NLsocket sock) { NLsocket client[MAX_CLIENTS]; NLint clientnum = 0; NLbyte string[NL_MAX_STRING_LENGTH]; memset(client, 0, sizeof(client)); while(1) { NLint i; NLbyte buffer[128]; /* check for a new client */ NLsocket newsock = nlAcceptConnection(sock); if(newsock != NL_INVALID) { NLaddress addr; nlGetRemoteAddr(newsock, &addr); client[clientnum] = newsock; printf("Client %d connected from %s\n", clientnum, nlAddrToString(&addr, string)); clientnum++; } else { if(nlGetError() == NL_SYSTEM_ERROR) { printErrorExit(); } } /* loop through the clients and read the packets */ for(i=0;i 0) { NLint j; buffer[127] = 0; /* null terminate the char string */ printf("Client %d sent %s\n", i, buffer); for(j=0;j 0) { printf("%s\n", buffer); } sleep(0); } } int main(int argc, char **argv) { NLboolean isserver = NL_FALSE; NLsocket serversock; NLsocket clientsock; NLaddress addr; NLbyte server[] = "127.0.0.1:25000"; NLenum type = NL_UNRELIABLE; /* Change this to NL_RELIABLE for reliable connection */ NLbyte string[NL_MAX_STRING_LENGTH]; if(!nlInit()) printErrorExit(); printf("nlGetString(NL_VERSION) = %s\n\n", nlGetString(NL_VERSION)); printf("nlGetString(NL_NETWORK_TYPES) = %s\n\n", nlGetString(NL_NETWORK_TYPES)); if(!nlSelectNetwork(NL_IP)) printErrorExit(); if(argc > 1) { if(!strcmp(argv[1], "-s")) /* server mode */ isserver = NL_TRUE; } if(isserver) { /* create a server socket */ serversock = nlOpen(25000, type); /* just a random port number ;) */ if(serversock == NL_INVALID) printErrorExit(); if(!nlListen(serversock)) /* let's listen on this socket */ { nlClose(serversock); printErrorExit(); } nlGetLocalAddr(serversock, &addr); printf("Server address is %s\n", nlAddrToString(&addr, string)); mainServerLoop(serversock); } else { /* create a client socket */ clientsock = nlOpen(0, type); /* let the system assign the port number */ nlGetLocalAddr(clientsock, &addr); printf("our address is %s\n", nlAddrToString(&addr, string)); if(clientsock == NL_INVALID) printErrorExit(); /* create the NLaddress */ nlStringToAddr(server, &addr); printf("Address is %s\n", nlAddrToString(&addr, string)); /* now connect */ if(!nlConnect(clientsock, &addr)) { nlClose(clientsock); printErrorExit(); } mainClientLoop(clientsock); } nlShutdown(); return 0; } hawknl-1.6.8+dfsg2/samples/mac/test.mcp000066400000000000000000004715721130562644400177240ustar00rootroot00000000000000cool(^`hCodeWarrior Project/0q12+.345*|i-j6rgsabck7}89~:;t<=>?@{,ABluCDKLvMNGJOPQFmInRwhxdefoSTUVWyXYZ[\H]^pz_` (E  ! "'#$%&)      !"#$%&'()*+,-./0123456789@!$9HYHZH[H\H]89K:;!k *&JS%'+,)#.$/(-3 6<=TU>2N75?d^]\bjca R@ 01VW " ighfOQABPeDELFGHI_CM4XYZ[`ll2@X@ v%$%"" YZ[ROOTGRUPSourcesFILEFILEGRUP Mac LibrariesFILEFILE FILE FILEFILE GRUP ANSI LibraryFILE FILE FILEFILE FILEFILEFILEFILEFILEFILEFILEFILEFILEFILEFILEFILEFILEFILEFILEFILE FILE"@P%%  jZ j] FLj:@jZ^` JavaClasses.jarZIP MWZP Merge Out????APPLDLGXckidProjWSPC??? Monaco( ( __starta.out@ MacHeaders.h package package.sym SystemClassesBundleDcۯ  <     !"$^`S JavaClasses.jarZIP MWZPHello World PPC????APPL@X???? ansi_prefix.mac.hhhAlex Hme::a.out????APPLX????U {__starta.zipZIP JAVAJAVAMetrowerks Java@F EDF;[01vhdlg    \ce]^_ f a!g"h$be   athL stubQ@ MSL C.PPC.LibMPLF@MSL RuntimePPC.bMPLF__L+pfF Hel`pHello WorldSourcesMac brsANSI LibraryHello World.cIntfabMathLibMSL RuntimePPC.LibMSL.Pib:Hello World PPCLib Import PBon HelpMW C/C++ PPCMW Pascal PRPCAsmXCOFF Import PPCPEF ImporPPL SIOUX.PPC.Lib__startHello World PPC????APPL@X????V P'CODE' 'DATA' 'PICT' a.out@U {Hello WorldSourcesMac LibrariesANSI LibraryHello World.cInterfaceLibMathLibMSL RuntimePPC.LibMSL C.PPC.Lib:Hello World PPCLib Import PPCBalloon HelpMW C/C++ PPCMW Pascal PPCRezPPCAsmXCOFF Import PPCPEF Import PPCMSL SIOUX.PPC.LibHello World 68KMSL C.68K Fa(4i_8d).LibMSL SIOUX.68K.LibMacOS.lib:a.out:Lib Import 68KMPW Import 68KMW C/C++ 68KPEF Import 68KHello World68K.cMathLib68K Fa(4i_8d).LibMSL Runtime68K.LibMSL C++.68K Fa(4i_8d).LibHello World PPC:a.outMW Pascal 68K:MSL C:Bin:MSL C.68K Fa(4i_8d).Lib:MSL C:Bin:MSL SIOUX.68K.Lib:MacOS 68K:MacOS.lib:Hello World68K.c:MacOS 68K:MathLib68K:MathLib68K (Model Far):MathLib68K Fa(4i_8d).Lib:Runtime:Runtime 68K:MSL Runtime68K.Lib:MSL C++:Bin:MSL C++.68K Fa(4i_8d).Lib:Hello World.c:MacOS Common:InterfaceLib:MacOS Common:MathLib:Runtime:Runtime PPC:MSL RuntimePPC.Lib:MSL C:Bin:MSL C.PPC.Lib:MSL C:Bin:MSL SIOUX.PPC.LibMacOS 68K LinkerMacOS PPC LinkerCustom KeywordsAccess PathsTarget SettingsFile MappingsBuild ExtrasDebugger Target68K CodeGen68K Disassembler68K Linker68K ProjectC/C++ CompilerC/C++ WarningsCFM68KFTP PanelIR OptimizerPascal CompilerPascal WarningsRez CompilerPPC CodeGenPPC DisassemblerPPC LinkerPPC PEFPPC ProjectPPCAsm Panel:HelloWorld 68K68K Global OptimizerPPC Global OptimizerSource TreesDebugger RuntimeOutput FlagsPerl PanelPackager PanelHelloWorld-Carbon:HelloWorldCarbonCarbon.rCarbonLibMSL C.Carbon.LibMSL SIOUX.Carbon.LibTest 68KTest PPCTest-Carbontest.cGUSI_SIOUX.PPC.LibGUSI_MSL.PPC.LibGUSI_Core.PPC.LibPPCToolLibs.oThreadsLibHawkNL.PPC.LibHawkNL.68K.LibHawkNL.Full.PPC.LibGUSIConfig.cpPLStringFuncsPPC.libOpenTransportLibOpenTptInternetLibOpenTransportExtnPPC.oOpenTptInetPPC.oHawkNL.bare.PPC.Lib:Hawk Test Mac  "Kp/ =JorldRe s  athL stubceLiQ@@SL C 2MPLF<DtimeSbo__~F Hel!"#$Y\%:&O'a()*+, -6.^/w0123456789:+;6<B=Q>`?g@qA~BCDEFGHIJKLM.N;OLPYQdRsSTUVWXYZ[\]^_+`9aDbScbdvefghijklYK 'Zl [T j\e]^_ fagih j"b Hel0 "Kp/ =JorldRe   athL stubQ@ MSL C.PPC.LibMPLF@MSL RuntimePPC.bMPLF__L+pfF Hel`pHello WorldSourcesMac brsANSI LibraryHello World.cIntfabMathLibMSL RuntimePPC.LibMSL.Pib:Hello World PPCLib Import PBon HelpMW C/C++ PPCMW Pascal PRPCAsmXCOFF Import PPCPEF ImporPPL SIOUX.PPC.Lib HelloWorld 68K????APPLX????U {a.outE.EXE@Hello World:Project MiscHello World:EditorHello World:FontHello World:MIPS CodeGenHello World:MIPS Linker PanelHello World:MIPS ProjectHello World:MrC[pp] Hello World:MrC[pp] CodeGenHello World:MrC[pp] WarningsHello World:Magic Cap Class CompilerHello World:Magic Cap LinkerHello World:Magic Cap ProjectHello World:Project ExtrasHello World:Custom KeywordsHello World:Access PathsHello World:Build ExtrasHello World:VCS SetupHello World:68K CodeGenHello World:68K DisassemblerHello World:68K LinkerHello World:68K ProjectHello World:C/C++ CompilerHello World:C/C++ WarningsHello World:CFM68KHello World:IR OptimizerHello World:Java ProjectHello World:Pascal CompilerHello World:Pascal WarningsHello World:PPC CodeGenHello World:PPC DisassemblerHello World:PPC LinkerHello World:PPC PEFHello World:PPC ProjectHello World:PPCAsm PanelHello World:Rez CompilerHello World:WinRC CompilerHello World:x86 CodeGenHello World:x86 LinkerHello World:x86 ProjectHello World:Target SettingsHello World:File MappingsProject File ListHello World 68K:Custom KeywordsHello World 68K:Access PathsHello World 68K:Target SettingsHello World 68K:File MappingsHello World 68K:Build ExtrasHello World 68K:68K CodeGenHello World 68K:68K DisassemblerHello World 68K:68K LinkerHello World 68K:68K ProjectHello World 68K:C/C++ CompilerHello World 68K:C/C++ WarningsHello World 68K:CFM68KHello World 68K:IR OptimizerHello World 68K:MacOS Merge PanelHello World 68K:Pascal CompilerHello World 68K:Pascal WarningsHello World 68K:PPC CodeGenHello World 68K:PPC DisassemblerHello World 68K:PPC LinkerHello World 68K:PPC PEFHello World 68K:PPC ProjectHello World 68K:PPCAsm PanelHello World 68K:Rez CompilerHello World 68K:WinRC CompilerHello World 68K:x86 CodeGenHello World 68K:x86 LinkerHello World 68K:x86 ProjectHello World:MacOS Merge PanelHello World PPC:Custom KeywordsHello World PPC:Access PathsHello World PPC:Target SettingsHello World PPC:File MappingsHello World PPC:Build ExtrasHello World PPC:68K CodeGenHello World PPC:68K DisassemblerHello World PPC:68K LinkerHello World PPC:68K ProjectHello World PPC:C/C++ CompilerHello World PPC:C/C++ WarningsHello World PPC:CFM68KHello World PPC:IR OptimizerHello World PPC:MacOS Merge PanelHello World PPC:Pascal CompilerHello World PPC:Pascal WarningsHello World PPC:PPC CodeGenHello World PPC:PPC DisassemblerHello World PPC:PPC LinkerHello World PPC:PPC PEFHello World PPC:PPC ProjectHello World PPC:PPCAsm PanelHello World PPC:Rez CompilerHello World PPC:WinRC CompilerHello World PPC:x86 CodeGenHello World PPC:x86 LinkerHello World PPC:x86 ProjectHello World 68K:Java OutputHello World 68K:Java ProjectHello World 68K:Java VMHello World PPC:Java OutputHello World PPC:Java ProjectHello World PPC:Java VMHello World 68K:Java LanguageHello World PPC:Java LanguageHello World 68K:Debugger TargetHello World 68K:FTP PanelHello World 68K:JavaDoc ProjectHello World 68K:x86 Exceptions PanelHello World PPC:Debugger TargetHello World PPC:FTP PanelHello World PPC:JavaDoc ProjectHello World PPC:x86 Exceptions PanelHello World 68K:68K Global OptimizerHello World 68K:Java Command LineHello World 68K:Java MacOS SettingsHello World 68K:PPC Global OptimizerHello World 68K:x86 Global OptimizerHello World PPC:68K Global OptimizerHello World PPC:Java Command LineHello World PPC:Java MacOS SettingsHello World PPC:PPC Global OptimizerHello World PPC:x86 Global OptimizerHello World 68K:Source TreesHello World 68K:Debugger RuntimeHello World 68K:Output FlagsHello World 68K:Perl PanelHello World PPC:Source TreesHello World PPC:Debugger RuntimeHello World PPC:Output FlagsHello World PPC:Perl PanelHello World 68K:Remote DebugHello World 68K:Auto-targetHello World 68K:Java MRJAppBuilderHello World 68K:Packager PanelHello World 68K:x86 DisassemblerHello World PPC:Remote DebugHello World PPC:Auto-targetHello World PPC:Java MRJAppBuilderHello World PPC:Packager PanelHello World PPC:x86 DisassemblerHelloWorld-Carbon:Source TreesHelloWorld-Carbon:Access PathsHelloWorld-Carbon:Debugger RuntimeHelloWorld-Carbon:Target SettingsHelloWorld-Carbon:File MappingsHelloWorld-Carbon:Build ExtrasHelloWorld-Carbon:Debugger TargetHelloWorld-Carbon:Remote DebugHelloWorld-Carbon:Auto-targetHelloWorld-Carbon:Custom KeywordsHelloWorld-Carbon:68K CodeGenHelloWorld-Carbon:68K DisassemblerHelloWorld-Carbon:68K Global OptimizerHelloWorld-Carbon:68K LinkerHelloWorld-Carbon:68K ProjectHelloWorld-Carbon:C/C++ CompilerHelloWorld-Carbon:C/C++ WarningsHelloWorld-Carbon:CFM68KHelloWorld-Carbon:FTP PanelHelloWorld-Carbon:Java Command LineHelloWorld-Carbon:Java LanguageHelloWorld-Carbon:Java MRJAppBuilderHelloWorld-Carbon:Java OutputHelloWorld-Carbon:Java ProjectHelloWorld-Carbon:JavaDoc ProjectHelloWorld-Carbon:MacOS Merge PanelHelloWorld-Carbon:Output FlagsHelloWorld-Carbon:Packager PanelHelloWorld-Carbon:PPC CodeGenHelloWorld-Carbon:PPC DisassemblerHelloWorld-Carbon:PPC Global OptimizerHelloWorld-Carbon:PPC LinkerHelloWorld-Carbon:PPC PEFHelloWorld-Carbon:PPC ProjectHelloWorld-Carbon:PPCAsm PanelHelloWorld-Carbon:Rez CompilerHelloWorld-Carbon:WinRC CompilerHelloWorld-Carbon:x86 CodeGenHelloWorld-Carbon:x86 DisassemblerHelloWorld-Carbon:x86 Exceptions PanelHelloWorld-Carbon:x86 Global OptimizerHelloWorld-Carbon:x86 LinkerHelloWorld-Carbon:x86 ProjectTest 68K:Source TreesTest 68K:Access PathsTest 68K:Debugger RuntimeTest 68K:Target SettingsTest 68K:File MappingsTest 68K:Build ExtrasTest 68K:Debugger TargetTest 68K:Remote DebugTest 68K:Auto-targetTest 68K:Custom KeywordsTest 68K:68K CodeGenTest 68K:68K DisassemblerTest 68K:68K Global OptimizerTest 68K:68K LinkerTest 68K:68K ProjectTest 68K:C/C++ CompilerTest 68K:C/C++ WarningsTest 68K:CFM68KTest 68K:FTP PanelTest 68K:Java Command LineTest 68K:Java LanguageTest 68K:Java MRJAppBuilderTest 68K:Java OutputTest 68K:Java ProjectTest 68K:JavaDoc ProjectTest 68K:MacOS Merge PanelTest 68K:Output FlagsTest 68K:Packager PanelTest 68K:PPC CodeGenTest 68K:PPC DisassemblerTest 68K:PPC Global OptimizerTest 68K:PPC LinkerTest 68K:PPC PEFTest 68K:PPC ProjectTest 68K:PPCAsm PanelTest 68K:Rez CompilerTest 68K:WinRC CompilerTest 68K:x86 CodeGenTest 68K:x86 DisassemblerTest 68K:x86 Exceptions PanelTest 68K:x86 Global OptimizerTest 68K:x86 LinkerTest 68K:x86 ProjectTest PPC:Source TreesTest PPC:Access PathsTest PPC:Debugger RuntimeTest PPC:Target SettingsTest PPC:File MappingsTest PPC:Build ExtrasTest PPC:Debugger TargetTest PPC:Remote DebugTest PPC:Auto-targetTest PPC:Custom KeywordsTest PPC:68K CodeGenTest PPC:68K DisassemblerTest PPC:68K Global OptimizerTest PPC:68K LinkerTest PPC:68K ProjectTest PPC:C/C++ CompilerTest PPC:C/C++ WarningsTest PPC:CFM68KTest PPC:FTP PanelTest PPC:Java Command LineTest PPC:Java LanguageTest PPC:Java MRJAppBuilderTest PPC:Java OutputTest PPC:Java ProjectTest PPC:JavaDoc ProjectTest PPC:MacOS Merge PanelTest PPC:Output FlagsTest PPC:Packager PanelTest PPC:PPC CodeGenTest PPC:PPC DisassemblerTest PPC:PPC Global OptimizerTest PPC:PPC LinkerTest PPC:PPC PEFTest PPC:PPC ProjectTest PPC:PPCAsm PanelTest PPC:Rez CompilerTest PPC:WinRC CompilerTest PPC:x86 CodeGenTest PPC:x86 DisassemblerTest PPC:x86 Exceptions PanelTest PPC:x86 Global OptimizerTest PPC:x86 LinkerTest PPC:x86 ProjectTest-Carbon:Source TreesTest-Carbon:Access PathsTest-Carbon:Debugger RuntimeTest-Carbon:Target SettingsTest-Carbon:File MappingsTest-Carbon:Build ExtrasTest-Carbon:Debugger TargetTest-Carbon:Remote DebugTest-Carbon:Auto-targetTest-Carbon:Custom KeywordsTest-Carbon:68K CodeGenTest-Carbon:68K DisassemblerTest-Carbon:68K Global OptimizerTest-Carbon:68K LinkerTest-Carbon:68K ProjectTest-Carbon:C/C++ CompilerTest-Carbon:C/C++ WarningsTest-Carbon:CFM68KTest-Carbon:FTP PanelTest-Carbon:Java Command LineTest-Carbon:Java LanguageTest-Carbon:Java MRJAppBuilderTest-Carbon:Java OutputTest-Carbon:Java ProjectTest-Carbon:JavaDoc ProjectTest-Carbon:MacOS Merge PanelTest-Carbon:Output FlagsTest-Carbon:Packager PanelTest-Carbon:PPC CodeGenTest-Carbon:PPC DisassemblerTest-Carbon:PPC Global OptimizerTest-Carbon:PPC LinkerTest-Carbon:PPC PEFTest-Carbon:PPC ProjectTest-Carbon:PPCAsm PanelTest-Carbon:Rez CompilerTest-Carbon:WinRC CompilerTest-Carbon:x86 CodeGenTest-Carbon:x86 DisassemblerTest-Carbon:x86 Exceptions PanelTest-Carbon:x86 Global OptimizerTest-Carbon:x86 LinkerTest-Carbon:x86 Project    jZ j] FLj:@jZ^` jZ j] FLj:@jZ^`    !"#% @:@::::GUSI2:lib:@:::@:MacOS Support:@:MSL:werks Standard Library:@ MacOS 68K LinkerTest 68Kld 68K:main0nmain0d@n0__startMSIEhttp://java.sun.com/products/jdk/1.1/docs/api/00f`LN A0 UNuHYO o"o,/XXX*t`D@g HHԀ`(X@@g 0H@HԀ`XX$ݱ(SJnXOL`NuH $@ ,& g@JfB,0n`Tn(:`Appl:v>n`Tn(:`Clss.class`TMW Java Heln(*MWCD:v>n`Tn(:`RSRC:v>n`Tn(:`TEXT.bhn`TBalloon Helpn(*TEXT.htmlhoP@(!TEXT.java`TMW Java Heln(*TEXT.ripss`TRezJava Heln(*ZIP .zipss`TMW Java Heln(*docu:v>n`Tn(:`rsrc:v>n`Tn(:`.class`TMW Java Heln(*.zipss`TMW Java Heln(* MIPS LinkerTEXT.c~n`TMW C/C++ MIPSn(wHTEXT.c++n`TMW C/C++ MIPSn(wHTEXT.cc+n`TMW C/C++ MIPSn(wHTEXT.cp+n`TMW C/C++ MIPSn(wHTEXT.cppn`TMW C/C++ MIPSn(wHTEXT.hppn`TMW C/C++ MIPSn(wHTEXT.pchn`TMW C/C++ MIPSn(wHTEXT.pch++`TMW C/C++ MIPSn(wHNoneMMPr@MacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KPLob`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pMW Pascal 68KTEXT.pasMW Pascal 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.ppuMW Pascal 68KTEXT.rRezTEXT.segdocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docP.rsrc`MacOS MergeAPPL`Appl`RSRC`TEXT.bhBalloon HelpTEXT.rRezrsrc`shlbMacOS PPC LinkerAPPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ PPCTEXT.c++MW C/C++ PPCTEXT.ccMW C/C++ PPCTEXT.cpMW C/C++ PPCTEXT.cppMW C/C++ PPCTEXT.expTEXT.hMW C/C++ PPCTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.ppuMW Pascal PPCTEXT.rRezTEXT.sPPCAsmXCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPJava LinkerAPPL`Appl`COkMW JavaClssMW JavaJjrf.jrfMWCD`RSRC`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaTEXT.mfTEXT.rRezZIP MW Java@ZipFMW Javadocu`rsrc`.classMW Java.jar@.javaMW Java.zipMW JavaWin32 x86 LinkerTEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.ccMW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.defTEXT.hMW C/C++ x86TEXT.pMW Pascal x86TEXT.pasMW Pascal x86TEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.ppuMW Pascal x86TEXT.rcMW WinRCTEXT.resWinRes Import.docP.libLib Import x86.objObj Import x86MW JavaDoc Linker COkMW JavaDocClssMW JavaDocRSRCRez`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaDocTEXT.rRezZIP MW JavaDoc@ZipFMW JavaDocrsrcRez`.classMW JavaDoc.zipMW JavaDoc????APPL7n7Mr~[`Yp~>=ti~[` ~[`~ ,~[`~[`@Y H=~[`\~>-et~[`^t~[`_ ,En~[`c~[`Z y=~[`.~?(-rM~[`Jt~[` ,bu~[` M~[`Zx1555=bu~[`~?p-~[`r~[` ,~[`~[`GZ=sm~[`c~?-@e~[`egPre~[`f ,sm~[`j~[`[ Extr=di~[` 0~@-in~[` L ~[` ,~[` O~[`m[xpCal=ot~[` ~@P-~[` P~[` }ra~[` ;~[` dta~[`Z ~@{de~[`_ ~[`e\ =~[` -~[` WSequ~[` ,~[` [Debure~[`\X !<=~[` f~A-re~[` !h~[` ,ri~[` ~[`\tTra=la~[` ~A`-!~[` eft1~[` ,nA~[` ~[`]=Au~[`4 *~A-~[`6 FtrTo~[`7 ,ll~[`; I~[`A]helf_=0L~[`] ~A-se~[`_ "~[`` ,Er~[`d ~[`j]ety=Sq~[` ~B@-~[` o~[` ,io~[` ~[`/^Proc=sI~[`K X~B-pt~[`M tekT~[`N }Ta~[` w;h~[` zn#~[` ~B{de~[` QT~[`P'CODE' 'DATA' 'PICT' @:@::::GUSI2:lib:top Folder:CVS:atrt:GUSI2:lib::::include:esktop Folder:CVS:atrt:HawkNL:include::::@:::src:@::::GUSI2:include:Folder:CVS:atrt:GUSI2:include:@:MacOS Support:@:MSL:werks Standard Library:@ MacOS PPC LinkerTest PPCld PPC:12mainiYmain~iY a.out????APPLX????U { Merge Out????APPLDLGXckidProjWSPCN4 O5 67839:L;< = >?PDREFMGHIJ__startepLN AC UNuHYO o"o,/XXX*t`D@g HHԀ`(X@@g 0H@HԀ`XX$ݱ(SJnXOL`NuH $@ ,& g@JfB,0p0 RpB0p0 RpB0p0 RpB0pX@@RE Emp0 RB0L N^NuSetupLabelMenuNV/N~UO/.?<N060&N^NuInitDialogNV(/ $n j^C( Pp5"QUO/ Hxp.*/Nx0UO/ Hxp.+/Nb0UO/ Hxp.,/NL0UO/ Hxp.-/N60UO/ Hxp../N 0UO/ Hxp.//N 0UO/ Hxp.0/N0UO/ Hxp.1/N0UO/ Hx p.2/N0UO/ Hx p.3/N0UO/ Hx 0.4R@H/N0A6pRJf@(A6C)p.(.UO/ Hx Hn(N0$_N^NuPutDataNV$/ $n j^C$ Pp5"QUO/ HxHnNr0n&UO/ HxHnNZ0n'UO/ HxHnNB0n(UO/ HxHnN*0n)UO/ HxHnN0n*UO/ HxHnN0n+UO/ HxHnN0n,UO/ HxHnN0n-UO/ Hx HnN0n.UO/ Hx HnN0n/UO/ Hx HnN0 .S=@0UO/ Hx Hn$?<N0A%C2p.$.p.$A$B0A$"j^"Qp5"Qp$_N^NuGetDataNVH0&n$n vxz|~BnBnBnBnBnBn R"S)( MSIEInternet ExplorerIexplore.exe 0 Rpdhp Rrdhk pg&F&SGR7nd7n<7n>p0 RpB0p0 RpB0p0 RpB0pX@@RE Emp0 RB0L N^NuSetupLabelMenuNV/N~UO/.?<N060&N^NuInitDialogNV(/ $n j^C( Pp5"QUO/ Hxp.*/Nx0UO/ Hxp.+/Nb0UO/ Hxp.,/NL0UO/ Hxp.-/N60UO/ Hxp../N 0UO/ Hxp.//N 0UO/ Hxp.0/N0UO/ Hxp.1/N0UO/ Hx p.2/N0UO/ Hx p.3/N0UO/ Hx 0.4R@H/N0A6pRJf@(A6C)p.(.UO/ Hx Hn(N0$_N^NuPutDataNV$/ $n j^C$ Pp5"QUO/ HxHnNr0n&UO/ HxHnNZ0n'UO/ HxHnNB0n(UO/ HxHnN*0n)UO/ HxHnN0n*UO/ HxHnN0n+UO/ HxHnN0n,UO/ HxHnN0n-UO/ Hx HnN0n.UO/ Hx HnN0n/UO/ Hx HnN0 .S=@0UO/ Hx Hn$?<N0A%C2p.$.p.$A$B0A$"j^"Qp5"Qp$_N^NuGetDataNVH0&n$n vxz|~BnBnBnBnBnBn R"S)(MRJApplication Hawk Test MacPC????APPL@X????P'CODE' 'DATA' 'PICT'@ JavaClasses.jarZIP MWZP Merge Out????APPLDLGXckidProjWSPC,=L3pVt 5   ; Vr9Tg 1!I"b#{$%&' ()*%+E,b-@./01??2 3 14P5o67( 89: ;!<L;B=]>u?@AB0C+D4!E-=F8[G;{H>IJKL M0N KOgPQRS TU V% ;WfI WX xYer Z [ \jo ] ^ _ <` Wa sb c d e f g h 3i Qj qk l m n o p *q Or ts tp u v whA )xP Kyan ozx.ma { | } ~/utLm A^z>` >a:^~&Ef#Ba.Lbx5Jd0Law&:K`v#8Nd~!6Pn8Mc|&7Lbx     $=Vs+C` !"-#G$f%~&'()* + , :- [. r/ 0 1 2 3 4!5! 6!A7!b8!y9 MacOS PPC LinkerAPPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.bhcPdgP \Balloon Help3jP* 'TEXT.cMW C/C++ PPCTEXT.c++MW C/C++ PPCTEXT.ccMW C/C++ PPCTEXT.cpMW C/C++ PPCTEXT.cppMW C/C++ PPCTEXT.expTEXT.hMW C/C++ PPCTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.rRezTEXT.shcPdgP \PPCAsmn Hel3jP* 'XCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPMacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KRSRC`TEXT.bhcPdgP \Balloon Help3jP* 'TEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pMW Pascal 68KTEXT.pasMW Pascal 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.rRezTEXT.segv "(h@v X|N 0+d*v 0X3Udocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docPWin32 x86 Linker TEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.poclhjj:MW Pascal x86oP@(xTEXT.paslhjj:MW Pascal x86oP@(xTEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.rcMW WinRCTEXT.res++"(h@v X|WinRes Import*v 0X3I.doc.libLib Import x86.objObj Import x86 MC LinkerCLUS.defss`TRezJava Heln(:@MMCHMMLB.docv "(h@v X|Lib Import 68K*v 0X3IMPLF.docv "(h@v X|Lib Import 68K*v 0X3IOBJ .docv "(h@v X|MPW Import 68K*v 0X3ITEXT.cMC C/C++TEXT.c++v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.cc+v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.clsMC Class CompilerTEXT.cp+v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.cppv "(h@v X|MW C/C++ 68K*v 0X3ITEXT.defTEXT.docTEXT.hTEXT.pch++"(h@v X|MW Pascal 68K*v 0X3ITEXT.pas++"(h@v X|MW Pascal 68K*v 0X3ITEXT.pchMC C/C++TEXT.pch++"(h@v X|MW C/C++ 68K*v 0X3ITEXT.ts Java LinkerAPPL:v>n`Tn(:`Appl:v>n`Tn(:`Clss.class`TMW Java Heln(*MWCD:v>n`Tn(:`RSRC:v>n`Tn(:`TEXT.bhn`TBalloon Helpn(*TEXT.htmlhoP@(!TEXT.java`TMW Java Heln(*TEXT.ripss`TRezJava Heln(*ZIP .zipss`TMW Java Heln(*docu:v>n`Tn(:`rsrc:v>n`Tn(:`.class`TMW Java Heln(*.zipss`TMW Java Heln(* MIPS LinkerTEXT.c~n`TMW C/C++ MIPSn(wHTEXT.c++n`TMW C/C++ MIPSn(wHTEXT.cc+n`TMW C/C++ MIPSn(wHTEXT.cp+n`TMW C/C++ MIPSn(wHTEXT.cppn`TMW C/C++ MIPSn(wHTEXT.hppn`TMW C/C++ MIPSn(wHTEXT.pchn`TMW C/C++ MIPSn(wHTEXT.pch++`TMW C/C++ MIPSn(wHNoneMMPr@MacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KPLob`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pMW Pascal 68KTEXT.pasMW Pascal 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.ppuMW Pascal 68KTEXT.rRezTEXT.segdocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docP.rsrc`MacOS MergeAPPL`Appl`RSRC`TEXT.bhBalloon HelpTEXT.rRezrsrc`shlbMacOS PPC LinkerAPPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ PPCTEXT.c++MW C/C++ PPCTEXT.ccMW C/C++ PPCTEXT.cpMW C/C++ PPCTEXT.cppMW C/C++ PPCTEXT.expTEXT.hMW C/C++ PPCTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.ppuMW Pascal PPCTEXT.rRezTEXT.sPPCAsmXCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPJava LinkerAPPL`Appl`COkMW JavaClssMW JavaJjrf.jrfMWCD`RSRC`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaTEXT.mfTEXT.rRezZIP MW Java@ZipFMW Javadocu`rsrc`.classMW Java.jar@.javaMW Java.zipMW JavaWin32 x86 LinkerTEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.ccMW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.defTEXT.hMW C/C++ x86TEXT.pMW Pascal x86TEXT.pasMW Pascal x86TEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.ppuMW Pascal x86TEXT.rcMW WinRCTEXT.resWinRes Import.docP.libLib Import x86.objObj Import x86MW JavaDoc Linker COkMW JavaDocClssMW JavaDocRSRCRez`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaDocTEXT.rRezZIP MW JavaDoc@ZipFMW JavaDocrsrcRez`.classMW JavaDoc.zipMW JavaDoc????APPL迀iYnll蝠~[`nw9,~[`nl{~[`n=~[`ol-~[`ol~[`ow:,~[`ol|~[`o=kT~[`o;m-~[`o=m~[`o>w;,~[`oCm|P~[`oIXme=~[`oem:-bk~[`ogm;~[`ohw<,~[`ommE|~[`osl2=~[`omc-~[`omg~[`ow=,~[`om~[`o=~[`om}(-~[`on ps~[`ow>,ps~[`onh~[`pYX=~[`pun}-~[`pwn52s~[`pxw?,~[`p}n8i~[`pcH=~[`pnv}-~[`pn~[`pw@,~[`pn~[`p=vu~[`pn~ -~[`pn~[`pwA, ~[`pnk~[`p`=~[`pn~p-~[`pnT~[`pwB,l~[`pnl~[`q=~[`qo>~-~[`qoZ~[`q wC,~[`q%o]m~[`q+=~[`qGo-~[`qIo~[`qJwD}~[`qPo;w~[`qQo~[`qopp{~[`qtp~[`qz=~[`qp-n~[`qp~[`qwL,~[`qq8~[`q=~[`qq -o~[`qq~[`qwM,~[`qq0 ~[`q@ =bo~[`qq3-p~[`qq7~[`qwN,~[`qqx ~[`qa.outE.EXE@'CODE' 'DATA' 'PICT' @:@::::GUSI2:lib:@:::@:MacOS Support:@:MSL:werks Standard Library:@ MacOS PPC LinkerTest-Carbonarbon: MacOS PPC LinkerAPPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.bhcPdgP \Balloon Help3jP* 'TEXT.cMW C/C++ PPCTEXT.c++MW C/C++ PPCTEXT.ccMW C/C++ PPCTEXT.cpMW C/C++ PPCTEXT.cppMW C/C++ PPCTEXT.expTEXT.hMW C/C++ PPCTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.rRezTEXT.shcPdgP \PPCAsmn Hel3jP* 'XCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPMacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KRSRC`TEXT.bhcPdgP \Balloon Help3jP* 'TEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pMW Pascal 68KTEXT.pasMW Pascal 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.rRezTEXT.segv "(h@v X|N 0+d*v 0X3Udocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docPWin32 x86 Linker TEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.poclhjj:MW Pascal x86oP@(xTEXT.paslhjj:MW Pascal x86oP@(xTEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.rcMW WinRCTEXT.res++"(h@v X|WinRes Import*v 0X3I.doc.libLib Import x86.objObj Import x86 MC LinkerCLUS.defss`TRezJava Heln(:@MMCHMMLB.docv "(h@v X|Lib Import 68K*v 0X3IMPLF.docv "(h@v X|Lib Import 68K*v 0X3IOBJ .docv "(h@v X|MPW Import 68K*v 0X3ITEXT.cMC C/C++TEXT.c++v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.cc+v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.clsMC Class CompilerTEXT.cp+v "(h@v X|MW C/C++ 68K*v 0X3ITEXT.cppv "(h@v X|MW C/C++ 68K*v 0X3ITEXT.defTEXT.docTEXT.hTEXT.pch++"(h@v X|MW Pascal 68K*v 0X3ITEXT.pas++"(h@v X|MW Pascal 68K*v 0X3ITEXT.pchMC C/C++TEXT.pch++"(h@v X|MW C/C++ 68K*v 0X3ITEXT.ts Java LinkerAPPL:v>n`Tn(:`Appl:v>n`Tn(:`Clss.class`TMW Java Heln(*MWCD:v>n`Tn(:`RSRC:v>n`Tn(:`TEXT.bhn`TBalloon Helpn(*TEXT.htmlhoP@(!TEXT.java`TMW Java Heln(*TEXT.ripss`TRezJava Heln(*ZIP .zipss`TMW Java Heln(*docu:v>n`Tn(:`rsrc:v>n`Tn(:`.class`TMW Java Heln(*.zipss`TMW Java Heln(* MIPS LinkerTEXT.c~n`TMW C/C++ MIPSn(wHTEXT.c++n`TMW C/C++ MIPSn(wHTEXT.cc+n`TMW C/C++ MIPSn(wHTEXT.cp+n`TMW C/C++ MIPSn(wHTEXT.cppn`TMW C/C++ MIPSn(wHTEXT.hppn`TMW C/C++ MIPSn(wHTEXT.pchn`TMW C/C++ MIPSn(wHTEXT.pch++`TMW C/C++ MIPSn(wHNoneMMPr@MacOS 68K LinkerAPPL`Appl`MMLBLib Import 68KMPLFLib Import 68KMWCD`OBJ MPW Import 68KPLob`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ 68KTEXT.c++MW C/C++ 68KTEXT.ccMW C/C++ 68KTEXT.cpMW C/C++ 68KTEXT.cppMW C/C++ 68KTEXT.expTEXT.hMW C/C++ 68KTEXT.pMW Pascal 68KTEXT.pasMW Pascal 68KTEXT.pchMW C/C++ 68KTEXT.pch++MW C/C++ 68KTEXT.ppuMW Pascal 68KTEXT.rRezTEXT.segdocu`rsrc`shlbPEF Import 68KstubPEF Import 68K.docP.rsrc`MacOS MergeAPPL`Appl`RSRC`TEXT.bhBalloon HelpTEXT.rRezrsrc`shlbMacOS PPC LinkerAPPL`Appl`MMLBLib Import PPCMPLFLib Import PPCMWCD`RSRC`TEXT.bhBalloon HelpTEXT.cMW C/C++ PPCTEXT.c++MW C/C++ PPCTEXT.ccMW C/C++ PPCTEXT.cpMW C/C++ PPCTEXT.cppMW C/C++ PPCTEXT.expTEXT.hMW C/C++ PPCTEXT.pMW Pascal PPCTEXT.pasMW Pascal PPCTEXT.pchMW C/C++ PPCTEXT.pch++MW C/C++ PPCTEXT.ppuMW Pascal PPCTEXT.rRezTEXT.sPPCAsmXCOFXCOFF Import PPCdocu`rsrc`shlbPEF Import PPCstubPEF Import PPC.docPJava LinkerAPPL`Appl`COkMW JavaClssMW JavaJjrf.jrfMWCD`RSRC`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaTEXT.mfTEXT.rRezZIP MW Java@ZipFMW Javadocu`rsrc`.classMW Java.jar@.javaMW Java.zipMW JavaWin32 x86 LinkerTEXT.cMW C/C++ x86TEXT.c++MW C/C++ x86TEXT.ccMW C/C++ x86TEXT.cpMW C/C++ x86TEXT.cppMW C/C++ x86TEXT.defTEXT.hMW C/C++ x86TEXT.pMW Pascal x86TEXT.pasMW Pascal x86TEXT.pchMW C/C++ x86TEXT.pch++MW C/C++ x86TEXT.ppuMW Pascal x86TEXT.rcMW WinRCTEXT.resWinRes Import.docP.libLib Import x86.objObj Import x86MW JavaDoc Linker COkMW JavaDocClssMW JavaDocRSRCRez`TEXT.bhBalloon HelpTEXT.htmlTEXT.javaMW JavaDocTEXT.rRezZIP MW JavaDoc@ZipFMW JavaDocrsrcRez`.classMW JavaDoc.zipMW JavaDocmainiYmain~iY a.out????APPLX????U {__startMRJApplication MSIEInternet ExplorerIexplore.exeMSIEhttp://java.sun.com/products/jdk/1.1/docs/api/epLN AC UNuHYO o"o,/XXX*t`D@g HHԀ`(X@@g 0H@HԀ`XX$ݱ(SJnXOL`NuH $@ ,& g@JfB,0w;,~[`oCm|P~[`oIXme=~[`oem:-bk~[`ogm;~[`ohw<,~[`ommE|~[`osl2=~[`omc-~[`omg~[`ow=,~[`om~[`o=~[`om}(-~[`on ps~[`ow>,ps~[`onh~[`pYX=~[`pun}-~[`pwn52s~[`pxw?,~[`p}n8i~[`pcH=~[`pnv}-~[`pn~[`pw@,~[`pn~[`p=vu~[`pn~ -~[`pn~[`pwA, ~[`pnk~[`p`=~[`pn~p-~[`pnT~[`pwB,l~[`pnl~[`q=~[`qo>~-~[`qoZ~[`q wC,~[`q%o]m~[`q+=~[`qGo-~[`qIo~[`qJwD}~[`qPo;w~[`qQo~[`qopp{~[`qtp~[`qz=~[`qp-n~[`qp~[`qwL,~[`qq8~[`q=~[`qq -o~[`qq~[`qwM,~[`qq0 ~[`q@ =bo~[`qq3-p~[`qq7~[`qwN,~[`qqx ~[`q__sta__startHelloWorldCarbon????APPL@X????P'CODE' 'DATA' 'PICT' a.outE.EXE@UV W X \e]^_ fa g!i"h#j%b =JorldRe   athL stubQ@ MSL C.PPC.LibMPLF@MSL RuntimePPC.bMPLF__L+pfF Hel`pHello WorldSourcesMac brsANSI LibraryHello World.cIntfabMathLibMSL RuntimePPC.LibMSL.Pib:Hello World PPCLib Import PBon HelpMW C/C++ PPCMW Pascal PRPCAsmXCOFF Import PPCPEF ImporPPL SIOUX.PPC.LibJZ$mstrlumstl(mstn((msti+mstr4vmstlPmstn P pref{ Z0pref Jprefn pref prefyW.pref.prefPprefpref pref" prefZm  pref* prefa vpref>pref prefmVpref )pprefd8pref prefX6prefL pref-vpref(8prefC@ pref_pref9^  pref^&<pref&o'prefvh (pref!$.pref "( pref8#R$prefV$v pref%*pref&+nJpref':vLmtgl,mpsiP(msti PLst^x* x mtslmtpl mtpsxmtpiXmtlo 0 prefհ7 8pref D9 pref:bpref`F! mtsl@mtplnZmtpsmtpiDmtlo& prefCS8prefU prefqV&6prefԃd4rprefg mall(mapl-\pref G t7\pref yFeprefSprefmoti mtslZJmtplnmtps mtpioTmtlot"prefy2 prefN$!prefpref}?VprefFpref9 pref+Dprefopref mpref*prefX prefъ pref|1 prefUGprefQH >pref1 pref prefApref\prefHpref@prefWq <2prefsnprefdpref? bpreffxprefprefG pref7 pref* $ pref8prefpref.pref)~.pref pref$"prefg 0pref%prefΝ3prefa{ D pref3prefOIjpref^pref\prefoprefspref{u?VprefS%prefT  pref #9pref7pref,BprefĿ prefW? n prefaE\ prefW7hprefG&?prefo>pref/pref)pref =Epref2prefd'EprefmWprefz=2prefoJgpref \BprefԨ(Ubpref{+iprefɧprefnopref- prefW&! prefm,Aprefgeprefh}prefmLJ.prefTi% prefs"prefJ?pref tprefS8 Ppref6 4d prefT  Rpref- jprefApref* pref5҃pref"֓prefܧ?Vpref!preft prefr $pref prefSTF)pref4-mpref pref3FC pref<FOpref#*prefmWk>pref$>Sypref7t$0pref= & pref!+pref"0prefo#1pref)$k2pref%Aprefm&J pref0-'kbpref(M prefGp)MprefD*l]pref,=+T pref,T prefxs-T"pref.TprefS/UprefW/0V.pref1V pref~2X"pref7<3YprefM4Yprefq05Y(pref6YB pref07YNpref8YjprefoL9hawknl-1.6.8+dfsg2/samples/max.c000066400000000000000000000065051130562644400164230ustar00rootroot00000000000000/* Sample program for the HawkNL cross platform network library Copyright (C) 2001-2003 Phil Frisbie, Jr. (phil@hawksoft.com) */ /* This app opens up UDP/TCP sockets until the system cannot open up any more, or it hits the NL_MAX_INT_SOCKETS limit. On a Windows NT 4.0 server with 256 MB of RAM, it can open up 64511 UDP sockets and 7926 connected TCP sockets, and on Windows 95 it can open up 252 UDP sockets. */ #include #include #include #include "nl.h" static void printError(void) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { printf("System error: %u, %s\n", (unsigned int)err, nlGetSystemErrorStr(nlGetSystemError())); } else { printf("HawkNL error: %s\n", nlGetErrorStr(err)); } } static void printErrorExit(void) { printError(); nlShutdown(); exit(EXIT_FAILURE); } int main(int argc, char **argv) { NLsocket sock, serversock, s; NLaddress address, serveraddr, *alladdr; NLint group, count; NLbyte string[NL_MAX_STRING_LENGTH]; if(nlInit() == NL_FALSE) printErrorExit(); printf("nlGetString(NL_VERSION) = %s\n", nlGetString(NL_VERSION)); printf("nlGetString(NL_NETWORK_TYPES) = %s\n", nlGetString(NL_NETWORK_TYPES)); if(nlSelectNetwork(NL_IP) == NL_FALSE) printErrorExit(); /* list all the local addresses */ printf("local addresses are:\n"); alladdr = nlGetAllLocalAddr(&count); if(alladdr != NULL) { while(count-- > 0) { printf(" %s\n", nlAddrToString(alladdr++, string)); } } printf("\n"); printf("Testing TCP connected sockets\n\n"); serversock = nlOpen(1258, NL_RELIABLE); nlListen(serversock); nlGetLocalAddr(serversock, &serveraddr); nlSetAddrPort(&serveraddr, 1258); group = nlGroupCreate(); nlGroupAddSocket(group, serversock); while(1 == 1) { /* create a client socket */ sock = nlOpen(0, NL_RELIABLE); /* let the system assign the port number */ if(sock == NL_INVALID) { printError(); break; } nlConnect(sock, &serveraddr); printf("Socket: %d\r", sock); if(nlPollGroup(group, NL_READ_STATUS, &s, 1, 1000) != 1) { printError(); break; } sock = nlAcceptConnection(serversock); if(sock == NL_INVALID) { printError(); break; } printf("Socket: %d\r", sock); } printf("\nOpened %d sockets\n", nlGetInteger(NL_OPEN_SOCKETS)); nlShutdown(); if(nlInit() == NL_FALSE) printErrorExit(); if(nlSelectNetwork(NL_IP) == NL_FALSE) printErrorExit(); printf("Testing UDP sockets\n\n"); while(1 == 1) { /* create a client socket */ sock = nlOpen(0, NL_UNRELIABLE); /* let the system assign the port number */ if(sock == NL_INVALID) { printError(); break; } nlGetLocalAddr(sock, &address); printf("Socket: %d, port: %hu\r", sock, nlGetPortFromAddr(&address)); } printf("\nOpened %d sockets\n", nlGetInteger(NL_OPEN_SOCKETS)); nlShutdown(); return 0; } hawknl-1.6.8+dfsg2/samples/multicast.c000066400000000000000000000166621130562644400176500ustar00rootroot00000000000000/* Sample program for the HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) */ /* This sample app shows client and server Multicasting. For complete usage, use multicast -h */ #include #include #include #include #include "nl.h" #if defined WIN32 || defined WIN64 #define WIN32_LEAN_AND_MEAN #include #define sleep(x) Sleep((DWORD)(1000 * (x))) #else #include #define stricmp strcasecmp #endif /* command line helper functions from HAWK game engine */ static int ParamCount=0; static char **ParamData=NULL; static void initParam(int count, char **params) { ParamCount=count; ParamData=params; } static NLboolean isParam(char *name) { int i; int len; for(i=0;i 0) { nlGetRemoteAddr(sock, &addr); buffer[99] = (NLbyte)0; printf("Time at %s is %s", nlAddrToString(&addr, string), buffer); memset(buffer, 0, sizeof(buffer)); } sleep(0); } } int main(int argc, char **argv) { NLboolean isserver = NL_FALSE; NLsocket sock; NLaddress addr, maddr; NLbyte string[NL_MAX_STRING_LENGTH]; NLbyte address[] = "234.235.236.237"; NLushort port = 1258; NLint ttl = NL_TTL_LOCAL; NLint interval = 10; NLaddress *alladdr; NLint count; printf("Multicast demo program using HawkNL library.\n"); printf("Copyright 2000-2002 by Phil Frisbie\n"); printf("For usage help, use multicast -h\n\n"); if(nlInit() == NL_FALSE) printErrorExit(); if(nlSelectNetwork(NL_IP) == NL_FALSE) printErrorExit(); initParam(argc, argv); if(isParam("-h") == NL_TRUE) { printUsage(); return 0; } if(isParam("-s") == NL_TRUE) { isserver = NL_TRUE; } if(isParam("-a") == NL_TRUE) { nlStringToAddr(getStrParam("-a"), &maddr); } else { nlStringToAddr(address, &maddr); } if(isParam("-p") == NL_TRUE) { NLushort p = (NLushort)getIntParam("-p"); if(p < 1024 || p > 65535) { printf("error: invalid port, using default port of %u\n", port); nlSetAddrPort(&maddr, port); } else { nlSetAddrPort(&maddr, p); } } else { nlSetAddrPort(&maddr, port); } if(isParam("-t") == NL_TRUE) { NLint t = getIntParam("-t"); if(t < 1 || t > 255) { printf("error: invalid ttl, using default ttl of %d\n", ttl); } else { ttl = t; } } if(isParam("-i") == NL_TRUE) { NLint i = getIntParam("-i"); if(i < 1 || i > 60) { printf("error: invalid interval, using default interval of %d\n", interval); } else { interval = i; } } /* change TTL if you want to get out of your LAN */ /* note that this call must be before nlConnect */ nlHint(NL_MULTICAST_TTL, ttl); /* enable reuse address to run two or more copies on one machine */ nlHint(NL_REUSE_ADDRESS, NL_TRUE); /* list all the local addresses */ printf("local addresses are:\n"); alladdr = nlGetAllLocalAddr(&count); if(alladdr != NULL) { while(count-- > 0) { printf(" %s\n", nlAddrToString(alladdr++, string)); } } printf("\n"); if(isserver == NL_TRUE) { /* create a socket */ /* to just write, you can use port 0 */ /* but if you want to read also, then use the */ /* multicast port just like the client code below */ sock = nlOpen(0, NL_UDP_MULTICAST); if(sock == NL_INVALID) printErrorExit(); nlGetLocalAddr(sock, &addr); printf("our socket address is %s\n", nlAddrToString(&addr, string)); if(nlConnect(sock, &maddr) == NL_FALSE) { nlClose(sock); printErrorExit(); } printf("multicast address %s\n", nlAddrToString(&maddr, string)); serverLoop(sock, interval); } else { /* create a socket */ /* to receive, you must specify a port number */ /* that matches the multicast address port number */ sock = nlOpen(1258, NL_UDP_MULTICAST); if(sock == NL_INVALID) printErrorExit(); nlGetLocalAddr(sock, &addr); printf("our address is %s\n", nlAddrToString(&addr, string)); if(nlConnect(sock, &maddr) == NL_FALSE) { nlClose(sock); printErrorExit(); } printf("multicast address %s\n", nlAddrToString(&maddr, string)); clientLoop(sock); } return 0; } hawknl-1.6.8+dfsg2/samples/overrun.c000066400000000000000000000054551130562644400173410ustar00rootroot00000000000000/* Sample program for the HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) */ /* Test various calls for buffer over-run problems */ /* To test UNICODE on Windows NT/2000/XP, define UNICODE and _UNICODE in your compiler settings and recompile HawkNL. Then uncomment both the defines below and compile this program. */ //#define _UNICODE //#define UNICODE #include #include #include #include "nl.h" #ifdef WINDOWS_APP #define WIN32_LEAN_AND_MEAN #include #include #endif #ifndef _INC_TCHAR #ifdef _UNICODE #define TEXT(x) L##x #define _tmain wmain #define _tprintf wprintf #define _stprintf swprintf #define _tcslen wcslen #ifdef WINDOWS_APP #define _ttoi _wtoi #else /* !WINDOWS_APP*/ #define _ttoi wtoi #endif /* !WINDOWS_APP*/ #else /* !UNICODE */ #define TEXT(x) x #define _tmain main #define _tprintf printf #define _stprintf sprintf #define _tcslen strlen #endif /* !UNICODE */ #endif /* _INC_TCHAR */ static void printError(void) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { _tprintf(TEXT("System error: %s\n"), nlGetSystemErrorStr(nlGetSystemError())); } else { _tprintf(TEXT("HawkNL error: %s\n"), nlGetErrorStr(err)); } } static void printErrorExit(void) { printError(); nlShutdown(); exit(EXIT_FAILURE); } #if defined (_WIN32_WCE) int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd ) #else int _tmain(int argc, NLchar **argv) #endif { NLaddress addr1; NLchar string[NL_MAX_STRING_LENGTH]; NLchar string2[] = "123.456.789.000%s%s%s%s%s%s%s%s%s"; if(nlInit() == NL_FALSE) printErrorExit(); _tprintf(TEXT("nlGetString(NL_VERSION) = %s\n\n"), nlGetString(NL_VERSION)); if(nlSelectNetwork(NL_IP) == NL_FALSE) printErrorExit(); /* init the string improperly with NO null termination */ memset(string, 'a', sizeof(string)); _tprintf(TEXT("\nTest nlStringToAddr with unterminated string\n")); if(nlStringToAddr(string, &addr1) == NL_FALSE) printError(); _tprintf(TEXT("\nTest nlGetAddrFromName with unterminated string\n")); if(nlGetAddrFromName(string, &addr1) == NL_FALSE) printError(); _tprintf(TEXT("\nTest nlGetAddrFromNameAsync with unterminated string\n")); nlGetAddrFromNameAsync(string, &addr1); printError(); _tprintf(TEXT("\nTest nlStringToAddr with string containing formating\n")); if(nlStringToAddr(string2, &addr1) == NL_FALSE) printError(); _tprintf(TEXT("\nDone\n")); nlShutdown(); return 0; } hawknl-1.6.8+dfsg2/samples/samples.txt000066400000000000000000000035531130562644400176770ustar00rootroot00000000000000HawkNL sample applications async: Demonstrates asynchronous calls nlGetNameFromAddrAsync and nlGetAddrFromNameAsync by resolving five addresses or name at once, and displaying the results every second. broadcast: Demonstrates broadcast packets on a LAN. You can specify the network type on the command line. Supports NL_IP (the default), NL_IPX, or NL_LOOP_BACK. Example: broadcast NL_LOOPBACK buffer: Demonstrates how to use swap endian API, and the buffer read/write macros. clientserver: Shows client/server action using two threads. Uses nlPollGroup to check for incoming messages from the 10 client sockets. You can specify the network type on the command line. Supports NL_IP (the default), NL_IPX, or NL_LOOP_BACK. Example: clientserver NL_LOOPBACK eqtest.c: Shows how to query the EverQuest status server to get the current banner set in the chat server. getfile: Hey, something useful! Downloads a file from a web server from the command line. Example: getfile www.hawksoft.com /links.shtml c:\links.html Note: getfile now sends the HTTP header to stdout. max: Opens UDP ports, then connected TCP ports, until the system fails to open up more. On Windows NT 4.0 server with 256 MB of RAM, it can open up 64511 UDP sockets and 7926 connected TCP sockets. multicast: Demonstrates client and server multicast services. Example: multicast -s will run a server with default options, and just multicast will run a client with default options. For the full list of options, run multicast -h . overrun.c: Simply tests the buffer over-run prevention code in nlStringToAddr and nlGetAddrFromName* test.c: The original test app; a VERY simple chat app. threadpool.c: Shows how to use threads, mutexes, and conditions to create a server thread pool to handle a large number in incoming requests. timer.c: Tests the resolution of the NLTime function. hawknl-1.6.8+dfsg2/samples/test.c000066400000000000000000000103101130562644400166020ustar00rootroot00000000000000#include #include #include #include "nl.h" #if defined WIN32 || defined WIN64 #define WIN32_LEAN_AND_MEAN #include #define sleep(x) Sleep(1000 * (x)) #endif void printErrorExit(void) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { printf("System error: %s\n", nlGetSystemErrorStr(nlGetSystemError())); } else { printf("HawkNL error: %s\n", nlGetErrorStr(err)); } nlShutdown(); exit(1); } #define MAX_CLIENTS 10 void mainServerLoop(NLsocket sock) { NLsocket client[MAX_CLIENTS]; NLint clientnum = 0; NLbyte string[NL_MAX_STRING_LENGTH]; memset(client, 0, sizeof(client)); while(1) { NLint i; NLbyte buffer[128]; /* check for a new client */ NLsocket newsock = nlAcceptConnection(sock); if(newsock != NL_INVALID) { NLaddress addr; nlGetRemoteAddr(newsock, &addr); client[clientnum] = newsock; printf("Client %d connected from %s\n", clientnum, nlAddrToString(&addr, string)); clientnum++; } else { if(nlGetError() == NL_SYSTEM_ERROR) { printErrorExit(); } } /* loop through the clients and read the packets */ for(i=0;i 0) { NLint j; buffer[127] = 0; /* null terminate the char string */ printf("Client %d sent %s\n", i, buffer); for(j=0;j 0) { printf("%s\n", buffer); } sleep(0); } } int main(int argc, char **argv) { NLboolean isserver = NL_FALSE; NLsocket serversock; NLsocket clientsock; NLaddress addr; NLbyte server[] = "127.0.0.1:25000"; NLenum type = NL_UNRELIABLE; /* Change this to NL_RELIABLE for reliable connection */ NLbyte string[NL_MAX_STRING_LENGTH]; if(!nlInit()) printErrorExit(); printf("nlGetString(NL_VERSION) = %s\n\n", nlGetString(NL_VERSION)); printf("nlGetString(NL_NETWORK_TYPES) = %s\n\n", nlGetString(NL_NETWORK_TYPES)); if(!nlSelectNetwork(NL_IP)) printErrorExit(); if(argc > 1) { if(!strcmp(argv[1], "-s")) /* server mode */ isserver = NL_TRUE; } if(isserver) { /* create a server socket */ serversock = nlOpen(25000, type); /* just a random port number ;) */ if(serversock == NL_INVALID) printErrorExit(); if(!nlListen(serversock)) /* let's listen on this socket */ { nlClose(serversock); printErrorExit(); } nlGetLocalAddr(serversock, &addr); printf("Server address is %s\n", nlAddrToString(&addr, string)); mainServerLoop(serversock); } else { /* create a client socket */ clientsock = nlOpen(0, type); /* let the system assign the port number */ nlGetLocalAddr(clientsock, &addr); printf("our address is %s\n", nlAddrToString(&addr, string)); if(clientsock == NL_INVALID) printErrorExit(); /* create the NLaddress */ nlStringToAddr(server, &addr); printf("Address is %s\n", nlAddrToString(&addr, string)); /* now connect */ if(!nlConnect(clientsock, &addr)) { nlClose(clientsock); printErrorExit(); } mainClientLoop(clientsock); } nlShutdown(); return 0; } hawknl-1.6.8+dfsg2/samples/threadpool.c000066400000000000000000000176621130562644400200050ustar00rootroot00000000000000/* Sample program for the HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) */ /* This app shows a multithreaded client/server app with thread pooling. Choose the network type to use with the command line: clientserver NL_IP The default is NL_IP. Valid network types are: NL_IP, NL_IPX, and NL_LOOP_BACK */ #include #include #include #include "nl.h" #if defined WIN32 || defined WIN64 #define WIN32_LEAN_AND_MEAN #include #define sleep(x) Sleep(1000 * (x)) #else #include #endif #define MAX_CLIENTS 8 #define MAX_SERVER 4 #define MAX_CONNECTS 100 NLmutex startmutex, socketmutex; NLenum socktype = NL_RELIABLE_PACKETS; NLushort serverport = 25000; NLcond servercond; NLsocket clientsock = NL_INVALID; NLboolean shutdown = NL_FALSE; void printErrorExit(void) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { printf("System error: %s\n", nlGetSystemErrorStr(nlGetSystemError())); } else { printf("HawkNL error: %s\n", nlGetErrorStr(err)); } nlShutdown(); exit(1); } static void *mainServerLoop(void *t) { NLint thread = (NLint)t; NLenum err; /* wait for start */ nlMutexLock(&startmutex); nlMutexUnlock(&startmutex); nlThreadYield(); /* wait on the condition forever */ while(nlCondWait(&servercond, 0) == NL_TRUE) { NLbyte string[NL_MAX_STRING_LENGTH]; NLsocket s; if(shutdown == NL_TRUE) { printf("SERVER: thread %d asked to shut down\n", thread); return NULL; } nlMutexLock(&socketmutex); if(clientsock == NL_INVALID) { printf("SERVER: thread %d, invalid client socket\n", thread); nlMutexUnlock(&socketmutex); continue; } s = clientsock; clientsock = NL_INVALID; nlMutexUnlock(&socketmutex); if(nlRead(s, string, sizeof(string)) > 0) { printf("SERVER: thread %d, processed client thread %d\n", thread, atoi(string)); nlWrite(s, string, strlen(string) + 1); } else { printf("SERVER: thread %d, nlRead error\n", thread); } /* we are done, so close the socket */ nlClose(s); } /* if we got here, there was a problem with the condition */ /* or we are shutting down */ err = nlGetError(); if(err == NL_SYSTEM_ERROR) { printf("SERVER: thread %d, system error: %s\n", thread, nlGetSystemErrorStr(nlGetSystemError())); } else { printf("SERVER: thread %d, HawkNL error: %s\n", thread, nlGetErrorStr(err)); } printf("SERVER: thread %d exiting\n", thread); return NULL; } static void *mainClientLoop(void *t) { NLint thread = (NLint)t; NLsocket sock; NLaddress addr; NLbyte str[NL_MAX_STRING_LENGTH]; while(1) { sock = nlOpen(0, socktype); if(sock == NL_INVALID) { printf("CLIENT: thread %d nlOpen error\n", thread); if(nlGetError() == NL_NO_NETWORK) { /* we are shutting down */ break; } continue; } /* now connect */ nlGetLocalAddr(sock, &addr); nlSetAddrPort(&addr, serverport); if(!nlConnect(sock, &addr)) { printf("CLIENT: thread %d nlConnect error\n", thread); nlClose(sock); printf("CLIENT: thread %d closed\n", thread); break; } printf("CLIENT: thread %d connected to %s\n", thread, nlAddrToString(&addr, str)); sprintf(str, "%d Client thread says hello", thread); nlWrite(sock, str, strlen(str) + 1); while(nlRead(sock, str, sizeof(str)) > 0) { printf("CLIENT: thread %d received \"%s\"\n", thread, str); } nlClose(sock); nlThreadYield(); } printf("CLIENT: thread %d exiting\n", thread); return NULL; } int main(int argc, char **argv) { NLsocket serversock; NLenum type = NL_IP;/* default network type */ NLint connects = 0; NLint i; if(!nlInit()) printErrorExit(); printf("nlGetString(NL_VERSION) = %s\n\n", nlGetString(NL_VERSION)); printf("nlGetString(NL_NETWORK_TYPES) = %s\n\n", nlGetString(NL_NETWORK_TYPES)); if (argc == 2) { if(strcmp(argv[1], "NL_IPX") == 0) { type = NL_IPX; } else if(strcmp(argv[1], "NL_LOOP_BACK") == 0) { type = NL_LOOP_BACK; } else if(strcmp(argv[1], "NL_IP") == 0) { type = NL_IP; } } if(!nlSelectNetwork(type)) printErrorExit(); nlEnable(NL_BLOCKING_IO); if(nlCondInit(&servercond) == NL_FALSE) printErrorExit(); nlMutexInit(&startmutex); nlMutexInit(&socketmutex); /* create the server socket */ serversock = nlOpen(serverport, socktype); /* just a random port number ;) */ if(serversock == NL_INVALID) printErrorExit(); if(!nlListen(serversock)) /* let's listen on this socket */ { nlClose(serversock); printErrorExit(); } /* create the server threads */ nlMutexLock(&startmutex); for(i=0;i #include #include #if defined WIN32 || defined WIN64 #include #endif #include "nl.h" static void printErrorExit(void) { NLenum err = nlGetError(); if(err == NL_SYSTEM_ERROR) { printf("System error: %s\n", nlGetSystemErrorStr(nlGetSystemError())); } else { printf("HawkNL error: %s\n", nlGetErrorStr(err)); } nlShutdown(); exit(EXIT_FAILURE); } int main(int argc, char **argv) { NLtime t; NLlong curtime, lastime; NLint count; NLlong times[20]; if(nlInit() == NL_FALSE) printErrorExit(); printf("Testing the resolution of nlTime()\n\n"); nlTime(&t); curtime = lastime = t.useconds; count = 20; while(count-- > 0) { while(lastime == curtime) { nlTime(&t); curtime = t.useconds; } if(lastime > curtime) { times[count] = (curtime - lastime + 1000000); } else { times[count] = (curtime - lastime); } lastime = curtime; } count = 20; while(count-- > 0) { printf("nlTime resolution is %d microseconds\n", times[count]); lastime = curtime; } nlShutdown(); return 0; } hawknl-1.6.8+dfsg2/src/000077500000000000000000000000001130562644400146075ustar00rootroot00000000000000hawknl-1.6.8+dfsg2/src/GUSIConfig.cp000066400000000000000000000034441130562644400170350ustar00rootroot00000000000000typedef int bool; /**************** BEGIN GUSI CONFIGURATION **************************** * * GUSI Configuration section generated by GUSI Configurator * last modified: Wed Aug 1 15:37:20 2001 * * This section will be overwritten by the next run of Configurator. */ #define GUSI_SOURCE #include #include /* Declarations of Socket Factories */ __BEGIN_DECLS void GUSIwithInetSockets(); void GUSIwithLocalSockets(); void GUSIwithMTInetSockets(); void GUSIwithMTTcpSockets(); void GUSIwithMTUdpSockets(); void GUSIwithOTInetSockets(); void GUSIwithOTTcpSockets(); void GUSIwithOTUdpSockets(); void GUSIwithPPCSockets(); void GUSISetupFactories(); __END_DECLS /* Configure Socket Factories */ void GUSISetupFactories() { #ifdef GUSISetupFactories_BeginHook GUSISetupFactories_BeginHook #endif GUSIwithInetSockets(); #ifdef GUSISetupFactories_EndHook GUSISetupFactories_EndHook #endif } /* Declarations of File Devices */ __BEGIN_DECLS void GUSIwithDConSockets(); void GUSIwithNullSockets(); void GUSISetupDevices(); __END_DECLS /* Configure File Devices */ void GUSISetupDevices() { #ifdef GUSISetupDevices_BeginHook GUSISetupDevices_BeginHook #endif GUSIwithNullSockets(); #ifdef GUSISetupDevices_EndHook GUSISetupDevices_EndHook #endif } #ifndef __cplusplus #error GUSISetupConfig() needs to be written in C++ #endif GUSIConfiguration::FileSuffix sSuffices[] = { "", '????', '????' }; extern "C" void GUSISetupConfig() { GUSIConfiguration * config = GUSIConfiguration::CreateInstance(GUSIConfiguration::kNoResource); config->ConfigureSuffices( sizeof(sSuffices)/sizeof(GUSIConfiguration::FileSuffix)-1, sSuffices); } /**************** END GUSI CONFIGURATION *************************/ hawknl-1.6.8+dfsg2/src/HawkNL-LCC.prj000066400000000000000000000040101130562644400170420ustar00rootroot00000000000000; Wedit project file. Syntax: Name = value [HawkNL-LCC] PrjFiles=15 File1=CONDITION.C File2=CRC.C File3=ERR.C File4=ERRORSTR.C File5=GROUP.C File6=HAWKNL-LCC.DEF File7=IPX.C File8=LOOPBACK.C File9=MSVCRT.LIB File10=MUTEX.C File11=NL.C File12=NLTIME.C UserCount=1 User1=PFRISBIE CmsDirectory=D:\MyProjects\HawkNL\src\CMS PutOptions=4 GetOptions=0 FileOptions=0 LockOptions=1 UsersOptions=1 ProjectFlags=0 ExtraCmsFilesCount=0 Frame=111 0 819 713 StatusBar=0,0,0,0 Name=HawkNL-LCC CurrentFile=D:\MyProjects\HawkNL\src\NL.C OpenFiles=12 OpenFile1="D:\MyProjects\HawkNL\src\THREAD.C" 1 97 42 879 499 OpenFile2="D:\MyProjects\HawkNL\src\SOCK.C" 1 119 56 901 513 OpenFile3="d:\myprojects\hawknl\src\nlinternal.h" 73 307 104 1118 504 OpenFile4="D:\MyProjects\HawkNL\src\NL.C" 1690 163 100 -1010 557 OpenFile5="D:\MyProjects\HawkNL\src\MUTEX.C" 1 185 122 967 579 OpenFile6="D:\MyProjects\HawkNL\src\LOOPBACK.C" 1 207 144 989 601 OpenFile7="D:\MyProjects\HawkNL\src\IPX.C" 1 229 166 1011 623 OpenFile8="D:\MyProjects\HawkNL\src\GROUP.C" 1 251 188 1033 645 OpenFile9="D:\MyProjects\HawkNL\src\ERRORSTR.C" 1 273 210 1055 667 OpenFile10="D:\MyProjects\HawkNL\src\ERR.C" 1 295 232 1077 689 OpenFile11="D:\MyProjects\HawkNL\src\CONDITION.C" 1 97 42 879 499 OpenFile12="D:\MYPROJECTS\HAWKNL\include\nl.h" 95 119 56 892 311 OpenFile13="D:\MyProjects\HawkNL\src\CONDITION.C" 1 2 38 784 495 ProjectPath=D:\MyProjects\HawkNL\src SourcesDir=D:\MyProjects\HawkNL\src Defines=NL_WIN_THREADS Includes=d:\lcc\include Libraries=MSVCRT.LIB WSOCK32.LIB LinkerArgs= ProjectTime=8259 MakeName=d:\lcc\bin\make.exe MakeDir=D:\MyProjects\HawkNL\src\lcc Exe=d:\myprojects\hawknl\lib\hawknl.dll DebuggerArguments= DbgExeName=d:\myprojects\hawknl\lib\hawknl.dll DbgDir=d:\myprojects\hawknl\src\lcc CompilerFlags=772 FortranFlags=0 EiffelFlags=0 Useframework=0 NumberOfBreakpoints=0 ErrorFile=D:\MyProjects\HawkNL\src\lcc\HawkNL-LCC.err NrOfFileProcessors=0 UserName=PFRISBIE File13=SOCK.C File14=THREAD.C File15=WSOCK32.LIB hawknl-1.6.8+dfsg2/src/NLchanges.txt000066400000000000000000000526321130562644400172220ustar00rootroot00000000000000Change log for HawkNL Version 1.68 Fixed potential mutex contention with multiple CPU systems Added NL_ERROR_STATUS to nlPollGroup Fixed nlThreadCreate bug when using native Windows threads on Win9x Fixed 'double bind' bug with UDP connections De-linted source files; several minor corrections Version 1.67 Cleaned up internal references to NL_INVALID, INVALID_SOCKET, and SOCKET_ERROR Fixed Winsock bug with connect() that limited connecting more than 8000 TCP sockets Fixed compiler warning in err.c for MSVC 6.0 and eMbedded Visual C++ 3.0 Fixed bug in nlGroupDeleteSocket Native Windows threads are now the default when compiled on Windows Fixed bug in nlWrite which caused a segfault with a non-blocking connect on some Unix OSs Modified socket stats to be more accurate during the first 8 seconds of use Version 1.66 Modified nlConnect, nlGetNameFromAddrAsync, and nlGetAddrFromNameAsync so that they copy the const data Fixed nlGroupDestroy bug Modified nlInit so that it clears out any previous error Enabled linger on TCP sockets Version 1.65 Fixed potential error in nlGetError when called before any error had been set Fixed Linux bug where first error message would not be set properly Fixed bug in nlGetAllLocalAddr where it could return improperly allocated memory when address count was 0 Fixed a bug where the localhost address would sometimes show as 247.0.0.1 Re-enabled some MSVC compiler warnings and cleaned up code Replaced Winsock macros FD_CLR, FD_SET, and FD_ISSET with inlined functions Fixed bug where nlPollGroup with the NL_LOOP_BACK driver ignored the timeout value Fixed bug in nlGetAllLocalAddr where it could return no local addresses Fixed bug in nlGetLocalAddr with NL_LOOP_BACK driver Fixed several Linux/Unix sample app compile errors Version 1.64 Added more error detection to nlMutexUnlock with Windows threads Added new error code for nlMutexUnlock, NL_MUTEX_OWNER Removed redundent calculation in nlPollGroup of highest real socket for select() Updated NLaddress for future IPv6 address support, and to hide more network details Fixed an NL_UDP deadlock when blocking on nlRead on one thread, and calling nlSetRemoteAddr on a second thread Fixed a bug in nlGroupDeleteSocket when deleting a closed socket Fixed a bug in nlGetSystemError when called before nlInit Added more comments in multicast.c to clarify port numbers for clients and servers Fixed bug where nlStringToAddr where a port number higher than 65535 would wrap the port number instead of returning an error Cleaned up the Windows code for nlTime Fixed nlListen bug when using a system assigned port number (port 0) Updated clientserver.c for a more graceful shutdown Version 1.63 Fixed several sample apps so that they compile on Linux/Unix Added root makefile for Linux Added TCP/IP specific aliases for connection types: NL_TCP = NL_RELIABLE NL_TCP_PACKETS = NL_RELIABLE_PACKETS NL_UDP = NL_UNRELIABLE NL_UDP_BROADCAST = NL_BROADCAST NL_UDP_MULTICAST = NL_MULTICAST Added updated HawkNL.pas file and Delphi sample applications for broadcast, eqtest, max, and test Fixed two potential memory problems when reallocating memory Fixed IN_MULTICAST macro bug in sock.c Fixed potential memory problem with nlGroupCreate Version 1.62 Performed another security audit and made more changes for better buffer overflow prevention Fixed a recursion bug in nlMutexLock with Windows threads Fixed potential memory leak in nlMutexInit and nlThreadCreate with pthreads Fixed MacOS 7-9 build; GUSI is not POSIX compliant and does not support PTHREAD_MUTEX_ERRORCHECK Version 1.61 Added code to prevent Format String Exploits to nlStringToAddr and nlGetAddrFromName* Updated overrun.c to test the Format String Exploit code Fixed potential bug in GetNameFromAddrAsync where you could read an incomplete string Fixed bug with NL_RELIABLE_PACKETS; monitor thread would sometimes stop working Fixed potential loss of unsent data when closing an NL_RELIABLE_PACKETS socket Version 1.6 Fixed Linux/GCC compiler errors and warnings Updated Linux makefile to install to user/local/ Added monitor thread to make sure any buffered nlWrites with NL_RELIABLE_PACKETS are sent Version 1.6 beta 4 Fixed bug where nlMutexLock and nlMutexUnlock did not return NL_TRUE Fixed bug in nlShutdown with NL_LOOP_BACK driver Fixed bug in nlThreadCreate with Windows threads Updated to new pthread for Win32 library Added recursion checks to Windows mutex code Added error NL_MUTEX_RECURSION Changed pthread mutex type to PTHREAD_MUTEX_ERRORCHECK Removed NL_THREADSAFE compile option; NL always compiles with thread safety Fixed nlShutdown deadlock bug when a blocking socket was blocked on a socket call Fixed nlGetSystemError bug where the error was sometimes lost on Windows Removed NL_CON_TERM error, check for NL_SOCK_DISCONNECT instead Fixed bug where nlRead was not reporting the socket disconnect with NL_LOOP_BACK driver Fixed nlShutdown bug when called from two threads at the same time Fixed another deadlock when nlShutdown and nlClose were called from two threads at the same time Updated NL_IPX driver with improved code from NL_IP driver Version 1.6 beta 3 Updated nlMutexInit, nlMutexLock, nlMutexUnlock, and nlMutexDestroy to return NLboolean Updated nlCondDestroy to return NLboolean Added better error detection for NULL pointers in nlCond* and nlMutex* functions Updated Windows pthread code to better handle pthread errors Updated nlThreadJoin to return NLboolean value Updated nlClose, nlClearSocketStat, nlHint, nlClear, nlEnable, and nlDisable to return NLboolean Updated nlGroupDestroy, nlGroupDeleteSocket, and nlGroupGetSockets to return NLboolean Fixed bug when using groups with NLlong user data Added 'const' qualifier to many parameters Updated nlStringToAddr, nlGetRemoteAddr, nlSetRemoteAddr, nlGetLocalAddr, nlSetLocalAddr, nlGetAddrFromName*, nlGetNameFromAddrAsync, and nlSetAddrPort to return NLboolean Fixed potential buffer over-runs in nlStringToAddr and nlGetAddrFromName* Updated nlWrite with NL_RELIABLE_PACKETS to return 0 when the last packet is still unsent; this is just like UDP, and only one packet will be buffered at a time Added NL_STRING_OVER_RUN, NL_SOCKET_NOT_FOUND, and NL_TIMED_OUT error codes Updated nlThreadCreate to return NL_INVALID cast to NLthreadID on error Updated nlTime to return NLboolean Version 1.6 beta 2 Fixed small memory leak in sock.c Fixed MacOS X compile problems Fixed problem where mutexes were being double locked Fixed bug in loopback driver Moved some include files to reduce scope of internal modules Fixed Linux compile problems with condition.c Ported buffer.c to compile on WinCE Fixed writeString and readString macros for WinCE and UNICODE Added ProjectBuilder project files for MacOS X Version 1.6 beta 1 Cleaned up use of NLsocket in code Removed the hardcoded limit on number of sockets; max.c may now take a LONG time Number of sockets is now dynamic to decrease memory, and to increase server scalability Removed NL_MAX_SOCKETS enumerant from nlGetInteger Reduced UDP/TCP internal socket memory usage from 408 bytes to 216 bytes Reduced group memory usage from 64K bytes per group down to a minimum of 80 bytes Groups are now suitable to store any NLlong user data More WinCE fixes; WinCE does not have ANSI C time functions or errno Fixed compile errors with NL_THREAD_SAFE undefined Exposed thread and mutex API for NLU and user apps Updated clientserver.c to use the new multithread API Added project file for eMbedded Visual C++ 3.0 for Windows CE MANY more little fixes for WinCE compile; now compiles cleanly Removed some no longer used error messages and the defines Removed NL_KEEPALIVE hint since it is actually a useless and misleading TCP option Added more compile options; loopback network driver can be eliminated if desired Fixed minor Mac OSX compile error Added condition variables, nlCond* Added nlMtime for millisecond accurate time similar to ftime() Renamed NL_SOCKET_ERROR error to NL_SYSTEM_ERROR Rewrote the nlMutex* and nlCond* code Added nlUtime for microsecond accurate time similar to gettimeofday() Fixed buffer bug in nlWrite with NL_RELIABLE_PACKETS Added time.c sample app to test timer resolution Modified nlMtime so that on Windows it is simply a wrapper around nlUtime Updated getfile.c so that it works with non-blocking or blocking IO Added threadpool.c sample app the test threads, conditions, and mutexes Fixed multithread connect/accept problem with NL_LOOP_BACK Combined nlMtime and nlUtime into nlTime Version 1.51 update Finished unicode (UCS-2 for Windows NT/2000/XP/CE) and WinCE support Updated async.c for unicode and WinCE When compiling on WinCE, NL will use native threads and will not include IPX Fixed another bug in nlRead with NL_RELIABLE_PACKETS Version 1.5 release Fixed nlInit problem when called multiple times Modified nlShutdown to be more thread safe Fixed multithread problem with GNE; closing sockets while polling groups could deadlock Added first part of unicode (UCS-2 for Windows) and WinCE support, but not yet complete Version 1.5 beta 2 Fixed MacOS X compile problems, again Fixed potential threading problem with NL_RELIABLE_PACKETS and nlPollGroup Fixed bug in nlRead with NL_RELIABLE_PACKETS Added nlGetAllLocalAddr to get all addresses on a multihomed system Updated broadcast.c, max.c, and multicast.c to use nlGetAllLocalAddr Version 1.5 beta 1 Added makefile for SGI Fixed SGI compile problems Added additional mutex locking in group API Fixed a potential threading problem in nlPollGroup Fixed MacOS X compile problems Fixed bug in nlInit Changed nlSwap* from inlined to regular API calls Modified nlSwap* so that you can choose big endian or little endian data format. This also effects the read*/write* macros Added NL_BIG_ENDIAN_DATA and NL_LITTLE_ENDIAN_DATA defines for nlEnable and nlDisable. Disabling one enables the other, and enabling one disables the other. Default is NL_BIG_ENDIAN_DATA enabled Modified nlPollGroup for better support of NL_RELIABLE_PACKETS Modified NL_RELIABLE_PACKETS so that they use less memory per socket Fixed Linux compile warnings for loopback.c and err.c Version 1.42 Release update Added hawknl.def file for Visual Basic support (non decorated function names) Fixed a bug where all global state variables were not reset properly after calling nlInit, nlShutdown, then nlInit again Fixed nlConnect bug where some Unixs would return an error of EINPROGRESS instead of EWOULDBLOCK for non-blocking sockets Added new error string for EINPROGRESS, non-Windows systems have the proper description Version 1.41 Release update Modifed max.c to test for both UDP and connected TCP sockets Fixed bug where nlGetSocketStat would return 0 Added ELOOK system error string for MacOS Added NL_SAFE_COPY option to nl.h to fix nlRead* and nlWrite* macro problems on Sparc CPUs Modified makefile.solaris to define NL_SAFE_COPY Added #include to nl.h for the nlRead* and nlWrite* macros Fixed Solaris compile problems Removed NLChat Windows example, made it a separate download Version 1.4 Release Fixed non-Microsoft compiler errors in wsock.h and mutex.h Fixed a potential access violation in nlGroupGetSockets De-linted all source files, various minor fixes More minor compile fixes Updated nlStringToAddr, nlGetRemoteAddr, nlGetLocalAddr, and nlGetAddrFromName so that address.valid will tell you if the function was successful Fixed nlGetAddrFromName* so they will always handle a port number, example: www.name.com:80 Fixed nlGetNameFromAddr* so they always add the port number if port!=0 Updated async.c to show the nlGetAddrFromName* and nlGetNameFromAddr* fixes Updated nlGetLocalAddr so that it also returns the local port of the socket Version 1.4 beta 4 Merged in Ryan Haksi's Mac modifications Cleaned up code in err.c and thread.c Updated sock_ReadPacket for better error detection, and simplified the code Added NL_PACKET_SYNC error code for NL_RELIABLE_PACKETS Added compile option to remove mutexes and per-thread error codes for single threaded apps Added socklen_t define to sock.c for better POSIX compliance Updated clientserver.c to show more NL features Fixed bug in nlAccept for NL_RELIABLE_PACKETS Changed err.c to use TLS (thread local storage) for error codes Added NL_TLS_ERROR code Added makefile.osx Version 1.4 beta 3 Fixed Linux and Solaris makefiles Fixed several bugs in err.c for POSIX systems Moved system include files before NL include files Added the NL_REUSE_ADDRESS hint to IPX Version 1.4 beta 2 Moved NL_TCP_NO_DELAY from nlEnable/nlDisable/nlGetBoolean to nlHint Added Windows compile option to remove IPX support Added NL_CONNECTION_TYPES to nlGetString Fixed NL_NETWORK_TYPES to return the network types and not the connection types Added NL_PARALLEL network type for future support of parallel ports Added NL_RAW connection type for NL_SERIAL and NL_PARALLEL network types Fixed bad error message when calling nlGetAddrFromName Fixed an error when sending to a group where a socket in that group had been closed Fixed getfile.c which was broken by non-blocking connects Added NL_LOOP_BACK network code Fixed bug in IPX code that caused it not to init properly Updated broadcast.c to add the network choice on the command line Renamed test2.c to clientserver.c and added it to the MSVC workspace Updated clientserver.c to add the network choice on the command line Fixed bug in multicast code Added mutexes to each socket for better thread safety Version 1.4 beta 1 Added changes to support Mingw32 compiler for Windows Added nlSetLocalAddr to choose the local address, or network interface nlOpen has been modified to create NL_BROADCAST and NL_MULTICAST sockets nlBroadcast has been been eliminated, use nlWrite nlConnectMulticast has been been eliminated, use nlConnect broadcast.c and multicast.c have been updated Added a millisecond timeout value to nlPollGroup Modified nlConnect so that it does not block on a non-blocking TCP socket Added NL_WRONG_TYPE and NL_CON_PENDING to errorstr.c Added nlHint for advanced control of sockets Added wrappers for mutex and thread APIs for future portability nlSetMulticastTTL has been eliminated, use nlHint BEFORE nlConnect Added per thread NL error messages Added threads for the non-blocking UDP connect Added Windows option to use native Windows threads instead of pthreads Version 1.3 Added new makefiles for Linux and Solaris Added a Windows static library for those that do not want to use a DLL Changed address_t to NLaddress Now compiles with LCC for Windows Version 1.3 beta 2 Fixed several things for better UNIX compatibility; Solaris is now supported Added NL_PACKET_SIZE to errorstr.c Version 1.3 beta 1 Added nlSetRemoteAddr, which I overlooked months ago Updated getfile.c to strip off the HTTP header, and to be more HTTP 1.0 compliant Added nlPollGroup for added scalability. Uses select() to check the read or write status of all sockets in a group, and returns a list of those sockets Updated test2.c to use nlPollGroup Updated the IPX code to test for packets larger than the 1466 byte limit Version 1.2 Fixed Win9x nlConnect error with NL_UNRELIABLE connection Updated nlAccept so that it connects NL_UNRELIABLE connections Version 1.2 beta 3 Fixed multicast support broken in beta 2 Updated nlOpen to automatically reuse TCP server addresses (SO_REUSEADDR) Updated nlConnect to speed up connecting NL_UNRELIABLE sockets Version 1.2 beta 2 Added mutexes around global variables to make them thread safe. The following are now thread safe: All read/write functions when updating stats All functions that create or destroy NLsockets All group functions nlClear Added NL_SOCKET_STATS enumerant to nlEnable and nlDisable socket read/write statistics Added NL_HIGH_BYTES_SENT, NL_PACKETS_RECEIVED, NL_AVE_BYTES_RECEIVED and NL_HIGH_BYTES_RECEIVED Updated nlGetInteger and nlGetSocketStat to return NLlong Added nlClearSocketStat to clear the stats for an individual socket Added a packet size limit of 16384 bytes to NL_UNRELIABLE and NL_RELIABLE_PACKETS Updated getfile.c to use the new socket read/write statistics Added the first 64 bit CPU compatibility code Version 1.2 beta 1 Added the nlGroup API to create groups of sockets Added NL_RELIABLE_PACKETS to packetize the TCP stream Added more error codes and error checking Removed NLPeek because of potential misuse, and the high performance penalty on Windows Moved most error checking from the drivers to nl.c to reduce code size Version 1.0 beta 1 Added some missing error strings to errorstr.c Fixed a minor bug in sock_Broadcast Added double macros: nlSwapd, readDouble, and writeDouble Added buffer.c to show how the swap and read/write buffer macros work Updated nlOpen to use NLushort for port number Added error checking to sock_StringToAddr Fixed sock_GetAddrFromName so that the address will always return something valid Added NL_BAD_ADDR error code Added asynchronous calls nlGetAddrFromNameAsync and nlGetNameFromAddrAsync using the PTHREADS-WIN32 library Added async.c to show how to use the new asynchronous calls Updated nlGetAddrFromName and nlGetAddrFromNameAsync so they will accept a numeric address string Added max.c to test how many ports can be opened at once on a system Added NL_MESSAGE_END error message for TCP with non-blocking to notify the app the message is done Updated nlRead to support the NL_MESSAGE_END error message Added getfile.c to show how to download a file from a web server Updated nlGetLocalAddr so that you now need to pass an NLsocket to it, just like nlGetRemoteAddr Updated nlGetLocalAddr so that it is accurate with a connected socket on a multihomed system Updated NLChat to use TCP instead of UDP Changed NLChat default port to 1258 (HawkNLU port), and added 209.204.172.76 (www.hawksoft.com) to the address list Fixed nlSetMulticastTTL so that it works on all Unix's and Windows Winsock versions Renamed nlGetSocketPort to nlGetPortFromAddr Renamed nlSetSocketPort to nlSetAddrPort Added nlGetSocketStat to get the statistics for an individual socket (nlGetInteger returns the statistics for all sockets combined) Change log for HawkNL and NLU Version 0.6 alpha Added a new sample, NLChat, a Windows chat program, courtesy of Tim Lyakhovetskiy Reoganized MSVC workspace, object files are now separate from the .exes, .dlls, and .libs Bumped the Warning Level up to Level 4 (the max) for NLU Moved the endian and read*/write* macros to nl.h where they can be easily used by apps Added crc functions to NLU Updated sock_Peek to return NLulong Added multicast support with nlConnectMulticast and nlSetMulticastTTL Moved CRC functions from NLU to NL so other apps can use them Fixed the elusive 'Win95 cannot connect a UDP socket' failure that caused test.c to only work with TCP Added a multicast sample Added NL_SOCK_DISCONNECT error code to let you know if the socket has been disconnected, or other network error has occurred, each time you read or write, so you can shut down the socket Changed nlGetSocketPort to return NLushort port number Changed nlSetSocketPort to use NLushort port number NL code is now compiling cleanly with Warning Level 4 Started 'de-linting' the source code with LCLint Renamed sockets.c and sockets.h to sock.c and sock.h to avoid name collisions on some platforms Version 0.5 alpha Added official port numbers to protocol.h For Windows, changed from _cdecl to _stdcall calling convention Added Delphi headers and project files courtesy of 'Johnny' Renamed convert* functions to nluSwap* Converted nluSwaps and nluSwapl to macros Inlined nluSwapf Added nlGetErrorStr and nlGetSystemErrorStr to convert error codes to strings, based on code supplied by Ryan Haksi Added a reference count to nlInit and nlShutdown Added NL_TCP_NO_DELAY enumerant to nlEnable and nlDisable Added nlGetBoolean (how did I miss that one?) Added NL_CON_REFUSED error code Reorganized NLU API to make it event driven Deleted nluServerAcceptPlayer and nluVoiceServerPump because NLU is now event driven Added nluBanAddress Refined NLU protocol some more Added nluGetConnectionStats Consolidated nluPlayerSend and nluServerSend to nluSend Consolidated nluPlayerReceive and nluServerReceive to nluReceive Changed all nluVoicePlayer* functions to nluVoice* Changed the library name to HawkNL Version 0.4 alpha Added NLlong and NLulong Fixed nlAddrToString and nlGetString to make them thread safe Altered nlGetNameFromAddr to make it easier to use Deleted nluVoicePlayerPump Added nluVoicePlayerSend and nluVoicePlayerReceive Removed NLU_CRC and NLU_SEQUENCE options, they really should be transparent Fixed sock_ConnectUDP and sock_AcceptUDP so they should now work through firewalls Deleted nluSelectNetwork, just use nlSelectNetwork Added nluGroupGetPlayers Changed server_t and player_t to nlu_server_t and nlu_player_t Changed callback functions in nlu.h to return NLboolean values Rewrote getNewSocket to be more efficient Added NL_MAX_SOCKETS and NL_OPEN_SOCKETS enumerants to nlGetInteger Version 0.3 alpha Added IPX/SPX code for Windows Added nlEnable/Disable to API Added option to choose blocking IO for threaded apps Added many functions to the NLU API, including the first of the voice API Version 0.2 alpha Initial release hawknl-1.6.8+dfsg2/src/condition.c000066400000000000000000000166111130562644400167460ustar00rootroot00000000000000/* HawkNL condition module Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #include "nlinternal.h" #ifdef NL_WIN_THREADS enum { SIGNAL = 0, BROADCAST = 1, MAX_EVENTS = 2 }; struct nl_cond_t { HANDLE events_[MAX_EVENTS]; }; struct timespec { long tv_sec; long tv_nsec; }; #else /* !NL_WIN_THREADS */ #ifndef WINDOWS_APP #include #endif /* WINDOWS_APP */ #include #include struct nl_cond_t { pthread_cond_t cond; pthread_mutex_t mutex; }; #endif /* !NL_WIN_THREADS */ NL_EXP NLboolean NL_APIENTRY nlCondInit(NLcond *cond) { if(cond == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } else { #ifdef NL_WIN_THREADS NLcond cv = NULL; cv = (NLcond)malloc(sizeof(struct nl_cond_t)); if(cv == NULL) { nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } cv->events_[SIGNAL] = CreateEvent(NULL, FALSE, FALSE, NULL); cv->events_[BROADCAST] = CreateEvent(NULL, TRUE, FALSE, NULL); #else int result; NLcond cv = NULL; cv = (NLcond)malloc(sizeof(struct nl_cond_t)); if(cv == NULL) { nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } result = pthread_cond_init((pthread_cond_t *)&cv->cond, NULL); if(result != 0) { free(cv); #ifdef WINDOWS_APP SetLastError((DWORD)result); #endif nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } result = pthread_mutex_init((pthread_mutex_t *)&cv->mutex, NULL); if(result != 0) { (void)pthread_cond_destroy((pthread_cond_t *)&cv->cond); free(cv); #ifdef WINDOWS_APP SetLastError((DWORD)result); #endif nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } #endif *cond = cv; } return NL_TRUE; } NL_EXP NLboolean NL_APIENTRY nlCondWait(NLcond *cond, NLint timeout) { if(cond == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(*cond == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(timeout <= 0) { NLcond cv = *cond; #ifdef NL_WIN_THREADS DWORD result; result = WaitForMultipleObjects (2,cv->events_, FALSE, INFINITE); if(result == WAIT_FAILED) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } #else int result = 0; (void)pthread_mutex_lock((pthread_mutex_t *)&cv->mutex); result = pthread_cond_wait((pthread_cond_t *)&cv->cond, (pthread_mutex_t *)&cv->mutex); if(result != 0) { #ifdef WINDOWS_APP SetLastError((DWORD)result); #endif nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } (void)pthread_mutex_unlock((pthread_mutex_t *)&cv->mutex); #endif } else { NLcond cv = *cond; #ifdef NL_WIN_THREADS DWORD result; result = WaitForMultipleObjects (2, cv->events_, FALSE, (DWORD)timeout); if(result == WAIT_FAILED) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } else if(result == WAIT_TIMEOUT) { nlSetError(NL_TIMED_OUT); return NL_FALSE; } } #else int result = 0; struct timespec tv; NLtime t; NLlong ms; /* convert timeout to an absolute time */ (void)nlTime(&t); ms = t.mseconds + timeout; tv.tv_sec = t.seconds + (ms / 1000); tv.tv_nsec = (ms % 1000) * 1000; (void)pthread_mutex_lock((pthread_mutex_t *)&cv->mutex); result = pthread_cond_timedwait((pthread_cond_t *)&cv->cond, (pthread_mutex_t *)&cv->mutex, &tv); if(result == ETIMEDOUT) { nlSetError(NL_TIMED_OUT); (void)pthread_mutex_unlock((pthread_mutex_t *)&cv->mutex); return NL_FALSE; } else if(result != 0) { #ifdef WINDOWS_APP SetLastError((DWORD)result); #endif nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } (void)pthread_mutex_unlock((pthread_mutex_t *)&cv->mutex); } #endif return NL_TRUE; } NL_EXP NLboolean NL_APIENTRY nlCondSignal(NLcond *cond) { NLcond cv; if(cond == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(*cond == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } else { #ifdef NL_WIN_THREADS cv = *cond; if(PulseEvent(cv->events_[SIGNAL]) == 0) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } #else int result; cv = *cond; result = pthread_cond_signal((pthread_cond_t *)&cv->cond); if(result != 0) { #ifdef WINDOWS_APP SetLastError((DWORD)result); #endif nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } #endif } return NL_TRUE; } NL_EXP NLboolean NL_APIENTRY nlCondBroadcast(NLcond *cond) { if(cond == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(*cond == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } else { NLcond cv = *cond; #ifdef NL_WIN_THREADS if(PulseEvent(cv->events_[BROADCAST]) == 0) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } #else int result; result = pthread_cond_broadcast((pthread_cond_t *)&cv->cond); if(result != 0) { #ifdef WINDOWS_APP SetLastError((DWORD)result); #endif nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } #endif } return NL_TRUE; } NL_EXP NLboolean NL_APIENTRY nlCondDestroy(NLcond *cond) { if(cond == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(*cond == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } else { NLcond cv = *cond; #ifdef NL_WIN_THREADS (void)CloseHandle(cv->events_[SIGNAL]); (void)CloseHandle(cv->events_[BROADCAST]); #else (void)pthread_cond_destroy((pthread_cond_t *)&cv->cond); #endif free(*cond); *cond = NULL; } return NL_TRUE; } hawknl-1.6.8+dfsg2/src/crc.c000066400000000000000000000163371130562644400155340ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #include "../include/nl.h" static NLushort crc16tab[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 }; NL_EXP NLushort NL_APIENTRY nlGetCRC16(NLubyte *data, NLint len) { register NLushort crc = 0xffff; register NLubyte *cp = data; register NLint cnt = len; while(0 != cnt--) { crc = (NLushort)((crc<<8) ^ crc16tab[(crc>>8) ^ *cp++]); } return crc; } static NLulong crc32tab[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; NL_EXP NLulong NL_APIENTRY nlGetCRC32(NLubyte *data, NLint len) { register NLulong crc = (NLulong)0xffffffff; register NLubyte *cp = data; register NLint cnt = len; while(0 != cnt--) { crc = ((crc) >> 8) ^ crc32tab[(NLint)(*cp++) ^ ((crc) & 0x000000FF)]; } return crc; } hawknl-1.6.8+dfsg2/src/err.c000066400000000000000000000055021130562644400155450ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #include "nlinternal.h" #ifdef WINDOWS_APP /* Windows systems */ #define NL_WIN_THREADS #ifdef _MSC_VER #pragma warning (disable:4201) #pragma warning (disable:4214) #endif /* _MSC_VER */ #define WIN32_LEAN_AND_MEAN #include #ifdef _MSC_VER #pragma warning (default:4201) #pragma warning (default:4214) #endif /* _MSC_VER */ #endif #ifdef NL_WIN_THREADS /* native Windows */ static DWORD key = (DWORD)0xFFFFFFFF; #else /* POSIX systems */ #include #define KEY_NULL ((pthread_key_t)-1) static pthread_key_t key = KEY_NULL; #endif void nlSetError(NLenum err) { #ifdef NL_WIN_THREADS /* check to see if we need to initialize */ if(key == (DWORD)0xFFFFFFFF) { key = TlsAlloc(); } if(key != (DWORD)0xFFFFFFFF) { (void)TlsSetValue(key, (LPVOID)err); } #else /* check to see if we need to initialize */ if(key == KEY_NULL) { (void)pthread_key_create(&key, NULL); } if(key != KEY_NULL) { (void)pthread_setspecific(key, (void *)err); } #endif } NL_EXP NLenum NL_APIENTRY nlGetError(void) { NLenum result; #ifdef NL_WIN_THREADS /* check to see if we need to initialize */ if(key == (DWORD)0xFFFFFFFF) { key = TlsAlloc(); if(key == (DWORD)0xFFFFFFFF) return NL_TLS_ERROR; else return NL_NO_ERROR; } else { int lasterror = WSAGetLastError(); result = (NLenum)TlsGetValue(key); WSASetLastError(lasterror); return result; } #else /* check to see if we need to initialize */ if(key == KEY_NULL) { if(pthread_key_create(&key, NULL) != 0) return NL_TLS_ERROR; else return NL_NO_ERROR; } else { result = (NLenum)pthread_getspecific(key); return result; } #endif } hawknl-1.6.8+dfsg2/src/errorstr.c000066400000000000000000000275731130562644400166530ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ /* Based on code supplied by Ryan Haksi */ #if defined WIN32 || defined WIN64 || defined (_WIN32_WCE) #if !defined (_WIN32_WCE) #include #endif #include "wsock.h" #elif macintosh /* POSIX compat Mac systems ie pre OSX with GUSI2 installed */ #include #include #include #include #include #include #include #include #include #include #else /* POSIX systems */ #include #include #include #include #include #endif #include "nlinternal.h" NL_EXP const /*@observer@*/ NLchar* NL_APIENTRY nlGetSystemErrorStr(NLint err) { NLchar *lpszRetStr; switch(err) { #ifdef WINDOWS_APP case WSABASEERR: lpszRetStr=(NLchar *)TEXT("No error."); break; case WSAVERNOTSUPPORTED: lpszRetStr=(NLchar *)TEXT("Version of WinSock not supported."); break; case WSASYSNOTREADY: lpszRetStr=(NLchar *)TEXT("WinSock not present or not responding."); break; case WSANOTINITIALISED: lpszRetStr=(NLchar *)TEXT("WinSock not initialized."); break; #endif /* ELOOK is used on some Macs */ #ifdef ELOOK case ELOOK: lpszRetStr=(NLchar *)TEXT("Internal mapping for kOTLookErr, don't return to client."); break; #endif /* EPROCLIM not defined in some UNIXs */ #ifdef EPROCLIM case EPROCLIM: lpszRetStr=(NLchar *)TEXT("Too many processes."); break; #endif /* On some UNIXs, EINTR and NO_DATA have the same value */ #if (EINTR != NO_DATA) case EINTR: lpszRetStr=(NLchar *)TEXT("Interrupted function call."); break; #if defined(NO_DATA) case NO_DATA: lpszRetStr=(NLchar *)TEXT("Valid name, no data record for type."); break; #endif #else case NO_DATA: lpszRetStr=(NLchar *)TEXT("Interrupted function call or no data record for type."); break; #endif case EBADF: lpszRetStr=(NLchar *)TEXT("Bad file descriptor."); break; case EFAULT: lpszRetStr=(NLchar *)TEXT("The namelen argument is incorrect."); break; case EMFILE: lpszRetStr=(NLchar *)TEXT("Too many open files."); break; case EINVAL: lpszRetStr=(NLchar *)TEXT("App version not supported by DLL."); break; #if defined(TRY_AGAIN) case TRY_AGAIN: lpszRetStr=(NLchar *)TEXT("Non-authoritive: host not found or server failure."); break; #endif #if defined(NO_RECOVERY) case NO_RECOVERY: lpszRetStr=(NLchar *)TEXT("Non-recoverable: refused or not implemented."); break; #endif #if defined(HOST_NOT_FOUND) case HOST_NOT_FOUND: lpszRetStr=(NLchar *)TEXT("Authoritive: Host not found."); break; #endif case EACCES: lpszRetStr=(NLchar *)TEXT("Permission to access socket denied."); break; case ENETDOWN: lpszRetStr=(NLchar *)TEXT("Network subsystem failed."); break; case EAFNOSUPPORT: lpszRetStr=(NLchar *)TEXT("Address family not supported."); break; case ENOBUFS: lpszRetStr=(NLchar *)TEXT("No buffer space available."); break; case EPROTONOSUPPORT: lpszRetStr=(NLchar *)TEXT("Specified protocol not supported."); break; case EPROTOTYPE: lpszRetStr=(NLchar *)TEXT("Protocol wrong type for this socket."); break; case ESOCKTNOSUPPORT: lpszRetStr=(NLchar *)TEXT("Socket type not supported for address family."); break; case ENOTSOCK: lpszRetStr=(NLchar *)TEXT("Descriptor is not a socket."); break; case EWOULDBLOCK: lpszRetStr=(NLchar *)TEXT("Non-blocking socket would block."); break; case EADDRINUSE: lpszRetStr=(NLchar *)TEXT("Address already in use."); break; case ECONNABORTED: lpszRetStr=(NLchar *)TEXT("Connection aborted."); break; case ECONNRESET: lpszRetStr=(NLchar *)TEXT("Connection reset."); break; case ENOTCONN: lpszRetStr=(NLchar *)TEXT("Not connected."); break; case ETIMEDOUT: lpszRetStr=(NLchar *)TEXT("Connection timed out."); break; case ECONNREFUSED: lpszRetStr=(NLchar *)TEXT("Connection was refused."); break; case EHOSTDOWN: lpszRetStr=(NLchar *)TEXT("Host is down."); break; case ENETUNREACH: lpszRetStr=(NLchar *)TEXT("Network unreachable."); break; case EHOSTUNREACH: lpszRetStr=(NLchar *)TEXT("Host unreachable."); break; case EADDRNOTAVAIL: lpszRetStr=(NLchar *)TEXT("Address not available."); break; case EINPROGRESS: #ifdef WINDOWS_APP lpszRetStr=(NLchar *)TEXT("A blocking sockets call is in progress."); #else lpszRetStr=(NLchar *)TEXT("The socket is non-blocking and the connection could not be established immediately."); #endif break; case EDESTADDRREQ: lpszRetStr=(NLchar *)TEXT("Destination address is required."); break; case EISCONN: lpszRetStr=(NLchar *)TEXT("Socket is already connected."); break; case ENETRESET: lpszRetStr=(NLchar *)TEXT("Connection has been broken due to the remote host resetting."); break; case EOPNOTSUPP: lpszRetStr=(NLchar *)TEXT("Operation not supported on socket"); break; case ESHUTDOWN: lpszRetStr=(NLchar *)TEXT("Socket has been shut down."); break; case EMSGSIZE: lpszRetStr=(NLchar *)TEXT("The message was too large to fit into the specified buffer and was truncated."); break; case EALREADY: lpszRetStr=(NLchar *)TEXT("A non-blocking connect call is in progress on the specified socket."); break; case ENOPROTOOPT: lpszRetStr=(NLchar *)TEXT("Bad protocol option."); break; case EPFNOSUPPORT: lpszRetStr=(NLchar *)TEXT("Protocol family not supported."); break; case ETOOMANYREFS: lpszRetStr=(NLchar *)TEXT("Too many references; can't splice."); break; case ELOOP: lpszRetStr=(NLchar *)TEXT("Too many levels of symbolic links."); break; case ENAMETOOLONG: lpszRetStr=(NLchar *)TEXT("File name too long."); break; case ENOTEMPTY: lpszRetStr=(NLchar *)TEXT("Directory not empty."); break; #if !defined(macintosh) case EUSERS: lpszRetStr=(NLchar *)TEXT("Too many users."); break; case EDQUOT: lpszRetStr=(NLchar *)TEXT("Disc quota exceeded."); break; case ESTALE: lpszRetStr=(NLchar *)TEXT("Stale NFS file handle."); break; case EREMOTE: lpszRetStr=(NLchar *)TEXT("Too many levels of remote in path."); break; #endif default: #ifdef WINDOWS_APP { static NLchar temp[256]; /* FormatMessage is unicode compliant */ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)temp, 256, NULL); lpszRetStr = temp; } #else lpszRetStr=strerror(err); #endif break; } return (const NLchar*)lpszRetStr; } NL_EXP const /*@observer@*/ NLchar* NL_APIENTRY nlGetErrorStr(NLenum err) { NLchar *retStr; switch(err) { case NL_NO_ERROR: retStr = (NLchar *)TEXT("No HawkNL error."); break; case NL_NO_NETWORK: retStr = (NLchar *)TEXT("No network was found on init."); break; case NL_OUT_OF_MEMORY: retStr = (NLchar *)TEXT("Out of memory."); break; case NL_INVALID_ENUM: retStr = (NLchar *)TEXT("Invalid NLenum."); break; case NL_INVALID_SOCKET: retStr = (NLchar *)TEXT("Socket is not valid."); break; case NL_INVALID_PORT: retStr = (NLchar *)TEXT("Port could not be opened."); break; case NL_INVALID_TYPE: retStr = (NLchar *)TEXT("Network type is not available."); break; case NL_SYSTEM_ERROR: retStr = (NLchar *)TEXT("A system error occurred, call nlGetSystemError."); break; case NL_SOCK_DISCONNECT: retStr = (NLchar *)TEXT("Connection error: Close socket."); break; case NL_NOT_LISTEN: retStr = (NLchar *)TEXT("Socket has not been set to listen."); break; case NL_CON_REFUSED: retStr = (NLchar *)TEXT("Connection refused."); break; case NL_NO_PENDING: retStr = (NLchar *)TEXT("No pending connections to accept."); break; case NL_BAD_ADDR: retStr = (NLchar *)TEXT("The address or port are not valid."); break; case NL_MESSAGE_END: retStr = (NLchar *)TEXT("TCP message end."); break; case NL_NULL_POINTER: retStr = (NLchar *)TEXT("A NULL pointer was passed to a function."); break; case NL_INVALID_GROUP: retStr = (NLchar *)TEXT("The group is not valid."); break; case NL_OUT_OF_GROUPS: retStr = (NLchar *)TEXT("Out of groups."); break; case NL_OUT_OF_GROUP_SOCKETS: retStr = (NLchar *)TEXT("The group is full."); break; case NL_BUFFER_SIZE: retStr = (NLchar *)TEXT("The buffer is too small."); break; case NL_PACKET_SIZE: retStr = (NLchar *)TEXT("The packet is too large."); break; case NL_WRONG_TYPE: retStr = (NLchar *)TEXT("Wrong socket type."); break; case NL_CON_PENDING: retStr = (NLchar *)TEXT("A non-blocking connection is still pending."); break; case NL_SELECT_NET_ERROR: retStr = (NLchar *)TEXT("A network type is already selected."); break; case NL_PACKET_SYNC: retStr = (NLchar *)TEXT("The NL_RELIABLE_PACKET stream is out of sync."); break; case NL_TLS_ERROR: retStr = (NLchar *)TEXT("Thread local storage could not be created."); break; case NL_TIMED_OUT: retStr = (NLchar *)TEXT("The function timed out."); break; case NL_SOCKET_NOT_FOUND: retStr = (NLchar *)TEXT("The socket was not found in the group."); break; case NL_STRING_OVER_RUN: retStr = (NLchar *)TEXT("The string could cause a buffer over-run or corrupt memory."); break; case NL_MUTEX_RECURSION: retStr = (NLchar *)TEXT("The mutex was recursivly locked by a single thread."); break; case NL_MUTEX_OWNER: retStr = (NLchar *)TEXT("The mutex is not owned by the thread."); break; default: retStr = (NLchar *)TEXT("Undefined HawkNL error."); break; } return (const NLchar*)retStr; } hawknl-1.6.8+dfsg2/src/group.c000066400000000000000000000326051130562644400161150ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #include #define FD_SETSIZE 8192 #if defined WIN32 || defined WIN64 || defined (_WIN32_WCE) /* Windows systems */ #ifdef _MSC_VER #pragma warning (disable:4201) #pragma warning (disable:4214) #pragma warning (disable:4127) #endif /* _MSC_VER */ #define WIN32_LEAN_AND_MEAN #include #ifdef _MSC_VER #pragma warning (default:4201) #pragma warning (default:4214) #endif /* _MSC_VER */ #else /* Unix-style systems or macs with posix support */ #include #include #include #define INVALID_SOCKET -1 #define SOCKET int #endif #include "nlinternal.h" static NLmutex grouplock; typedef struct { NLsocket *sockets; /* the list of sockets in this group */ NLint maxsockets; /* the number of sockets allocated */ NLint numsockets; /* the number of sockets stored */ fd_set *fdset; /* for nlPollGroup */ SOCKET highest; /* for nlPollGroup */ } nl_group_t; typedef /*@only@*/ nl_group_t *pnl_group_t; static /*@only@*/ pnl_group_t *groups; static NLint nlnextgroup = 0; static NLint nlnumgroups = 0; /* Internal functions */ void nlGroupLock(void) { (void)nlMutexLock(&grouplock); } void nlGroupUnlock(void) { (void)nlMutexUnlock(&grouplock); } NLboolean nlGroupInit(void) { if(groups == NULL) { groups = (nl_group_t **)malloc(NL_MAX_GROUPS * sizeof(nl_group_t *)); } if(groups == NULL) { nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } memset(groups, 0, NL_MAX_GROUPS * sizeof(nl_group_t *)); if(nlMutexInit(&grouplock) == NL_FALSE) { /* error code is already set */ return NL_FALSE; } return NL_TRUE; } void nlGroupShutdown(void) { if(groups != NULL) { NLint i; for(i=0;ifdset == NULL) { int i; SOCKET realsock; /* create the fd_set */ pgroup->fdset = (fd_set *)malloc(sizeof(fd_set)); if(pgroup->fdset == NULL) { (void)nlMutexUnlock(&grouplock); nlSetError(NL_OUT_OF_MEMORY); return INVALID_SOCKET; } FD_ZERO(pgroup->fdset); pgroup->highest = 0; for(i=0;inumsockets;i++) { realsock = (SOCKET)nlSockets[pgroup->sockets[i]]->realsocket; FD_SET(realsock, pgroup->fdset); if(pgroup->highest < realsock + 1) { pgroup->highest = realsock + 1; } } } memcpy(fd, pgroup->fdset, sizeof(fd_set)); return pgroup->highest; } /* Group management API */ NL_EXP NLint NL_APIENTRY nlGroupCreate(void) { NLint newgroup = NL_INVALID; nl_group_t *pgroup = NULL; if(groups == NULL) { nlSetError(NL_NO_NETWORK); return NL_INVALID; } if(nlMutexLock(&grouplock) == NL_FALSE) { return NL_INVALID; } if(nlnumgroups == NL_MAX_GROUPS) { (void)nlMutexUnlock(&grouplock); nlSetError(NL_OUT_OF_GROUPS); return NL_INVALID; } /* get a group number */ if(nlnumgroups == nlnextgroup) { /* do not increment nlnextgroup here, wait in case of malloc failure */ newgroup = nlnextgroup + 1; } else /* there is an open group slot somewhere below nlnextgroup */ { NLint i; for(i=0;isockets = (NLsocket *)malloc(NL_MIN_SOCKETS * sizeof(NLsocket *)); if(pgroup->sockets == NULL) { free(pgroup); (void)nlMutexUnlock(&grouplock); nlSetError(NL_OUT_OF_MEMORY); return NL_INVALID; } pgroup->maxsockets = NL_MIN_SOCKETS; /* fill with -1, since 0 is a valid socket number */ for(i=0;imaxsockets;i++) { pgroup->sockets[i] = -1; } pgroup->numsockets = 0; pgroup->fdset = NULL; pgroup->highest = 0; groups[newgroup] = pgroup; } nlnumgroups++; if(nlnumgroups == newgroup) { nlnextgroup = nlnumgroups; } if(nlMutexUnlock(&grouplock) == NL_FALSE) { return NL_INVALID; } /* adjust the group number */ return (newgroup + NL_FIRST_GROUP); } NL_EXP NLboolean NL_APIENTRY nlGroupDestroy(NLint group) { NLint realgroup = group - NL_FIRST_GROUP; if(groups == NULL) { nlSetError(NL_NO_NETWORK); return NL_FALSE; } if(realgroup < 0) { nlSetError(NL_INVALID_GROUP); return NL_FALSE; } if(nlMutexLock(&grouplock) == NL_FALSE) { return NL_FALSE; } if(groups[realgroup] != NULL) { if(groups[realgroup]->fdset != NULL) { free(groups[realgroup]->fdset); } if(groups[realgroup]->sockets != NULL) { free(groups[realgroup]->sockets); } free(groups[realgroup]); groups[realgroup] = NULL; nlnumgroups--; } if(nlMutexUnlock(&grouplock) == NL_FALSE) { return NL_FALSE; } return NL_TRUE; } NL_EXP NLboolean NL_APIENTRY nlGroupAddSocket(NLint group, NLsocket socket) { NLint realgroup = group - NL_FIRST_GROUP; NLint i; nl_group_t *pgroup = NULL; if(groups == NULL) { nlSetError(NL_NO_NETWORK); return NL_FALSE; } if(realgroup < 0) { nlSetError(NL_INVALID_GROUP); return NL_FALSE; } /* add the socket to the group */ if(nlMutexLock(&grouplock) == NL_FALSE) { return NL_FALSE; } pgroup = groups[realgroup]; /* allocate more sockets as needed */ if(pgroup->numsockets == pgroup->maxsockets) { NLint oldmax = pgroup->maxsockets; NLint j; NLsocket *newsockets; if(oldmax == NL_MAX_GROUP_SOCKETS) { (void)nlMutexUnlock(&grouplock); nlSetError(NL_OUT_OF_GROUP_SOCKETS); return NL_FALSE; } pgroup->maxsockets *= 2; if(pgroup->maxsockets > NL_MAX_GROUP_SOCKETS) { pgroup->maxsockets = NL_MAX_GROUP_SOCKETS; } if((newsockets = (NLsocket *)realloc(pgroup->sockets, pgroup->maxsockets * sizeof(NLsocket *))) == NULL) { pgroup->maxsockets = oldmax; (void)nlMutexUnlock(&grouplock); nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } /* set the new sockets to -1 */ for(j=oldmax;jmaxsockets;j++) { newsockets[j] = -1; } pgroup->sockets = newsockets; } for(i=0;imaxsockets;i++) { if(pgroup->sockets[i] == -1) { pgroup->sockets[i] = socket; if(pgroup->fdset != NULL) { SOCKET realsock; /* make sure the socket is valid */ if(nlIsValidSocket(socket) == NL_FALSE) { (void)nlMutexUnlock(&grouplock); nlSetError(NL_INVALID_SOCKET); return NL_FALSE; } realsock = (SOCKET)nlSockets[socket]->realsocket; FD_SET(realsock, pgroup->fdset); if(pgroup->highest < realsock + 1) { pgroup->highest = realsock + 1; } } break; } } if(i == pgroup->maxsockets) { (void)nlMutexUnlock(&grouplock); nlSetError(NL_OUT_OF_GROUP_SOCKETS); return NL_FALSE; } pgroup->numsockets++; if(nlMutexUnlock(&grouplock) == NL_FALSE) { return NL_FALSE; } return NL_TRUE; } NLboolean nlGroupGetSocketsINT(NLint group, NLsocket *socket, NLint *number) { NLint realgroup = group - NL_FIRST_GROUP; NLint len, i; nl_group_t *pgroup = NULL; if(socket == NULL || number == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(groups == NULL) { nlSetError(NL_NO_NETWORK); return NL_FALSE; } if(realgroup < 0) { nlSetError(NL_INVALID_GROUP); *number = 0; return NL_FALSE; } pgroup = groups[realgroup]; len = *number; if(len > pgroup->numsockets) { len = pgroup->numsockets; } for(i=0;isockets[i]; } *number = len; return NL_TRUE; } NL_EXP NLboolean NL_APIENTRY nlGroupGetSockets(NLint group, NLsocket *socket, NLint *number) { NLboolean result; if(nlMutexLock(&grouplock) == NL_FALSE) { return NL_FALSE; } result = nlGroupGetSocketsINT(group, socket, number); if(nlMutexUnlock(&grouplock) == NL_FALSE) { return NL_FALSE; } return result; } NL_EXP NLboolean NL_APIENTRY nlGroupDeleteSocket(NLint group, NLsocket socket) { NLint realgroup = group - NL_FIRST_GROUP; NLint i; nl_group_t *pgroup = NULL; if(groups == NULL) { nlSetError(NL_NO_NETWORK); return NL_FALSE; } if(realgroup < 0) { nlSetError(NL_INVALID_GROUP); return NL_FALSE; } /* delete the socket from the group */ if(nlMutexLock(&grouplock) == NL_FALSE) { return NL_FALSE; } pgroup = groups[realgroup]; for(i=0;inumsockets;i++) { /* check for match */ if(pgroup->sockets[i] == socket) break; } if(i == pgroup->numsockets) { /* did not find the socket */ (void)nlMutexUnlock(&grouplock); nlSetError(NL_SOCKET_NOT_FOUND); return NL_FALSE; } /* now pgroup[i] points to the socket to delete */ /* shift all other sockets down to close the gap */ i++; for(;imaxsockets;i++) { pgroup->sockets[i - 1] = pgroup->sockets[i]; /* check for end of list */ if(pgroup->sockets[i] == -1) break; } pgroup->numsockets--; if(pgroup->fdset != NULL) { /* make sure the socket is valid */ if(nlIsValidSocket(socket) == NL_TRUE) { SOCKET realsock; realsock = (SOCKET)nlSockets[socket]->realsocket; FD_CLR(realsock, pgroup->fdset); } else { /* the socket was already closed */ /* free the fdset so that it can be rebuilt */ free(pgroup->fdset); pgroup->fdset = NULL; (void)nlMutexUnlock(&grouplock); nlSetError(NL_INVALID_SOCKET); return NL_FALSE; } } if(nlMutexUnlock(&grouplock) == NL_FALSE) { return NL_FALSE; } return NL_TRUE; } hawknl-1.6.8+dfsg2/src/hawkNL.exp000066400000000000000000000040721130562644400165140ustar00rootroot00000000000000HawkNL.dll _nlAcceptConnection@4 _nlAcceptConnection@4 _nlAddrCompare@8 _nlAddrCompare@8 _nlAddrToString@8 _nlAddrToString@8 _nlClear@4 _nlClear@4 _nlClearSocketStat@8 _nlClearSocketStat@8 _nlClose@4 _nlClose@4 _nlCondBroadcast@4 _nlCondBroadcast@4 _nlCondDestroy@4 _nlCondDestroy@4 _nlCondInit@4 _nlCondInit@4 _nlCondSignal@4 _nlCondSignal@4 _nlCondWait@8 _nlCondWait@8 _nlConnect@8 _nlConnect@8 _nlDisable@4 _nlDisable@4 _nlEnable@4 _nlEnable@4 _nlGetAddrFromName@8 _nlGetAddrFromName@8 _nlGetAddrFromNameAsync@8 _nlGetAddrFromNameAsync@8 _nlGetAllLocalAddr@4 _nlGetAllLocalAddr@4 _nlGetBoolean@4 _nlGetBoolean@4 _nlGetCRC16@8 _nlGetCRC16@8 _nlGetCRC32@8 _nlGetCRC32@8 _nlGetError@0 _nlGetError@0 _nlGetErrorStr@4 _nlGetErrorStr@4 _nlGetInteger@4 _nlGetInteger@4 _nlGetLocalAddr@8 _nlGetLocalAddr@8 _nlGetNameFromAddr@8 _nlGetNameFromAddr@8 _nlGetNameFromAddrAsync@8 _nlGetNameFromAddrAsync@8 _nlGetPortFromAddr@4 _nlGetPortFromAddr@4 _nlGetRemoteAddr@8 _nlGetRemoteAddr@8 _nlGetSocketStat@8 _nlGetSocketStat@8 _nlGetString@4 _nlGetString@4 _nlGetSystemError@0 _nlGetSystemError@0 _nlGetSystemErrorStr@4 _nlGetSystemErrorStr@4 _nlGroupAddSocket@8 _nlGroupAddSocket@8 _nlGroupCreate@0 _nlGroupCreate@0 _nlGroupDeleteSocket@8 _nlGroupDeleteSocket@8 _nlGroupDestroy@4 _nlGroupDestroy@4 _nlGroupGetSockets@12 _nlGroupGetSockets@12 _nlHint@8 _nlHint@8 _nlInit@0 _nlInit@0 _nlListen@4 _nlListen@4 _nlMutexDestroy@4 _nlMutexDestroy@4 _nlMutexInit@4 _nlMutexInit@4 _nlMutexLock@4 _nlMutexLock@4 _nlMutexUnlock@4 _nlMutexUnlock@4 _nlOpen@8 _nlOpen@8 _nlPollGroup@16 _nlPollGroup@16 _nlRead@12 _nlRead@12 _nlSelectNetwork@4 _nlSelectNetwork@4 _nlSetAddrPort@8 _nlSetAddrPort@8 _nlSetLocalAddr@4 _nlSetLocalAddr@4 _nlSetRemoteAddr@8 _nlSetRemoteAddr@8 _nlShutdown@0 _nlShutdown@0 _nlStringToAddr@8 _nlStringToAddr@8 _nlSwapd@8 _nlSwapd@8 _nlSwapf@4 _nlSwapf@4 _nlSwapl@4 _nlSwapl@4 _nlSwaps@4 _nlSwaps@4 _nlThreadCreate@12 _nlThreadCreate@12 _nlThreadJoin@8 _nlThreadJoin@8 _nlThreadYield@0 _nlThreadYield@0 _nlTime@4 _nlTime@4 _nlWrite@12 _nlWrite@12 hawknl-1.6.8+dfsg2/src/hawknl-lcc.def000066400000000000000000000016451130562644400173200ustar00rootroot00000000000000LIBRARY HawkNL EXPORTS nlAcceptConnection nlAddrCompare nlAddrToString nlClear nlClearSocketStat nlClose nlCondBroadcast nlCondDestroy nlCondInit nlCondSignal nlCondWait nlConnect nlDisable nlEnable nlGetAddrFromName nlGetAddrFromNameAsync nlGetAllLocalAddr nlGetBoolean nlGetCRC16 nlGetCRC32 nlGetError nlGetErrorStr nlGetInteger nlGetLocalAddr nlGetNameFromAddr nlGetNameFromAddrAsync nlGetPortFromAddr nlGetRemoteAddr nlGetSocketStat nlGetString nlGetSystemError nlGetSystemErrorStr nlGroupAddSocket nlGroupCreate nlGroupDeleteSocket nlGroupDestroy nlGroupGetSockets nlHint nlInit nlListen nlMutexDestroy nlMutexInit nlMutexLock nlMutexUnlock nlOpen nlPollGroup nlRead nlSelectNetwork nlSetAddrPort nlSetLocalAddr nlSetRemoteAddr nlShutdown nlStringToAddr nlSwapd nlSwapf nlSwapl nlSwaps nlThreadCreate nlThreadJoin nlThreadSleep nlThreadYield nlTime nlWrite hawknl-1.6.8+dfsg2/src/hawknl.def000066400000000000000000000051431130562644400165560ustar00rootroot00000000000000LIBRARY HawkNL EXPORTS nlAcceptConnection = _nlAcceptConnection@4 nlAddrCompare = _nlAddrCompare@8 nlAddrToString = _nlAddrToString@8 nlClear = _nlClear@4 nlClearSocketStat = _nlClearSocketStat@8 nlClose = _nlClose@4 nlCondBroadcast = _nlCondBroadcast@4 nlCondDestroy = _nlCondDestroy@4 nlCondInit = _nlCondInit@4 nlCondSignal = _nlCondSignal@4 nlCondWait = _nlCondWait@8 nlConnect = _nlConnect@8 nlDisable = _nlDisable@4 nlEnable = _nlEnable@4 nlGetAddrFromName = _nlGetAddrFromName@8 nlGetAddrFromNameAsync = _nlGetAddrFromNameAsync@8 nlGetAllLocalAddr = _nlGetAllLocalAddr@4 nlGetBoolean = _nlGetBoolean@4 nlGetCRC16 = _nlGetCRC16@8 nlGetCRC32 = _nlGetCRC32@8 nlGetError = _nlGetError@0 nlGetErrorStr = _nlGetErrorStr@4 nlGetInteger = _nlGetInteger@4 nlGetLocalAddr = _nlGetLocalAddr@8 nlGetNameFromAddr = _nlGetNameFromAddr@8 nlGetNameFromAddrAsync = _nlGetNameFromAddrAsync@8 nlGetPortFromAddr = _nlGetPortFromAddr@4 nlGetRemoteAddr = _nlGetRemoteAddr@8 nlGetSocketStat = _nlGetSocketStat@8 nlGetString = _nlGetString@4 nlGetSystemError = _nlGetSystemError@0 nlGetSystemErrorStr = _nlGetSystemErrorStr@4 nlGroupAddSocket = _nlGroupAddSocket@8 nlGroupCreate = _nlGroupCreate@0 nlGroupDeleteSocket = _nlGroupDeleteSocket@8 nlGroupDestroy = _nlGroupDestroy@4 nlGroupGetSockets = _nlGroupGetSockets@12 nlHint = _nlHint@8 nlInit = _nlInit@0 nlListen = _nlListen@4 nlMutexDestroy = _nlMutexDestroy@4 nlMutexInit = _nlMutexInit@4 nlMutexLock = _nlMutexLock@4 nlMutexUnlock = _nlMutexUnlock@4 nlOpen = _nlOpen@8 nlPollGroup = _nlPollGroup@20 nlRead = _nlRead@12 nlSelectNetwork = _nlSelectNetwork@4 nlSetAddrPort = _nlSetAddrPort@8 nlSetLocalAddr = _nlSetLocalAddr@4 nlSetRemoteAddr = _nlSetRemoteAddr@8 nlShutdown = _nlShutdown@0 nlStringToAddr = _nlStringToAddr@8 nlSwapd = _nlSwapd@8 nlSwapf = _nlSwapf@4 nlSwapl = _nlSwapl@4 nlSwaps = _nlSwaps@4 nlThreadCreate = _nlThreadCreate@12 nlThreadJoin = _nlThreadJoin@8 nlThreadYield = _nlThreadYield@0 nlTime = _nlTime@4 nlWrite = _nlWrite@12 hawknl-1.6.8+dfsg2/src/ipx.c000066400000000000000000001033731130562644400155620ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #include #include #include #include #define FD_SETSIZE 8192 #if defined WIN32 || defined WIN64 #include "wsock.h" #ifndef sleep #define sleep(x) Sleep((DWORD)(1000 * (x))) #endif #ifdef _MSC_VER #pragma warning (disable:4100) /* disable "unreferenced formal parameter" */ #endif #else /* Unix-style systems */ #include #include #include #include #include #include #include #define readsocket read #define writesocket write #define closesocket close #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #define SOCKET int /* define INADDR_NONE if not already */ #ifndef INADDR_NONE #define INADDR_NONE ((unsigned long) -1) #define sockerrno errno #endif #endif #include "nlinternal.h" #ifdef NL_INCLUDE_IPX #include "ipx.h" typedef struct { NLaddress /*@temp@*/*address; NLchar /*@temp@*/*name; NLsocket socket; } NLaddress_ex_t; extern SOCKET nlGroupGetFdset(NLint group, /*@out@*/ fd_set *fd); #define MAXHOSTNAMELEN 256 #define NL_CONNECT_STRING "HawkNL request connection." #define NL_REPLY_STRING "HawkNL connection OK." static NLaddress ipx_ouraddress; static NLaddress ipx_ouraddress_copy; static NLint ipxport = 0; static volatile int backlog = SOMAXCONN; static volatile NLboolean reuseaddress = NL_FALSE; #ifdef WINDOWS_APP static NLmutex ipxportlock; static volatile NLushort ipxnextport = 1024; static NLushort ipx_getNextPort(void) { NLlong temp; (void)nlMutexLock(&ipxportlock); temp = (NLlong)ipxnextport; if(++temp > 65535) { /* skip the well known ports */ temp = 1024; } ipxnextport = (NLushort)temp; (void)nlMutexUnlock(&ipxportlock); return ipxnextport; } static NLint ipx_bind(SOCKET socket, const struct sockaddr *a, int len) { struct sockaddr_ipx *addr = (struct sockaddr_ipx *)a; int ntries = 500; /* this is to prevent an infinite loop */ NLboolean found = NL_FALSE; /* check to see if the port is already specified */ if(addr->sa_socket != 0) { /* do the normal bind */ return bind(socket, a, len); } /* let's find our own port number */ while(ntries-- > 0) { addr->sa_socket = htons(ipx_getNextPort()); if(bind(socket, (struct sockaddr *)addr, len) != SOCKET_ERROR) { found = NL_TRUE; break; } } if(found == NL_TRUE) { return 0; } /* could not find a port, restore the port number back to 0 */ addr->sa_socket = 0; /* return error */ return SOCKET_ERROR; } #else #define sock_bind bind #endif /* WINDOWS_APP */ /* handle some common connection errors so the app knows when a connection has been dropped */ static NLint ipx_Error(void) { int err = sockerrno; switch (err) { #ifdef WINDOWS_APP case WSABASEERR: return 0; #endif case EWOULDBLOCK: return 0; case ENETRESET: case EHOSTUNREACH: case ECONNABORTED: case ECONNRESET: case ENETUNREACH: case ETIMEDOUT: nlSetError(NL_SOCK_DISCONNECT); break; default: nlSetError(NL_SYSTEM_ERROR); break; } return NL_INVALID; } static void ipx_SetReuseAddr(SOCKET socket) { int i = 1; if(reuseaddress == NL_FALSE) { return; } if(setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (char *)&i, (int)sizeof(i)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); } } static NLboolean ipx_SetNonBlocking(SOCKET socket) { unsigned long i = 1; if(ioctl(socket, FIONBIO, &i) == SOCKET_ERROR) { return NL_FALSE; } return NL_TRUE; } static NLboolean ipx_SetBlocking(SOCKET socket) { unsigned long i = 0; if(ioctl(socket, FIONBIO, &i) == SOCKET_ERROR) { return NL_FALSE; } return NL_TRUE; } static NLboolean ipx_SetBroadcast(SOCKET socket) { int i = 1; if(setsockopt(socket, SOL_SOCKET, SO_BROADCAST, (char *)&i, (int)sizeof(i)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } return NL_TRUE; } /* is there a better way to get our address? */ static NLboolean ipx_GetHostAddress(NLaddress *address) { NLint addrlen = (NLint)sizeof(NLaddress); SOCKET sock; sock = socket(PF_IPX, SOCK_DGRAM, NSPROTO_IPX); if(sock == INVALID_SOCKET) { nlSetError(NL_NO_NETWORK); return NL_FALSE; } ((struct sockaddr_ipx *)address)->sa_family = AF_IPX; memset(((struct sockaddr_ipx *)address)->sa_netnum, 0, 4); memset(((struct sockaddr_ipx *)address)->sa_nodenum, 0, 6); ((struct sockaddr_ipx *)address)->sa_socket = 0; if(ipx_bind(sock, (struct sockaddr *)address, (int)sizeof(NLaddress)) == SOCKET_ERROR) { nlSetError(NL_NO_NETWORK); (void)closesocket(sock); return NL_FALSE; } if(getsockname(sock, (struct sockaddr *)address, &addrlen) != 0) { nlSetError(NL_NO_NETWORK); (void)closesocket(sock); return NL_FALSE; } (void)closesocket(sock); return NL_TRUE; } static NLushort ipx_GetPort(SOCKET socket) { struct sockaddr_ipx addr; int len; len = (int)sizeof(struct sockaddr_ipx); if(getsockname(socket, (struct sockaddr *)&addr, &len) != 0) { return 0; } return ntohs(addr.sa_socket); } NLboolean ipx_Init(void) { #ifdef WINDOWS_APP WSADATA libmibWSAdata; if(WSAStartup(0x101,&libmibWSAdata) != 0) { return NL_FALSE; } #endif if(ipx_GetHostAddress(&ipx_ouraddress) == NL_FALSE) { ipx_Shutdown(); return NL_FALSE; } return NL_TRUE; } void ipx_Shutdown(void) { #ifdef WINDOWS_APP (void)WSACleanup(); #endif } NLboolean ipx_Listen(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; if(sock->reliable == NL_TRUE) { if(listen((SOCKET)sock->realsocket, backlog) != 0) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } } sock->listen = NL_TRUE; return NL_TRUE; } static SOCKET ipx_AcceptIPX(NLsocket nlsocket, struct sockaddr_ipx /*@out@*/ *newaddr) { nl_socket_t *sock = nlSockets[nlsocket]; struct sockaddr_ipx ouraddr; SOCKET newsocket; NLushort localport; NLbyte buffer[NL_MAX_STRING_LENGTH]; socklen_t len = (socklen_t)sizeof(struct sockaddr_ipx); NLint slen = (NLint)sizeof(NL_CONNECT_STRING); NLbyte reply = (NLbyte)0x00; NLint count = 0; /* Get the packet and remote host address */ if(recvfrom((SOCKET)sock->realsocket, buffer, (int)sizeof(buffer), 0, (struct sockaddr *)newaddr, &len) < (int)sizeof(NL_CONNECT_STRING)) { nlSetError(NL_NO_PENDING); return INVALID_SOCKET; } /* Let's check for the connection string */ buffer[slen - 1] = (NLbyte)0; /* null terminate for peace of mind */ if(strcmp(buffer, NL_CONNECT_STRING) != 0) { nlSetError(NL_NO_PENDING); return INVALID_SOCKET; } /* open up a new socket on this end */ newsocket = socket(PF_IPX, SOCK_DGRAM, NSPROTO_IPX); if(newsocket == INVALID_SOCKET) { nlSetError(NL_SYSTEM_ERROR); (void)closesocket(newsocket); return INVALID_SOCKET; } ouraddr.sa_family = AF_IPX; memset(&ouraddr.sa_netnum, 0, 4); memset(&ouraddr.sa_nodenum, 0, 6); ouraddr.sa_socket = 0; if(ipx_bind(newsocket, (struct sockaddr *)&ouraddr, len) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); (void)closesocket(newsocket); return INVALID_SOCKET; } /* get the new port */ localport = ipx_GetPort(newsocket); /* create the return message */ writeShort(buffer, count, localport); writeString(buffer, count, (NLchar *)TEXT(NL_REPLY_STRING)); /* send back the reply with our new port */ if(sendto((SOCKET)sock->realsocket, buffer, count, 0, (struct sockaddr *)newaddr, (int)sizeof(struct sockaddr_ipx)) < count) { nlSetError(NL_SYSTEM_ERROR); (void)closesocket(newsocket); return INVALID_SOCKET; } /* send back a 0 length packet from our new port, needed for firewalls */ if(sendto(newsocket, &reply, 0, 0, (struct sockaddr *)newaddr, (int)sizeof(struct sockaddr_ipx)) < 0) { nlSetError(NL_SYSTEM_ERROR); (void)closesocket(newsocket); return INVALID_SOCKET; } /* connect the socket */ if(connect(newsocket, (struct sockaddr *)newaddr, (int)sizeof(struct sockaddr_ipx)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); (void)closesocket(newsocket); return INVALID_SOCKET; } return newsocket; } NLsocket ipx_AcceptConnection(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; nl_socket_t *newsock; NLsocket newsocket; SOCKET realsocket; struct sockaddr_ipx newaddr; if(sock->listen == NL_FALSE) { nlSetError(NL_NOT_LISTEN); return NL_INVALID; } if(sock->type == NL_RELIABLE || sock->type == NL_RELIABLE_PACKETS) { NLint len = (NLint)sizeof(newaddr); realsocket = accept((SOCKET)sock->realsocket, (struct sockaddr *)&newaddr, &len); if(realsocket == INVALID_SOCKET) { if(sockerrno == EWOULDBLOCK || errno == EAGAIN)/* yes, we need to use errno here */ { nlSetError(NL_NO_PENDING); } else { nlSetError(NL_SYSTEM_ERROR); } return NL_INVALID; } } else if(sock->type == NL_UNRELIABLE) { realsocket = ipx_AcceptIPX(socket, &newaddr); if(realsocket == INVALID_SOCKET) { /* error is already set in sock_AcceptUDP */ return NL_INVALID; } } else { nlSetError(NL_WRONG_TYPE); return NL_INVALID; } newsocket = nlGetNewSocket(); if(newsocket == NL_INVALID) { return NL_INVALID; } if(nlLockSocket(newsocket, NL_BOTH) == NL_FALSE) { return NL_INVALID; } newsock = nlSockets[newsocket]; /* update the remote address */ memcpy((char *)&newsock->addressin, (char *)&newaddr, sizeof(struct sockaddr_ipx)); newsock->realsocket = (NLint)realsocket; newsock->localport = ipx_GetPort(realsocket); newsock->remoteport = ipx_GetPortFromAddr((NLaddress *)&newsock->addressin); if(newsock->blocking == NL_FALSE) { if(ipx_SetNonBlocking((SOCKET)newsock->realsocket) == NL_FALSE) { nlSetError(NL_SYSTEM_ERROR); ipx_Close(newsocket); return NL_INVALID; } } newsock->reliable = sock->reliable; return newsocket; } NLsocket ipx_Open(NLushort port, NLenum type) { nl_socket_t *newsock; NLsocket newsocket; SOCKET realsocket; switch (type) { case NL_RELIABLE: case NL_RELIABLE_PACKETS: realsocket = socket(PF_IPX, SOCK_SEQPACKET, NSPROTO_SPXII); break; case NL_UNRELIABLE: case NL_BROADCAST: realsocket = socket(PF_IPX, SOCK_DGRAM, NSPROTO_IPX); break; default: nlSetError(NL_INVALID_ENUM); return NL_INVALID; } if(realsocket == INVALID_SOCKET) { nlSetError(NL_SYSTEM_ERROR); return NL_INVALID; } newsocket = nlGetNewSocket(); if(newsocket == NL_INVALID) { return NL_INVALID; } if(nlLockSocket(newsocket, NL_BOTH) == NL_FALSE) { return NL_INVALID; } newsock = nlSockets[newsocket]; newsock->realsocket = (NLint)realsocket; if(type == NL_RELIABLE || type == NL_RELIABLE_PACKETS) { newsock->reliable = NL_TRUE; } else { newsock->reliable = NL_FALSE; } ipx_SetReuseAddr(realsocket); if(newsock->blocking == NL_FALSE) { if(ipx_SetNonBlocking(realsocket) == NL_FALSE) { nlSetError(NL_SYSTEM_ERROR); nlUnlockSocket(newsocket, NL_BOTH); ipx_Close(newsocket); return NL_INVALID; } } ((struct sockaddr_ipx *)&newsock->addressin)->sa_family = AF_IPX; memset(((struct sockaddr_ipx *)&newsock->addressin)->sa_netnum, 0, 4); memset(((struct sockaddr_ipx *)&newsock->addressin)->sa_nodenum, 0, 6); ((struct sockaddr_ipx *)&newsock->addressin)->sa_socket = htons((unsigned short)port); if(ipx_bind((SOCKET)realsocket, (struct sockaddr *)&newsock->addressin, (int)sizeof(newsock->addressin)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); nlUnlockSocket(newsocket, NL_BOTH); ipx_Close(newsocket); return NL_INVALID; } if(type == NL_BROADCAST) { ((struct sockaddr_ipx *)&newsock->addressout)->sa_family = AF_IPX; memset(((struct sockaddr_ipx *)&newsock->addressout)->sa_netnum, 0, 4); memset(((struct sockaddr_ipx *)&newsock->addressout)->sa_nodenum, 0xff, 6); ((struct sockaddr_ipx *)&newsock->addressout)->sa_socket = htons((unsigned short)port); if(ipx_SetBroadcast(realsocket) == NL_FALSE) { nlSetError(NL_SYSTEM_ERROR); nlUnlockSocket(newsocket, NL_BOTH); return NL_INVALID; } } newsock->localport = ipx_GetPort(realsocket); newsock->type = type; nlUnlockSocket(newsocket, NL_BOTH); return newsocket; } static NLboolean ipx_ConnectIPX(NLsocket socket, const NLaddress *address) { nl_socket_t *sock = nlSockets[socket]; time_t begin, t; if(sendto((SOCKET)sock->realsocket, (char *)NL_CONNECT_STRING, (NLint)sizeof(NL_CONNECT_STRING), 0, (struct sockaddr *)address, (int)sizeof(struct sockaddr_ipx)) == SOCKET_ERROR) { if(sock->blocking == NL_TRUE) { nlSetError(NL_SYSTEM_ERROR); } else { sock->conerror = NL_TRUE; } return NL_FALSE; } (void)time(&begin); /* try for six seconds */ while((time(&t) - begin) < 6) { NLbyte buffer[NL_MAX_STRING_LENGTH]; NLbyte *pbuffer = buffer; NLushort newport; NLint slen = (NLint)(sizeof(NL_REPLY_STRING) + sizeof(newport)); NLint received; NLbyte reply = (NLbyte)0; socklen_t len = (socklen_t)sizeof(struct sockaddr_ipx); received = recvfrom((SOCKET)sock->realsocket, (char *)buffer, (int)sizeof(buffer), 0, (struct sockaddr *)&sock->addressin, &len); if(received == SOCKET_ERROR) { if(sockerrno != EWOULDBLOCK) { if(sock->blocking == NL_TRUE) { nlSetError(NL_CON_REFUSED); } else { sock->conerror = NL_TRUE; } return NL_FALSE; } } if(received >= slen) { NLint count = 0; /* retrieve the port number */ readShort(buffer, count, newport); ((struct sockaddr_ipx *)&sock->addressin)->sa_socket = htons(newport); /* Lets check for the reply string */ pbuffer[slen - 1] = (NLbyte)0; /* null terminate for peace of mind */ pbuffer += sizeof(newport); if(strcmp(pbuffer, NL_REPLY_STRING) == 0) { if(connect((SOCKET)sock->realsocket, (struct sockaddr *)&sock->addressin, (int)sizeof(struct sockaddr_ipx)) == SOCKET_ERROR) { if(sock->blocking == NL_TRUE) { nlSetError(NL_SYSTEM_ERROR); } else { sock->conerror = NL_TRUE; } return NL_FALSE; } /* send back a 0 length packet to the new port, needed for firewalls */ if(send((SOCKET)sock->realsocket, &reply, 0, 0) == SOCKET_ERROR) { if(sock->blocking == NL_TRUE) { nlSetError(NL_SYSTEM_ERROR); } else { sock->conerror = NL_TRUE; } return NL_FALSE; } /* success! */ sock->localport = ipx_GetPort((SOCKET)sock->realsocket); sock->remoteport = ipx_GetPortFromAddr((NLaddress *)&sock->addressin); sock->connected = NL_TRUE; sock->connecting = NL_FALSE; return NL_TRUE; } } nlThreadSleep(NL_CONNECT_SLEEP); } if(sock->blocking == NL_TRUE) { nlSetError(NL_CON_REFUSED); } else { sock->conerror = NL_TRUE; } return NL_FALSE; } static void *ipx_ConnectIPXAsynchInt(void /*@owned@*/*addr) { NLaddress_ex_t *address = (NLaddress_ex_t *)addr; (void)ipx_ConnectIPX(address->socket, address->address); free(addr); return NULL; } static NLboolean ipx_ConnectIPXAsynch(NLsocket socket, const NLaddress *address) { NLaddress_ex_t /*@dependent@*/*addr; nl_socket_t *sock = nlSockets[socket]; addr = (NLaddress_ex_t *)malloc(sizeof(NLaddress_ex_t)); if(addr == NULL) { nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } addr->address = (NLaddress *)address; addr->socket = socket; sock->connecting = NL_TRUE; sock->conerror = NL_FALSE; if(nlThreadCreate(ipx_ConnectIPXAsynchInt, (void *)addr, NL_FALSE) == (NLthreadID)NL_INVALID) { return NL_FALSE; } return NL_TRUE; } NLboolean ipx_Connect(NLsocket socket, const NLaddress *address) { nl_socket_t *sock = nlSockets[socket]; memcpy((char *)&sock->addressin, (char *)address, sizeof(struct sockaddr_ipx)); if((sock->type == NL_RELIABLE) || (sock->type == NL_RELIABLE_PACKETS)) { if(sock->blocking == NL_FALSE) { (void)ipx_SetBlocking((SOCKET)sock->realsocket); } if(connect((SOCKET)sock->realsocket, (struct sockaddr *)&sock->addressin, (int)sizeof(struct sockaddr_ipx)) != 0) { if(sock->blocking == NL_FALSE && (sockerrno == EWOULDBLOCK || sockerrno == EINPROGRESS)) { sock->connecting = NL_TRUE; } else { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } } if(sock->blocking == NL_FALSE) { (void)ipx_SetNonBlocking((SOCKET)sock->realsocket); } sock->localport = ipx_GetPort((SOCKET)sock->realsocket); sock->remoteport = ipx_GetPortFromAddr((NLaddress *)&sock->addressin); sock->connected = NL_TRUE; } else if(sock->type == NL_UNRELIABLE) { if(sock->blocking == NL_TRUE) { return ipx_ConnectIPX(socket, &sock->addressin); } else { return ipx_ConnectIPXAsynch(socket, &sock->addressin); } } else { nlSetError(NL_WRONG_TYPE); } return NL_TRUE; } void ipx_Close(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; if((sock->type == NL_RELIABLE_PACKETS || sock->type == NL_RELIABLE) && sock->listen == NL_FALSE) { struct linger l = {1, 10}; (void)setsockopt((SOCKET)sock->realsocket, SOL_SOCKET, SO_LINGER, (const char *)&l, (int)sizeof(l)); } (void)closesocket((SOCKET)sock->realsocket); } NLint ipx_Read(NLsocket socket, NLvoid *buffer, NLint nbytes) { nl_socket_t *sock = nlSockets[socket]; NLint count; if(sock->type == NL_RELIABLE || sock->type == NL_RELIABLE_PACKETS) { /* check for a non-blocking connection pending */ if(sock->connecting == NL_TRUE) { fd_set fdset; struct timeval t = {0,0}; FD_ZERO(&fdset); FD_SET((SOCKET)sock->realsocket, &fdset); if(select(sock->realsocket + 1, NULL, &fdset, NULL, &t) == 1) { /* the connect has completed */ sock->connected = NL_TRUE; sock->connecting = NL_FALSE; } else { /* check for a failed connect */ FD_ZERO(&fdset); FD_SET((SOCKET)sock->realsocket, &fdset); if(select(sock->realsocket + 1, NULL, NULL, &fdset, &t) == 1) { nlSetError(NL_CON_REFUSED); } else { nlSetError(NL_CON_PENDING); } return NL_INVALID; } } count = recv((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0); } else { /* check for a non-blocking connection pending */ if(sock->connecting == NL_TRUE) { nlSetError(NL_CON_PENDING); return NL_INVALID; } /* check for a connection error */ if(sock->conerror == NL_TRUE) { nlSetError(NL_CON_REFUSED); return NL_INVALID; } if(sock->connected == NL_TRUE) { count = recv((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0); } else { socklen_t len = (socklen_t)sizeof(struct sockaddr_ipx); count = recvfrom((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0, (struct sockaddr *)&sock->addressin, &len); } } if(count == SOCKET_ERROR) { return ipx_Error(); } return count; } NLint ipx_Write(NLsocket socket, const NLvoid *buffer, NLint nbytes) { nl_socket_t *sock = nlSockets[socket]; NLint count; if(sock->type == NL_RELIABLE || sock->type == NL_RELIABLE_PACKETS) { if(sock->connecting == NL_TRUE) { fd_set fdset; struct timeval t = {0,0}; FD_ZERO(&fdset); FD_SET((SOCKET)(sock->realsocket), &fdset); if(select(sock->realsocket + 1, NULL, &fdset, NULL, &t) == 1) { /* the connect has completed */ sock->connected = NL_TRUE; sock->connecting = NL_FALSE; } else { /* check for a failed connect */ FD_ZERO(&fdset); FD_SET((SOCKET)sock->realsocket, &fdset); if(select(sock->realsocket + 1, NULL, NULL, &fdset, &t) == 1) { nlSetError(NL_CON_REFUSED); } else { nlSetError(NL_CON_PENDING); } return NL_INVALID; } } count = send((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0); } else /* IPX */ { /* check for a non-blocking connection pending */ if(sock->connecting == NL_TRUE) { nlSetError(NL_CON_PENDING); return NL_INVALID; } /* check for a connection error */ if(sock->conerror == NL_TRUE) { nlSetError(NL_CON_REFUSED); return NL_INVALID; } if(nbytes > 1466) { nlSetError(NL_PACKET_SIZE); return NL_INVALID; } if(sock->connected == NL_TRUE) { count = send((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0); } else { count = sendto((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0, (struct sockaddr *)&sock->addressout, (int)sizeof(struct sockaddr_ipx)); } } if(count == SOCKET_ERROR) { return ipx_Error(); } return count; } NLchar *ipx_AddrToString(const NLaddress *address, NLchar *string) { _stprintf(string, TEXT("%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x:%u"), (unsigned int)((struct sockaddr_ipx *)address)->sa_netnum[0] & 0xff, (unsigned int)((struct sockaddr_ipx *)address)->sa_netnum[1] & 0xff, (unsigned int)((struct sockaddr_ipx *)address)->sa_netnum[2] & 0xff, (unsigned int)((struct sockaddr_ipx *)address)->sa_netnum[3] & 0xff, (unsigned int)((struct sockaddr_ipx *)address)->sa_nodenum[0] & 0xff, (unsigned int)((struct sockaddr_ipx *)address)->sa_nodenum[1] & 0xff, (unsigned int)((struct sockaddr_ipx *)address)->sa_nodenum[2] & 0xff, (unsigned int)((struct sockaddr_ipx *)address)->sa_nodenum[3] & 0xff, (unsigned int)((struct sockaddr_ipx *)address)->sa_nodenum[4] & 0xff, (unsigned int)((struct sockaddr_ipx *)address)->sa_nodenum[5] & 0xff, ntohs(((struct sockaddr_ipx *)address)->sa_socket)); return string; } NLboolean ipx_StringToAddr(const NLchar *string, NLaddress *address) { int val; NLchar buffer[3]; buffer[2] = (NLchar)0; memset(address, 0, sizeof(NLaddress)); ((struct sockaddr_ipx *)address)->sa_family = AF_IPX; address->valid = NL_FALSE; #define DO(src,dest) \ buffer[0] = string[(sizeof(NLchar) * src)]; \ buffer[1] = string[src + 1]; \ if(_stscanf (buffer, (const NLchar *)TEXT("%x"), &val) != 1) \ return NL_FALSE; \ ((struct sockaddr_ipx *)address)->dest = (char)val DO(0, sa_netnum[0]); DO(2, sa_netnum[1]); DO(4, sa_netnum[2]); DO(6, sa_netnum[3]); DO(9, sa_nodenum[0]); DO(11, sa_nodenum[1]); DO(13, sa_nodenum[2]); DO(15, sa_nodenum[3]); DO(17, sa_nodenum[4]); DO(19, sa_nodenum[5]); #undef DO (void)_stscanf(&string[(sizeof(NLchar) * 22)], (const NLchar *)TEXT("%d"), &val); ((struct sockaddr_ipx *)address)->sa_socket = htons((unsigned short)val); address->valid = NL_TRUE; return NL_TRUE; } NLboolean ipx_GetLocalAddr(NLsocket socket, NLaddress *address) { nl_socket_t *sock = nlSockets[socket]; memcpy(address, &ipx_ouraddress, sizeof(NLaddress)); ipx_SetAddrPort(address, sock->localport); address->valid = NL_TRUE; return NL_TRUE; } NLaddress *ipx_GetAllLocalAddr(NLint *count) { *count = 1; memcpy(&ipx_ouraddress_copy, &ipx_ouraddress, sizeof(NLaddress)); ipx_ouraddress_copy.valid = NL_TRUE; return &ipx_ouraddress_copy; } NLboolean ipx_SetLocalAddr(const NLaddress *address) { memcpy(&ipx_ouraddress, address, sizeof(NLaddress)); return NL_TRUE; } NLchar *ipx_GetNameFromAddr(const NLaddress *address, NLchar *name) { return ipx_AddrToString(address, name); } NLboolean ipx_GetNameFromAddrAsync(const NLaddress *address, NLchar *name) { (void)ipx_AddrToString(address, name); return NL_TRUE; } NLboolean ipx_GetAddrFromName(const NLchar *name, NLaddress *address) { NLint n; NLchar buffer[(sizeof(NLchar) * 32)]; address->valid = NL_TRUE; n = (NLint)_tcslen(name); if(n == (sizeof(NLchar) * 12)) { _stprintf(buffer, TEXT("00000000:%s:%d"), name, ipxport); return ipx_StringToAddr (buffer, address); } if(n == (sizeof(NLchar) * 21)) { _stprintf(buffer, TEXT("%s:%d"), name, ipxport); return ipx_StringToAddr (buffer, address); } if((n > (sizeof(NLchar) * 21)) && (n <= (sizeof(NLchar) * 27))) { return ipx_StringToAddr (name, address); } memset(address, 0, sizeof(NLaddress)); address->valid = NL_FALSE; return NL_FALSE; } NLboolean ipx_GetAddrFromNameAsync(const NLchar *name, NLaddress *address) { return ipx_GetAddrFromName(name, address); } NLboolean ipx_AddrCompare(const NLaddress *address1, const NLaddress *address2) { if(((struct sockaddr_ipx *)address1)->sa_family != ((struct sockaddr_ipx *)address2)->sa_family) return NL_FALSE; if(memcmp(((struct sockaddr_ipx *)address1)->sa_netnum, ((struct sockaddr_ipx *)address2)->sa_netnum, 4) != 0) return NL_FALSE; if(memcmp(((struct sockaddr_ipx *)address1)->sa_nodenum, ((struct sockaddr_ipx *)address2)->sa_nodenum, 6) != 0) return NL_FALSE; if(((struct sockaddr_ipx *)address1)->sa_socket != ((struct sockaddr_ipx *)address2)->sa_socket) return NL_FALSE; return NL_TRUE; } NLushort ipx_GetPortFromAddr(const NLaddress *address) { return ntohs(((struct sockaddr_ipx *)address)->sa_socket); } void ipx_SetAddrPort(NLaddress *address, NLushort port) { ((struct sockaddr_ipx *)address)->sa_socket = htons((NLushort)port); } NLint ipx_GetSystemError(void) { NLint err = sockerrno; #ifdef WINDOWS_APP if(err < WSABASEERR) { if(errno > 0) { err = errno; } } #endif return err; } NLint ipx_PollGroup(NLint group, NLenum name, NLsocket *sockets, NLint number, NLint timeout) { NLint numselect, count = 0; NLint numsockets = NL_MAX_GROUP_SOCKETS; NLsocket temp[NL_MAX_GROUP_SOCKETS]; NLsocket *ptemp = temp; fd_set fdset; SOCKET highest; struct timeval t = {0,0}; /* {seconds, useconds}*/ struct timeval *tp = &t; NLboolean result; nlGroupLock(); highest = nlGroupGetFdset(group, &fdset); if(highest == INVALID_SOCKET) { /* error is set by nlGroupGetFdset */ nlGroupUnlock(); return NL_INVALID; } result = nlGroupGetSocketsINT(group, ptemp, &numsockets); nlGroupUnlock(); if(result == NL_FALSE) { /* any error is set by nlGroupGetSockets */ return NL_INVALID; } if(numsockets == 0) { return 0; } /* check for full blocking call */ if(timeout < 0) { tp = NULL; } else /* set t values */ { t.tv_sec = timeout/1000; t.tv_usec = (timeout%1000) * 1000; } /* call select to check the status */ switch(name) { case NL_READ_STATUS: numselect = select((int)highest, &fdset, NULL, NULL, tp); break; case NL_WRITE_STATUS: numselect = select((int)highest, NULL, &fdset, NULL, tp); break; case NL_ERROR_STATUS: numselect = select((int)highest, NULL, NULL, &fdset, tp); break; default: nlSetError(NL_INVALID_ENUM); return NL_INVALID; } if(numselect == SOCKET_ERROR) { if(sockerrno == ENOTSOCK) { /* one of the sockets has been closed */ nlSetError(NL_INVALID_SOCKET); } else if(sockerrno == EINTR) { /* select was interrupted by the system, maybe because the app is exiting */ return 0; } else { nlSetError(NL_SYSTEM_ERROR); } return NL_INVALID; } if(numselect > number) { nlSetError(NL_BUFFER_SIZE); return NL_INVALID; } /* fill *sockets with a list of the sockets ready to be read */ while(numsockets-- > 0 && numselect > count) { if(FD_ISSET(nlSockets[*ptemp]->realsocket, &fdset) != 0) { *sockets = *ptemp; sockets++; count ++; } ptemp++; } return count; } NLboolean ipx_Hint(NLenum name, NLint arg) { switch(name) { case NL_LISTEN_BACKLOG: backlog = arg; break; case NL_REUSE_ADDRESS: reuseaddress = (NLboolean)(arg != 0 ? NL_TRUE : NL_FALSE); break; default: nlSetError(NL_INVALID_ENUM); return NL_FALSE; } return NL_TRUE; } #endif /* NL_INCLUDE_IPX */ hawknl-1.6.8+dfsg2/src/ipx.h000066400000000000000000000050261130562644400155630ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #ifndef IPX_H #define IPX_H #ifdef __cplusplus extern "C" { #endif NLboolean ipx_Init(void); void ipx_Shutdown(void); NLboolean ipx_Listen(NLsocket socket); NLsocket ipx_AcceptConnection(NLsocket socket); NLsocket ipx_Open(NLushort port, NLenum type); NLboolean ipx_Connect(NLsocket socket, const NLaddress *address); void ipx_Close(NLsocket socket); NLint ipx_Read(NLsocket socket, /*@out@*/ NLvoid *buffer, NLint nbytes); NLint ipx_Write(NLsocket socket, const NLvoid *buffer, NLint nbytes); NLchar *ipx_AddrToString(const NLaddress *address, /*@returned@*/ /*@out@*/ NLchar *string); NLboolean ipx_StringToAddr(const NLchar *string, /*@out@*/ NLaddress *address); NLboolean ipx_GetLocalAddr(NLsocket socket, /*@out@*/ NLaddress *address); NLaddress *ipx_GetAllLocalAddr(NLint *count); NLboolean ipx_SetLocalAddr(const NLaddress *address); NLchar *ipx_GetNameFromAddr(const NLaddress *address, /*@returned@*/ /*@out@*/ NLchar *name); NLboolean ipx_GetNameFromAddrAsync(const NLaddress *address, /*@out@*/ NLchar *name); NLboolean ipx_GetAddrFromName(const NLchar *name, /*@out@*/ NLaddress *address); NLboolean ipx_GetAddrFromNameAsync(const NLchar *name, /*@out@*/ NLaddress *address); NLboolean ipx_AddrCompare(const NLaddress *address1, const NLaddress *address2); NLushort ipx_GetPortFromAddr(const NLaddress *address); void ipx_SetAddrPort(NLaddress *address, NLushort port); NLint ipx_GetSystemError(void); NLint ipx_PollGroup(NLint group, NLenum name, /*@out@*/ NLsocket *sockets, NLint number, NLint timeout); NLboolean ipx_Hint(NLenum name, NLint arg); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* IPX_H */ hawknl-1.6.8+dfsg2/src/loopback.c000066400000000000000000000651041130562644400165530ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2003 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #include #include #if defined (_WIN32_WCE) #define errno GetLastError() #else #include #endif #include "nlinternal.h" #ifdef WINDOWS_APP /* Windows systems */ #include "wsock.h" #else /* Unix-style systems or macs with posix support */ #include /* for ntohs and htons */ #endif #ifdef NL_INCLUDE_LOOPBACK #include "loopback.h" static NLaddress loopback_ouraddress; static NLint loopgroup; static volatile NLboolean reuseaddress = NL_FALSE; static NLmutex portlock; /* In memory of my step-father, Don Portlock, who passed away Jan 12, 2001 - Phil */ static volatile NLushort newport = 1024; static NLushort loopback_getNextPort(void) { (void)nlMutexLock(&portlock); if(++newport > 65535) { newport = 1024; } (void)nlMutexUnlock(&portlock); return newport; } static NLboolean loopback_ScanPort(NLushort port, NLenum type) { NLint numsockets = NL_MAX_GROUP_SOCKETS; NLsocket temp[NL_MAX_GROUP_SOCKETS]; if(reuseaddress == NL_TRUE) { return NL_TRUE; } if(nlGroupGetSockets(loopgroup, (NLsocket *)&temp, &numsockets) == NL_FALSE) { return NL_FALSE; } if(numsockets == 0) { return NL_TRUE; } while(numsockets-- > 0) { nl_socket_t *sock = nlSockets[temp[numsockets]]; if(sock->type == type && sock->localport == port) { return NL_FALSE; } } return NL_TRUE; } static NLushort loopback_TryPort(NLushort port, NLenum type) { NLint ntries = 500; /* this is to prevent an infinite loop */ if(port > 0) { if(loopback_ScanPort(port, type) == NL_TRUE) { return port; } else { return 0; } } /* let's find our own port number */ while(ntries-- > 0) { port = loopback_getNextPort(); if(loopback_ScanPort(port, type) == NL_TRUE) { return port; } } return 0; } NLboolean loopback_Init(void) { loopgroup = nlGroupCreate(); if(loopgroup == NL_INVALID) { return NL_FALSE; } return NL_TRUE; } void loopback_Shutdown(void) { (void)nlGroupDestroy(loopgroup); } NLboolean loopback_Listen(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; NLint i = NL_MAX_ACCEPT; if(sock->type == NL_BROADCAST) { nlSetError(NL_WRONG_TYPE); return NL_FALSE; } sock->listen = NL_TRUE; while(i-- > 0) { sock->ext->accept[i] = NL_INVALID; } return NL_TRUE; } NLsocket loopback_AcceptConnection(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; if(sock->listen == NL_FALSE) { nlSetError(NL_NOT_LISTEN); return NL_INVALID; } if(sock->inuse == NL_FALSE) { /* socket was closed by nlShutdown */ nlSetError(NL_INVALID_SOCKET); return NL_INVALID; } if(sock->ext == NULL) { /* socket was closed on another thread */ nlSetError(NL_INVALID_SOCKET); return NL_INVALID; } if(sock->ext->accept[0] != NL_INVALID) { NLsocket newsocket; NLsocket osock = sock->ext->accept[0]; nl_socket_t *othersock = nlSockets[osock]; /* make sure the other socket is valid */ if(nlIsValidSocket(osock) == NL_FALSE) { NLint i; for(i=1;iext->accept[i-1] = sock->ext->accept[i]; } sock->ext->accept[NL_MAX_ACCEPT-1] = NL_INVALID; return loopback_AcceptConnection(socket); } newsocket = loopback_Open(0, sock->type); if(newsocket != NL_INVALID) { NLint i; nl_socket_t *newsock = nlSockets[newsocket]; /* we must unlock the socket briefly or else nlConnect will deadlock */ nlUnlockSocket(socket, NL_BOTH); if(nlLockSocket(osock, NL_READ) == NL_FALSE) { return NL_INVALID; } (void)nlLockSocket(socket, NL_BOTH); /* do the connecting */ newsock->ext->consock = osock; newsock->remoteport = othersock->localport; othersock->ext->consock = newsocket; othersock->remoteport = newsock->localport; newsock->connected = NL_TRUE; loopback_SetAddrPort(&othersock->addressin, othersock->remoteport); loopback_SetAddrPort(&newsock->addressin, newsock->remoteport); othersock->connected = NL_TRUE; othersock->connecting = NL_FALSE; /* move the accept que down one */ for(i=1;iext->accept[i-1] = sock->ext->accept[i]; } sock->ext->accept[NL_MAX_ACCEPT-1] = NL_INVALID; nlUnlockSocket(socket, NL_BOTH); nlUnlockSocket(osock, NL_READ); (void)nlLockSocket(socket, NL_BOTH); return newsocket; } } nlSetError(NL_NO_PENDING); return NL_INVALID; } NLsocket loopback_Open(NLushort port, NLenum type) { nl_socket_t *newsock; NLsocket newsocket; NLint i; NLushort lport; switch (type) { case NL_RELIABLE: case NL_UNRELIABLE: case NL_RELIABLE_PACKETS: case NL_BROADCAST: break; default: nlSetError(NL_INVALID_ENUM); return NL_INVALID; } lport = loopback_TryPort(port, type); if(lport == 0) { nlSetError(NL_INVALID_PORT); return NL_INVALID; } newsocket = nlGetNewSocket(); if(newsocket == NL_INVALID) { return NL_INVALID; } if(nlLockSocket(newsocket, NL_BOTH) == NL_FALSE) { return NL_INVALID; } newsock = nlSockets[newsocket]; newsock->type = type; newsock->localport = lport; if(type == NL_BROADCAST) { newsock->remoteport = lport; } if((newsock->ext = (nl_extra_t *)malloc(sizeof(nl_extra_t))) == NULL) { nlSetError(NL_OUT_OF_MEMORY); nlUnlockSocket(newsocket, NL_BOTH); loopback_Close(newsocket); return NL_INVALID; } /* clear out the structure */ memset(newsock->ext, 0, sizeof(nl_extra_t)); for(i=0;iext->inpacket[i] = (NLbyte *)malloc((size_t)(NL_MAX_PACKET_LENGTH + 2))) == NULL) { nlSetError(NL_OUT_OF_MEMORY); err = NL_TRUE; } if(err == NL_TRUE) { while(i-- > 0) { free(newsock->ext->inpacket[i]); } nlUnlockSocket(newsocket, NL_BOTH); loopback_Close(newsocket); return NL_INVALID; } } (void)nlGroupAddSocket(loopgroup, newsocket); nlUnlockSocket(newsocket, NL_BOTH); return newsocket; } NLboolean loopback_Connect(NLsocket socket, const NLaddress *address) { nl_socket_t *sock = nlSockets[socket]; NLushort port; NLint numsockets = NL_MAX_GROUP_SOCKETS; NLsocket temp[NL_MAX_GROUP_SOCKETS]; /* no need to connect a broadcast socket */ if(sock->type == NL_BROADCAST) { nlSetError(NL_WRONG_TYPE); } port = loopback_GetPortFromAddr(address); /* make sure socket is not already connected */ if(sock->connected == NL_TRUE || sock->connecting == NL_TRUE) { nlSetError(NL_CON_REFUSED); return NL_FALSE; } if(nlGroupGetSockets(loopgroup, (NLsocket *)&temp, &numsockets) == NL_FALSE) { return NL_FALSE; } if(numsockets == 0) { return NL_FALSE; } while(numsockets-- > 0) { NLsocket s = temp[numsockets]; nl_socket_t *othersock = nlSockets[s]; if(sock->type == othersock->type && port == othersock->localport && othersock->listen == NL_TRUE && othersock->connected == NL_FALSE && othersock->connecting == NL_FALSE) { /* we found the right socket, so connect */ NLint i; if(nlLockSocket(s, NL_BOTH) == NL_FALSE) { return NL_FALSE; } for(i=0;iext->accept[i] == NL_INVALID) { othersock->ext->accept[i] = socket; sock->connecting = NL_TRUE; sock->ext->consock = s; nlUnlockSocket(s, NL_BOTH); if(sock->blocking == NL_TRUE) { nlUnlockSocket(socket, NL_BOTH); /* wait for nlAccept to be called */ while(sock->connecting == NL_TRUE) { if(sock->inuse == NL_FALSE) { /* nlShutdown has been called */ nlSetError(NL_INVALID_SOCKET); return NL_FALSE; } nlThreadSleep(NL_CONNECT_SLEEP); } (void)nlLockSocket(socket, NL_BOTH); } return NL_TRUE; } } nlUnlockSocket(s, NL_BOTH); } } nlSetError(NL_CON_REFUSED); return NL_FALSE; } void loopback_Close(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; int i; if(sock->connected == NL_TRUE || sock->connecting == NL_TRUE) { /* break the connection */ nl_socket_t *othersock = nlSockets[sock->ext->consock]; if(othersock->ext != NULL) { othersock->ext->consock = NL_INVALID; } othersock->connected = NL_FALSE; sock->connected = NL_FALSE; sock->listen = NL_FALSE; if(sock->type != NL_BROADCAST) { /* this allows nlPollGroup to report socket is readable */ /* so that the app can get the NL_SOCK_DISCONNECT message*/ if(othersock->ext != NULL) { othersock->ext->inlen[othersock->ext->nextinused] = -1; } } } for(i=0;iext->inpacket[i]; free(t); sock->ext->inpacket[i] = NULL; } free(sock->ext); sock->ext = NULL; } NLint loopback_Read(NLsocket socket, NLvoid *buffer, NLint nbytes) { nl_socket_t *sock = nlSockets[socket]; NLint len = sock->ext->inlen[sock->ext->nextinused]; NLint c = 0; NLushort port; if(sock->blocking == NL_TRUE) { while(len == 0) { nlUnlockSocket(socket, NL_READ); nlThreadSleep(10); if(sock->inuse == NL_FALSE) { /* nlShutdown has been called */ nlSetError(NL_INVALID_SOCKET); return NL_INVALID; } (void)nlLockSocket(socket, NL_READ); len = sock->ext->inlen[sock->ext->nextinused]; } } if(len > 0) { if(len > nbytes) { nlSetError(NL_BUFFER_SIZE); return NL_INVALID; } if(sock->connecting == NL_TRUE) { nlSetError(NL_CON_PENDING); return NL_INVALID; } /* get the port number */ readShort(sock->ext->inpacket[sock->ext->nextinused], c, port); loopback_SetAddrPort(&sock->addressin, port); /* copy the packet */ memcpy(buffer, sock->ext->inpacket[sock->ext->nextinused] + 2, (size_t)len); /* zero out length and set up for next packet */ sock->ext->inlen[sock->ext->nextinused] = 0; sock->ext->nextinused++; if(sock->ext->nextinused >= NL_NUM_PACKETS) { sock->ext->nextinused = 0; } } /* check for broken connection */ else if((len == -1) || (sock->connected == NL_TRUE && sock->ext->consock == NL_INVALID) || (sock->connected == NL_FALSE && sock->type != NL_BROADCAST)) { nlSetError(NL_SOCK_DISCONNECT); return NL_INVALID; } return len; } static NLint loopback_WritePacket(NLsocket to, const NLvoid *buffer, NLint nbytes, NLushort fromport) { nl_socket_t *sock = nlSockets[to]; NLint i, j; NLint c = 0; /* check the packet size */ if(nbytes > NL_MAX_PACKET_LENGTH) { nlSetError(NL_PACKET_SIZE); return NL_INVALID; } if(nlLockSocket(to, NL_READ) == NL_FALSE) { return NL_INVALID; } /* make sure we have an empty packet buffer */ if(sock->ext->nextinfree == NL_INVALID) { /* all buffers were filled by last write */ /* check to see if any were emptied by a read */ i = NL_NUM_PACKETS; j = sock->ext->nextinused; while(i-- > 0) { if(sock->ext->inlen[j] == 0) { /* found the first free */ sock->ext->nextinfree = j; break; } j++; if(j >= NL_NUM_PACKETS) { j = 0; } } if(sock->ext->nextinfree == NL_INVALID) { nlUnlockSocket(to, NL_READ); /* none are free */ if(sock->type == NL_RELIABLE || sock->type == NL_RELIABLE_PACKETS) { return 0; } else { /* silently fail */ return nbytes; } } } /* write the port number */ writeShort(sock->ext->inpacket[sock->ext->nextinfree], c, fromport); /* copy the packet buffer */ memcpy(sock->ext->inpacket[sock->ext->nextinfree] + 2, buffer, (size_t)nbytes); sock->ext->inlen[sock->ext->nextinfree] = nbytes; sock->ext->nextinfree++; if(sock->ext->nextinfree >= NL_NUM_PACKETS) { sock->ext->nextinfree = 0; } /* check for full packet buffers */ if(sock->ext->inlen[sock->ext->nextinfree] != 0) { sock->ext->nextinfree = NL_INVALID; } nlUnlockSocket(to, NL_READ); return nbytes; } NLint loopback_Write(NLsocket socket, const NLvoid *buffer, NLint nbytes) { nl_socket_t *sock = nlSockets[socket]; nl_socket_t *othersock; NLsocket s[NL_MAX_GROUP_SOCKETS]; NLint number = NL_MAX_GROUP_SOCKETS; NLint i; NLint count; switch (sock->type) { case NL_RELIABLE: case NL_RELIABLE_PACKETS: default: { if(sock->connected == NL_TRUE) { /* check for broken connection */ if(sock->ext->consock == NL_INVALID) { nlSetError(NL_SOCK_DISCONNECT); return NL_INVALID; } count = loopback_WritePacket(sock->ext->consock, buffer, nbytes, sock->localport); } else if(sock->connecting == NL_TRUE) { nlSetError(NL_CON_PENDING); return NL_INVALID; } else { nlSetError(NL_SOCK_DISCONNECT); return NL_INVALID; } } break; case NL_UNRELIABLE: { if(sock->connected == NL_TRUE) { /* check for broken connection */ if(sock->ext->consock == NL_INVALID) { nlSetError(NL_SOCK_DISCONNECT); return NL_INVALID; } count = loopback_WritePacket(sock->ext->consock, buffer, nbytes, sock->localport); } else if(sock->connecting == NL_TRUE) { nlSetError(NL_CON_PENDING); return NL_INVALID; } /* unconnected UDP emulation */ count = nbytes; (void)nlGroupGetSockets(loopgroup, (NLsocket *)s, &number); for(i=0;iremoteport == othersock->localport && othersock->connected == NL_FALSE && sock->type == othersock->type) { (void)loopback_WritePacket(s[i], buffer, nbytes, sock->localport); } } } } break; case NL_BROADCAST: { count = nbytes; (void)nlGroupGetSockets(loopgroup, (NLsocket *)s, &number); for(i=0;ilocalport == othersock->localport && sock->type == othersock->type) { (void)loopback_WritePacket(s[i], buffer, nbytes, sock->localport); } } } } } return count; } NLchar *loopback_AddrToString(const NLaddress *address, NLchar *string) { _stprintf(string, TEXT("127.0.0.1:%u"), loopback_GetPortFromAddr(address)); return string; } NLboolean loopback_StringToAddr(const NLchar *string, NLaddress *address) { NLchar *st; NLint port; memset(address, 0, sizeof(NLaddress)); address->valid = NL_TRUE; /* check for a port number */ st = _tcschr(string, TEXT(':')); if(st != NULL) { st++; port = _ttoi(st); if(port < 0 || port > 65535) { nlSetError(NL_BAD_ADDR); address->valid = NL_FALSE; return NL_FALSE; } loopback_SetAddrPort(address, (NLushort)port); } return NL_TRUE; } NLboolean loopback_GetLocalAddr(NLsocket socket, NLaddress *address) { nl_socket_t *sock = nlSockets[socket]; memset(address, 0, sizeof(NLaddress)); loopback_SetAddrPort(address, sock->localport); address->valid = NL_TRUE; return NL_TRUE; } NLaddress *loopback_GetAllLocalAddr(NLint *count) { *count = 1; memset(&loopback_ouraddress, 0, sizeof(NLaddress)); loopback_ouraddress.valid = NL_TRUE; return &loopback_ouraddress; } NLboolean loopback_SetLocalAddr(const NLaddress *address) { /* this is just to keep compilers happy */ if(address == NULL) { return NL_FALSE; } return NL_TRUE; } NLchar *loopback_GetNameFromAddr(const NLaddress *address, NLchar *name) { _stprintf(name, TEXT("%s:%u"), TEXT("localhost"), loopback_GetPortFromAddr(address)); return name; } NLboolean loopback_GetNameFromAddrAsync(const NLaddress *address, NLchar *name) { (void)loopback_GetNameFromAddr(address, name); return NL_TRUE; } NLboolean loopback_GetAddrFromName(const NLchar *name, NLaddress *address) { return loopback_StringToAddr(name, address); } NLboolean loopback_GetAddrFromNameAsync(const NLchar *name, NLaddress *address) { return loopback_GetAddrFromName(name, address); } NLboolean loopback_AddrCompare(const NLaddress *address1, const NLaddress *address2) { if(*(NLushort *)(&address1->addr[0]) == *(NLushort *)(&address2->addr[0])) { return NL_TRUE; } return NL_FALSE; } NLushort loopback_GetPortFromAddr(const NLaddress *address) { return *(NLushort *)(&address->addr[0]); } void loopback_SetAddrPort(NLaddress *address, NLushort port) { *(NLushort *)(&address->addr[0]) = port; } NLint loopback_GetSystemError(void) { return errno; } NLint loopback_PollGroup(NLint group, NLenum name, NLsocket *sockets, NLint number, NLint timeout) { NLint count = 0; NLint numsockets = NL_MAX_GROUP_SOCKETS; NLsocket temp[NL_MAX_GROUP_SOCKETS]; NLtime end, now; nlGroupLock(); if(nlGroupGetSocketsINT(group, (NLsocket *)&temp, &numsockets) == NL_FALSE) { /* any error is set by nlGroupGetSockets */ nlGroupUnlock(); return NL_INVALID; } nlGroupUnlock(); if(numsockets == 0) { return 0; } (void)nlTime(&now); end.seconds = now.seconds; end.mseconds = now.mseconds; if(timeout > 0) { end.mseconds += timeout; while(end.mseconds > 999) { end.mseconds -= 1000; end.seconds++; } } while(count == 0) { switch(name) { case NL_READ_STATUS: { NLint i = 0; NLint j = numsockets; while(j-- > 0) { /* check for a packet */ nl_socket_t *sock; if(nlIsValidSocket(temp[i]) != NL_TRUE) { nlSetError(NL_INVALID_SOCKET); return NL_INVALID; } sock = nlSockets[temp[i]]; if(sock->ext->inlen[sock->ext->nextinused] != 0) { *sockets = temp[i]; sockets++; count++; if(count > number) { nlSetError(NL_BUFFER_SIZE); return NL_INVALID; } } i++; } } break; case NL_WRITE_STATUS: { NLint i = 0; NLint j = numsockets; while(j-- > 0) { nl_socket_t *sock; if(nlIsValidSocket(temp[i]) != NL_TRUE) { nlSetError(NL_INVALID_SOCKET); return NL_INVALID; } sock = nlSockets[temp[i]]; /* check for a free packet if reliable and connected */ if((sock->type == NL_TCP || sock->type == NL_TCP_PACKETS) && (sock->connecting == NL_TRUE || sock->connected == NL_TRUE)) { nl_socket_t *othersock = nlSockets[sock->ext->consock]; if(othersock->ext->nextinfree == NL_INVALID) { continue; } } /* add the socket to the list */ *sockets = temp[i]; sockets++; count++; if(count > number) { nlSetError(NL_BUFFER_SIZE); return NL_INVALID; } i++; } } break; case NL_ERROR_STATUS: { NLint i = 0; NLint j = numsockets; while(j-- > 0) { nl_socket_t *sock; if(nlIsValidSocket(temp[i]) != NL_TRUE) { nlSetError(NL_INVALID_SOCKET); return NL_INVALID; } sock = nlSockets[temp[i]]; if(sock->connected == NL_FALSE && sock->type != NL_UDP_BROADCAST) { /* add the socket to the list */ *sockets = temp[i]; sockets++; count++; if(count > number) { nlSetError(NL_BUFFER_SIZE); return NL_INVALID; } i++; } } } break; default: nlSetError(NL_INVALID_ENUM); return NL_INVALID; } if(timeout != 0) { nlThreadSleep(1); (void)nlTime(&now); if(timeout > 0 && (now.seconds > end.seconds || (now.seconds == end.seconds && now.mseconds > end.mseconds))) break; } else { break; } } return count; } NLboolean loopback_Hint(NLenum name, NLint arg) { switch (name) { case NL_REUSE_ADDRESS: reuseaddress = (NLboolean)(arg != 0 ? NL_TRUE : NL_FALSE); break; default: nlSetError(NL_INVALID_ENUM); return NL_FALSE; } return NL_TRUE; } #endif /* NL_INCLUDE_LOOPBACK */ hawknl-1.6.8+dfsg2/src/loopback.h000066400000000000000000000053011130562644400165510ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #ifndef LOOPBACK_H #define LOOPBACK_H #ifdef __cplusplus extern "C" { #endif NLboolean loopback_Init(void); void loopback_Shutdown(void); NLboolean loopback_Listen(NLsocket socket); NLsocket loopback_AcceptConnection(NLsocket socket); NLsocket loopback_Open(NLushort port, NLenum type); NLboolean loopback_Connect(NLsocket socket, const NLaddress *address); void loopback_Close(NLsocket socket); NLint loopback_Read(NLsocket socket, /*@out@*/ NLvoid *buffer, NLint nbytes); NLint loopback_Write(NLsocket socket, const NLvoid *buffer, NLint nbytes); NLchar *loopback_AddrToString(const NLaddress *address, /*@returned@*/ /*@out@*/ NLchar *string); NLboolean loopback_StringToAddr(const NLchar *string, /*@out@*/ NLaddress *address); NLboolean loopback_GetLocalAddr(/*@unused@*/ NLsocket socket, /*@out@*/ NLaddress *address); NLaddress *loopback_GetAllLocalAddr(/*@out@*/ NLint *count); NLboolean loopback_SetLocalAddr(/*@unused@*/ const NLaddress *address); NLchar *loopback_GetNameFromAddr(const NLaddress *address, /*@returned@*/ /*@out@*/ NLchar *name); NLboolean loopback_GetNameFromAddrAsync(const NLaddress *address, /*@out@*/ NLchar *name); NLboolean loopback_GetAddrFromName(const NLchar *name, /*@out@*/ NLaddress *address); NLboolean loopback_GetAddrFromNameAsync(const NLchar *name, /*@out@*/ NLaddress *address); NLboolean loopback_AddrCompare(const NLaddress *address1, const NLaddress *address2); NLushort loopback_GetPortFromAddr(const NLaddress *address); void loopback_SetAddrPort(NLaddress *address, NLushort port); NLint loopback_GetSystemError(void); NLint loopback_PollGroup(NLint group, NLenum name, /*@out@*/ NLsocket *sockets, NLint number, NLint timeout); NLboolean loopback_Hint(NLenum name, NLint arg); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* LOOPBACK_H */ hawknl-1.6.8+dfsg2/src/makefile.linux000066400000000000000000000045011130562644400174450ustar00rootroot00000000000000CC = gcc AR = ar cru RANLIB = ranlib MAJOR_VERSION = 1 MINOR_VERSION = 6 PATCH_LEVEL = 8 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL) LIBDIR = /usr/local/lib INCDIR = /usr/local/include INCLUDE = -I../include OUTPUT = libNL.so.$(VERSION) LIBNAME = NL STATIC = libNL.a OPTFLAGS = -funroll-all-loops -ffast-math -fomit-frame-pointer -O2 -D_GNU_SOURCE -D_REENTRANT CFLAGS = -Wall -fPIC $(INCLUDE) $(OPTFLAGS) LIBFLAGS = -shared -Wl,-soname,NL.so.$(MAJOR_VERSION).$(MINOR_VERSION) -rdynamic -lpthread OBJECTS = crc.o errorstr.o nl.o sock.o group.o loopback.o err.o thread.o mutex.o condition.o nltime.o all: $(OBJECTS) $(CC) -o $(OUTPUT) $(OBJECTS) $(LIBFLAGS) $(CFLAGS) $(AR) $(STATIC) $(OBJECTS) $(RANLIB) $(STATIC) nl.o : nlinternal.h nl.c sock.o : nlinternal.h sock.h sock.c errorstr.o : nlinternal.h errorstr.c crc.o : ../include/nl.h crc.c group.o : nlinternal.h group.c loopback.o : nlinternal.h loopback.h loopback.c err.o : nlinternal.h err.c thread.o : nlinternal.h thread.c mutex.o : nlinternal.h mutex.c condition.0 : nlinternal.h condition.c nltime.o : nlinternal.h nltime.c install: cp $(OUTPUT) $(LIBDIR) cp $(STATIC) $(LIBDIR) chmod 755 $(LIBDIR)/$(OUTPUT) ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION) ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION) ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).so ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/$(LIBNAME).so cp ../include/nl.h $(INCDIR)/nl.h chmod 644 $(INCDIR)/nl.h @echo "" @echo "*************************************************" @echo "* Installed HawkNL. *" @echo "* Remember to run /sbin/ldconfig before using *" @echo "* the library, you may also want to check that *" @echo "* $(LIBDIR) is included in /etc/ld.so.conf *" @echo "* You must be root to run ldconfig. *" @echo "*************************************************" uninstall: rm -f $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION) rm -f $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION) rm -f $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION) rm -f $(LIBDIR)/lib$(LIBNAME).so rm -f $(LIBDIR)/$(STATIC) rm -f $(INCDIR)/nl.h .PHONY : clean clean: rm $(OBJECTS) $(OUTPUT) $(STATIC) hawknl-1.6.8+dfsg2/src/makefile.mingw000066400000000000000000000047431130562644400174370ustar00rootroot00000000000000# I'm no expert at makefiles, i tried to keep this as similiar as possible to # the makefile.linux from which i derived it. # Elias Pschernig elias@users.sourceforge.net # I don't know any simple way to get the install dir, so let the user tell it ifeq ($(MINGDIR),) patherror: @echo Please specify your mingw32 directory via set MINGDIR=* endif CC = gcc AR = ar crus # create, replace, update, symbols INCLUDE = -I../include OUTPUT = NL.dll LIBNAME = NL STATIC = libNL_s.a IMPORT = libNL.a OPTFLAGS = -funroll-all-loops -ffast-math -fomit-frame-pointer -O2 -D_REENTRANT CFLAGS = -Wall $(INCLUDE) $(OPTFLAGS) LIBFLAGS = -shared -lpthreadGC -lwsock32 OBJECTS = crc.o errorstr.o nl.o sock.o group.o ipx.o err.o thread.o loopback.o mutex.o condition.o nltime.o ifeq ($(OS),Windows_NT) SYSDIR = $(SystemRoot)/system32 # not sure about this, can someone test it under NT/2K ? else SYSDIR = $(windir)/system # on win95/98/ME this is the path to the DLL dir endif LIBDIR = $(MINGDIR)/lib INCDIR = $(MINGDIR)/include .PHONY : clean ifdef STATICLINK all: $(OBJECTS) @echo building static library $(AR) $(STATIC) $(OBJECTS) install: cp $(STATIC) $(LIBDIR) cp ../include/nl.h $(INCDIR)/nl.h uninstall: rm -f $(LIBDIR)/$(STATIC) rm -f $(INCDIR)/nl.h clean: rm -f $(OBJECTS) $(STATIC) else all: $(OBJECTS) @echo building dynamic library, set STATICLINK for static lib $(CC) -o $(OUTPUT) $(OBJECTS) $(LIBFLAGS) $(CFLAGS) -Wl,--out-implib=$(IMPORT) install: cp $(OUTPUT) $(SYSDIR) cp $(IMPORT) $(LIBDIR) cp ../include/nl.h $(INCDIR)/nl.h uninstall: rm -f $(SYSDIR)/$(OUTPUT) rm -f $(LIBDIR)/$(IMPORT) rm -f $(INCDIR)/nl.h clean: rm -f $(OBJECTS) $(OUTPUT) $(IMPORT) endif crc.o: ../include/nl.h err.o: nlinternal.h ../include/nl.h sock.h loopback.h serial.h parallel.h ipx.h errorstr.o: wsock.h nlinternal.h ../include/nl.h sock.h loopback.h serial.h parallel.h ipx.h group.o: nlinternal.h ../include/nl.h sock.h loopback.h serial.h parallel.h ipx.h ipx.o: wsock.h nlinternal.h ../include/nl.h sock.h loopback.h serial.h parallel.h ipx.h loopback.o: nlinternal.h ../include/nl.h sock.h loopback.h serial.h parallel.h ipx.h mutex.o: nlinternal.h ../include/nl.h nl.o: nlinternal.h ../include/nl.h sock.h loopback.h serial.h parallel.h ipx.h sock.o: wsock.h nlinternal.h ../include/nl.h sock.h loopback.h serial.h parallel.h ipx.h thread.o: nlinternal.h ../include/nl.h condition.o: nlinternal.h ../include/nl.h nltime: nlinternal.h ../include/nl.h .PHONY : default default: all hawknl-1.6.8+dfsg2/src/makefile.osx000066400000000000000000000055231130562644400171240ustar00rootroot00000000000000CC = c++ AR = ar cru RANLIB = ranlib MAJOR_VERSION = 1 MINOR_VERSION = 6 PATCH_LEVEL = 8 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL) LIBDIR = /usr/lib INCDIR = /usr/include INCLUDE = -I../include LIBNAME = NL OUTPUT = lib$(LIBNAME).$(VERSION).dylib STATIC = libNL.a OPTFLAGS = -funroll-all-loops -ffast-math -fomit-frame-pointer -O2 -D_REENTRANT -DMACOSX CFLAGS = -Wall -fPIC $(INCLUDE) $(OPTFLAGS) LIBFLAGS = -dylib -r -lpthread -Wl,-x OBJECTS = crc.o errorstr.o nl.o sock.o group.o loopback.o err.o thread.o mutex.o condition.o nltime.o all: $(OBJECTS) $(CC) -o $(OUTPUT) $(OBJECTS) $(LIBFLAGS) $(CFLAGS) $(AR) $(STATIC) $(OBJECTS) $(RANLIB) $(STATIC) nl.o : nlinternal.h nl.c sock.o : nlinternal.h sock.h sock.c errorstr.o : nlinternal.h errorstr.c crc.o : ../include/nl.h crc.c group.o : nlinternal.h group.c loopback.o : nlinternal.h loopback.h loopback.c err.o : nlinternal.h err.c thread.o : nlinternal.h thread.c mutex.o : nlinternal.h mutex.c condition.o : nlinternal.h condition.c nltime.o : nlinternal.h nltime.c install: @echo "" @echo "*************************************************" @echo "* If you forgot to su to root, this probably *" @echo "* wont work *" @echo "*************************************************" cp $(OUTPUT) $(LIBDIR) cp $(STATIC) $(LIBDIR) chmod 755 $(LIBDIR)/$(OUTPUT) ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).$(MAJOR_VERSION).$(MINOR_VERSION).dylib ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).$(MAJOR_VERSION).dylib ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).dylib cp ../include/nl.h $(INCDIR)/nl.h chmod 644 $(INCDIR)/nl.h @echo "" @echo "*************************************************" @echo "* Installed HawkNL. *" @echo "* Remember to run /sbin/ldconfig before using *" @echo "* the library, you may also want to check that *" @echo "* $(LIBDIR) is included in /etc/ld.so.conf *" @echo "* You must be root to run ldconfig. *" @echo "*************************************************" uninstall: @echo "" @echo "*************************************************" @echo "* If you forgot to su to root, this probably *" @echo "* wont work *" @echo "*************************************************" rm -f $(LIBDIR)/$(OUTPUT) rm -f $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION) rm -f $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION) rm -f $(LIBDIR)/lib$(LIBNAME).so rm -f $(LIBDIR)/$(STATIC) rm -f $(INCDIR)/nl.h @echo "" @echo "*************************************************" @echo "* HawkNL uninstalled. *" @echo "*************************************************" .PHONY : clean clean: rm $(OBJECTS) $(OUTPUT) $(STATIC) hawknl-1.6.8+dfsg2/src/makefile.solaris000066400000000000000000000035471130562644400177730ustar00rootroot00000000000000CC = gcc LD = /usr/ccs/bin/ld AR = /usr/ccs/bin/ar cru RANLIB = /usr/ccs/bin/ranlib MAJOR_VERSION = 1 MINOR_VERSION = 6 PATCH_LEVEL = 8 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL) LIBDIR = /usr/lib INCDIR = /usr/include INCLUDE = -I../include OUTPUT = libNL.so.$(VERSION) LIBNAME = NL STATIC = libNL.a OPTFLAGS = -funroll-all-loops -ffast-math -fomit-frame-pointer -O2 -D_GNU_SOURCE -D_REENTRANT -DNL_SAFE_COPY -DSOLARIS CFLAGS = -Wall -fPIC $(INCLUDE) $(OPTFLAGS) LIBFLAGS = -G -h libNL.so.$(MAJOR_VERSION) -o $(OUTPUT) -lpthread -lnsl -lsocket OBJECTS = crc.o errorstr.o nl.o sock.o group.o loopback.o err.o thread.o mutex.o condition.o nltime.o all: $(OBJECTS) $(LD) $(LIBFLAGS) $(OBJECTS) $(AR) $(STATIC) $(OBJECTS) $(RANLIB) $(STATIC) nl.o : nlinternal.h nl.c sock.o : nlinternal.h sock.c errorstr.o : nlinternal.h errorstr.c crc.o : ../include/nl.h crc.c group.o : nlinternal.h group.c loopback.o : nlinternal.h loopback.h loopback.c err.o : nlinternal.h err.c thread.o : nlinternal.h thread.c mutex.o : nlinternal.h mutex.c condition.0 : nlinternal.h condition.c nltime.o : nlinternal.h nltime.c install: cp $(OUTPUT) $(LIBDIR) cp $(STATIC) $(LIBDIR) chmod 755 $(LIBDIR)/$(OUTPUT) ln -s $(LIBDIR)/$(OUTPUT) lib$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION) ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION) ln -s $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).so cp ../include/nl.h $(INCDIR)/nl.h chmod 644 $(INCDIR)/nl.h uninstall: rm -f $(LIBDIR)/$(OUTPUT) $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION) rm -f $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION).$(MINOR_VERSION) rm -f $(LIBDIR)/lib$(LIBNAME).so.$(MAJOR_VERSION) rm -f $(LIBDIR)/lib$(LIBNAME).so rm -f $(LIBDIR)/$(STATIC) rm -f $(INCDIR)/nl.h .PHONY : clean clean: rm $(OBJECTS) $(OUTPUT) $(STATIC) hawknl-1.6.8+dfsg2/src/mutex.c000066400000000000000000000127611130562644400161240ustar00rootroot00000000000000/* HawkNL mutex module Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #include "nlinternal.h" #ifdef NL_WIN_THREADS struct nl_mutex_t { CRITICAL_SECTION mutex; DWORD thread; }; #else /* !NL_WIN_THREADS */ #include #ifndef WINDOWS_APP #include #endif /* WINDOWS_APP */ struct nl_mutex_t { pthread_mutex_t mutex; }; #endif /* NL_WIN_THREADS */ NL_EXP NLboolean NL_APIENTRY nlMutexInit(NLmutex *mutex) { if(mutex == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } else { NLmutex mx; #ifdef NL_WIN_THREADS /* native Windows */ mx = (NLmutex)malloc(sizeof(struct nl_mutex_t)); if(mx == NULL) { nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } InitializeCriticalSection(&mx->mutex); mx->thread = 0; #else /* POSIX */ pthread_mutexattr_t attr; int result; mx = (NLmutex)malloc(sizeof(struct nl_mutex_t)); if(mx == NULL) { nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } (void)pthread_mutexattr_init(&attr); #if defined Macintosh /* GUSI is not fully POSIX compliant, and does not define PTHREAD_MUTEX_ERRORCHECK */ (void)pthread_mutexattr_settype(&attr, NULL); #else (void)pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK); #endif result = pthread_mutex_init((pthread_mutex_t *)&mx->mutex, &attr); (void)pthread_mutexattr_destroy(&attr); if(result != 0) { #ifdef WINDOWS_APP SetLastError((DWORD)result); #endif nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } #endif *mutex = mx; } return NL_TRUE; } NL_EXP NLboolean NL_APIENTRY nlMutexLock(NLmutex *mutex) { if(mutex == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(*mutex == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } else { NLmutex mx = *mutex; #ifdef NL_WIN_THREADS DWORD threadid = GetCurrentThreadId(); /* native Windows */ /* this call will not stop recursion on a single thread */ EnterCriticalSection(&mx->mutex); /* check for recursion */ if(mx->thread == threadid) { nlSetError(NL_MUTEX_RECURSION); /* must call LeaveCriticalSection for each EnterCriticalSection */ /* so this nullifies the above call to EnterCriticalSection*/ LeaveCriticalSection(&mx->mutex); return NL_FALSE; } else { mx->thread = threadid; } #else int result; /* POSIX */ result = pthread_mutex_lock((pthread_mutex_t *)&mx->mutex); if(result == EDEADLK) { nlSetError(NL_MUTEX_RECURSION); return NL_FALSE; } else if(result != 0) { #ifdef WINDOWS_APP SetLastError((DWORD)result); #endif nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } #endif } return NL_TRUE; } NL_EXP NLboolean NL_APIENTRY nlMutexUnlock(NLmutex *mutex) { if(mutex == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(*mutex == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } else { NLmutex mx = *mutex; #ifdef NL_WIN_THREADS DWORD threadid = GetCurrentThreadId(); /* native Windows */ if((mx->thread == 0) ||(mx->thread != threadid)) { nlSetError(NL_MUTEX_OWNER); return NL_FALSE; } mx->thread = 0; LeaveCriticalSection(&mx->mutex); #else int result; /* POSIX */ result = pthread_mutex_unlock((pthread_mutex_t *)&mx->mutex); if(result == EPERM) { nlSetError(NL_MUTEX_OWNER); return NL_FALSE; } else if(result != 0) { #ifdef WINDOWS_APP SetLastError((DWORD)result); #endif nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } #endif } return NL_TRUE; } NL_EXP NLboolean NL_APIENTRY nlMutexDestroy(NLmutex *mutex) { if(mutex == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(*mutex == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } else { NLmutex mx = *mutex; #ifdef NL_WIN_THREADS /* native Windows */ DeleteCriticalSection(&mx->mutex); #else /* POSIX */ (void)pthread_mutex_destroy((pthread_mutex_t *)&mx->mutex); #endif } free(*mutex); *mutex = NULL; return NL_TRUE; } hawknl-1.6.8+dfsg2/src/nl.c000066400000000000000000001314621130562644400153730ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #include #include "nlinternal.h" #include "sock.h" #include "serial.h" #include "parallel.h" #ifdef NL_INCLUDE_LOOPBACK #include "loopback.h" #endif #if defined WINDOWS_APP && defined NL_INCLUDE_IPX #include "ipx.h" #endif #define MAX_NET_DRIVERS 6 volatile nl_state_t nlState = {NL_FALSE, NL_TRUE}; /* mutexes for global variables */ static NLmutex socklock, instatlock, outstatlock; static volatile NLboolean nlBlocking = NL_FALSE; static volatile nl_stats_t nlInstats; static volatile nl_stats_t nlOutstats; static volatile NLsocket nlNextsocket = 0; static volatile NLint nlNumsockets = 0; static volatile NLint nlMaxNumsockets = NL_MIN_SOCKETS; /* this is dynamic, and can grow as needed */ static volatile NLint nlInitCount = 0; pnl_socket_t *nlSockets = NULL; /* the current selected driver */ static nl_netdriver_t /*@null@*/*driver = NULL; static nl_netdriver_t netdrivers[] = { { (NLchar*)TEXT("NL_IP"), (NLchar*)TEXT("NL_RELIABLE NL_UNRELIABLE NL_RELIABLE_PACKETS NL_BROADCAST NL_UDP_MULTICAST NL_MULTICAST"), NL_IP, NL_FALSE, sock_Init, sock_Shutdown, sock_Listen, sock_AcceptConnection, sock_Open, sock_Connect, sock_Close, sock_Read, sock_Write, sock_AddrToString, sock_StringToAddr, sock_GetLocalAddr, sock_GetAllLocalAddr, sock_SetLocalAddr, sock_GetNameFromAddr, sock_GetNameFromAddrAsync, sock_GetAddrFromName, sock_GetAddrFromNameAsync, sock_AddrCompare, sock_GetPortFromAddr, sock_SetAddrPort, sock_GetSystemError, sock_PollGroup, sock_Hint } #ifdef NL_INCLUDE_LOOPBACK , { (NLchar*)TEXT("NL_LOOP_BACK"), (NLchar*)TEXT("NL_RELIABLE NL_UNRELIABLE NL_RELIABLE_PACKETS NL_BROADCAST"), NL_LOOP_BACK, NL_FALSE, loopback_Init, loopback_Shutdown, loopback_Listen, loopback_AcceptConnection, loopback_Open, loopback_Connect, loopback_Close, loopback_Read, loopback_Write, loopback_AddrToString, loopback_StringToAddr, loopback_GetLocalAddr, loopback_GetAllLocalAddr, loopback_SetLocalAddr, loopback_GetNameFromAddr, loopback_GetNameFromAddrAsync, loopback_GetAddrFromName, loopback_GetAddrFromNameAsync, loopback_AddrCompare, loopback_GetPortFromAddr, loopback_SetAddrPort, loopback_GetSystemError, loopback_PollGroup, loopback_Hint } #endif /* NL_INCLUDE_LOOPBACK */ #if defined WINDOWS_APP && defined NL_INCLUDE_IPX , { (NLchar*)TEXT("NL_IPX"), (NLchar*)TEXT("NL_RELIABLE NL_UNRELIABLE NL_RELIABLE_PACKETS NL_BROADCAST"), NL_IPX, NL_FALSE, ipx_Init, ipx_Shutdown, ipx_Listen, ipx_AcceptConnection, ipx_Open, ipx_Connect, ipx_Close, ipx_Read, ipx_Write, ipx_AddrToString, ipx_StringToAddr, ipx_GetLocalAddr, ipx_GetAllLocalAddr, ipx_SetLocalAddr, ipx_GetNameFromAddr, ipx_GetNameFromAddrAsync, ipx_GetAddrFromName, ipx_GetAddrFromNameAsync, ipx_AddrCompare, ipx_GetPortFromAddr, ipx_SetAddrPort, ipx_GetSystemError, ipx_PollGroup, ipx_Hint } #endif /* WINDOWS_APP && NL_INCLUDE_IPX */ , { (NLchar*)NULL, } }; /* Internal helper functions. */ static NLboolean isSafeString(const NLchar *string) { int i; NLboolean nullfound = NL_FALSE; /* make sure string is null terminated at less than NL_MAX_STRING_LENGTH */ for(i=0;ireadlock) == NL_FALSE || nlMutexInit(&sock->writelock) == NL_FALSE) { (void)nlMutexUnlock(&socklock); return NL_INVALID; } } else /* there is an open socket slot somewhere below nlNextsocket */ { NLsocket i; NLmutex readlock, writelock; for(i=0;iinuse == NL_FALSE) { /* found an open socket slot */ newsocket = i; sock = nlSockets[i]; break; } } /* let's check just to make sure we did find a socket */ if(sock == NULL) { (void)nlMutexUnlock(&socklock); nlSetError(NL_OUT_OF_MEMORY); return NL_INVALID; } readlock = sock->readlock; writelock = sock->writelock; /* clear the structure */ memset(sock, 0, sizeof(nl_socket_t)); sock->readlock = readlock; sock->writelock = writelock; } /* sockets are blocking until set for non-blocking */ sock->blocking = nlBlocking; sock->inuse = NL_TRUE; nlNumsockets++; (void)nlMutexUnlock(&socklock); return newsocket; } static void nlReturnSocket(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; if((sock != NULL) && (sock->inuse == NL_TRUE)) { sock->inuse = NL_FALSE; if(sock->inbuf != NULL) { free(sock->inbuf); sock->inbuf = NULL; } if(sock->outbuf != NULL) { free(sock->outbuf); sock->outbuf = NULL; } nlNumsockets--; } } void nlFreeSocket(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; if(sock != NULL) { if(sock->inbuf != NULL) { free(sock->inbuf); } if(sock->outbuf != NULL) { free(sock->outbuf); } (void)nlMutexDestroy(&sock->readlock); (void)nlMutexDestroy(&sock->writelock); free(sock); } } NLboolean nlIsValidSocket(NLsocket socket) { nl_socket_t *sock; if(socket < 0 || socket > nlMaxNumsockets) { nlSetError(NL_INVALID_SOCKET); return NL_FALSE; } sock = nlSockets[socket]; if(sock == NULL) { nlSetError(NL_INVALID_SOCKET); return NL_FALSE; } if(sock->inuse == NL_FALSE) { nlSetError(NL_INVALID_SOCKET); return NL_FALSE; } return NL_TRUE; } NLboolean nlLockSocket(NLsocket socket, NLint which) { nl_socket_t *sock = nlSockets[socket]; if((which&NL_READ) > 0) { if(nlMutexLock(&sock->readlock) == NL_FALSE) { return NL_FALSE; } } if((which&NL_WRITE) > 0) { if(nlMutexLock(&sock->writelock) == NL_FALSE) { if((which&NL_READ) > 0) { (void)nlMutexUnlock(&sock->readlock); } return NL_FALSE; } } return NL_TRUE; } void nlUnlockSocket(NLsocket socket, NLint which) { nl_socket_t *sock = nlSockets[socket]; if((which&NL_WRITE) > 0) { (void)nlMutexUnlock(&sock->writelock); } if((which&NL_READ) > 0) { (void)nlMutexUnlock(&sock->readlock); } } static void nlUpdateStats(volatile nl_stats_t *stats, NLint nbytes, NLint npackets) { time_t t; (void)time(&t); if(stats->stime == 0) { /* must be the first time through */ stats->stime = t; stats->lastbucket = -1; stats->firstround = NL_TRUE; } /* do the basic update */ stats->packets += npackets; stats->bytes += nbytes; /* check to see if we need to do the full update */ if(stats->stime != t) { NLint i; NLlong count = 0; time_t diff = t - stats->stime; stats->stime = t; if(stats->curbytes > stats->highest) { stats->highest = stats->curbytes; } if(diff >= NL_NUM_BUCKETS) { diff = NL_NUM_BUCKETS; } while(diff > 1) { /* we need to zero out skipped over buckets */ stats->lastbucket++; if(stats->lastbucket == NL_NUM_BUCKETS) { stats->lastbucket = 0; } stats->bucket[stats->lastbucket] = 0; diff--; } stats->lastbucket++; if(stats->lastbucket == NL_NUM_BUCKETS) { stats->lastbucket = 0; stats->firstround = NL_FALSE; } stats->bucket[stats->lastbucket] = stats->curbytes; if(stats->firstround == NL_TRUE) { /* this corrects the stats for the first second */ for(i=stats->lastbucket + 1;ibucket[i] = stats->curbytes; } } stats->curbytes = 0; for(i=0;ibucket[i]; } stats->average = count / NL_NUM_BUCKETS; } stats->curbytes += nbytes; } static void nlUpdateInStats(NLint nbytes, NLint npackets) { if(nlState.socketStats == NL_FALSE) { return; } (void)nlMutexLock(&instatlock); nlUpdateStats(&nlInstats, nbytes, npackets); (void)nlMutexUnlock(&instatlock); } static void nlUpdateOutStats(NLint nbytes, NLint npackets) { if(nlState.socketStats == NL_FALSE) { return; } (void)nlMutexLock(&outstatlock); nlUpdateStats(&nlOutstats, nbytes, npackets); (void)nlMutexUnlock(&outstatlock); } static void nlUpdateSocketInStats(NLsocket socket, NLint nbytes, NLint npackets) { nl_socket_t *sock = nlSockets[socket]; if(nlState.socketStats == NL_FALSE) { return; } nlUpdateStats(&sock->instats, nbytes, npackets); } static void nlUpdateSocketOutStats(NLsocket socket, NLint nbytes, NLint npackets) { nl_socket_t *sock = nlSockets[socket]; if(nlState.socketStats == NL_FALSE) { return; } nlUpdateStats(&sock->outstats, nbytes, npackets); } /* Low level functions, a thin layer over Sockets. */ /* Trys to init all drivers, BUT DOES NOT SELECT A DRIVER */ NL_EXP NLboolean NL_APIENTRY nlInit(void) { int i, numdrivers = 0; nlSetError(NL_NO_ERROR); /* init socket memory, mutexes, and global variables */ if(nlInitCount == 0) { nlMaxNumsockets = NL_MIN_SOCKETS; if(nlSockets == NULL) { nlSockets = (nl_socket_t **)malloc(nlMaxNumsockets * sizeof(nl_socket_t *)); } if(nlSockets == NULL) { nlSetError(NL_OUT_OF_MEMORY); nlShutdown(); return NL_FALSE; } if(nlGroupInit() == NL_FALSE) { nlShutdown(); return NL_FALSE; } if(nlMutexInit(&socklock) == NL_FALSE || nlMutexInit(&instatlock) == NL_FALSE || nlMutexInit(&outstatlock) == NL_FALSE) { nlShutdown(); return NL_FALSE; } nlNumsockets = 0; nlNextsocket = 0; nlBlocking = NL_FALSE; nlState.socketStats = NL_FALSE; nlState.nl_big_endian_data = NL_TRUE; for(i=0;i 0) { return; } if(driver != NULL) { /* close any open sockets */ (void)nlMutexLock(&socklock); if(nlSockets != NULL) { NLsocket i; for(i=0;iClose(i); nlThreadYield(); } } } } /* now we can shutdown the driver */ driver->Shutdown(); driver->initialized = NL_FALSE; driver = NULL; } else { nlSetError(NL_NO_NETWORK); } nlThreadSleep(1); /* now free all the socket structures */ if(nlSockets != NULL) { NLsocket i; for(i=0;iListen(socket); nlUnlockSocket(socket, NL_BOTH); return result; } nlSetError(NL_INVALID_SOCKET); return NL_FALSE; } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Accepts a pending connection. Creates a new socket object for this connection. */ NL_EXP NLsocket NL_APIENTRY nlAcceptConnection(NLsocket socket) { if(driver) { if(nlIsValidSocket(socket) == NL_TRUE) { NLsocket newsocket; if(nlLockSocket(socket, NL_BOTH) == NL_FALSE) { return NL_INVALID; } newsocket = driver->AcceptConnection(socket); nlUnlockSocket(socket, NL_BOTH); if(newsocket != NL_INVALID) { /* the new socket was locked when it is created */ nlUnlockSocket(newsocket, NL_BOTH); } return newsocket; } nlSetError(NL_INVALID_SOCKET); return NL_INVALID; } nlSetError(NL_NO_NETWORK); return NL_INVALID; } /* Creates a new socket object. Can be used for reading or broadcast as is. For non-broadcast use, call nlConnectSocket to connect to a remote address. */ NL_EXP NLsocket NL_APIENTRY nlOpen(NLushort port, NLenum type) { if(driver) { return (driver->Open(port, type)); } nlSetError(NL_NO_NETWORK); return NL_INVALID; } /* Connect a socket to a remote address. */ NL_EXP NLboolean NL_APIENTRY nlConnect(NLsocket socket, const NLaddress *address) { if(driver) { if(nlIsValidSocket(socket) == NL_TRUE) { if(address == NULL) { nlSetError(NL_NULL_POINTER); } else { NLboolean result; if(nlLockSocket(socket, NL_BOTH) == NL_FALSE) { return NL_FALSE; } result = driver->Connect(socket, address); nlUnlockSocket(socket, NL_BOTH); return result; } } else { nlSetError(NL_INVALID_SOCKET); } return NL_FALSE; } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Close the socket. */ NL_EXP NLboolean NL_APIENTRY nlClose(NLsocket socket) { if(driver) { if(nlIsValidSocket(socket) == NL_TRUE) { if(nlMutexLock(&socklock) == NL_FALSE) { return NL_FALSE; } if(nlLockSocket(socket, NL_BOTH) == NL_FALSE) { return NL_FALSE; } driver->Close(socket); /* return the socket for reuse */ nlReturnSocket(socket); nlUnlockSocket(socket, NL_BOTH); if(nlMutexUnlock(&socklock) == NL_FALSE) { return NL_FALSE; } return NL_TRUE; } else { nlSetError(NL_INVALID_SOCKET); return NL_TRUE; } } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Reads from a socket. */ NL_EXP NLint NL_APIENTRY nlRead(NLsocket socket, NLvoid *buffer, NLint nbytes) { if(driver) { if(nlIsValidSocket(socket) == NL_TRUE) { if(buffer == NULL) { nlSetError(NL_NULL_POINTER); } else { NLint received; if(nlLockSocket(socket, NL_READ) == NL_FALSE) { return NL_INVALID; } received = driver->Read(socket, buffer, nbytes); if(received > 0) { nlUpdateSocketInStats(socket, received, 1); nlUpdateInStats(received, 1); } nlUnlockSocket(socket, NL_READ); return received; } } else { nlSetError(NL_INVALID_SOCKET); } return NL_INVALID; } nlSetError(NL_NO_NETWORK); return NL_INVALID; } /* Writes to a socket. */ NL_EXP NLint NL_APIENTRY nlWrite(NLsocket socket, const NLvoid *buffer, NLint nbytes) { if(driver) { /* check for group */ if(socket >= NL_FIRST_GROUP) { NLint number = NL_MAX_GROUP_SOCKETS; NLsocket s[NL_MAX_GROUP_SOCKETS]; NLint i; NLint sent = nbytes; if(nlGroupGetSockets((NLint)socket, (NLsocket *)s, &number) == NL_FALSE) { return NL_INVALID; } for(i=0;iWrite(socket, buffer, nbytes); if(sent > 0) { nlUpdateSocketOutStats(socket, sent, 1); nlUpdateOutStats(sent, 1); } nlUnlockSocket(socket, NL_WRITE); return sent; } } else { nlSetError(NL_INVALID_SOCKET); } return NL_INVALID; } } nlSetError(NL_NO_NETWORK); return NL_INVALID; } /* Polls all sockets in the group to see which have data waiting to be read. nlPollGroup uses select() on TCP or UDP sockets. Returns number of sockets waiting, and a list of those sockets, or NL_INVALID on an error. */ NL_EXP NLint NL_APIENTRY nlPollGroup(NLint group, NLenum name, /*@out@*/ NLsocket *sockets, NLint number, NLint timeout) { if(driver) { if(sockets == NULL ) { nlSetError(NL_NULL_POINTER); return 0; } return (driver->PollGroup(group, name, sockets, number, timeout)); } nlSetError(NL_NO_NETWORK); return 0; } NL_EXP NLboolean NL_APIENTRY nlHint(NLenum name, NLint arg) { if(driver) { return driver->Hint(name, arg); } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Converts the numeric address in the NLaddress structure to a string. */ NL_EXP /*@null@*/ NLchar* NL_APIENTRY nlAddrToString(const NLaddress *address, NLchar *string) { if(driver) { if((string == NULL) || (address == NULL)) { nlSetError(NL_NULL_POINTER); return NULL; } return (driver->AddrToString(address, string)); } nlSetError(NL_NO_NETWORK); return NULL; } /* Takes a string that contains a full network address (ie, for IP 192.168.0.1:27000), and adds it to the NLaddress structure. */ NL_EXP NLboolean NL_APIENTRY nlStringToAddr(const NLchar *string, NLaddress *address) { if(driver) { if((string == NULL) || (address == NULL)) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(isSafeString(string) == NL_FALSE) { nlSetError(NL_STRING_OVER_RUN); return NL_FALSE; } return driver->StringToAddr(string, address); } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Gets the remote address of the socket if connected to a remote host, or the local address if not connected. */ /* Note: the drivers put a copy of address in nl_socket_t, so we just need to copy it */ NL_EXP NLboolean NL_APIENTRY nlGetRemoteAddr(NLsocket socket, NLaddress *address) { if(driver) { if(address == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(nlIsValidSocket(socket) == NL_TRUE) { nl_socket_t *sock = nlSockets[socket]; if(nlLockSocket(socket, NL_READ) == NL_FALSE) { return NL_FALSE; } memcpy(address, &sock->addressin, sizeof(NLaddress)); address->valid = NL_TRUE; nlUnlockSocket(socket, NL_READ); } else { nlSetError(NL_INVALID_SOCKET); memset(address, 0, sizeof(NLaddress)); return NL_FALSE; } return NL_TRUE; } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Sets the remote address of an unconnected UDP socket. */ NL_EXP NLboolean NL_APIENTRY nlSetRemoteAddr(NLsocket socket, const NLaddress *address) { if(driver) { if(nlIsValidSocket(socket) == NL_TRUE) { if(address == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } else { nl_socket_t *sock = nlSockets[socket]; if(nlLockSocket(socket, NL_WRITE) == NL_FALSE) { return NL_FALSE; } memcpy(&sock->addressout, address, sizeof(NLaddress)); nlUnlockSocket(socket, NL_WRITE); } } else { nlSetError(NL_INVALID_SOCKET); return NL_FALSE; } return NL_TRUE; } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Gets the local address. */ NL_EXP NLboolean NL_APIENTRY nlGetLocalAddr(NLsocket socket, NLaddress *address) { if(driver) { if(nlIsValidSocket(socket) == NL_TRUE) { if(address == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(nlLockSocket(socket, NL_READ) == NL_FALSE) { return NL_FALSE; } if(driver->GetLocalAddr(socket, address) == NL_FALSE) { nlUnlockSocket(socket, NL_READ); return NL_FALSE; } nlUnlockSocket(socket, NL_READ); } else { nlSetError(NL_INVALID_SOCKET); return NL_FALSE; } return NL_TRUE; } nlSetError(NL_NO_NETWORK); return NL_FALSE; } NL_EXP NLaddress * NL_APIENTRY nlGetAllLocalAddr(/*@out@*/ NLint *count) { if(driver) { if(count == NULL) { nlSetError(NL_NULL_POINTER); return NULL; } return driver->GetAllLocalAddr(count); } nlSetError(NL_NO_NETWORK); return NULL; } NL_EXP NLboolean NL_APIENTRY nlSetLocalAddr(const NLaddress *address) { if(driver) { if(address == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } return driver->SetLocalAddr(address); } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Resolves the name from the address. */ NL_EXP /*@null@*/ NLchar* NL_APIENTRY nlGetNameFromAddr(const NLaddress *address, NLchar *name) { if(driver) { if((name == NULL) || (address == NULL)) { nlSetError(NL_NULL_POINTER); return NULL; } return (driver->GetNameFromAddr(address, name)); } nlSetError(NL_NO_NETWORK); return NULL; } /* Resolves the name from the address asynchronously. */ NL_EXP NLboolean NL_APIENTRY nlGetNameFromAddrAsync(const NLaddress *address, NLchar *name) { if(driver) { if((name == NULL) || (address == NULL)) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } return driver->GetNameFromAddrAsync(address, name); } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Get the address from a host name. */ NL_EXP NLboolean NL_APIENTRY nlGetAddrFromName(const NLchar *name, NLaddress *address) { if(driver) { if((name == NULL) || (address == NULL)) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(isSafeString(name) == NL_FALSE) { nlSetError(NL_STRING_OVER_RUN); return NL_FALSE; } return driver->GetAddrFromName(name, address); } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Get the address from a host name asynchronously. */ NL_EXP NLboolean NL_APIENTRY nlGetAddrFromNameAsync(const NLchar *name, NLaddress *address) { if(driver) { if((name == NULL) || (address == NULL)) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(isSafeString(name) == NL_FALSE) { nlSetError(NL_STRING_OVER_RUN); return NL_FALSE; } return driver->GetAddrFromNameAsync(name, address); } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Compare two addresses. */ NL_EXP NLboolean NL_APIENTRY nlAddrCompare(const NLaddress *address1, const NLaddress *address2) { if(driver) { if((address1 == NULL) || (address2 == NULL)) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } return driver->AddrCompare(address1, address2); } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Get the port number from an address. */ NL_EXP NLushort NL_APIENTRY nlGetPortFromAddr(const NLaddress *address) { if(driver) { if(address == NULL) { nlSetError(NL_NULL_POINTER); return 0; } return driver->GetPortFromAddr(address); } nlSetError(NL_NO_NETWORK); return 0; } /* Set the port number in the address. */ NL_EXP NLboolean NL_APIENTRY nlSetAddrPort(NLaddress *address, NLushort port) { if(driver) { if(address == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } driver->SetAddrPort(address, port); return NL_TRUE; } nlSetError(NL_NO_NETWORK); return NL_FALSE; } /* Non-socket functions */ /* Select the network to use. */ NL_EXP NLboolean NL_APIENTRY nlSelectNetwork(NLenum network) { int i, found = 0; if(driver != NULL) { /* we cannot select a new network without shutting down first */ nlSetError(NL_SELECT_NET_ERROR); return NL_FALSE; } for(i=0;i 0) { nlSetError(NL_INVALID_TYPE); } else { nlSetError(NL_INVALID_ENUM); } return NL_FALSE; } /* Returns a string corresponding to the NLenum. */ NL_EXP const /*@observer@*//*@null@*/ NLchar* NL_APIENTRY nlGetString(NLenum name) { /* use seperate strings for thread safety */ static NLchar vstring[NL_MAX_STRING_LENGTH]; static NLchar tstring[NL_MAX_STRING_LENGTH]; NLint i; /* intitialize the version string */ _tcsncpy(vstring, (NLchar *)TEXT(NL_VERSION_STRING), (size_t)NL_MAX_STRING_LENGTH); vstring[NL_MAX_STRING_LENGTH - 1] = (NLchar) '\0'; #ifdef _UNICODE /* add the UNICODE string */ safecat(vstring, (NLchar *)TEXT(" UNICODE version")); #endif /* intitialize the network types string */ memset(tstring, 0, sizeof(NLchar) * NL_MAX_STRING_LENGTH); for(i=0;iconnections); } break; default: nlSetError(NL_INVALID_ENUM); } return NULL; } /* Returns an integer corresponding to the NLenum. */ NL_EXP NLlong NL_APIENTRY nlGetInteger(NLenum name) { switch (name) { case NL_PACKETS_SENT: return nlOutstats.packets; case NL_BYTES_SENT: return nlOutstats.bytes; case NL_AVE_BYTES_SENT: nlUpdateOutStats(0, 0); return nlOutstats.average; case NL_HIGH_BYTES_SENT: return nlOutstats.highest; case NL_PACKETS_RECEIVED: return nlInstats.packets; case NL_BYTES_RECEIVED: return nlInstats.bytes; case NL_AVE_BYTES_RECEIVED: nlUpdateInStats(0, 0); return nlInstats.average; case NL_HIGH_BYTES_RECEIVED: return nlInstats.highest; case NL_OPEN_SOCKETS: return nlNumsockets; default: nlSetError(NL_INVALID_ENUM); } return 0; } /* Clears the stat corresponding to the NLenum. */ NL_EXP NLboolean NL_APIENTRY nlClear(NLenum name) { switch (name) { case NL_PACKETS_SENT: if(nlMutexLock(&outstatlock) == NL_FALSE) { return NL_FALSE; } nlOutstats.packets = 0; if(nlMutexUnlock(&outstatlock) == NL_FALSE) { return NL_FALSE; } break; case NL_BYTES_SENT: if(nlMutexLock(&outstatlock) == NL_FALSE) { return NL_FALSE; } nlOutstats.bytes = 0; if(nlMutexUnlock(&outstatlock) == NL_FALSE) { return NL_FALSE; } break; case NL_AVE_BYTES_SENT: if(nlMutexLock(&outstatlock) == NL_FALSE) { return NL_FALSE; } nlOutstats.average = 0; memset((NLbyte *)nlOutstats.bucket, 0, sizeof(NLlong) * NL_NUM_BUCKETS); if(nlMutexUnlock(&outstatlock) == NL_FALSE) { return NL_FALSE; } break; case NL_HIGH_BYTES_SENT: if(nlMutexLock(&outstatlock) == NL_FALSE) { return NL_FALSE; } nlOutstats.highest = 0; if(nlMutexUnlock(&outstatlock) == NL_FALSE) { return NL_FALSE; } break; case NL_PACKETS_RECEIVED: if(nlMutexLock(&instatlock) == NL_FALSE) { return NL_FALSE; } nlInstats.packets = 0; if(nlMutexUnlock(&instatlock) == NL_FALSE) { return NL_FALSE; } break; case NL_BYTES_RECEIVED: if(nlMutexLock(&instatlock) == NL_FALSE) { return NL_FALSE; } nlInstats.bytes = 0; if(nlMutexUnlock(&instatlock) == NL_FALSE) { return NL_FALSE; } break; case NL_AVE_BYTES_RECEIVED: if(nlMutexLock(&instatlock) == NL_FALSE) { return NL_FALSE; } nlInstats.average = 0; memset((NLbyte *)nlInstats.bucket, 0, sizeof(NLlong) * NL_NUM_BUCKETS); if(nlMutexUnlock(&instatlock) == NL_FALSE) { return NL_FALSE; } break; case NL_HIGH_BYTES_RECEIVED: if(nlMutexLock(&instatlock) == NL_FALSE) { return NL_FALSE; } nlInstats.highest = 0; if(nlMutexUnlock(&instatlock) == NL_FALSE) { return NL_FALSE; } break; case NL_ALL_STATS: (void)nlClear(NL_PACKETS_SENT); (void)nlClear(NL_BYTES_SENT); (void)nlClear(NL_AVE_BYTES_SENT); (void)nlClear(NL_HIGH_BYTES_SENT); (void)nlClear(NL_PACKETS_RECEIVED); (void)nlClear(NL_BYTES_RECEIVED); (void)nlClear(NL_AVE_BYTES_RECEIVED); (void)nlClear(NL_HIGH_BYTES_RECEIVED); break; default: nlSetError(NL_INVALID_ENUM); return NL_FALSE; } return NL_TRUE; } /* Get the socket or system error. */ NL_EXP NLint NL_APIENTRY nlGetSystemError(void) { if(driver) { return driver->GetSystemError(); } return NL_NO_NETWORK; } NL_EXP NLboolean NL_APIENTRY nlEnable(NLenum name) { switch (name) { case NL_BLOCKING_IO: nlBlocking = NL_TRUE; break; case NL_TCP_NO_DELAY: return nlHint(NL_TCP_NO_DELAY, (NLint)NL_TRUE); case NL_SOCKET_STATS: nlState.socketStats = NL_TRUE; break; case NL_BIG_ENDIAN_DATA: nlState.nl_big_endian_data = NL_TRUE; break; case NL_LITTLE_ENDIAN_DATA: nlState.nl_big_endian_data = NL_FALSE; break; default: nlSetError(NL_INVALID_ENUM); return NL_FALSE; } return NL_TRUE; } NL_EXP NLboolean NL_APIENTRY nlDisable(NLenum name) { switch (name) { case NL_BLOCKING_IO: nlBlocking = NL_FALSE; break; case NL_TCP_NO_DELAY: return nlHint(NL_TCP_NO_DELAY, NL_FALSE); case NL_SOCKET_STATS: nlState.socketStats = NL_FALSE; break; case NL_BIG_ENDIAN_DATA: nlState.nl_big_endian_data = NL_FALSE; break; case NL_LITTLE_ENDIAN_DATA: nlState.nl_big_endian_data = NL_TRUE; break; default: nlSetError(NL_INVALID_ENUM); return NL_FALSE; } return NL_TRUE; } NL_EXP NLboolean NL_APIENTRY nlGetBoolean(NLenum name) { switch (name) { case NL_BLOCKING_IO: return nlBlocking; case NL_SOCKET_STATS: return nlState.socketStats; case NL_BIG_ENDIAN_DATA: return nlState.nl_big_endian_data; case NL_LITTLE_ENDIAN_DATA: return (NLboolean)(nlState.nl_big_endian_data == NL_TRUE ? NL_FALSE:NL_TRUE); default: nlSetError(NL_INVALID_ENUM); return NL_FALSE; } } NL_EXP NLlong NL_APIENTRY nlGetSocketStat(NLsocket socket, NLenum name) { nl_socket_t *sock; NLlong result = 0; if(nlIsValidSocket(socket) == NL_FALSE) { nlSetError(NL_INVALID_SOCKET); return 0; } if(nlLockSocket(socket, NL_BOTH) == NL_FALSE) { return 0; } sock = nlSockets[socket]; switch (name) { case NL_PACKETS_SENT: result = sock->outstats.packets; break; case NL_BYTES_SENT: result = sock->outstats.bytes; break; case NL_AVE_BYTES_SENT: nlUpdateSocketOutStats(socket, 0, 0); result = sock->outstats.average; if(result == 0) { /* this corrects the stats for the first second */ result = sock->outstats.curbytes; } break; case NL_HIGH_BYTES_SENT: result = sock->outstats.highest; break; case NL_PACKETS_RECEIVED: result = sock->instats.packets; break; case NL_BYTES_RECEIVED: result = sock->instats.bytes; break; case NL_AVE_BYTES_RECEIVED: nlUpdateSocketInStats(socket, 0, 0); result = sock->instats.average; if(result == 0) { /* this corrects the stats for the first second */ result = sock->instats.curbytes; } break; case NL_HIGH_BYTES_RECEIVED: result = sock->instats.highest; break; default: nlSetError(NL_INVALID_ENUM); } nlUnlockSocket(socket, NL_BOTH); return result; } NL_EXP NLboolean NL_APIENTRY nlClearSocketStat(NLsocket socket, NLenum name) { nl_socket_t *sock; if(nlIsValidSocket(socket) == NL_FALSE) { nlSetError(NL_INVALID_SOCKET); return NL_FALSE; } if(nlLockSocket(socket, NL_BOTH) == NL_FALSE) { return NL_FALSE; } sock = nlSockets[socket]; switch (name) { case NL_PACKETS_SENT: sock->outstats.packets = 0; break; case NL_BYTES_SENT: sock->outstats.bytes = 0; break; case NL_AVE_BYTES_SENT: sock->outstats.average = 0; memset((NLbyte *)sock->outstats.bucket, 0, sizeof(NLlong) * NL_NUM_BUCKETS); break; case NL_HIGH_BYTES_SENT: sock->outstats.highest = 0; break; case NL_PACKETS_RECEIVED: sock->instats.packets = 0; break; case NL_BYTES_RECEIVED: sock->instats.bytes = 0; break; case NL_AVE_BYTES_RECEIVED: sock->instats.average = 0; memset((NLbyte *)sock->instats.bucket, 0, sizeof(NLlong) * NL_NUM_BUCKETS); break; case NL_HIGH_BYTES_RECEIVED: sock->instats.highest = 0; break; case NL_ALL_STATS: sock->outstats.packets = 0; sock->outstats.bytes = 0; sock->outstats.average = 0; memset((NLbyte *)sock->outstats.bucket, 0, sizeof(NLlong) * NL_NUM_BUCKETS); sock->outstats.highest = 0; sock->instats.packets = 0; sock->instats.bytes = 0; sock->instats.average = 0; memset((NLbyte *)sock->instats.bucket, 0, sizeof(NLlong) * NL_NUM_BUCKETS); sock->instats.highest = 0; break; default: nlSetError(NL_INVALID_ENUM); nlUnlockSocket(socket, NL_BOTH); return NL_FALSE; } nlUnlockSocket(socket, NL_BOTH); return NL_TRUE; } NL_EXP NLushort NL_APIENTRY nlSwaps(NLushort x) { if(NL_SWAP_TRUE) { return (NLushort)(((((NLushort)x) & 0x00ff) << 8) | ((((NLushort)x) & 0xff00) >> 8)); } else { return x; } } NL_EXP NLulong NL_APIENTRY nlSwapl(NLulong x) { if(NL_SWAP_TRUE) { return (NLulong)(((((NLulong)x) & 0x000000ff) << 24) | ((((NLulong)x) & 0x0000ff00) << 8) | ((((NLulong)x) & 0x00ff0000) >> 8) | ((((NLulong)x) & 0xff000000) >> 24)); } else { return x; } } NL_EXP NLfloat NL_APIENTRY nlSwapf(NLfloat f) { if(NL_SWAP_TRUE) { NLulong temp = (NLulong)nlSwapl(*(NLulong *)&f); return *((float *)&temp); } else { return f; } } NL_EXP NLdouble NL_APIENTRY nlSwapd(NLdouble d) { if(NL_SWAP_TRUE) { union {NLulong l[2]; NLdouble d;} in, out; in.d = d; out.l[0] = nlSwapl(in.l[1]); out.l[1] = nlSwapl(in.l[0]); return out.d; } else { return d; } } #if defined (__LCC__) BOOL WINAPI __declspec(dllexport) LibMain(/*@unused@*/HINSTANCE hinstDLL, /*@unused@*/DWORD fdwReason, /*@unused@*/LPVOID lpvReserved) { return TRUE; } #endif /* WINDOWS APP */ hawknl-1.6.8+dfsg2/src/nlinternal.h000066400000000000000000000242031130562644400171270ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #ifndef INTERNAL_H #define INTERNAL_H #include "../include/nl.h" /* for malloc and free */ #include #ifndef MACOSX #include #endif /* Windows CE does not have time.h functions */ #if defined (_WIN32_WCE) extern time_t time(time_t *timer); #else #include #endif #ifdef NL_LITTLE_ENDIAN #define NL_SWAP_TRUE (nlState.nl_big_endian_data == NL_TRUE) #else #define NL_SWAP_TRUE (nlState.nl_big_endian_data != NL_TRUE) #endif /* NL_LITTLE_ENDIAN */ #ifdef WINDOWS_APP /* Windows systems */ #ifdef _MSC_VER #pragma warning (disable:4201) #pragma warning (disable:4214) #endif /* _MSC_VER */ #define WIN32_LEAN_AND_MEAN #include #include #ifdef _MSC_VER #pragma warning (default:4201) #pragma warning (default:4214) #endif /* _MSC_VER */ #endif /* part of portable unicode support */ #if !defined _TCHAR_DEFINED && !(defined _WCHAR_T_DEFINED && defined (__LCC__)) #ifdef _UNICODE #define TEXT(x) L##x #define _tcsncat wcsncat #define _stprintf swprintf #define _sntprintf snwprintf #define _stscanf swscanf #define _tcsncpy wcsncpy #define _tcscspn wcscspn #define _tcschr wcschr #define _tcslen wcslen #define _tcsrchr wcsrchr #ifdef WINDOWS_APP #define _ttoi _wtoi #else /* !WINDOWS_APP*/ #define _ttoi wtoi #endif /* !WINDOWS_APP*/ #else /* !UNICODE */ #define TEXT(x) x #define _tcsncat strncat #define _stprintf sprintf #define _sntprintf snprintf #define _stscanf sscanf #define _tcsncpy strncpy #define _tcscspn strcspn #define _tcschr strchr #define _tcslen strlen #define _ttoi atoi #define _tcsrchr strrchr #endif /* !UNICODE */ #endif /* _INC_TCHAR */ /* internally for TCP packets and UDP connections, all data is big endien, so we force it so here using these macros */ #undef writeShort #define writeShort(x, y, z) {*((NLushort *)((NLbyte *)&x[y])) = htons(z); y += 2;} #undef readShort #define readShort(x, y, z) {z = ntohs(*(NLushort *)((NLbyte *)&x[y])); y += 2;} #define NL_FIRST_GROUP (200000 + 1) /* the minumum number of sockets that will be allocated */ #define NL_MIN_SOCKETS 16 /* number of buckets for average bytes/second */ #define NL_NUM_BUCKETS 8 /* number of packets stored for NL_LOOP_BACK */ #define NL_NUM_PACKETS 8 #define NL_MAX_ACCEPT 10 /* for nlLockSocket and nlUnlockSocket */ #define NL_READ 0x0001 #define NL_WRITE 0x0002 #define NL_BOTH (NL_READ|NL_WRITE) /* time in milliseconds that unreliable connect/accepts sleep while waiting */ #define NL_CONNECT_SLEEP 50 #ifdef __cplusplus extern "C" { #endif /* the driver object */ typedef struct { const NLchar /*@observer@*/*name; const NLchar /*@observer@*/*connections; NLenum type; NLboolean initialized; NLboolean (*Init)(void); void (*Shutdown)(void); NLboolean (*Listen)(NLsocket socket); NLsocket (*AcceptConnection)(NLsocket socket); NLsocket (*Open)(NLushort port, NLenum type); NLboolean (*Connect)(NLsocket socket, const NLaddress *address); void (*Close)(NLsocket socket); NLint (*Read)(NLsocket socket, /*@out@*/ NLvoid *buffer, NLint nbytes); NLint (*Write)(NLsocket socket, const NLvoid *buffer, NLint nbytes); NLchar *(*AddrToString)(const NLaddress *address, /*@returned@*/ /*@out@*/ NLchar *string); NLboolean (*StringToAddr)(const NLchar *string, /*@out@*/ NLaddress *address); NLboolean (*GetLocalAddr)(NLsocket socket, /*@out@*/ NLaddress *address); NLaddress *(*GetAllLocalAddr)(/*@out@*/ NLint *count); NLboolean (*SetLocalAddr)(const NLaddress *address); NLchar *(*GetNameFromAddr)(const NLaddress *address, /*@returned@*/ /*@out@*/ NLchar *name); NLboolean (*GetNameFromAddrAsync)(const NLaddress *address, /*@out@*/ NLchar *name); NLboolean (*GetAddrFromName)(const NLchar *name, /*@out@*/ NLaddress *address); NLboolean (*GetAddrFromNameAsync)(const NLchar *name, /*@out@*/ NLaddress *address); NLboolean (*AddrCompare)(const NLaddress *address1, const NLaddress *address2); NLushort (*GetPortFromAddr)(const NLaddress *address); void (*SetAddrPort)(NLaddress *address, NLushort port); NLint (*GetSystemError)(void); NLint (*PollGroup)(NLint group, NLenum name, /*@out@*/ NLsocket *sockets, NLint number, NLint timeout); NLboolean (*Hint)(NLenum name, NLint arg); } nl_netdriver_t; typedef struct { NLlong bytes; /* bytes sent/received */ NLlong packets; /* packets sent/received */ NLlong highest; /* highest bytes/sec sent/received */ NLlong average; /* average bytes/sec sent/received */ time_t stime; /* the last time stats were updated */ NLint lastbucket; /* the last bucket that was used */ NLlong curbytes; /* current bytes sent/received */ NLlong bucket[NL_NUM_BUCKETS];/* buckets for sent/received counts */ NLboolean firstround; /* is this the first round through the buckets? */ } nl_stats_t; typedef struct { /* info for NL_LOOP_BACK, NL_SERIAL, and NL_PARALLEL */ NLbyte *outpacket[NL_NUM_PACKETS];/* temp storage for packet data */ NLbyte *inpacket[NL_NUM_PACKETS];/* temp storage for packet data */ NLint outlen[NL_NUM_PACKETS];/* the length of each packet */ NLint inlen[NL_NUM_PACKETS];/* the length of each packet */ NLint nextoutused; /* the next used packet */ NLint nextinused; /* the next used packet */ NLint nextoutfree; /* the next free packet */ NLint nextinfree; /* the next free packet */ NLsocket accept[NL_MAX_ACCEPT];/* pending connects */ NLsocket consock; /* the socket this socket is connected to */ } nl_extra_t; /* the internal socket object */ typedef struct { /* the current status of the socket */ NLenum driver; /* the driver used with this socket */ NLenum type; /* type of socket */ NLboolean inuse; /* is in use */ NLboolean connecting; /* a non-blocking TCP or UDP connection is in process */ NLboolean conerror; /* an error occured on a UDP connect */ NLboolean connected; /* is connected */ NLboolean reliable; /* do we use reliable */ NLboolean blocking; /* is set to blocking */ NLboolean listen; /* can receive an incoming connection */ NLint realsocket; /* the real socket number */ NLushort localport; /* local port number */ NLushort remoteport; /* remote port number */ NLaddress addressin; /* address of remote system, same as the socket sockaddr_in structure */ NLaddress addressout; /* the multicast address set by nlConnect or the remote address for unconnected UDP */ NLmutex readlock; /* socket is locked to update data */ NLmutex writelock; /* socket is locked to update data */ /* the current read/write statistics for the socket */ nl_stats_t instats; /* stats for received */ nl_stats_t outstats; /* stats for sent */ /* NL_RELIABLE_PACKETS info and storage */ NLbyte *outbuf; /* temp storage for partially sent reliable packet data */ NLint outbuflen; /* the length of outbuf */ NLint sendlen; /* how much still needs to be sent */ NLbyte *inbuf; /* temp storage for partially received reliable packet data */ NLint inbuflen; /* the length of inbuf */ NLint reclen; /* how much of the reliable packet we have received */ NLboolean readable; /* a complete packet is in inbuf */ NLboolean message_end; /* a message end error ocured but was not yet reported */ NLboolean packetsync; /* is the reliable packet stream in sync */ /* pointer to extra info needed for NL_LOOP_BACK, NL_SERIAL, and NL_PARALLEL */ nl_extra_t *ext; } nl_socket_t; typedef struct { NLboolean socketStats; /* enable collection of socket read/write statistics, default disabled */ NLboolean nl_big_endian_data; /* is the packet data big endian? */ } nl_state_t; /* used by the drivers to allocate and free socket objects */ NLsocket nlGetNewSocket(void); /* other functions */ NLboolean nlGroupInit(void); void nlGroupShutdown(void); void nlGroupLock(void); void nlGroupUnlock(void); NLboolean nlGroupGetSocketsINT(NLint group, /*@out@*/ NLsocket *socket, /*@in@*/ NLint *number); NLboolean nlIsValidSocket(NLsocket socket); NLboolean nlLockSocket(NLsocket socket, NLint which); void nlUnlockSocket(NLsocket socket, NLint which); void nlSetError(NLenum err); void nlThreadSleep(NLint mseconds); /* globals (as few as possible) */ extern volatile nl_state_t nlState; typedef /*@only@*/ nl_socket_t *pnl_socket_t; extern /*@only@*/ pnl_socket_t *nlSockets; #ifdef __cplusplus } /* extern "C" */ #endif #endif /* INTERNAL_H */ hawknl-1.6.8+dfsg2/src/nltime.c000066400000000000000000000114251130562644400162460ustar00rootroot00000000000000/* HawkNL time module Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #include "nlinternal.h" #ifdef WINDOWS_APP #ifdef _MSC_VER #pragma warning (disable:4201) #pragma warning (disable:4214) #endif /* _MSC_VER */ #include #include #include #ifdef _MSC_VER #pragma warning (default:4201) #pragma warning (default:4214) #endif /* _MSC_VER */ struct mytimeb { time_t time; unsigned short millitm; }; static void myftime(struct mytimeb *tb) { static int needinit = 1; static time_t currentseconds; static DWORD currentmseconds; static DWORD lastmseconds; if(needinit == 1) { time_t t; currentseconds = time(&t); lastmseconds = GetTickCount(); currentmseconds = lastmseconds % 1000; needinit = 0; } else { DWORD mseconds = GetTickCount(); /* check for roll over */ if(mseconds < lastmseconds) { currentmseconds += (UINT_MAX - lastmseconds) + mseconds + 1; } else { currentmseconds += mseconds - lastmseconds; } lastmseconds = mseconds; while(currentmseconds > 1000) { currentseconds++; currentmseconds -= 1000; } } tb->time = currentseconds; tb->millitm = (unsigned short)currentmseconds; } #else /* !WINDOWS_APP */ #include #endif /* !WINDOWS_APP */ NL_EXP NLboolean NL_APIENTRY nlTime(NLtime *t) { #ifdef WINDOWS_APP static NLboolean needinit = NL_TRUE; static NLboolean haspcounter = NL_FALSE; static LARGE_INTEGER freq; static LARGE_INTEGER lastcount; static NLtime currenttime; if(t == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } if(needinit == NL_TRUE) { if(QueryPerformanceFrequency(&freq) != 0) { if(QueryPerformanceCounter(&lastcount) != 0) { /* get the current time */ struct mytimeb tb; myftime(&tb); currenttime.seconds = (NLlong)(tb.time); currenttime.useconds = (NLlong)(tb.millitm * 1000); haspcounter = NL_TRUE; } } needinit = NL_FALSE; } if(haspcounter == NL_TRUE) { LARGE_INTEGER currentcount; LARGE_INTEGER diffcount; (void)QueryPerformanceCounter(¤tcount); diffcount.QuadPart = currentcount.QuadPart - lastcount.QuadPart; lastcount.QuadPart = currentcount.QuadPart; while(diffcount.QuadPart >= freq.QuadPart) { diffcount.QuadPart -= freq.QuadPart; currenttime.seconds++; } currenttime.useconds += (NLlong)(diffcount.QuadPart * 1000000 / freq.QuadPart); if(currenttime.useconds >= 1000000) { currenttime.useconds -= 1000000; currenttime.seconds++; } t->seconds = currenttime.seconds; t->mseconds = currenttime.useconds / 1000; t->useconds = currenttime.useconds; } else { /* fall back to myftime */ struct mytimeb tb; myftime(&tb); t->seconds = (NLlong)(tb.time); t->mseconds = (NLlong)(tb.millitm); t->useconds = (NLlong)(tb.millitm * 1000); } #else /* !WINDOWS_APP */ struct timeval tv; if(t == NULL) { nlSetError(NL_NULL_POINTER); return NL_FALSE; } gettimeofday(&tv, NULL); t->seconds = (NLlong)(tv.tv_sec); t->mseconds = (NLlong)(tv.tv_usec / 1000); t->useconds = (NLlong)(tv.tv_usec); #endif /* !WINDOWS_APP */ return NL_TRUE; } /* Windows CE does not have time.h functions */ #if defined (_WIN32_WCE) time_t time(time_t *timer) { NLtime t; nlTime(&t); *timer = t.seconds; return *timer; } #endif hawknl-1.6.8+dfsg2/src/parallel.h000066400000000000000000000046561130562644400165670ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #ifndef PARALLEL_H #define PARALLEL_H #ifdef __cplusplus extern "C" { #endif NLboolean parallel_Init(void); void parallel_Shutdown(void); NLboolean parallel_Listen(NLsocket socket); NLsocket parallel_AcceptConnection(NLsocket socket); NLsocket parallel_Open(NLushort port, NLenum type); NLboolean parallel_Connect(NLsocket socket, NLaddress *address); NLboolean parallel_Close(NLsocket socket); NLint parallel_Read(NLsocket socket, NLvoid *buffer, NLint nbytes); NLint parallel_Write(NLsocket socket, NLvoid *buffer, NLint nbytes); NLbyte *parallel_AddrToString(NLaddress *address, NLbyte *string); NLboolean parallel_StringToAddr(NLbyte *string, NLaddress *address); NLboolean parallel_GetLocalAddr(NLsocket socket, NLaddress *address); NLboolean parallel_SetLocalAddr(NLaddress *address); NLbyte *parallel_GetNameFromAddr(NLaddress *address, NLbyte *name); NLboolean parallel_GetNameFromAddrAsync(NLaddress *address, NLbyte *name); NLboolean parallel_GetAddrFromName(NLbyte *name, NLaddress *address); NLboolean parallel_GetAddrFromNameAsync(NLbyte *name, NLaddress *address); NLboolean parallel_AddrCompare(NLaddress *address1, NLaddress *address2); NLushort parallel_GetPortFromAddr(NLaddress *address); void parallel_SetAddrPort(NLaddress *address, NLushort port); NLint parallel_GetSystemError(void); NLint parallel_PollGroup(NLint group, NLenum name, NLsocket *sockets, NLint number, NLint timeout); NLboolean parallel_Hint(NLenum name, NLint arg); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* PARALLEL_H */ hawknl-1.6.8+dfsg2/src/readme.txt000066400000000000000000000036711130562644400166140ustar00rootroot00000000000000HawkNL (Hawk Network Library) Project created and maintained by Phil Frisbie, Jr. HawkNL has been tested on the following platforms: Win32 (9x, ME, NT 4.0, 2000, XP, CE) Linux (various flavors) Solaris (2.6, 7 and 8) AIX MacOSX MacOS 7+ SGI Irix Contributors (code, ideas, comments, motivation, etc.): Adam Driscoll aj Alexis Anthony Whitehead cemeni Cristian Ferretti Dan Schwartz Daniel Ludwig Davide Lucchesi Derrick Schommer Diego Losada Dominique Louis Elias Pschernig Fabian Fabio Reis Cecin Gareth Thomas Gazin Matthieu Gillius Ian Levesque Jacob Schwartz Jeckle Joel Wilsson Johnny Kevin Jenkins Marco Mattias Linnap maxOh Mika Kolehmainen Mike mirv Pascal Lequeux Richard Albury Ryan Haksi Sean Middleditch Simon Michelmore Sir Morris Stan Allan Steve Williams Tim Lyakhovetskiy Tomas Nilsson Tony Cox Wade Williams William DePalo [MVP] Winston Ewert WingZero Y.K. Hun hawknl-1.6.8+dfsg2/src/serial.h000066400000000000000000000045721130562644400162470ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #ifndef SERIAL_H #define SERIAL_H #ifdef __cplusplus extern "C" { #endif NLboolean serial_Init(void); void serial_Shutdown(void); NLboolean serial_Listen(NLsocket socket); NLsocket serial_AcceptConnection(NLsocket socket); NLsocket serial_Open(NLushort port, NLenum type); NLboolean serial_Connect(NLsocket socket, NLaddress *address); NLboolean serial_Close(NLsocket socket); NLint serial_Read(NLsocket socket, NLvoid *buffer, NLint nbytes); NLint serial_Write(NLsocket socket, NLvoid *buffer, NLint nbytes); NLbyte *serial_AddrToString(NLaddress *address, NLbyte *string); NLboolean serial_StringToAddr(NLbyte *string, NLaddress *address); NLboolean serial_GetLocalAddr(NLsocket socket, NLaddress *address); NLboolean serial_SetLocalAddr(NLaddress *address); NLbyte *serial_GetNameFromAddr(NLaddress *address, NLbyte *name); NLboolean serial_GetNameFromAddrAsync(NLaddress *address, NLbyte *name); NLboolean serial_GetAddrFromName(NLbyte *name, NLaddress *address); NLboolean serial_GetAddrFromNameAsync(NLbyte *name, NLaddress *address); NLboolean serial_AddrCompare(NLaddress *address1, NLaddress *address2); NLushort serial_GetPortFromAddr(NLaddress *address); void serial_SetAddrPort(NLaddress *address, NLushort port); NLint serial_GetSystemError(void); NLint serial_PollGroup(NLint group, NLenum name, NLsocket *sockets, NLint number, NLint timeout); NLboolean serial_Hint(NLenum name, NLint arg); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* SERIAL_H */ hawknl-1.6.8+dfsg2/src/sock.c000066400000000000000000002051571130562644400157240ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #define FD_SETSIZE 8192 #include #include #include #if defined (_WIN32_WCE) #define EAGAIN 11 #define errno GetLastError() #else #include #endif #if defined WIN32 || defined WIN64 || defined (_WIN32_WCE) #include "wsock.h" #elif defined Macintosh #include #include #include #include #include #include #include #include #include #define closesocket close #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #define SOCKET int #define sockerrno errno /* define INADDR_NONE if not already */ #ifndef INADDR_NONE #define INADDR_NONE ((unsigned long) -1) #endif #else /* Unix-style systems */ #ifdef SOLARIS #include /* for FIONBIO */ #endif #include #include #include #include #include #include #include #include #include #define closesocket close #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #define SOCKET int #define sockerrno errno /* define INADDR_NONE if not already */ #ifndef INADDR_NONE #define INADDR_NONE ((unsigned long) -1) #endif /* SGI and MacOS X do not include socklen_t */ #if defined __sgi || defined MACOSX typedef int socklen_t; #endif #endif /* WINDOWS_APP*/ #include "nlinternal.h" #include "sock.h" #ifndef IN_MULTICAST #define IN_MULTICAST(i) (((unsigned long)(i) & 0xF0000000) == (unsigned long)0xE0000000) #endif #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN NL_MAX_STRING_LENGTH #endif #define NL_CONNECT_STRING "HawkNL request connection." #define NL_REPLY_STRING "HawkNL connection OK." #define NL_HEADER_LEN 4 /* * Portable NLMAX() function macro */ #define NLMAX( a, b ) ( ( a ) > ( b ) ? ( a ) : ( b ) ) #define NLMIN( a, b ) ( ( a ) < ( b ) ? ( a ) : ( b ) ) static volatile NLuint ouraddress, bindaddress; static volatile int backlog = SOMAXCONN; static volatile int multicastTTL = 1; static volatile NLboolean reuseaddress = NL_FALSE; static volatile NLboolean nlTCPNoDelay = NL_FALSE; static NLaddress *alladdr = NULL; typedef struct { NLaddress /*@temp@*/*address; NLchar /*@temp@*/*name; NLsocket socket; } NLaddress_ex_t; extern SOCKET nlGroupGetFdset(NLint group, /*@out@*/ fd_set *fd); /* This is a Winsock work around to be able to bind() to more than 3976 ports */ #ifdef WINDOWS_APP static NLmutex portlock; /* In memory of my step-father, Don Portlock, who passed away Jan 12, 2001 - Phil */ static volatile NLushort nextport = 1024; static NLushort sock_getNextPort(void) { NLlong temp; (void)nlMutexLock(&portlock); temp = (NLlong)nextport; if(++temp > 65535) { /* skip the well known ports */ temp = 1024; } nextport = (NLushort)temp; (void)nlMutexUnlock(&portlock); return nextport; } static NLint sock_bind(SOCKET socket, const struct sockaddr *a, int len) { struct sockaddr_in *addr = (struct sockaddr_in *)a; int ntries = 500; /* this is to prevent an infinite loop */ NLboolean found = NL_FALSE; /* check to see if the port is already specified */ if(addr->sin_port != 0) { /* do the normal bind */ return bind(socket, a, len); } /* let's find our own port number */ while(ntries-- > 0) { addr->sin_port = htons(sock_getNextPort()); if(bind(socket, (struct sockaddr *)addr, len) != SOCKET_ERROR) { found = NL_TRUE; break; } } if(found == NL_TRUE) { return 0; } /* could not find a port, restore the port number back to 0 */ addr->sin_port = 0; /* return error */ return SOCKET_ERROR; } static int sock_connect(SOCKET socket, const struct sockaddr* a, int len ) { struct sockaddr_in addr; addr.sin_family = AF_INET; addr.sin_addr.s_addr = INADDR_ANY; addr.sin_port = 0; if(sock_bind(socket, (struct sockaddr *)&addr, (int)sizeof(addr)) == SOCKET_ERROR) { return SOCKET_ERROR; } return connect(socket, a, len); } #else #define sock_bind bind #define sock_connect connect #endif /* WINDOWS_APP */ /* helper functions for NL_RELIABLE_PACKETS */ static NLint rpGroup; /* the group to hold all the NL_RELIABLE_PACKETS sockets */ static NLmutex rpMutex; /* mutex to lock the functions */ static NLboolean needThread = NL_TRUE; /* do we need to spawn a thread? */ static NLint rpSocketCount = 0; /* total count of NL_RELIABLE_PACKETS sockets */ static volatile NLint rpBufferedCount = 0;/* count of sockets that are buffering data */ static void sock_WritePacketCheckPending(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; /* first check for data waiting to be sent */ if(sock->sendlen > 0) { NLint count, size = NL_MAX_PACKET_LENGTH + NL_HEADER_LEN; if(size > sock->sendlen) { size = sock->sendlen; } count = send((SOCKET)sock->realsocket, (char *)sock->outbuf, size, 0); if(count > 0) { sock->sendlen -= count; if(sock->sendlen > 0) { /* move remaining data to beginning of outbuf */ memmove(sock->outbuf, (sock->outbuf + count), (size_t)sock->sendlen); } else { rpBufferedCount--; } } } } static void *sock_rpThread(void *p) { static NLsocket *sockets = NULL; static NLint maxsockets = 0; /* allocate memory */ if(sockets == NULL) { sockets = (NLsocket *)malloc(sizeof(NLsocket *) * 16); if(sockets == NULL) { needThread = NL_TRUE; return NULL; } maxsockets = 16; } while(rpGroup != NL_INVALID) { NLint count = maxsockets; /* make sure there is something to do */ if(rpSocketCount == 0 || rpBufferedCount == 0) { goto loopend; } /* see if we need to allocate more memory */ if(maxsockets < rpSocketCount) { NLsocket *temp; while(maxsockets < rpSocketCount) { maxsockets *= 2; } temp = (NLsocket *)realloc((void *)sockets, sizeof(NLsocket *) * maxsockets); if(temp == NULL) { goto cleanup; } sockets = temp; } /* we can now get the sockets */ if(nlGroupGetSockets(rpGroup, sockets, &count) == NL_FALSE) { goto cleanup; } while(count-- > 0 && rpBufferedCount > 0) { NLsocket socket = sockets[count]; (void)nlLockSocket(socket, NL_WRITE); sock_WritePacketCheckPending(socket); nlUnlockSocket(socket, NL_WRITE); } loopend: nlThreadSleep(50); } cleanup: free(sockets); sockets = NULL; maxsockets = 0; needThread = NL_TRUE; return p; } static void sock_AddSocket(NLsocket socket) { (void)nlMutexLock(&rpMutex); (void)nlGroupAddSocket(rpGroup, socket); rpSocketCount++; if(needThread == NL_TRUE) { (void)nlThreadCreate(sock_rpThread, NULL, NL_FALSE); needThread = NL_FALSE; } (void)nlMutexUnlock(&rpMutex); } static void sock_DeleteSocket(NLsocket socket) { (void)nlMutexLock(&rpMutex); (void)nlGroupDeleteSocket(rpGroup, socket); rpSocketCount--; (void)nlMutexUnlock(&rpMutex); } /* handle some common connection errors so the app knows when a connection has been dropped */ static NLint sock_Error(void) { switch (sockerrno) { #ifdef WINDOWS_APP case WSABASEERR: return 0; #endif case EWOULDBLOCK: return 0; case ENETRESET: case EHOSTUNREACH: case ECONNABORTED: case ECONNRESET: case ENETUNREACH: case ETIMEDOUT: nlSetError(NL_SOCK_DISCONNECT); break; default: nlSetError(NL_SYSTEM_ERROR); break; } return NL_INVALID; } static NLboolean sock_SetNonBlocking(SOCKET socket) { int rc; unsigned long i = 1; rc = ioctl(socket, FIONBIO, &i); if(rc == SOCKET_ERROR) { return NL_FALSE; } return NL_TRUE; } static NLboolean sock_SetBroadcast(SOCKET socket) { int i = 1; if(setsockopt(socket, SOL_SOCKET, SO_BROADCAST, (char *)&i, (int)sizeof(i)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } return NL_TRUE; } static void sock_SetReuseAddr(SOCKET socket) { int i = 1; if(reuseaddress == NL_FALSE) { return; } if(setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (char *)&i, (int)sizeof(i)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); } } static void sock_SetTCPNoDelay(SOCKET socket) { int i = 1; if(setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, (char *)&i, (int)sizeof(i)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); } } static NLboolean sock_SetMulticastTTL(SOCKET socket, NLint ttl) { unsigned char cttl; /* make sure we have a valid TTL */ if(ttl > 255) ttl = 255; if(ttl < 1) ttl = 1; cttl = (unsigned char)ttl; /* first try setsockopt by passing a 'char', the Unix standard */ if(setsockopt(socket, IPPROTO_IP, IP_MULTICAST_TTL, (char *)&cttl, (int)sizeof(cttl)) == SOCKET_ERROR) { /* if that failed, we might be on a Windows system that requires an 'int' */ if(setsockopt(socket, IPPROTO_IP, IP_MULTICAST_TTL, (char *)&ttl, (int)sizeof(ttl)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } } return NL_TRUE; } static NLsocket sock_SetSocketOptions(NLsocket s) { nl_socket_t *sock = nlSockets[s]; NLenum type = sock->type; SOCKET realsocket = (SOCKET)sock->realsocket; if(type == NL_RELIABLE || type == NL_RELIABLE_PACKETS) { sock->reliable = NL_TRUE; if(nlTCPNoDelay == NL_TRUE) { sock_SetTCPNoDelay(realsocket); } if(type == NL_RELIABLE_PACKETS) { sock->packetsync = NL_TRUE; } } else { sock->reliable = NL_FALSE; } sock_SetReuseAddr(realsocket); if(sock->blocking == NL_FALSE) { if(sock_SetNonBlocking(realsocket) == NL_FALSE) { nlSetError(NL_SYSTEM_ERROR); return NL_INVALID; } } return s; } static NLuint sock_GetHostAddress(void) { struct hostent *local; char buff[MAXHOSTNAMELEN]; if(gethostname(buff, MAXHOSTNAMELEN) == SOCKET_ERROR) { return INADDR_NONE; } buff[MAXHOSTNAMELEN - 1] = '\0'; local = gethostbyname(buff); if(!local) return (NLuint)htonl(0x7f000001); return *(NLuint *)local->h_addr_list[0]; } static NLushort sock_GetPort(SOCKET socket) { struct sockaddr_in addr; socklen_t len; len = (socklen_t)sizeof(struct sockaddr_in); if(getsockname(socket, (struct sockaddr *) &addr, &len) == SOCKET_ERROR) { return 0; } return ntohs(addr.sin_port); } NLboolean sock_Init(void) { #ifdef WINDOWS_APP WSADATA libmibWSAdata; /* first try Winsock 2.0 */ if(WSAStartup(MAKEWORD(2, 0),&libmibWSAdata) != 0) { /* Winsock 2.0 failed, so now try 1.1 */ if(WSAStartup(MAKEWORD(1, 1),&libmibWSAdata) != 0) { return NL_FALSE; } } if(nlMutexInit(&portlock) == NL_FALSE) { return NL_FALSE; } #endif if(nlMutexInit(&rpMutex) == NL_FALSE) { return NL_FALSE; } if((rpGroup = nlGroupCreate()) == NL_INVALID) { return NL_FALSE; } ouraddress = sock_GetHostAddress(); if(ouraddress == (NLuint)INADDR_NONE) { return NL_FALSE; } bindaddress = INADDR_ANY; return NL_TRUE; } void sock_Shutdown(void) { #ifdef WINDOWS_APP (void)WSACleanup(); (void)nlMutexDestroy(&portlock); (void)nlMutexDestroy(&rpMutex); (void)nlGroupDestroy(rpGroup); rpGroup = NL_INVALID; #endif if(alladdr != NULL) { free(alladdr); alladdr = NULL; } } NLboolean sock_Listen(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; if(sock->listen == NL_TRUE) { return NL_TRUE; } if(sock->reliable == NL_TRUE) /* TCP */ { /* check for unbound socket */ if(sock->localport == 0) { /* bind socket */ ((struct sockaddr_in *)&sock->addressin)->sin_family = AF_INET; ((struct sockaddr_in *)&sock->addressin)->sin_addr.s_addr = bindaddress; ((struct sockaddr_in *)&sock->addressin)->sin_port = 0; if(sock_bind((SOCKET)sock->realsocket, (struct sockaddr *)&sock->addressin, (int)sizeof(struct sockaddr)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } } if(listen((SOCKET)sock->realsocket, backlog) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } } sock->listen = NL_TRUE; return NL_TRUE; } static SOCKET sock_AcceptUDP(NLsocket nlsocket, /*@out@*/struct sockaddr_in *newaddr) { nl_socket_t *sock = nlSockets[nlsocket]; struct sockaddr_in ouraddr; SOCKET newsocket; NLushort localport; NLbyte buffer[NL_MAX_STRING_LENGTH]; socklen_t len = (socklen_t)sizeof(struct sockaddr_in); NLint slen = (NLint)sizeof(NL_CONNECT_STRING); NLbyte reply = (NLbyte)0x00; NLint count = 0; /* Get the packet and remote host address */ if(recvfrom((SOCKET)sock->realsocket, buffer, (int)sizeof(buffer), 0, (struct sockaddr *)newaddr, &len) < (int)sizeof(NL_CONNECT_STRING)) { nlSetError(NL_NO_PENDING); return INVALID_SOCKET; } /* Let's check for the connection string */ buffer[slen - 1] = (NLbyte)0; /* null terminate for peace of mind */ if(strcmp(buffer, NL_CONNECT_STRING) != 0) { nlSetError(NL_NO_PENDING); return INVALID_SOCKET; } /* open up a new socket on this end */ newsocket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); if(newsocket == INVALID_SOCKET) { nlSetError(NL_SYSTEM_ERROR); (void)closesocket(newsocket); return INVALID_SOCKET; } ouraddr.sin_family = AF_INET; ouraddr.sin_addr.s_addr = bindaddress; /* system assigned port number */ ouraddr.sin_port = 0; if(sock_bind(newsocket, (struct sockaddr *)&ouraddr, len) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); (void)closesocket(newsocket); return INVALID_SOCKET; } /* get the new port */ localport = sock_GetPort(newsocket); /* create the return message */ writeShort(buffer, count, localport); writeString(buffer, count, (NLchar *)TEXT(NL_REPLY_STRING)); /* send back the reply with our new port */ if(sendto((SOCKET)sock->realsocket, buffer, count, 0, (struct sockaddr *)newaddr, (int)sizeof(struct sockaddr_in)) < count) { nlSetError(NL_SYSTEM_ERROR); (void)closesocket(newsocket); return INVALID_SOCKET; } /* send back a 0 length packet from our new port, needed for firewalls */ if(sendto(newsocket, &reply, 0, 0, (struct sockaddr *)newaddr, (int)sizeof(struct sockaddr_in)) < 0) { nlSetError(NL_SYSTEM_ERROR); (void)closesocket(newsocket); return INVALID_SOCKET; } /* connect the socket */ if(connect(newsocket, (struct sockaddr *)newaddr, (int)sizeof(struct sockaddr_in)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); (void)closesocket(newsocket); return INVALID_SOCKET; } return newsocket; } NLsocket sock_AcceptConnection(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; nl_socket_t *newsock = NULL; NLsocket newsocket = NL_INVALID; SOCKET realsocket = INVALID_SOCKET; struct sockaddr_in newaddr; socklen_t len = (socklen_t)sizeof(newaddr); memset(&newaddr, 0, sizeof(newaddr)); if(sock->listen != NL_TRUE) { nlSetError(NL_NOT_LISTEN); return NL_INVALID; } if(sock->type == NL_RELIABLE || sock->type == NL_RELIABLE_PACKETS) /* TCP */ { SOCKET s = 101; /* !@#$% metrowerks compiler, try to get it to actually produce some code */ s = accept((SOCKET)(sock->realsocket), (struct sockaddr *)&newaddr, &len); realsocket = s; if(realsocket == INVALID_SOCKET) { if(sockerrno == EWOULDBLOCK || errno == EAGAIN)/* yes, we need to use errno here */ { nlSetError(NL_NO_PENDING); } else { nlSetError(NL_SYSTEM_ERROR); } return NL_INVALID; } } else if(sock->type == NL_UNRELIABLE)/* UDP*/ { realsocket = sock_AcceptUDP(socket, &newaddr); if(realsocket == INVALID_SOCKET) { /* error is already set in sock_AcceptUDP */ return NL_INVALID; } } else /* broadcast or multicast */ { nlSetError(NL_WRONG_TYPE); return NL_INVALID; } newsocket = nlGetNewSocket(); if(newsocket == NL_INVALID) { return NL_INVALID; } if(nlLockSocket(newsocket, NL_BOTH) == NL_FALSE) { return NL_INVALID; } newsock = nlSockets[newsocket]; /* update the remote address */ memcpy((char *)&newsock->addressin, (char *)&newaddr, sizeof(struct sockaddr_in)); newsock->realsocket = (NLint)realsocket; newsock->localport = sock_GetPort(realsocket); newsock->remoteport = sock_GetPortFromAddr((NLaddress *)&newsock->addressin); newsock->type = sock->type; newsock->connected = NL_TRUE; if(newsock->type == NL_RELIABLE_PACKETS) { sock_AddSocket(newsocket); } return sock_SetSocketOptions(newsocket); } NLsocket sock_Open(NLushort port, NLenum type) { nl_socket_t *newsock; NLsocket newsocket; SOCKET realsocket; switch (type) { case NL_RELIABLE: /* TCP */ case NL_RELIABLE_PACKETS: /* TCP packets */ realsocket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); break; case NL_UNRELIABLE: /* UDP */ case NL_BROADCAST: /* UDP broadcast */ case NL_UDP_MULTICAST: /* UDP multicast */ realsocket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); break; default: nlSetError(NL_INVALID_ENUM); return NL_INVALID; } if(realsocket == INVALID_SOCKET) { nlSetError(NL_SYSTEM_ERROR); return NL_INVALID; } newsocket = nlGetNewSocket(); if(newsocket == NL_INVALID) { return NL_INVALID; } if(nlLockSocket(newsocket, NL_BOTH) == NL_FALSE) { return NL_INVALID; } newsock = nlSockets[newsocket]; newsock->realsocket = (NLint)realsocket; newsock->type = type; if(sock_SetSocketOptions(newsocket) == NL_INVALID) { nlUnlockSocket(newsocket, NL_BOTH); (void)sock_Close(newsocket); return NL_INVALID; } /* do not bind a TCP socket here if the port is 0; let connect assign the port */ if((type == NL_RELIABLE || type == NL_RELIABLE_PACKETS) && port == 0) { newsock->localport = 0; } else { ((struct sockaddr_in *)&newsock->addressin)->sin_family = AF_INET; ((struct sockaddr_in *)&newsock->addressin)->sin_addr.s_addr = bindaddress; ((struct sockaddr_in *)&newsock->addressin)->sin_port = htons((unsigned short)port); if(sock_bind(realsocket, (struct sockaddr *)&newsock->addressin, (int)sizeof(struct sockaddr)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); nlUnlockSocket(newsocket, NL_BOTH); (void)sock_Close(newsocket); return NL_INVALID; } if(type == NL_BROADCAST) { if(sock_SetBroadcast(realsocket) == NL_FALSE) { nlSetError(NL_SYSTEM_ERROR); nlUnlockSocket(newsocket, NL_BOTH); (void)sock_Close(newsocket); return NL_INVALID; } ((struct sockaddr_in *)&newsock->addressout)->sin_family = AF_INET; ((struct sockaddr_in *)&newsock->addressout)->sin_addr.s_addr = INADDR_BROADCAST; ((struct sockaddr_in *)&newsock->addressout)->sin_port = htons((unsigned short)port); } newsock->localport = sock_GetPort(realsocket); } if(type == NL_RELIABLE_PACKETS) { sock_AddSocket(newsocket); } nlUnlockSocket(newsocket, NL_BOTH); return newsocket; } static NLboolean sock_ConnectUDP(NLsocket socket, const NLaddress *address) { nl_socket_t *sock = nlSockets[socket]; time_t begin, t; if(sendto((SOCKET)sock->realsocket, (char *)NL_CONNECT_STRING, (NLint)sizeof(NL_CONNECT_STRING), 0, (struct sockaddr *)address, (int)sizeof(struct sockaddr_in)) == SOCKET_ERROR) { if(sock->blocking == NL_TRUE) { nlSetError(NL_SYSTEM_ERROR); } else { sock->conerror = NL_TRUE; } return NL_FALSE; } (void)time(&begin); /* try for six seconds */ while((time(&t) - begin) < 6) { NLbyte buffer[NL_MAX_STRING_LENGTH]; NLbyte *pbuffer = buffer; NLushort newport; NLint slen = (NLint)(sizeof(NL_REPLY_STRING) + sizeof(newport)); NLint received; NLbyte reply = (NLbyte)0; socklen_t len = (socklen_t)sizeof(struct sockaddr_in); received = recvfrom((SOCKET)sock->realsocket, (char *)buffer, (int)sizeof(buffer), 0, (struct sockaddr *)&sock->addressin, &len); if(received == SOCKET_ERROR) { if(sockerrno != EWOULDBLOCK) { if(sock->blocking == NL_TRUE) { nlSetError(NL_CON_REFUSED); } else { sock->conerror = NL_TRUE; } return NL_FALSE; } } if(received >= slen) { NLint count = 0; /* retrieve the port number */ readShort(buffer, count, newport); ((struct sockaddr_in *)&sock->addressin)->sin_port = htons(newport); /* Lets check for the reply string */ pbuffer[slen - 1] = (NLbyte)0; /* null terminate for peace of mind */ pbuffer += sizeof(newport); if(strcmp(pbuffer, NL_REPLY_STRING) == 0) { if(connect((SOCKET)sock->realsocket, (struct sockaddr *)&sock->addressin, (int)sizeof(struct sockaddr_in)) == SOCKET_ERROR) { if(sock->blocking == NL_TRUE) { nlSetError(NL_SYSTEM_ERROR); } else { sock->conerror = NL_TRUE; } return NL_FALSE; } /* send back a 0 length packet to the new port, needed for firewalls */ if(send((SOCKET)sock->realsocket, &reply, 0, 0) == SOCKET_ERROR) { if(sock->blocking == NL_TRUE) { nlSetError(NL_SYSTEM_ERROR); } else { sock->conerror = NL_TRUE; } return NL_FALSE; } /* success! */ sock->localport = sock_GetPort((SOCKET)sock->realsocket); sock->remoteport = sock_GetPortFromAddr((NLaddress *)&sock->addressin); sock->connected = NL_TRUE; sock->connecting = NL_FALSE; return NL_TRUE; } } nlThreadSleep(NL_CONNECT_SLEEP); } if(sock->blocking == NL_TRUE) { nlSetError(NL_CON_REFUSED); } else { sock->conerror = NL_TRUE; } return NL_FALSE; } static void *sock_ConnectUDPAsynchInt(void /*@owned@*/*addr) { NLaddress_ex_t *address = (NLaddress_ex_t *)addr; (void)sock_ConnectUDP(address->socket, address->address); free(addr); return NULL; } static NLboolean sock_ConnectUDPAsynch(NLsocket socket, const NLaddress *address) { NLaddress_ex_t /*@dependent@*/*addr; nl_socket_t *sock = nlSockets[socket]; addr = (NLaddress_ex_t *)malloc(sizeof(NLaddress_ex_t)); if(addr == NULL) { nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } addr->address = (NLaddress *)address; addr->socket = socket; sock->connecting = NL_TRUE; sock->conerror = NL_FALSE; if(nlThreadCreate(sock_ConnectUDPAsynchInt, (void *)addr, NL_FALSE) == (NLthreadID)NL_INVALID) { return NL_FALSE; } return NL_TRUE; } static NLboolean sock_ConnectMulticast(NLsocket socket, const NLaddress *address) { struct ip_mreq mreq; nl_socket_t *sock = nlSockets[socket]; if(sock->reliable == NL_TRUE) { nlSetError(NL_WRONG_TYPE); return NL_FALSE; } if(!IN_MULTICAST(ntohl(((struct sockaddr_in *)address)->sin_addr.s_addr))) { nlSetError(NL_BAD_ADDR); return NL_FALSE; } memcpy((char *)&sock->addressin, (char *)address, sizeof(struct sockaddr_in)); memcpy((char *)&sock->addressout, (char *)address, sizeof(struct sockaddr_in)); /* join the multicast group */ mreq.imr_multiaddr.s_addr = ((struct sockaddr_in *)address)->sin_addr.s_addr; mreq.imr_interface.s_addr = bindaddress; if(setsockopt((SOCKET)sock->realsocket, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&mreq, (int)sizeof(mreq)) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } sock->localport = sock_GetPort((SOCKET)sock->realsocket); sock->remoteport = sock_GetPortFromAddr((NLaddress *)&sock->addressout); return sock_SetMulticastTTL((SOCKET)sock->realsocket, multicastTTL); } NLboolean sock_Connect(NLsocket socket, const NLaddress *address) { nl_socket_t *sock = nlSockets[socket]; memcpy((char *)&sock->addressin, (char *)address, sizeof(NLaddress)); if(sock->type == NL_RELIABLE || sock->type == NL_RELIABLE_PACKETS) { if(sock_connect((SOCKET)sock->realsocket, (struct sockaddr *)&sock->addressin, (int)sizeof(struct sockaddr_in)) == SOCKET_ERROR) { if(sock->blocking == NL_FALSE && (sockerrno == EWOULDBLOCK || sockerrno == EINPROGRESS)) { sock->connecting = NL_TRUE; } else { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } } sock->localport = sock_GetPort((SOCKET)sock->realsocket); sock->remoteport = sock_GetPortFromAddr((NLaddress *)&sock->addressin); sock->connected = NL_TRUE; return NL_TRUE; } else if(sock->type == NL_UDP_MULTICAST) { return sock_ConnectMulticast(socket, &sock->addressin); } else if(sock->type == NL_UNRELIABLE) { if(sock->blocking == NL_TRUE) { return sock_ConnectUDP(socket, &sock->addressin); } else { return sock_ConnectUDPAsynch(socket, &sock->addressin); } } else { nlSetError(NL_WRONG_TYPE); } return NL_FALSE; } void sock_Close(NLsocket socket) { nl_socket_t *sock = nlSockets[socket]; struct ip_mreq mreq; if(sock->type == NL_UDP_MULTICAST) { /* leave the multicast group */ mreq.imr_multiaddr.s_addr = ((struct sockaddr_in *)&sock->addressout)->sin_addr.s_addr; mreq.imr_interface.s_addr = bindaddress; (void)setsockopt((SOCKET)sock->realsocket, IPPROTO_IP, IP_DROP_MEMBERSHIP, (char *)&mreq, (int)sizeof(mreq)); } if(sock->type == NL_RELIABLE_PACKETS) { /* check for unsent data */ if(sock->sendlen > 0) { int tries = 200; /* 200 * 50 ms = up to a 10 second delay to allow data to be sent */ while(tries-- > 0 && sock->sendlen > 0) { nlThreadSleep(50); } } sock_DeleteSocket(socket); } if((sock->type == NL_RELIABLE_PACKETS || sock->type == NL_RELIABLE) && sock->listen == NL_FALSE) { struct linger l = {1, 10}; (void)setsockopt((SOCKET)sock->realsocket, SOL_SOCKET, SO_LINGER, (const char *)&l, (int)sizeof(l)); } (void)closesocket((SOCKET)sock->realsocket); } /* internal function to read reliable packets from TCP stream */ static NLint sock_ReadPacket(NLsocket socket, NLvoid /*@out@*/ *buffer, NLint nbytes, NLboolean checkonly) { nl_socket_t *sock = nlSockets[socket]; /* skip error reporting if checkonly is TRUE */ /* check for sync */ if(sock->packetsync == NL_FALSE) { if(checkonly == NL_FALSE) { nlSetError(NL_PACKET_SYNC); } else { sock->readable = NL_TRUE; } return NL_INVALID; } if(sock->message_end == NL_TRUE && checkonly == NL_FALSE && sock->reclen == 0) { sock->message_end = NL_FALSE; nlSetError(NL_MESSAGE_END); return NL_INVALID; } /* allocate some temp storage the first time through */ if(sock->inbuf == NULL) { sock->inbuflen = (nbytes + nbytes / 4 + NL_HEADER_LEN); if(sock->inbuflen < 1024) { sock->inbuflen = 1024; } else if(sock->inbuflen > NL_MAX_PACKET_LENGTH + NL_MAX_PACKET_LENGTH/4) { sock->inbuflen = NL_MAX_PACKET_LENGTH + NL_MAX_PACKET_LENGTH/4; } sock->inbuf = (NLbyte *)malloc((size_t)sock->inbuflen); if(sock->inbuf == NULL) { if(checkonly == NL_FALSE) { sock->inbuflen = 0; nlSetError(NL_OUT_OF_MEMORY); } return NL_INVALID; } } /* if inbuf is empty, get some data */ if(sock->reclen < NL_HEADER_LEN) { NLint count; count = recv((SOCKET)sock->realsocket, (char *)(sock->inbuf + sock->reclen), (sock->inbuflen - sock->reclen), 0); if(count == SOCKET_ERROR) { if(checkonly == NL_FALSE) { return sock_Error(); } else { sock->readable = NL_TRUE; return NL_INVALID; } } if(count == 0) { if(checkonly == NL_FALSE) { nlSetError(NL_MESSAGE_END); } else { sock->message_end = NL_TRUE; sock->readable = NL_TRUE; } return NL_INVALID; } sock->reclen += count; } /* start parsing the packet */ if(sock->reclen >= NL_HEADER_LEN) { NLboolean done = NL_FALSE; NLushort len; NLint c = 2; /* check for valid packet */ if(sock->inbuf[0] != 'N' || sock->inbuf[1] != 'L') { /* packet is not valid, we are somehow out of sync, or we are talking to a regular TCP stream */ if(checkonly == NL_FALSE) { nlSetError(NL_PACKET_SYNC); } else { sock->readable = NL_TRUE; } sock->packetsync = NL_FALSE; return NL_INVALID; } /* read the length of the packet */ readShort(sock->inbuf, c, len); if(len > NL_MAX_PACKET_LENGTH) { /* packet is not valid, or we are talking to a regular TCP stream */ if(checkonly == NL_FALSE) { nlSetError(NL_PACKET_SYNC); } else { sock->readable = NL_TRUE; } sock->packetsync = NL_FALSE; return NL_INVALID; } /* check to see if we need to make the inbuf storage larger */ if((NLint)len > sock->inbuflen) { NLint newbuflen; NLbyte *temp; newbuflen = (len + len / 4 + NL_HEADER_LEN); temp = (NLbyte *)realloc(sock->inbuf, (size_t)newbuflen); if(temp == NULL) { if(checkonly == NL_FALSE) { nlSetError(NL_OUT_OF_MEMORY); } return NL_INVALID; } sock->inbuf = temp; sock->inbuflen = newbuflen; } if(checkonly == NL_FALSE) { if(len > (NLushort)nbytes) { nlSetError(NL_BUFFER_SIZE); return NL_INVALID; } } /* see if we need to get more of the packet */ if(len > (NLushort)(sock->reclen - c)) { done = NL_FALSE; while(done == NL_FALSE) { NLint count; if(checkonly == NL_FALSE) { count = recv((SOCKET)sock->realsocket, (char *)(sock->inbuf + sock->reclen), (sock->inbuflen - sock->reclen), 0); } else { /* we are calling this from PollGroup, so it cannot block */ fd_set fdset; struct timeval t = {0,0}; FD_ZERO(&fdset); FD_SET((SOCKET)sock->realsocket, &fdset); if(select(sock->realsocket + 1, &fdset, NULL, NULL, &t) == 1) { count = recv((SOCKET)sock->realsocket, (char *)(sock->inbuf + sock->reclen), (sock->inbuflen - sock->reclen), 0); } else { /* socket would block, so break */ break; } } if(count == SOCKET_ERROR) { if(checkonly == NL_FALSE) { /* check to see if we already have all the packet */ if(len <= (NLushort)(sock->reclen - c)) { done = NL_TRUE; } else { /* report the error */ return sock_Error(); } } else { done = NL_TRUE; } } else if(count == 0) { sock->message_end = NL_TRUE; sock->readable = NL_TRUE; done = NL_TRUE; } else { sock->reclen += count; if(len <= (NLushort)(sock->reclen - c)) { done = NL_TRUE; } } } } /* see if we now have all of the packet */ if(len <= (NLushort)(sock->reclen - c)) { sock->readable = NL_TRUE; if(checkonly == NL_FALSE) { /* copy the packet */ memcpy(buffer, (sock->inbuf + c), (size_t)len); /* check for another packet */ sock->reclen -= (len + c); if(sock->reclen > 0) { /* move it down to the beginning of inbuf */ memmove(sock->inbuf, (sock->inbuf + c + len), (size_t)sock->reclen); } /* quick check to see if we have another complete packet buffered */ if(sock->reclen >= NL_HEADER_LEN) { NLushort templen; /* read the length of the packet */ c = 2; readShort(sock->inbuf, c, templen); /* check the length */ if(templen <= (NLushort)(sock->reclen - c)) { /* we have another complete packet, so mark as readable for PollGroup */ sock->readable = NL_TRUE; } else { sock->readable = NL_FALSE; } } else { sock->readable = NL_FALSE; } return (NLint)len; } } else { return 0; } } return 0; } NLint sock_Read(NLsocket socket, NLvoid *buffer, NLint nbytes) { nl_socket_t *sock = nlSockets[socket]; NLint count; if(nbytes < 0) { return 0; } if(sock->type == NL_RELIABLE || sock->type == NL_RELIABLE_PACKETS) /* TCP */ { /* check for a non-blocking connection pending */ if(sock->connecting == NL_TRUE) { fd_set fdset; struct timeval t = {0,0}; int serrval = -1; socklen_t serrsize = (socklen_t)sizeof(serrval); FD_ZERO(&fdset); FD_SET((SOCKET)sock->realsocket, &fdset); if(select(sock->realsocket + 1, NULL, &fdset, NULL, &t) == 1) { /* Check the socket status */ (void)getsockopt( sock->realsocket, SOL_SOCKET, SO_ERROR, (char *)&serrval, &serrsize ); if(serrval != 0) { if(serrval == ECONNREFUSED) { nlSetError(NL_CON_REFUSED); } else if(serrval == EINPROGRESS || serrval == EWOULDBLOCK) { nlSetError(NL_CON_PENDING); } return NL_INVALID; } /* the connect has completed */ sock->connected = NL_TRUE; sock->connecting = NL_FALSE; } else { /* check for a failed connect */ FD_ZERO(&fdset); FD_SET((SOCKET)sock->realsocket, &fdset); if(select(sock->realsocket + 1, NULL, NULL, &fdset, &t) == 1) { nlSetError(NL_CON_REFUSED); } else { nlSetError(NL_CON_PENDING); } return NL_INVALID; } } /* check for reliable packets */ if(sock->type == NL_RELIABLE_PACKETS) { return sock_ReadPacket(socket, buffer, nbytes, NL_FALSE); } count = recv((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0); if(count == 0) { /* end of message */ nlSetError(NL_MESSAGE_END); return NL_INVALID; } } else /* UDP */ { /* check for a non-blocking connection pending */ if(sock->connecting == NL_TRUE) { nlSetError(NL_CON_PENDING); return NL_INVALID; } /* check for a connection error */ if(sock->conerror == NL_TRUE) { nlSetError(NL_CON_REFUSED); return NL_INVALID; } if(sock->connected == NL_TRUE) { count = recv((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0); } else { socklen_t len = (socklen_t)sizeof(struct sockaddr_in); count = recvfrom((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0, (struct sockaddr *)&sock->addressin, &len); } } if(count == SOCKET_ERROR) { return sock_Error(); } return count; } static NLboolean allocateBuffer(nl_socket_t *sock, NLint nbytes) { NLint size = NLMIN(NLMAX((nbytes + NL_HEADER_LEN) * 2, 1024), (NL_MAX_PACKET_LENGTH + NL_HEADER_LEN)); /* first call */ if(sock->outbuf == NULL) { sock->outbuf = (NLbyte *)malloc((size_t)size); if(sock->outbuf == NULL) { sock->outbuflen = 0; nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } sock->outbuflen = size; } else { if(size > sock->outbuflen) { NLbyte *temp; temp = (NLbyte *)realloc(sock->outbuf, (size_t)size); if(temp == NULL) { sock->outbuflen = 0; nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } sock->outbuf = temp; sock->outbuflen = size; } } return NL_TRUE; } static NLint sock_WritePacket(NLsocket socket, const NLvoid *buffer, NLint nbytes) { nl_socket_t *sock = nlSockets[socket]; NLint count; NLbyte temp[NL_HEADER_LEN]; NLint c = 0; /* allocate memory for outbuf */ if(sock->outbuf == NULL) { if(allocateBuffer(sock, nbytes) == NL_FALSE) { return NL_INVALID; } } else { /* send any unsent data from last packet */ sock_WritePacketCheckPending(socket); } /* check to see if we already have some pending data */ if(sock->sendlen > 0) { /* to comply with the way UDP packets act */ /* if the send buffer has unsent data return 0 */ return 0; } /* ID for packets is 'NL'*/ writeByte(temp, c, 'N'); writeByte(temp, c, 'L'); /* add the packet length */ writeShort(temp, c, (NLushort)nbytes); count = send((SOCKET)sock->realsocket, (char *)temp, c, 0); if(count == SOCKET_ERROR) { if(sockerrno == EWOULDBLOCK) { count = 0; } else { return sock_Error(); } } if(count < c) { int dif = c - count; /* check outbuf size */ if(allocateBuffer(sock, nbytes) == NL_FALSE) { return NL_INVALID; } /* store it */ memcpy((sock->outbuf + sock->sendlen), (temp + count), (size_t)(dif)); sock->sendlen += (dif); memcpy((sock->outbuf + sock->sendlen), ((NLbyte *)buffer), (size_t)(nbytes)); sock->sendlen += (nbytes); rpBufferedCount++; } else { count = send((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0); if(count == SOCKET_ERROR) { if(sockerrno == EWOULDBLOCK) { count = 0; } else { return sock_Error(); } } /* make sure all was sent */ if(count < nbytes) { int dif = nbytes - count; /* check outbuf size */ if(allocateBuffer(sock, nbytes) == NL_FALSE) { return NL_INVALID; } /* store it */ memcpy((sock->outbuf + sock->sendlen), ((NLbyte *)buffer + count), (size_t)(dif)); sock->sendlen += dif; rpBufferedCount++; } } count = nbytes; return count; } NLint sock_Write(NLsocket socket, const NLvoid *buffer, NLint nbytes) { nl_socket_t *sock = nlSockets[socket]; NLint count; if(nbytes < 0) { return 0; } if((sock->type == NL_RELIABLE) || (sock->type == NL_RELIABLE_PACKETS)) /* TCP */ { if(sock->connecting == NL_TRUE) { fd_set fdset; struct timeval t = {0,0}; int serrval = -1; socklen_t serrsize = (socklen_t)sizeof(serrval); FD_ZERO(&fdset); FD_SET((SOCKET)sock->realsocket, &fdset); if(select(sock->realsocket + 1, NULL, &fdset, NULL, &t) == 1) { /* Check the socket status */ (void)getsockopt( sock->realsocket, SOL_SOCKET, SO_ERROR, (char *)&serrval, &serrsize ); if(serrval != 0) { if(serrval == ECONNREFUSED) { nlSetError(NL_CON_REFUSED); } else if(serrval == EINPROGRESS || serrval == EWOULDBLOCK) { nlSetError(NL_CON_PENDING); } return NL_INVALID; } /* the connect has completed */ sock->connected = NL_TRUE; sock->connecting = NL_FALSE; } else { /* check for a failed connect */ FD_ZERO(&fdset); FD_SET((SOCKET)sock->realsocket, &fdset); if(select(sock->realsocket + 1, NULL, NULL, &fdset, &t) == 1) { nlSetError(NL_CON_REFUSED); } else { nlSetError(NL_CON_PENDING); } return NL_INVALID; } } /* check for reliable packets */ if(sock->type == NL_RELIABLE_PACKETS) { if(nbytes > NL_MAX_PACKET_LENGTH) { nlSetError(NL_PACKET_SIZE); return NL_INVALID; } return sock_WritePacket(socket, buffer, nbytes); } count = send((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0); } else /* unconnected UDP */ { /* check for a non-blocking connection pending */ if(sock->connecting == NL_TRUE) { nlSetError(NL_CON_PENDING); return NL_INVALID; } /* check for a connection error */ if(sock->conerror == NL_TRUE) { nlSetError(NL_CON_REFUSED); return NL_INVALID; } if(nbytes > NL_MAX_PACKET_LENGTH) { nlSetError(NL_PACKET_SIZE); return NL_INVALID; } if(sock->type == NL_BROADCAST) { ((struct sockaddr_in *)&sock->addressin)->sin_addr.s_addr = INADDR_BROADCAST; } if(sock->type == NL_UDP_MULTICAST) { count = sendto((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0, (struct sockaddr *)&sock->addressout, (int)sizeof(struct sockaddr_in)); } else if(sock->connected == NL_TRUE) { count = send((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0); } else { count = sendto((SOCKET)sock->realsocket, (char *)buffer, nbytes, 0, (struct sockaddr *)&sock->addressout, (int)sizeof(struct sockaddr_in)); } } if(count == SOCKET_ERROR) { return sock_Error(); } return count; } NLchar *sock_AddrToString(const NLaddress *address, NLchar *string) { NLulong addr; NLushort port; addr = ntohl(((struct sockaddr_in *)address)->sin_addr.s_addr); port = ntohs(((struct sockaddr_in *)address)->sin_port); if(port == 0) { _stprintf(string, TEXT("%lu.%lu.%lu.%lu"), (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff); } else { _stprintf(string, TEXT("%lu.%lu.%lu.%lu:%u"), (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff, port); } return string; } NLboolean sock_StringToAddr(const NLchar *string, NLaddress *address) { NLulong a1, a2, a3, a4; NLulong ipaddress, port = 0; int ret; ret = _stscanf((const NLchar *)string, (const NLchar *)TEXT("%lu.%lu.%lu.%lu:%lu"), &a1, &a2, &a3, &a4, &port); if(a1 > 255 || a2 > 255 || a3 > 255 || a4 > 255 || port > 65535 || ret < 4) { /* bad address */ ((struct sockaddr_in *)address)->sin_family = AF_INET; ((struct sockaddr_in *)address)->sin_addr.s_addr = INADDR_NONE; ((struct sockaddr_in *)address)->sin_port = 0; nlSetError(NL_BAD_ADDR); address->valid = NL_FALSE; return NL_FALSE; } else { ipaddress = (a1 << 24) | (a2 << 16) | (a3 << 8) | a4; ((struct sockaddr_in *)address)->sin_family = AF_INET; ((struct sockaddr_in *)address)->sin_addr.s_addr = htonl(ipaddress); ((struct sockaddr_in *)address)->sin_port = htons((NLushort)port); address->valid = NL_TRUE; return NL_TRUE; } } NLboolean sock_GetLocalAddr(NLsocket socket, NLaddress *address) { nl_socket_t *sock = nlSockets[socket]; socklen_t len; memset(address, 0, sizeof(NLaddress)); ((struct sockaddr_in *)address)->sin_family = AF_INET; address->valid = NL_TRUE; len = (socklen_t)sizeof(struct sockaddr_in); /* if the socket is connected, this will get us the correct address on a multihomed system*/ if(getsockname((SOCKET)sock->realsocket, (struct sockaddr *)address, &len) == SOCKET_ERROR) { /* ignore error if socket has not been bound or connected yet */ if(sockerrno != EINVAL) { nlSetError(NL_SYSTEM_ERROR); address->valid = NL_FALSE; return NL_FALSE; } } /* if not connected, substitute the NIC address */ if(((struct sockaddr_in *)address)->sin_addr.s_addr == INADDR_ANY) { ((struct sockaddr_in *)address)->sin_addr.s_addr = ouraddress; } sock_SetAddrPort(address, sock->localport); return NL_TRUE; } NLaddress *sock_GetAllLocalAddr(NLint *count) { struct hostent *local; char buff[MAXHOSTNAMELEN]; int i = 0; if(gethostname(buff, MAXHOSTNAMELEN) == SOCKET_ERROR) { nlSetError(NL_SYSTEM_ERROR); return NULL; } buff[MAXHOSTNAMELEN - 1] = '\0'; local = gethostbyname(buff); if(local == NULL) { if(sockerrno == ENETDOWN) { nlSetError(NL_SYSTEM_ERROR); return NULL; } } /* count the number of returned IP addresses */ *count = 0; if(local != NULL) { while(local->h_addr_list[i++] != NULL) { (*count)++; } } /* allocate storage for address */ if(alladdr != NULL) { free(alladdr); } if(*count == 0) { *count = 1; alladdr = (NLaddress *)malloc(sizeof(NLaddress)); memset(alladdr, 0, sizeof(NLaddress)); /* fill in the localhost address */ ((struct sockaddr_in *)alladdr)->sin_family = AF_INET; ((struct sockaddr_in *)alladdr)->sin_addr.s_addr = (NLuint)htonl(0x7f000001); alladdr->valid = NL_TRUE; } else { alladdr = (NLaddress *)malloc(sizeof(NLaddress) * *count); memset(alladdr, 0, sizeof(NLaddress) * *count); /* fill in the addresses */ i = 0; while(local->h_addr_list[i] != NULL) { NLaddress *addr = &alladdr[i]; ((struct sockaddr_in *)addr)->sin_family = AF_INET; ((struct sockaddr_in *)addr)->sin_addr.s_addr = *(NLuint *)local->h_addr_list[i]; addr->valid = NL_TRUE; i++; } } return alladdr; } NLboolean sock_SetLocalAddr(const NLaddress *address) { /* should we check against all the local addresses? */ bindaddress = ouraddress = (NLuint)((struct sockaddr_in *)address)->sin_addr.s_addr; return NL_TRUE; } NLchar *sock_GetNameFromAddr(const NLaddress *address, NLchar *name) { struct hostent *hostentry; NLchar tempname[MAXHOSTNAMELEN]; hostentry = gethostbyaddr((char *)&((struct sockaddr_in *)address)->sin_addr, (int)sizeof(struct in_addr), AF_INET); if(hostentry != NULL) { NLushort port = sock_GetPortFromAddr(address); #ifdef _UNICODE NLchar temp[MAXHOSTNAMELEN]; /* convert from multibyte char string to wide char string */ mbstowcs(temp, (const char *)hostentry->h_name, MAXHOSTNAMELEN); temp[MAXHOSTNAMELEN - 1] = '\0'; #else NLchar *temp = (NLchar *)hostentry->h_name; #endif if(port != 0) { _sntprintf(tempname, (size_t)(NL_MAX_STRING_LENGTH), (const NLchar *)TEXT("%s:%hu"), (const NLchar *)temp, port); } else { _tcsncpy(tempname, (const NLchar *)temp, (size_t)(NL_MAX_STRING_LENGTH)); } tempname[NL_MAX_STRING_LENGTH - 1] = (NLchar)'\0'; } else { if(((struct sockaddr_in *)address)->sin_addr.s_addr == (unsigned long)INADDR_NONE) { _tcsncpy(tempname, (const NLchar *)TEXT("Bad address"), (size_t)(NL_MAX_STRING_LENGTH)); } else { (void)sock_AddrToString(address, tempname); } } /* special copy in case this was called as sock_GetNameFromAddrAsync */ name[0] = (NLchar)'\0'; _tcsncpy(&name[1], (const NLchar *)&tempname[1], (size_t)(NL_MAX_STRING_LENGTH - 1)); name[0] = tempname[0]; return name; } static void *sock_GetNameFromAddrAsyncInt(void /*@owned@*/ * addr) { NLaddress_ex_t *address = (NLaddress_ex_t *)addr; (void)sock_GetNameFromAddr(address->address, address->name); free(address->address); free(address); return NULL; } NLboolean sock_GetNameFromAddrAsync(const NLaddress *address, NLchar *name) { NLaddress_ex_t *addr; memset(name, 0, sizeof(NLchar) * NL_MAX_STRING_LENGTH); addr = (NLaddress_ex_t *)malloc(sizeof(NLaddress_ex_t)); if(addr == NULL) { nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } addr->address = (NLaddress *)malloc(sizeof(NLaddress)); if(addr->address == NULL) { nlSetError(NL_OUT_OF_MEMORY); free(addr); return NL_FALSE; } memcpy(addr->address, address, sizeof(NLaddress)); addr->name = name; if(nlThreadCreate(sock_GetNameFromAddrAsyncInt, (void *)addr, NL_FALSE) == (NLthreadID)NL_INVALID) { return NL_FALSE; } return NL_TRUE; } NLboolean sock_GetAddrFromName(const NLchar *name, NLaddress *address) { struct hostent *hostentry; NLushort port = 0; int pos; NLbyte temp[NL_MAX_STRING_LENGTH]; address->valid = NL_FALSE; /* first check to see if we have a numeric address already */ (void)sock_StringToAddr(name, address); /* clear out an NL_BAD_ADDR error */ if(nlGetError() == NL_BAD_ADDR) { nlSetError(NL_NO_ERROR); } if(((struct sockaddr_in *)address)->sin_addr.s_addr != (unsigned long)INADDR_NONE) { /* we are already done! */ address->valid = NL_TRUE; return NL_TRUE; } #ifdef _UNICODE /* convert from wide char string to multibyte char string */ (void)wcstombs(temp, (const NLchar *)name, NL_MAX_STRING_LENGTH); #else strncpy(temp, name, NL_MAX_STRING_LENGTH); #endif temp[NL_MAX_STRING_LENGTH - 1] = (NLbyte)'\0'; pos = (int)strcspn(temp, (const char *)":"); if(pos > 0) { NLbyte *p = &temp[pos+1]; temp[pos] = (NLbyte)'\0'; (void)sscanf(p, "%hu", &port); } hostentry = gethostbyname((const char *)temp); if(hostentry != NULL) { ((struct sockaddr_in *)address)->sin_family = AF_INET; ((struct sockaddr_in *)address)->sin_port = htons(port); ((struct sockaddr_in *)address)->sin_addr.s_addr = *(NLulong *)hostentry->h_addr_list[0]; address->valid = NL_TRUE; } else { ((struct sockaddr_in *)address)->sin_family = AF_INET; ((struct sockaddr_in *)address)->sin_addr.s_addr = INADDR_NONE; ((struct sockaddr_in *)address)->sin_port = 0; nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } return NL_TRUE; } static void *sock_GetAddrFromNameAsyncInt(void /*@owned@*/ *addr) { NLaddress_ex_t *address = (NLaddress_ex_t *)addr; (void)sock_GetAddrFromName(address->name, address->address); address->address->valid = NL_TRUE; free(address->name); free(address); return NULL; } NLboolean sock_GetAddrFromNameAsync(const NLchar *name, NLaddress *address) { NLaddress_ex_t *addr; address->valid = NL_FALSE; addr = (NLaddress_ex_t *)malloc(sizeof(NLaddress_ex_t)); if(addr == NULL) { nlSetError(NL_OUT_OF_MEMORY); return NL_FALSE; } addr->name = (NLchar *)malloc(NL_MAX_STRING_LENGTH); if(addr->name == NULL) { nlSetError(NL_OUT_OF_MEMORY); free(addr); return NL_FALSE; } _tcsncpy(addr->name, name, (size_t)NL_MAX_STRING_LENGTH); addr->name[NL_MAX_STRING_LENGTH - 1] = '\0'; addr->address = address; if(nlThreadCreate(sock_GetAddrFromNameAsyncInt, (void *)addr, NL_FALSE) == (NLthreadID)NL_INVALID) { return NL_FALSE; } return NL_TRUE; } NLboolean sock_AddrCompare(const NLaddress *address1, const NLaddress *address2) { if(((struct sockaddr_in *)address1)->sin_family != ((struct sockaddr_in *)address2)->sin_family) return NL_FALSE; if(((struct sockaddr_in *)address1)->sin_addr.s_addr != ((struct sockaddr_in *)address2)->sin_addr.s_addr) return NL_FALSE; if(((struct sockaddr_in *)address1)->sin_port != ((struct sockaddr_in *)address2)->sin_port) return NL_FALSE; return NL_TRUE; } NLushort sock_GetPortFromAddr(const NLaddress *address) { return ntohs(((struct sockaddr_in *)address)->sin_port); } void sock_SetAddrPort(NLaddress *address, NLushort port) { ((struct sockaddr_in *)address)->sin_port = htons((NLushort)port); } NLint sock_GetSystemError(void) { NLint err = sockerrno; #ifdef WINDOWS_APP if(err < WSABASEERR) { if(errno > 0) { err = errno; } } #endif return err; } NLint sock_PollGroup(NLint group, NLenum name, NLsocket *sockets, NLint number, NLint timeout) { NLint numselect, count = 0; NLint numsockets = NL_MAX_GROUP_SOCKETS; NLsocket temp[NL_MAX_GROUP_SOCKETS]; NLboolean reliable[NL_MAX_GROUP_SOCKETS]; NLboolean result; NLsocket *ptemp = temp; int i, found = 0; fd_set fdset; SOCKET highest; struct timeval t = {0,0}; /* {seconds, useconds}*/ struct timeval *tp = &t; nlGroupLock(); highest = nlGroupGetFdset(group, &fdset); if(highest == INVALID_SOCKET) { /* error is set by nlGroupGetFdset */ nlGroupUnlock(); return NL_INVALID; } result = nlGroupGetSocketsINT(group, ptemp, &numsockets); nlGroupUnlock(); if(result == NL_FALSE) { /* any error is set by nlGroupGetSockets */ return NL_INVALID; } if(numsockets == 0) { return 0; } if(name == NL_READ_STATUS) { /* check for buffered reliable packets */ for(i=0;itype == NL_RELIABLE_PACKETS && s->readable == NL_TRUE) { /* mark as readable */ reliable[i] = NL_TRUE; found++; /* change the timeout to 0, or non-blocking since we */ /* have at least one reliable packet to read */ timeout = 0; } else { reliable[i] = NL_FALSE; } } } /* check for full blocking call */ if(timeout < 0) { tp = NULL; } else /* set t values */ { t.tv_sec = timeout/1000; t.tv_usec = (timeout%1000) * 1000; } /* call select to check the status */ switch(name) { case NL_READ_STATUS: numselect = select((int)highest, &fdset, NULL, NULL, tp); break; case NL_WRITE_STATUS: numselect = select((int)highest, NULL, &fdset, NULL, tp); break; case NL_ERROR_STATUS: numselect = select((int)highest, NULL, NULL, &fdset, tp); break; default: nlSetError(NL_INVALID_ENUM); return NL_INVALID; } if(numselect == SOCKET_ERROR) { if(sockerrno == ENOTSOCK) { /* one of the sockets has been closed */ nlSetError(NL_INVALID_SOCKET); } else if(sockerrno == EINTR) { /* select was interrupted by the system, maybe because the app is exiting */ return 0; } else { nlSetError(NL_SYSTEM_ERROR); } return NL_INVALID; } if(numselect > number) { nlSetError(NL_BUFFER_SIZE); return NL_INVALID; } /* fill *sockets with a list of the sockets ready to be read */ numselect += found; i = 0; while(numsockets-- > 0 && numselect > count) { nl_socket_t *s = nlSockets[*ptemp]; if((reliable[i] == NL_TRUE ) || (FD_ISSET(s->realsocket, &fdset) != 0)) { /* if checking for read status, must check for a complete packet */ if(s->type == NL_RELIABLE_PACKETS && s->listen == NL_FALSE && name == NL_READ_STATUS) { (void)nlLockSocket(*ptemp, NL_READ); if(s->readable != NL_TRUE) { if(s->inuse == NL_TRUE) { (void)sock_ReadPacket(*ptemp, NULL, 0, NL_TRUE); } else { s->readable = NL_FALSE; } } if(s->readable == NL_TRUE) { /* we do have a complete packet */ *sockets = *ptemp; sockets++; count++; } nlUnlockSocket(*ptemp, NL_READ); } else { *sockets = *ptemp; sockets++; count ++; } } i++; ptemp++; } return count; } NLboolean sock_Hint(NLenum name, NLint arg) { switch(name) { case NL_LISTEN_BACKLOG: backlog = arg; break; case NL_MULTICAST_TTL: if(arg < 1) { arg = 1; } else if(arg > 255) { arg = 255; } multicastTTL = arg; break; case NL_REUSE_ADDRESS: reuseaddress = (NLboolean)(arg != 0 ? NL_TRUE : NL_FALSE); break; case NL_TCP_NO_DELAY: nlTCPNoDelay = (NLboolean)(arg != 0 ? NL_TRUE : NL_FALSE); break; default: nlSetError(NL_INVALID_ENUM); return NL_FALSE; } return NL_TRUE; } hawknl-1.6.8+dfsg2/src/sock.h000066400000000000000000000051041130562644400157170ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #ifndef SOCKETS_H #define SOCKETS_H #ifdef __cplusplus extern "C" { #endif NLboolean sock_Init(void); void sock_Shutdown(void); NLboolean sock_Listen(NLsocket socket); NLsocket sock_AcceptConnection(NLsocket socket); NLsocket sock_Open(NLushort port, NLenum type); NLboolean sock_Connect(NLsocket socket, const NLaddress *address); void sock_Close(NLsocket socket); NLint sock_Read(NLsocket socket, /*@out@*/ NLvoid *buffer, NLint nbytes); NLint sock_Write(NLsocket socket, const NLvoid *buffer, NLint nbytes); NLchar *sock_AddrToString(const NLaddress *address, /*@returned@*/ /*@out@*/ NLchar *string); NLboolean sock_StringToAddr(const NLchar *string, /*@out@*/ NLaddress *address); NLboolean sock_GetLocalAddr(NLsocket socket, /*@out@*/ NLaddress *address); NLaddress *sock_GetAllLocalAddr(/*@out@*/ NLint *count); NLboolean sock_SetLocalAddr(const NLaddress *address); NLchar *sock_GetNameFromAddr(const NLaddress *address, /*@returned@*/ /*@out@*/ NLchar *name); NLboolean sock_GetNameFromAddrAsync(const NLaddress *address, /*@out@*/ NLchar *name); NLboolean sock_GetAddrFromName(const NLchar *name, /*@out@*/ NLaddress *address); NLboolean sock_GetAddrFromNameAsync(const NLchar *name, /*@out@*/ NLaddress *address); NLboolean sock_AddrCompare(const NLaddress *address1, const NLaddress *address2); NLushort sock_GetPortFromAddr(const NLaddress *address); void sock_SetAddrPort(NLaddress *address, NLushort port); NLint sock_GetSystemError(void); NLint sock_PollGroup(NLint group, NLenum name, /*@out@*/ NLsocket *sockets, NLint number, NLint timeout); NLboolean sock_Hint(NLenum name, NLint arg); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* SOCKETS_H */ hawknl-1.6.8+dfsg2/src/thread.c000066400000000000000000000112041130562644400162200ustar00rootroot00000000000000/* HawkNL thread module Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #include "nlinternal.h" #ifdef NL_WIN_THREADS typedef struct { void *(*func) (void *); void *arg; } ThreadParms; static unsigned __stdcall threadfunc(void *arg) { void *(*func) (void *); void *args; func = ((ThreadParms *)arg)->func; args = ((ThreadParms *)arg)->arg; free(arg); return (unsigned)((*func)(args)); } #if defined (_WIN32_WCE) #define _beginthreadex(security, \ stack_size, \ start_proc, \ arg, \ flags, \ pid) \ CreateThread(security, \ stack_size, \ (LPTHREAD_START_ROUTINE) start_proc, \ arg, \ flags, \ pid) #else /* !(_WIN32_WCE) */ #include #endif /* !(_WIN32_WCE) */ #else /* !NL_WIN_THREADS */ /* POSIX systems */ #include #include #endif /* !NL_WIN_THREADS */ #ifndef WINDOWS_APP #include #endif /* WINDOWS_APP */ NL_EXP NLthreadID NL_APIENTRY nlThreadCreate(NLThreadFunc func, void *data, NLboolean joinable) { /* Windows threads */ #ifdef NL_WIN_THREADS HANDLE h; unsigned tid; ThreadParms *p; p = (ThreadParms *)malloc(sizeof(ThreadParms)); if(p == NULL) { nlSetError(NL_OUT_OF_MEMORY); return (NLthreadID)NL_INVALID; } p->func = func; p->arg = data; h = (HANDLE)_beginthreadex(NULL, 0, threadfunc, p, 0, &tid); if(h == (HANDLE)(0)) { nlSetError(NL_SYSTEM_ERROR); return (NLthreadID)NL_INVALID; } if(joinable == NL_FALSE) { (void)CloseHandle(h); return NULL; } return (NLthreadID)h; /* POSIX systems */ #else pthread_attr_t attr; pthread_t tid; int result; (void)pthread_attr_init(&attr); if(joinable == NL_FALSE) { (void)pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); } else { (void)pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); } result = pthread_create(&tid, &attr, func, data); (void)pthread_attr_destroy(&attr); if(result != 0) { #ifdef WINDOWS_APP SetLastError((DWORD)result); #endif nlSetError(NL_SYSTEM_ERROR); return (NLthreadID)NL_INVALID; } if(joinable == NL_FALSE) { return NULL; } return (NLthreadID)tid; #endif } NL_EXP void NL_APIENTRY nlThreadYield(void) { /* Windows threads */ #ifdef NL_WIN_THREADS Sleep((DWORD)0); /* POSIX systems */ #else (void)sched_yield(); #endif } NL_EXP NLboolean NL_APIENTRY nlThreadJoin(NLthreadID threadID, void **status) { /* Windows threads */ #ifdef NL_WIN_THREADS if(WaitForSingleObject((HANDLE)threadID, INFINITE) == WAIT_FAILED) { nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } if(status != NULL) { (void)GetExitCodeThread((HANDLE)threadID, (LPDWORD)status); } (void)CloseHandle((HANDLE)threadID); /* POSIX systems */ #else int result; result = pthread_join((pthread_t)threadID, status); if(result != 0) { #ifdef WINDOWS_APP SetLastError((DWORD)result); #endif nlSetError(NL_SYSTEM_ERROR); return NL_FALSE; } #endif return NL_TRUE; } void nlThreadSleep(NLint mseconds) { #ifdef WINDOWS_APP Sleep((DWORD)mseconds); #else /* !WINDOWS_APP */ struct timespec tv; tv.tv_sec = mseconds / 1000; tv.tv_nsec = (mseconds % 1000) * 1000; (void)nanosleep(&tv, NULL); #endif /* !WINDOWS_APP */ /* can use usleep if nanosleep is not supported on your platform */ /* (void)usleep(mseconds*1000); */ } hawknl-1.6.8+dfsg2/src/wsock.h000066400000000000000000000122231130562644400161060ustar00rootroot00000000000000/* HawkNL cross platform network library Copyright (C) 2000-2002 Phil Frisbie, Jr. (phil@hawksoft.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. Or go to http://www.gnu.org/copyleft/lgpl.html */ #ifndef WSOCK_H #define WSOCK_H #include "../include/nl.h" /* Windows systems */ #ifdef _MSC_VER #pragma warning (disable:4201) #pragma warning (disable:4214) #pragma warning (disable:4127) /* bogus FD_SET warning */ #endif /* _MSC_VER */ #define WIN32_LEAN_AND_MEAN #include #ifdef _MSC_VER #pragma warning (default:4201) #pragma warning (default:4214) #endif /* _MSC_VER */ #define ioctl ioctlsocket #undef EBADF #define EBADF WSAEBADF #undef EFAULT #define EFAULT WSAEFAULT #undef EMFILE #define EMFILE WSAEMFILE #undef EINTR #define EINTR WSAEINTR #undef EINVAL #define EINVAL WSAEINVAL #undef EACCES #define EACCES WSAEACCES #ifndef ENAMETOOLONG #define ENAMETOOLONG WSAENAMETOOLONG #endif #ifndef ENOTEMPTY #define ENOTEMPTY WSAENOTEMPTY #endif #ifndef ETIMEDOUT #define ETIMEDOUT WSAETIMEDOUT #endif #ifndef EREMOTE #define EREMOTE WSAEREMOTE #endif #define TRY_AGAIN WSATRY_AGAIN #define NO_RECOVERY WSANO_RECOVERY #define NO_DATA WSANO_DATA #define HOST_NOT_FOUND WSAHOST_NOT_FOUND #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS #define EALREADY WSAEALREADY #define ENOTSOCK WSAENOTSOCK #define EDESTADDRREQ WSAEDESTADDRREQ #define EMSGSIZE WSAEMSGSIZE #define EPROTOTYPE WSAEPROTOTYPE #define ENOPROTOOPT WSAENOPROTOOPT #define EPROTONOSUPPORT WSAEPROTONOSUPPORT #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT #define EOPNOTSUPP WSAEOPNOTSUPP #define EPFNOSUPPORT WSAEPFNOSUPPORT #define EAFNOSUPPORT WSAEAFNOSUPPORT #define EADDRINUSE WSAEADDRINUSE #define EADDRNOTAVAIL WSAEADDRNOTAVAIL #define ENETDOWN WSAENETDOWN #define ENETUNREACH WSAENETUNREACH #define ENETRESET WSAENETRESET #define ECONNABORTED WSAECONNABORTED #define ECONNRESET WSAECONNRESET #define ENOBUFS WSAENOBUFS #define EISCONN WSAEISCONN #define ENOTCONN WSAENOTCONN #define ESHUTDOWN WSAESHUTDOWN #define ETOOMANYREFS WSAETOOMANYREFS #define ECONNREFUSED WSAECONNREFUSED #define ELOOP WSAELOOP #define EHOSTDOWN WSAEHOSTDOWN #define EHOSTUNREACH WSAEHOSTUNREACH #define EPROCLIM WSAEPROCLIM #define EUSERS WSAEUSERS #define EDQUOT WSAEDQUOT #define ESTALE WSAESTALE #define sockerrno WSAGetLastError() /* get rid of some nasty LCLint messages */ #undef FIONBIO #define FIONBIO 0x8004667e typedef int socklen_t; typedef struct sockaddr_ipx { short sa_family; char sa_netnum[4]; char sa_nodenum[6]; unsigned short sa_socket; } SOCKADDR_IPX; #define NSPROTO_IPX 1000 #define NSPROTO_SPX 1256 #define NSPROTO_SPXII 1257 /* These replacement inlined functions are replacements for */ /* the Winsock macros, but compile without errors :) */ #undef FD_CLR #define FD_CLR nlFD_CLR NL_INLINE void nlFD_CLR(SOCKET fd, fd_set *set) { u_int i; for(i=0;ifd_count;i++) { if(set->fd_array[i] == fd) { while(i < set->fd_count-1) { set->fd_array[i] = set->fd_array[i+1]; i++; } set->fd_count--; break; } } } #undef FD_SET #define FD_SET nlFD_SET NL_INLINE void nlFD_SET(SOCKET fd, fd_set *set) { if(set->fd_count < FD_SETSIZE) set->fd_array[set->fd_count++]=fd; } /* This function is inlined for speed over the Winsock function */ #undef FD_ISSET #define FD_ISSET(fd, set) nlWSAFDIsSet((SOCKET)(fd), set) NL_INLINE int nlWSAFDIsSet(SOCKET fd, fd_set *set) { int i = (int)set->fd_count; while(i-- != 0) { if (set->fd_array[i] == fd) return 1; } return 0; } #endif /* WSOCK_H */