Commits

starkos  committed bcb6c59

Tagged 3.7

  • Participants

Comments (0)

Files changed (304)

+Premake Changelog
+-----------------
+3.7
+* Updated Lua to 5.1.3
+* Added new CodeLite support target (Ryan Pusztai)
+* Added new cb-ow (Code::Blocks Open Watcom) target (Tim Channon)
+* Place OSX winexe's into Content/MacOS folder (William Burnson)
+* Sibling executables may now be listed in package.links
+* Bug 1520012: Improper Makefiles when filenames have spaces (Diaa Sami)
+* Bug 2045506: "no-exceptions" flag ignored for VS200x (Benoit Miller)
+* Bug 2034470: Error in cmd line error handler
+* Bug 2114152: package or config table isn't generated automatically
+
+
+3.6
+* Patch 1946122: Add support for VS2008 (Ryan Pusztai)
+* Patch 1913448: Win32 crash when using '--clean --usetargetpath' (David Walters)
+* Patch 1771168: luaL_getn speed optimization (Richard O'Grady)
+* Bug 1939089: Premake segfault on Linux/PPC (Fabio Till)
+* Fixed "bad argument #2 to 'chdir'" error
+* Disable -MMD on multiple -arch flags (poor man's Universal binary support)
+
+3.5
+* Prevent creation of import libraries on OS X
+* Improved handling of dylibs on OS X
+* Patch 1771977: Ability to compile C source as C++ in Code::Blocks (Ryan Pusztai)
+* Bug 1804810: out-implib not present in linux gnu compler toolchain
+* Bug 1806949: .Net reference paths are broken when bindir is specified
+* Bug 1806960: Make clean does not remove .mdb files
+* Bug 1831389: Makefiles stored in subdirs contain no targets on first run
+
+3.4
+* Added `no-pch` flag to suppress precompiled headers
+* Added App.config support to GNU makefiles
+* Add os.mkdir() to script environment
+* Makefile now creates target directory before copying .NET references
+* Feature 1520182: Enhanced file-handling functions
+* Bug 531878: Problems with relative paths
+* Bug 1723867: Config-specific post-build on GNU target (Benoit Miller)
+* Bug 1596826: XML targets doesn't escape xml entities
+* Bug 1600155: Core dump due to newpackage() and matchfiles()
+* Bug 1608895: resgen command shown
+* Bug 1639730: Output filename is not set
+* Bug 1729227: non-portable executable with relative library path
+* Bug 1559951: default clean rule removes package dir
+* Patch 1733674: PCH support for Code::Block targets (Ryan Pusztai)
+* Patch 1746563: Ability to specify GUID for VS targets (Ryan Pusztai)
+* Patch 1754867: Creating import lib of different name (Ryan Pusztai)
+
+3.3
+* Added support for prebuild, prelink, and postbuild commands
+* Added `target` global variable to script environment
+* Added build flag `no-edit-and-continue`
+* Added build flags `native-wchar` and `no-native-wchar`
+* Added build flag `no-manifest`
+* Added build flag `seh-exceptions` (VS2005 only)
+* Added `resdefines`, `respaths`, and `resoptions`
+* Added `prebuildcommands`, `prelinkcommands`, and `postbuildcommands`
+* Added `pchheader` and `pchsource` (Visual Studio only)
+* Feature 1337547: Package-level bindir and libdir
+* Bug 1565755: Generated makefiles do not work with MSYS
+* Bug 1587955: Target path ignored for libs
+* Bug 1574725: Static library extension for "gnu" target
+* Bug 1522861: Fixed by using "ar -rcs" instead of "ar -cr && ranlib"
+* Bug 1656816: Mkdir set wrong directory rights
+* Bug 1655595: Compile/build problem on FreeBSD
+* Bug: "gnu" clean rule doesn't work in cmd.exe
+* Improved behavior of Linux findlib()
+* Updated Code::Blocks support to latest project version (major="1" minor="6")
+* Patch 1681666: GNU targets always show the console if kind = 'winexe'
+
+3.2
+* Added support for Code::Blocks
+* Updated MonoDevelop support
+* Upgraded Lua to 5.0.3
+* Added new matchdirs() to Lua script environment
+* Expose list of packages as _PACKAGES global in Lua
+* Turn off edit-and-continue in release builds with symbols
+* Bug 1559873: libpaths inserts extra space after -L
+
+3.1
+* Added support for Visual Studio 2005
+* Added support for Windows resources to GNU make target
+* Added path handling functions to Lua environment
+* Added matchrecursive() for recursive file searches
+* Added os.fileexists() function to Lua environment
+* Added os.appendfile() function to Lua environment
+* Changed `monoresgen` to `resgen` to keep up with Mono project
+* Added `mono2` .NET compiler set for Mono .NET 2.0 support
+* Feature 1096677: exclude files from matchfiles (package.excludes)
+* Bug 1439463: VS2003 RTTI problem
+* Bug 1439446: GNU Makefile problem under Mingw32
+* Bug 1422068: package.path="." causes bad makefiles
+* Bug 1431530: makefile target fails when project path specified
+
+3.0
+* Upgraded Lua interpreter to version 5.0.1
+* The options table now stores simple values, rather than tables
+* Completed MonoDevelop support
+* Improved .NET resource handling for GNU generator
+* Added unit test suite
+* Merged Scott Graham unicode build flag patch
+* Removed package.warninglevel in favor of extra-warnings flag
+* Added package.targetprefix 
+* Overhauled structure of generated GNU makefiles
+* Added --os command line option
+* Fixed bug 1268588: Use gcc to link C packages
+* Fixed bug 1363306: GNU C# should copy referenced DLLs
+
+2.4
+* Added chdir() to Lua script environment
+* Merged Thomas Harning's patch for .NET resources on GNU
+* Fixed bug 1194702: Can't put multiple packages in same directory
+* Fixed bug in GNU shared library builds (doh!)
+* Added target 'vs2002' to replace 'vs7'
+
+2.3
+* Added 'project.config[]' with 'bindir' and 'libdir'
+* Merged Scott Graham's "warninglevel" patch.
+* Fixed bug 1153484: Import lib in wrong directory.
+* Fixed bug 1013352: Stack overflow with large projects.
+* Fixed bug 945406: package.files, bad value = crash
+
+2.2
+* Worked around VS.NET bug for .NET assemblies > 64K.
+* Added --very-verbose flag to GNU generator.
+* GNU generator now supports assembly sources.
+ 
+2.1
+* File extension of generated binaries can now be set
+  with config.targetextension.
+* Windows targets now handle .def files for DLLs.
+
+2.0
+* Can now specify build actions per file
+* Include paths are now passed to VC7 resource compiler
+* Removed _WIN32 define from Cygwin makefiles
+* Added package.objdir to set intermediates directory
+* Added rmdir() to Lua script environment
+* A big bag of bug fixes
+
+1.9
+* Made verbose mode even more verbose.
+* posix.c now builds properly as C.
+* Fixed package dependency generation for GNU and VS2003.
+* Display Lua version number in usage text.
+* Fixed VS link between *.aspx and *.aspx.cs files.
+* Fixed VS link between *.resx and *.cs files.
+* Fixed *.d file generation for gcc 2.9x.
+* Unified various help options under '--help'.
+* Bin and Lib paths can now be arbitrarily long.
+* linkoptions are now applied in VC6 and VC7 projects.
+
+1.8
+* Added support for ASP.NET projects.
+* Fixed a bug in VC6 support for static libraries.
+* matchfiles() now uses package path instead of script path.
+* Added --verbose option.
+* No longer apply no-rtti and no-exceptions to *.c files.
+
+1.7
+* Location of generated project files can now be specified with
+  the project.path variable.
+* Inter-package dependencies are fixed for GNU makefiles.
+* No longer need to execute in same directory as project script.
+* Added "c" language specifier.
+* Added support for .resx and .config files to C# projects.
+* Added support for full assembly names in .NET references.
+* Fixed handling of paths in package.target variable.
+* Improved support for SharpDevelop.
+* Started support for OS X.
+* Added support for Digital Mars compiler.
+
+1.6.1
+* VS7 generator crashed if a package was built before one of its
+  dependencies. Now immediately assigns UUID before processing.
+  
+1.6
+* Added support for Visual Studio 2003 and SharpDevelop.
+* Added binaries directory as a reference path for VS7.
+	
+1.5
+* Added initial support for building static libraries.
+* Added "no-main" flag, prevents overriding WinMain() on 
+  Windows builds.
+* Added "--no-rtti" and "no-exceptions" build flags to
+  disable those C++ features.
+* Display error message when project has no packages.
+* Moved VC7 *.pdb files into intermediates directory.
+  
+1.4
+* Bug fixes to the path manipulation routines.
+* GNU makefiles are regenerated when premake scripts change.
+    
+1.3
+* Added support for the Cygwin environment.
+* Added "static-runtime" build flag to statically link against C/C++
+  standard runtime libraries.
+* Bug fixes to Visual Studio 6 and 7 generators and path reversing
+  algorithm.
+
+1.2
+* Standardized format of command-line options.
+* Can now handle custom command-line options in script.
+* Added new function findlib().
+* Added new C++ build flag "managed" for writing C++ .NET code.
+* Can now use open-source C# compilers in VS6 generator.
+* Several bug fixes to the VS7 generator.
+
+1.1
+* Added support for custom build configurations. Added "optimize",
+  "optimize-size", "optimize-speed", and "no-symbols" flags to control
+  build settings.
+* Added matchfiles() to select files using wildcards.
+* Added "unsafe" flag for C# projects.
+* Added newpackage() function for creating new package objects inline,
+  instead of creating separate scripts.
+* Changed include() to dopackage() and option() to addoption(). The old
+  versions have been kept for compatibility, but will be deprecated
+  eventually.
+* Major cleanup of the source code.
+
+1.0
+* Fixed a bug related to the reference paths in VS7 C# projects.
+* Display a warning message if a reference path can't be found.
+* Automatically create bin and lib directories if they do not exist.
+* GNU C# projects will now properly use the configured library paths.
+
+0.9.2
+* Added --with-mono and --with-pnet options.
+* VS7 C# projects will now properly use the configured library paths.
+
+0.9.1
+* Switched to Lua (http://www.lua.org/) for project script parsing.
+* Add support for custom project options.
+* Changed 'type' to 'kind' to avoid conflict with Lua function of the same name.
+* Changed 'conexe' to 'exe' because I liked it better.
+* Changed 'library' to 'dll' for C# projects to keep things consistent.
+
+0.9.0
+* Initial public release.
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

File Packages/debian/changelog

+premake (3.6-0ubuntu1~dapper1) dapper; urgency=low
+
+  * Sync to upstream release 3.6
+
+ -- Ryan Mulder <rjmyst3@gmail.com>  Wed, 30 Apr 2008 20:54:02 -0400
+
+premake (3.5-0ubuntu1~dapper2) dapper; urgency=low
+
+  * Initial release
+
+ -- Ryan Mulder <rjmyst3@gmail.com>  Thu, 17 Apr 2008 20:27:22 -0400
+

File Packages/debian/compat

+5

File Packages/debian/control

+Source: premake
+Section: contrib/devel
+Priority: optional
+Maintainer: Ryan Mulder <rjmyst3@gmail.com>
+Build-Depends: debhelper (>= 5)
+Standards-Version: 3.7.3
+Homepage: http://premake.sourceforge.net
+
+Package: premake
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Build Script Generator
+ Premake allows you to manage your project configuration in one
+ place and still support those pesky IDE-addicted Windows coders
+ and/or cranky Linux command-line junkies. It allows you to generate
+ project files for tools that you do not own. It saves the time that
+ would otherwise be spent manually keeping several different toolsets
+ in sync. And it provides an easy upgrade path as new versions of your
+ favorite tools are released.

File Packages/debian/copyright

+This package was debianized by Ryan Mulder <rjmyst3@gmail.com> on
+Thu, 17 Apr 2008 20:27:22 -0400.
+
+It was downloaded from <http://premake.sourceforge.net>
+
+Upstream Author: 
+
+    Jason Perkins <starkos@gmail.com>
+    
+Copyright: 
+
+    Copyright (C) 2002-2005 Jason Perkins and the Premake project
+
+License:
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+The Debian packaging is (C) 2008, Ryan Mulder <rjmyst3@gmail.com> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
+
+Lua License
+-----------
+
+Lua is licensed under the terms of the MIT license reproduced below.
+This means that Lua is free software and can be used for both academic
+and commercial purposes at absolutely no cost.
+
+For details and rationale, see http://www.lua.org/license.html .
+
+===============================================================================
+
+Copyright (C) 2003-2006 Tecgraf, PUC-Rio.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+===============================================================================
+
+(end of COPYRIGHT)

File Packages/debian/dirs

+usr/bin

File Packages/debian/premake.1

+.\" premake man page. 
+.\" Contact rjmyst3@gmail.com to correct errors or omissions. 
+.TH "PREMAKE" "1" "17 April 2008" "Ryan Mulder" ""
+.SH "NAME"
+Premake \- A build script generator.
+.SH "SYNOPSIS"
+.\" Syntax goes here. 
+.B premake \-\-target <str>
+.SH "DESCRIPTION"
+.B premake
+allows you to manage your project configuration in one place and still support those pesky IDE\-addicted Windows coders and/or cranky Linux command\-line junkies. It allows you to generate project files for tools that you do not own. It saves the time that would otherwise be spent manually keeping several different toolsets in sync. And it provides an easy upgrade path as new versions of your favorite tools are released.
+.SH "OPTIONS"
+.TP 8
+.B "\-\-file name"
+Process the specified premake script file. If not specified, "premake.lua" is assumed.
+.TP 8
+.B "\-\-verbose"
+Generate verbose makefiles (where applicable).
+.TP 8
+.B "\-\-clean"
+Remove all binaries and build scripts.
+.TP 8
+.B "\-\-cc name"
+Choose a C/C++ compiler, if supported by target; one of:
+      gcc       GNU gcc compiler
+      dmc       Digital Mars C/C+ compiler (experimental)
+.TP 8
+.B "\-\-dotnet name"
+Choose a .NET compiler set, if supported by target; one of:
+      ms        Microsoft (csc)
+      mono      Mono (mcs)
+      mono2     Mono .NET 2.0 (gmcs)
+      pnet      Portable.NET (cscc)
+.TP 8
+.B "\-\-os name"
+Generate files for different operating system; one of:
+      bsd       OpenBSD, NetBSD, or FreeBSD
+      linux     Linux
+      macosx    MacOS X
+      windows   Microsoft Windows
+.TP 8
+.B "\-\-target name"
+Generate input files for the specified toolset; one of:
+      cb\-gcc    Code::Blocks Studio with GCC
+      gnu       GNU Makefile for POSIX, MinGW, and Cygwin
+      monodev   MonoDevelop
+      sharpdev  ICSharpCode SharpDevelop
+      vs6       Microsoft Visual Studio 6
+      vs2002    Microsoft Visual Studio 2002
+      vs2003    Microsoft Visual Studio 2003
+      vs2005    Microsoft Visual Studio 2005 (includes Express editions)
+      vs2008    Microsoft Visual Studio 2008 (experimental)
+.TP 8
+.B "\-\-version"
+Display version information.
+.TP 8
+.B "\-\-help"
+Display this information.
+.SH "EXAMPLES"
+Generate Makefiles for gcc.
+.nf 
+premake \-\-target gnu
+.SH "AUTHORS"
+.nf 
+Jason Perkins and the Premake Project
+.fi 
+.SH "HISTORY"
+2008 \- Updated for Premake 3.6
+

File Packages/debian/rules

+#!/usr/bin/make -f
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+	dh_testdir
+
+	$(MAKE) CONFIG=Release
+
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	$(MAKE) CONFIG=Release clean
+
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+	cp $(CURDIR)/bin/premake $(CURDIR)/debian/premake/usr/bin
+
+binary-indep: build install
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs $(CURDIR)/CHANGES.txt
+	dh_installdocs
+	dh_installman $(CURDIR)/debian/premake.1
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+PREMAKE
+Build Script Generation
+
+Copyright (C) 2002-2008 by Jason Perkins
+Distributed under the GNU General Public License, see LICENSE.txt
+
+The Lua language and runtime library is (C) TeCGraf, PUC-Rio.
+See their website at http://www.lua.org/
+
+
+BUILDING PREMAKE
+
+  GNU make: type 'make' (also Cygwin and MinGW)
+
+  MS Visual C++ 6: open Premake.dsw and build.
+
+  MS Visual C++ 2002-2008: open Premake.sln and build.
+
+
+For questions, comments, or more information, visit the project
+website at http://premake.sourceforge.net/

File Scripts/HOWTO.txt

+- Update support files (README and CHANGES) and commit
+
+- Create SVN branch for the release and check it out 
+
+- Update version number (premake.c) and commit into branch
+
+
+In WINDOWS:
+
+$ premake --clean --target gnu
+$ make CONFIG=Release
+$ cd bin
+$ cp premake.exe ~/Code/Bin
+$ 7z a -tzip premake-win32-${VER}.zip premake.exe
+$ mv premake-win32-${VER}.zip ~/Desktop
+
+In OSX:
+
+- checkout branch
+$ premake --clean --target gnu
+$ make CONFIG=Release TARGET_ARCH="-arch i386 -arch ppc"
+$ cd bin
+$ strip premake
+$ sudo cp premake /usr/local/bin
+$ tar czvf premake-osx-${VER}.tar.gz premake
+$ mv premake-osx-${VER}.tar.gz ~/Desktop
+
+In Linux:
+
+- EXPORT 
+  https://premake.svn.sourceforge.net/svnroot/premake/branches/3.7
+  -> Premake-${VER}
+
+$ premake --clean --target gnu
+$ make CONFIG=Release
+$ cd bin
+$ sudo cp premake /usr/local/bin
+$ tar czvf premake-linux-${VER}.tar.gz premake
+$ sudo mv premake-linux-${VER}.tar.gz /mnt/hgfs/jason/Desktop
+
+$ premake --clean --target gnu
+$ rm -rf Scripts
+$ premake --os windows --target vs6
+$ premake --os windows --target vs2002
+$ unix2dos *.dsw *.sln Src/*.dsp Src/*.vcprj
+$ cd ..
+$ zip -r9 premake-src-${VER}.zip Premake-${VER}/*
+$ sudo mv premake-src-${VER}.zip /mnt/hgfs/jason/Desktop
+
+
+
+
+- Create new file release on SourceForge
+
+- Add new group to SourceForge tracker
+
+- Update download page on premake.sourceforge.net
+
+- Update online documentation as needed
+
+- Announce on website and mailing list
+
+- Update README and premake.c on trunk to version "+"
+
+- Move branch to tag
+
+- Switch back to trunk
+
+

File Scripts/ftp_msw.txt

+anonymous
+jason379@users.sourceforge.net
+cd incoming
+bin
+prompt
+mput premake-win32-*.zip
+quit
+

File Scripts/ftp_x11.txt

+user anonymous starkos@users.sourceforge.net
+cd incoming
+bin
+prompt
+mput premake-src-*.zip
+mput premake-*.tar.gz
+quit
+

File Scripts/msw.bat

+@echo off
+rem ***********************************************************
+rem * Premake Windows Binary Release Script
+rem * Originally written by Jason Perkins (starkos@gmail.com)
+rem *
+rem * Prerequisites:
+rem *  Command-line svn installed on path
+rem *  Command-line zip installed on path
+rem *  MinGW MSYS installed and on path
+rem ***********************************************************
+
+rem * Check arguments
+if "%1"=="" goto show_usage
+
+
+rem ***********************************************************
+rem * Pre-build checklist
+rem ***********************************************************
+
+echo. 
+echo STARTING PREBUILD CHECKLIST, PRESS ^^C TO ABORT.
+echo.
+echo Is the version number "%1" correct?
+pause
+echo.
+echo Have you created a release branch named "%1" in SVN?
+pause
+echo.
+echo Have you run all of the tests?
+pause
+echo.
+echo Did you update README.txt?
+pause
+echo.
+echo Did you update CHANGES.txt?
+pause
+echo.
+echo Are 'svn' and '7z' on the path?
+pause
+echo.
+echo Okay, ready to build the Windows binary packages for version %1!
+pause
+
+
+rem ***********************************************************
+rem * Retrieve source code
+rem ***********************************************************
+
+echo.
+echo RETRIEVING SOURCE CODE FROM REPOSITORY...
+echo.
+
+svn export https://premake.svn.sourceforge.net/svnroot/premake/branches/%1 Premake-%1
+
+
+rem ***********************************************************
+rem * Build the binaries
+rem ***********************************************************
+
+echo.
+echo BUILDING RELEASE BINARIES...
+echo.
+
+cd Premake-%1
+premake --target gnu
+make CONFIG=Release
+
+
+rem ----> Need to strip release?!
+
+
+rem ***********************************************************
+rem * Package things up
+rem ***********************************************************
+
+echo.
+echo CREATING PACKAGE...ft
+echo.
+
+cd bin
+7z a -tzip ..\..\premake-win32-%1.zip premake.exe
+
+
+rem ***********************************************************
+rem * Clean up
+rem ***********************************************************
+
+echo.
+echo CLEANING UP...
+echo.
+
+cd ..\..
+rmdir /s /q Premake-%1
+
+
+rem ***********************************************************
+rem * Upload to SF.net
+rem ***********************************************************
+
+echo.
+echo Ready to upload package to SourceForce, press ^^C to abort.
+pause
+
+ftp -s:ftp_msw.txt upload.sourceforge.net
+goto done
+
+
+rem ***********************************************************
+rem * Error messages
+rem ***********************************************************
+
+:show_usage
+echo Usage: msw.bat version_number
+goto done
+
+:done

File Scripts/osx.sh

+#!/bin/sh
+###################################################################
+# Premake OS X Binary Release Script
+# Originally written by Jason Perkins (starkos@gmail.com)
+#
+# Prerequisites:
+#  svn, zip
+###################################################################
+
+# Check arguments
+if [ $# -ne 1 ]; then
+  echo 1>&2 "Usage: $0 version_number"
+  exit 1
+fi
+
+
+###################################################################
+# Pre-build checklist
+###################################################################
+
+echo "" 
+echo "STARTING PREBUILD CHECKLIST, PRESS ^^C TO ABORT."
+echo ""
+echo "Is the version number '$1' correct?"
+read line
+echo ""
+echo "Have you created a release branch named '$1' in SVN?"
+read line
+echo ""
+echo "Have you run all of the tests?"
+read line
+echo ""
+echo "Is the version number in premake.c correct?"
+read line
+echo ""
+echo "Is README.txt up to date?"
+read line
+echo ""
+echo "Is CHANGES.txt up to date?"
+read line
+echo ""
+echo "Ready to build Source Code and OS X executable for version $1."
+echo "Press [Enter] to begin."
+read line
+
+
+
+#####################################################################
+# Stage 1: Preparation
+#
+# Pull the source code from Subversion.
+#####################################################################
+
+echo ""
+echo "RETRIEVING SOURCE CODE FROM REPOSITORY..."
+echo ""
+
+svn export https://premake.svn.sourceforge.net/svnroot/premake/branches/$1 Premake-$1
+
+echo ""
+echo "REMOVING PRIVATE FILES..."
+echo ""
+
+cd Premake-$1
+rm -rf Scripts
+rm -f  TODO.txt
+
+
+#####################################################################
+# Stage 2: Binary Package
+#####################################################################
+
+echo ""
+echo "BUILDING RELEASE BINARY..."
+echo ""
+
+premake --target gnu
+make CONFIG=Release TARGET_ARCH="-arch i386 -arch ppc"
+
+
+#####################################################################
+# Stage 3: Pack Release
+#####################################################################
+
+cd bin
+tar czvf ../../premake-osx-$1.tar.gz premake
+
+
+#####################################################################
+# Stage 4: Publish Files
+#
+# Send the files to SourceForge
+#####################################################################
+
+cd ../.. 
+echo ""
+echo "Upload packages to SourceForge?"
+read line
+if [ $line = "y" ]; then
+	echo "Uploading to SourceForge..."
+	ftp -n upload.sourceforge.net < ftp_x11.txt
+fi
+
+
+#####################################################################
+# All done
+#####################################################################
+
+echo ""
+echo "CLEANING UP..."
+echo ""
+cd ../..
+rm -rf Premake-$1

File Scripts/x11.sh

+#!/bin/sh
+###################################################################
+# Premake Source Code and Linux Binary Release Script
+# Originally written by Jason Perkins (starkos@gmail.com)
+#
+# Prerequisites:
+#  svn, zip
+###################################################################
+
+# Check arguments
+if [ $# -ne 1 ]; then
+  echo 1>&2 "Usage: $0 version_number"
+  exit 1
+fi
+
+
+###################################################################
+# Pre-build checklist
+###################################################################
+
+echo "" 
+echo "STARTING PREBUILD CHECKLIST, PRESS ^^C TO ABORT."
+echo ""
+echo "Is the version number '$1' correct?"
+read line
+echo ""
+echo "Have you created a release branch named '$1' in SVN?"
+read line
+echo ""
+echo "Have you run all of the tests?"
+read line
+echo ""
+echo "Is the version number in premake.c correct?"
+read line
+echo ""
+echo "Is README.txt up to date?"
+read line
+echo ""
+echo "Is CHANGES.txt up to date?"
+read line
+echo ""
+echo "Ready to build Source Code and POSIX executable for version $1."
+echo "Press [Enter] to begin."
+read line
+
+
+
+#####################################################################
+# Stage 1: Preparation
+#
+# Pull the source code from Subversion.
+#####################################################################
+
+echo ""
+echo "RETRIEVING SOURCE CODE FROM REPOSITORY..."
+echo ""
+
+svn export https://premake.svn.sourceforge.net/svnroot/premake/branches/$1 Premake-$1
+
+echo ""
+echo "REMOVING PRIVATE FILES..."
+echo ""
+
+cd Premake-$1
+rm -rf Scripts
+rm -f  TODO.txt
+
+
+#####################################################################
+# Stage 2: Source Code Package
+#####################################################################
+
+echo ""
+echo "PACKAGING SOURCE CODE..."
+echo ""
+
+premake --os linux --target gnu
+premake --os windows --target vs6
+premake --os windows --target vs2002
+
+unix2dos Premake.dsw
+unix2dos Premake.sln
+unix2dos Src/Premake.dsp
+unix2dos Src/Premake.vcproj
+
+cd ..
+zip -r9 premake-src-$1.zip Premake-$1/*
+
+
+#####################################################################
+# Stage 3: Binary Package
+#####################################################################
+
+echo ""
+echo "BUILDING RELEASE BINARY..."
+echo ""
+
+cd Premake-$1
+make CONFIG=Release
+
+
+#####################################################################
+# Stage 4: Pack Release
+#####################################################################
+
+cd bin
+tar czvf ../../premake-linux-$1.tar.gz premake
+
+
+#####################################################################
+# Stage 5: Publish Files
+#
+# Send the files to SourceForge
+#####################################################################
+
+cd ../.. 
+echo ""
+echo "Upload packages to SourceForge?"
+read line
+if [ $line = "y" ]; then
+	echo "Uploading to SourceForge..."
+	ftp -n -p upload.sourceforge.net < ftp_x11.txt
+fi
+
+
+#####################################################################
+# All done
+#####################################################################
+
+echo ""
+echo "CLEANING UP..."
+echo ""
+cd ../..
+rm -rf Premake-$1
+

File Src/Lua/COPYRIGHT

+Lua License
+-----------
+
+Lua is licensed under the terms of the MIT license reproduced below.
+This means that Lua is free software and can be used for both academic
+and commercial purposes at absolutely no cost.
+
+For details and rationale, see http://www.lua.org/license.html .
+
+===============================================================================
+
+Copyright (C) 2003-2006 Tecgraf, PUC-Rio.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+===============================================================================
+
+(end of COPYRIGHT)

File Src/Lua/README

+This is Lua 5.0.
+See HISTORY for a summary of changes since the last released version.
+
+* What is Lua?
+  ------------
+  Lua is a powerful, light-weight programming language designed for extending
+  applications. Lua is also frequently used as a general-purpose, stand-alone
+  language. Lua is free software.
+
+  For complete information, visit Lua's web site at http://www.lua.org/ .
+  For an executive summary, see http://www.lua.org/about.html .
+
+  Lua has been used in many different projects around the world.
+  For a short list, see http://www.lua.org/uses.html .
+
+* Availability
+  ------------
+  Lua is freely available for both academic and commercial purposes.
+  See COPYRIGHT and http://www.lua.org/license.html for details.
+  Lua can be downloaded from its official site http://www.lua.org/ and
+  several other sites aroung the world. For a complete list of mirror sites,
+  see http://www.lua.org/mirrors.html .
+
+* Installation
+  ------------
+  Lua is implemented in pure ANSI C, and compiles unmodified in all known
+  platforms that have an ANSI C compiler. Under Unix, simply typing "make"
+  should work. See INSTALL for detailed instructions.
+
+* Contacting the authors
+  ----------------------
+  Send your comments, questions, and bug reports to lua@tecgraf.puc-rio.br.
+  For more information about the authors, see http://www.lua.org/authors.html .
+  For reporting bugs, try also the mailing list: lua-l@tecgraf.puc-rio.br.
+  For more information about this list, including instructions on how to
+  subscribe and access the archives, see http://www.lua.org/lua-l.html .
+
+* Origin
+  ------
+  Lua is developed at Tecgraf, the Computer Graphics Technology Group
+  of PUC-Rio (the Pontifical Catholic University of Rio de Janeiro in Brazil).
+  Tecgraf is a laboratory of the Department of Computer Science.
+
+(end of README)

File Src/Lua/lapi.c

+/*
+** $Id: lapi.c,v 2.55.1.3 2008/01/03 15:20:39 roberto Exp $
+** Lua API
+** See Copyright Notice in lua.h
+*/
+
+
+#include <assert.h>
+#include <math.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define lapi_c
+#define LUA_CORE
+
+#include "lua.h"
+
+#include "lapi.h"
+#include "ldebug.h"
+#include "ldo.h"
+#include "lfunc.h"
+#include "lgc.h"
+#include "lmem.h"
+#include "lobject.h"
+#include "lstate.h"
+#include "lstring.h"
+#include "ltable.h"
+#include "ltm.h"
+#include "lundump.h"
+#include "lvm.h"
+
+
+
+const char lua_ident[] =
+  "$Lua: " LUA_RELEASE " " LUA_COPYRIGHT " $\n"
+  "$Authors: " LUA_AUTHORS " $\n"
+  "$URL: www.lua.org $\n";
+
+
+
+#define api_checknelems(L, n)	api_check(L, (n) <= (L->top - L->base))
+
+#define api_checkvalidindex(L, i)	api_check(L, (i) != luaO_nilobject)
+
+#define api_incr_top(L)   {api_check(L, L->top < L->ci->top); L->top++;}
+
+
+
+static TValue *index2adr (lua_State *L, int idx) {
+  if (idx > 0) {
+    TValue *o = L->base + (idx - 1);
+    api_check(L, idx <= L->ci->top - L->base);
+    if (o >= L->top) return cast(TValue *, luaO_nilobject);
+    else return o;
+  }
+  else if (idx > LUA_REGISTRYINDEX) {
+    api_check(L, idx != 0 && -idx <= L->top - L->base);
+    return L->top + idx;
+  }
+  else switch (idx) {  /* pseudo-indices */
+    case LUA_REGISTRYINDEX: return registry(L);
+    case LUA_ENVIRONINDEX: {
+      Closure *func = curr_func(L);
+      sethvalue(L, &L->env, func->c.env);
+      return &L->env;
+    }
+    case LUA_GLOBALSINDEX: return gt(L);
+    default: {
+      Closure *func = curr_func(L);
+      idx = LUA_GLOBALSINDEX - idx;
+      return (idx <= func->c.nupvalues)
+                ? &func->c.upvalue[idx-1]
+                : cast(TValue *, luaO_nilobject);
+    }
+  }
+}
+
+
+static Table *getcurrenv (lua_State *L) {
+  if (L->ci == L->base_ci)  /* no enclosing function? */
+    return hvalue(gt(L));  /* use global table as environment */
+  else {
+    Closure *func = curr_func(L);
+    return func->c.env;
+  }
+}
+
+
+void luaA_pushobject (lua_State *L, const TValue *o) {
+  setobj2s(L, L->top, o);
+  api_incr_top(L);
+}
+
+
+LUA_API int lua_checkstack (lua_State *L, int size) {
+  int res;
+  lua_lock(L);
+  if ((L->top - L->base + size) > LUAI_MAXCSTACK)
+    res = 0;  /* stack overflow */
+  else {
+    luaD_checkstack(L, size);
+    if (L->ci->top < L->top + size)
+      L->ci->top = L->top + size;
+    res = 1;
+  }
+  lua_unlock(L);
+  return res;
+}
+
+
+LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) {
+  int i;
+  if (from == to) return;
+  lua_lock(to);
+  api_checknelems(from, n);
+  api_check(from, G(from) == G(to));
+  api_check(from, to->ci->top - to->top >= n);
+  from->top -= n;
+  for (i = 0; i < n; i++) {
+    setobj2s(to, to->top++, from->top + i);
+  }
+  lua_unlock(to);
+}
+
+
+LUA_API void lua_setlevel (lua_State *from, lua_State *to) {
+  to->nCcalls = from->nCcalls;
+}
+
+
+LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) {
+  lua_CFunction old;
+  lua_lock(L);
+  old = G(L)->panic;
+  G(L)->panic = panicf;
+  lua_unlock(L);
+  return old;
+}
+
+
+LUA_API lua_State *lua_newthread (lua_State *L) {
+  lua_State *L1;
+  lua_lock(L);
+  luaC_checkGC(L);
+  L1 = luaE_newthread(L);
+  setthvalue(L, L->top, L1);
+  api_incr_top(L);
+  lua_unlock(L);
+  luai_userstatethread(L, L1);
+  return L1;
+}
+
+
+
+/*
+** basic stack manipulation
+*/
+
+
+LUA_API int lua_gettop (lua_State *L) {
+  return cast_int(L->top - L->base);
+}
+
+
+LUA_API void lua_settop (lua_State *L, int idx) {
+  lua_lock(L);
+  if (idx >= 0) {
+    api_check(L, idx <= L->stack_last - L->base);
+    while (L->top < L->base + idx)
+      setnilvalue(L->top++);
+    L->top = L->base + idx;
+  }
+  else {
+    api_check(L, -(idx+1) <= (L->top - L->base));
+    L->top += idx+1;  /* `subtract' index (index is negative) */
+  }
+  lua_unlock(L);
+}
+
+
+LUA_API void lua_remove (lua_State *L, int idx) {
+  StkId p;
+  lua_lock(L);
+  p = index2adr(L, idx);
+  api_checkvalidindex(L, p);
+  while (++p < L->top) setobjs2s(L, p-1, p);
+  L->top--;
+  lua_unlock(L);
+}
+
+
+LUA_API void lua_insert (lua_State *L, int idx) {
+  StkId p;
+  StkId q;
+  lua_lock(L);
+  p = index2adr(L, idx);
+  api_checkvalidindex(L, p);
+  for (q = L->top; q>p; q--) setobjs2s(L, q, q-1);
+  setobjs2s(L, p, L->top);
+  lua_unlock(L);
+}
+
+
+LUA_API void lua_replace (lua_State *L, int idx) {
+  StkId o;
+  lua_lock(L);
+  /* explicit test for incompatible code */
+  if (idx == LUA_ENVIRONINDEX && L->ci == L->base_ci)
+    luaG_runerror(L, "no calling environment");
+  api_checknelems(L, 1);
+  o = index2adr(L, idx);
+  api_checkvalidindex(L, o);
+  if (idx == LUA_ENVIRONINDEX) {
+    Closure *func = curr_func(L);
+    api_check(L, ttistable(L->top - 1)); 
+    func->c.env = hvalue(L->top - 1);
+    luaC_barrier(L, func, L->top - 1);
+  }
+  else {
+    setobj(L, o, L->top - 1);
+    if (idx < LUA_GLOBALSINDEX)  /* function upvalue? */
+      luaC_barrier(L, curr_func(L), L->top - 1);
+  }
+  L->top--;
+  lua_unlock(L);
+}
+
+
+LUA_API void lua_pushvalue (lua_State *L, int idx) {
+  lua_lock(L);
+  setobj2s(L, L->top, index2adr(L, idx));
+  api_incr_top(L);
+  lua_unlock(L);
+}
+
+
+
+/*
+** access functions (stack -> C)
+*/
+
+
+LUA_API int lua_type (lua_State *L, int idx) {
+  StkId o = index2adr(L, idx);
+  return (o == luaO_nilobject) ? LUA_TNONE : ttype(o);
+}
+
+
+LUA_API const char *lua_typename (lua_State *L, int t) {
+  UNUSED(L);
+  return (t == LUA_TNONE) ? "no value" : luaT_typenames[t];
+}
+
+
+LUA_API int lua_iscfunction (lua_State *L, int idx) {
+  StkId o = index2adr(L, idx);
+  return iscfunction(o);
+}
+
+
+LUA_API int lua_isnumber (lua_State *L, int idx) {
+  TValue n;
+  const TValue *o = index2adr(L, idx);
+  return tonumber(o, &n);
+}
+
+
+LUA_API int lua_isstring (lua_State *L, int idx) {
+  int t = lua_type(L, idx);
+  return (t == LUA_TSTRING || t == LUA_TNUMBER);
+}
+
+
+LUA_API int lua_isuserdata (lua_State *L, int idx) {
+  const TValue *o = index2adr(L, idx);
+  return (ttisuserdata(o) || ttislightuserdata(o));
+}
+
+
+LUA_API int lua_rawequal (lua_State *L, int index1, int index2) {
+  StkId o1 = index2adr(L, index1);
+  StkId o2 = index2adr(L, index2);
+  return (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0
+         : luaO_rawequalObj(o1, o2);
+}
+
+
+LUA_API int lua_equal (lua_State *L, int index1, int index2) {
+  StkId o1, o2;
+  int i;
+  lua_lock(L);  /* may call tag method */
+  o1 = index2adr(L, index1);
+  o2 = index2adr(L, index2);
+  i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 : equalobj(L, o1, o2);
+  lua_unlock(L);
+  return i;
+}
+
+
+LUA_API int lua_lessthan (lua_State *L, int index1, int index2) {
+  StkId o1, o2;
+  int i;
+  lua_lock(L);  /* may call tag method */
+  o1 = index2adr(L, index1);
+  o2 = index2adr(L, index2);
+  i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0
+       : luaV_lessthan(L, o1, o2);
+  lua_unlock(L);
+  return i;
+}
+
+
+
+LUA_API lua_Number lua_tonumber (lua_State *L, int idx) {
+  TValue n;
+  const TValue *o = index2adr(L, idx);
+  if (tonumber(o, &n))
+    return nvalue(o);
+  else
+    return 0;
+}
+
+
+LUA_API lua_Integer lua_tointeger (lua_State *L, int idx) {
+  TValue n;
+  const TValue *o = index2adr(L, idx);
+  if (tonumber(o, &n)) {
+    lua_Integer res;
+    lua_Number num = nvalue(o);
+    lua_number2integer(res, num);
+    return res;
+  }
+  else
+    return 0;
+}
+
+
+LUA_API int lua_toboolean (lua_State *L, int idx) {
+  const TValue *o = index2adr(L, idx);
+  return !l_isfalse(o);
+}
+
+
+LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
+  StkId o = index2adr(L, idx);
+  if (!ttisstring(o)) {
+    lua_lock(L);  /* `luaV_tostring' may create a new string */
+    if (!luaV_tostring(L, o)) {  /* conversion failed? */
+      if (len != NULL) *len = 0;
+      lua_unlock(L);
+      return NULL;
+    }
+    luaC_checkGC(L);
+    o = index2adr(L, idx);  /* previous call may reallocate the stack */
+    lua_unlock(L);
+  }
+  if (len != NULL) *len = tsvalue(o)->len;
+  return svalue(o);
+}
+
+
+LUA_API size_t lua_objlen (lua_State *L, int idx) {
+  StkId o = index2adr(L, idx);
+  switch (ttype(o)) {
+    case LUA_TSTRING: return tsvalue(o)->len;
+    case LUA_TUSERDATA: return uvalue(o)->len;
+    case LUA_TTABLE: return luaH_getn(hvalue(o));
+    case LUA_TNUMBER: {
+      size_t l;
+      lua_lock(L);  /* `luaV_tostring' may create a new string */
+      l = (luaV_tostring(L, o) ? tsvalue(o)->len : 0);
+      lua_unlock(L);
+      return l;
+    }
+    default: return 0;
+  }
+}
+
+
+LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) {
+  StkId o = index2adr(L, idx);
+  return (!iscfunction(o)) ? NULL : clvalue(o)->c.f;
+}
+