# HG changeset patch # User Mahlon E. Smith # Date 1433876517 25200 # Node ID 6dc2d52e4b13b8498159834d63cfc5f65fbc9a75 # Parent 9c66c159a3a6c066a2d09a79bc0fa13ab4ae57e5 Update to Lua 5.2. diff -r 9c66c159a3a6 -r 6dc2d52e4b13 LICENSE --- a/LICENSE Wed Jul 25 11:49:11 2012 -0700 +++ b/LICENSE Tue Jun 09 12:01:57 2015 -0700 @@ -1,5 +1,5 @@ -Copyright (c) 2011-2012, Mahlon E. Smith +Copyright (c) 2011-2015, Mahlon E. Smith All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff -r 9c66c159a3a6 -r 6dc2d52e4b13 Makefile --- a/Makefile Wed Jul 25 11:49:11 2012 -0700 +++ b/Makefile Tue Jun 09 12:01:57 2015 -0700 @@ -29,28 +29,28 @@ # and LIBS to the 'make' command line for your platform. # # The following works for OSX with macports or homebrew (10.6/10.7), -# FreeBSD 8.x and 9.x, and Ubuntu 11.10 and 12.04. +# FreeBSD 8.x through 10.x, and Ubuntu 11.10 through 14.04. # Ubuntu # - perftools doesn't currently register a .pc file at all -# - lua is called 'lua5.1' +# - lua is called 'lua5.2' ifeq ($(UNAME), Linux) volta: CFLAGS += -L/usr/lib -I/usr/include -volta: CFLAGS += $(shell pkg-config --cflags-only-I --libs-only-L lua5.1) -volta: LIBS += $(shell pkg-config --libs-only-l lua5.1) +volta: CFLAGS += $(shell pkg-config --cflags-only-I --libs-only-L lua5.2) +volta: LIBS += $(shell pkg-config --libs-only-l lua5.2) debug: CFLAGS += $(CFLAGS_DEBUG)\ - $(shell pkg-config --cflags-only-I --libs-only-L lua5.1) -debug: LIBS += $(shell pkg-config --libs-only-l lua5.1) -lprofiler + $(shell pkg-config --cflags-only-I --libs-only-L lua5.2) +debug: LIBS += $(shell pkg-config --libs-only-l lua5.2) -lprofiler # FreeBSD -# - lua is called 'lua-5.1' +# - lua is called 'lua-5.2' else ifeq ($(UNAME), FreeBSD) volta: CFLAGS += -L/usr/local/lib -I/usr/local/include -volta: CFLAGS += $(shell pkg-config --cflags-only-I --libs-only-L lua-5.1) -volta: LIBS += $(shell pkg-config --libs-only-l lua-5.1) +volta: CFLAGS += $(shell pkg-config --cflags-only-I --libs-only-L lua-5.2) +volta: LIBS += $(shell pkg-config --libs-only-l lua-5.2) debug: CFLAGS += $(CFLAGS_DEBUG)\ - $(shell pkg-config --cflags-only-I --libs-only-L lua-5.1 $(DEPS_DEBUG)) -debug: LIBS += $(shell pkg-config --libs-only-l lua-5.1 $(DEPS_DEBUG)) + $(shell pkg-config --cflags-only-I --libs-only-L lua-5.2 $(DEPS_DEBUG)) +debug: LIBS += $(shell pkg-config --libs-only-l lua-5.2 $(DEPS_DEBUG)) # Darwin, everyone else (best guess?) # - lua is called 'lua', hopefully! diff -r 9c66c159a3a6 -r 6dc2d52e4b13 accept_loop.c --- a/accept_loop.c Wed Jul 25 11:49:11 2012 -0700 +++ b/accept_loop.c Tue Jun 09 12:01:57 2015 -0700 @@ -1,6 +1,6 @@ /* vim: set noet nosta sw=4 ts=4 ft=c : */ /* -Copyright (c) 2011-2012, Mahlon E. Smith +Copyright (c) 2011-2015, Mahlon E. Smith All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff -r 9c66c159a3a6 -r 6dc2d52e4b13 db.c --- a/db.c Wed Jul 25 11:49:11 2012 -0700 +++ b/db.c Tue Jun 09 12:01:57 2015 -0700 @@ -1,6 +1,6 @@ /* vim: set noet nosta sw=4 ts=4 ft=c : */ /* -Copyright (c) 2011-2012, Mahlon E. Smith +Copyright (c) 2011-2015, Mahlon E. Smith All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff -r 9c66c159a3a6 -r 6dc2d52e4b13 db.h --- a/db.h Wed Jul 25 11:49:11 2012 -0700 +++ b/db.h Tue Jun 09 12:01:57 2015 -0700 @@ -1,6 +1,6 @@ /* vim: set noet nosta sw=4 ts=4 ft=c : */ /* -Copyright (c) 2011-2012, Mahlon E. Smith +Copyright (c) 2011-2015, Mahlon E. Smith All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff -r 9c66c159a3a6 -r 6dc2d52e4b13 lua.c --- a/lua.c Wed Jul 25 11:49:11 2012 -0700 +++ b/lua.c Tue Jun 09 12:01:57 2015 -0700 @@ -1,6 +1,6 @@ /* vim: set noet nosta sw=4 ts=4 ft=c : */ /* -Copyright (c) 2011-2012, Mahlon E. Smith +Copyright (c) 2011-2015, Mahlon E. Smith All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -79,25 +79,23 @@ luaL_openlibs( lua ); /* include lua standard libraries */ /* Predeclare the request table. */ - lua_pushstring( lua, "request" ); lua_createtable( lua, 0, 7 ); - lua_settable( lua, LUA_GLOBALSINDEX ); + lua_setglobal( lua, "request" ); /* Predeclare a table for shared data */ - lua_pushstring( lua, "shared" ); lua_newtable( lua ); - lua_settable( lua, LUA_GLOBALSINDEX ); + lua_setglobal( lua, "shared" ); /* replace the lua print() function with one that calls debug() instead */ lua_register( lua, "print", luaV_print ); /* Restrict additional globals. */ - lua_createtable( lua, 0, 1); - lua_pushcfunction( lua, luaV_globalindex ); - lua_setfield( lua, -2, "__newindex"); - lua_pushboolean( lua, 0 ); - lua_setfield( lua, -2, "__metatable"); - lua_setmetatable( lua, LUA_GLOBALSINDEX ); + lua_createtable( lua, 0, 1); + lua_pushcfunction( lua, luaV_globalindex ); + lua_setfield( lua, -2, "__newindex"); + lua_pushboolean( lua, 0 ); + lua_setfield( lua, -2, "__metatable"); + lua_setmetatable( lua, -2 ); lua_settop( lua, 0 ); /* wipe the stack */ return( lua ); @@ -111,7 +109,7 @@ void luaV_setup_request( parsed *request ) { - lua_getfield( v.lua, LUA_GLOBALSINDEX, "request" ); + lua_getglobal( v.lua, "request" ); lua_pushstring( v.lua, request->scheme ); lua_setfield( v.lua, 1, "scheme" ); lua_pushstring( v.lua, request->host ); diff -r 9c66c159a3a6 -r 6dc2d52e4b13 lua.h --- a/lua.h Wed Jul 25 11:49:11 2012 -0700 +++ b/lua.h Tue Jun 09 12:01:57 2015 -0700 @@ -1,6 +1,6 @@ /* vim: set noet nosta sw=4 ts=4 ft=c : */ /* -Copyright (c) 2011-2012, Mahlon E. Smith +Copyright (c) 2011-2015, Mahlon E. Smith All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff -r 9c66c159a3a6 -r 6dc2d52e4b13 main.c --- a/main.c Wed Jul 25 11:49:11 2012 -0700 +++ b/main.c Tue Jun 09 12:01:57 2015 -0700 @@ -1,6 +1,6 @@ /* vim: set noet nosta sw=4 ts=4 ft=c : */ /* -Copyright (c) 2011-2012, Mahlon E. Smith +Copyright (c) 2011-2015, Mahlon E. Smith All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff -r 9c66c159a3a6 -r 6dc2d52e4b13 process.c --- a/process.c Wed Jul 25 11:49:11 2012 -0700 +++ b/process.c Tue Jun 09 12:01:57 2015 -0700 @@ -1,6 +1,6 @@ /* vim: set noet nosta sw=4 ts=4 ft=c : */ /* -Copyright (c) 2011-2012, Mahlon E. Smith +Copyright (c) 2011-2015, Mahlon E. Smith All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff -r 9c66c159a3a6 -r 6dc2d52e4b13 util.c --- a/util.c Wed Jul 25 11:49:11 2012 -0700 +++ b/util.c Tue Jun 09 12:01:57 2015 -0700 @@ -1,6 +1,6 @@ /* vim: set noet nosta sw=4 ts=4 ft=c : */ /* -Copyright (c) 2011-2012, Mahlon E. Smith +Copyright (c) 2011-2015, Mahlon E. Smith All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff -r 9c66c159a3a6 -r 6dc2d52e4b13 volta.h --- a/volta.h Wed Jul 25 11:49:11 2012 -0700 +++ b/volta.h Tue Jun 09 12:01:57 2015 -0700 @@ -1,6 +1,6 @@ /* vim: set noet nosta sw=4 ts=4 ft=c : */ /* -Copyright (c) 2011-2012, Mahlon E. Smith +Copyright (c) 2011-2015, Mahlon E. Smith All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: