Upgrading to Lua 5.1

master
Tomas Guisasola 2007-03-18 19:17:04 +00:00
parent 6402524efd
commit 4074493524
5 changed files with 24 additions and 17 deletions

View File

@ -1,8 +1,8 @@
# $Id$
LUA_DIR= /usr/local/share/lua/5.0
LUA_DIR= /usr/local/share/lua/5.1
LUAS= src/xmlrpc.lua src/http.lua src/server.lua
LUAS= src/init.lua src/http.lua src/server.lua
build clean:

6
README
View File

@ -13,8 +13,8 @@ Here goes a small description of the files in the distribution
README -- This file
apitest.lua -- Overall API test script
httptest.lua -- Automatic tests over HTTP
xmlrpc.lua -- Source file
xmlrpc.http.lua -- Extension library over HTTP
xmlrpc.server.lua -- Server implementation over CGILua
init.lua -- Source file
http.lua -- Extension library over HTTP
server.lua -- Server implementation over CGILua
$Id$

View File

@ -4,11 +4,13 @@
-- $Id$
---------------------------------------------------------------------
require"socket.http"
require"ltn12"
require"xmlrpc"
local error, select, tonumber, tostring, unpack = error, select, tonumber, tostring, unpack
local request = socket.http.request
local ltn12 = require"ltn12"
local request = require"socket.http".request
local string = require"string"
local table = require"table"
local xmlrpc = require"xmlrpc"
module("xmlrpc.http")
@ -20,8 +22,9 @@ module("xmlrpc.http")
-- XML-RPC element).
---------------------------------------------------------------------
function call (url, method, ...)
local n = select ('#', ...)
local request_sink, tbody = ltn12.sink.table()
local request_body = xmlrpc.clEncode(method, unpack (arg))
local request_body = xmlrpc.clEncode(method, unpack (..., 1, n))
local err, code, headers, status = request {
url = url,
method = "POST",

View File

@ -4,8 +4,8 @@
-- $Id$
---------------------------------------------------------------------
require "lxp"
require "lxp.lom"
local lxp = require "lxp"
local lom = require "lxp.lom"
local assert, error, ipairs, pairs, type, tonumber, unpack = assert, error, ipairs, pairs, type, tonumber, unpack
local format, gsub, strfind, strsub = string.format, string.gsub, string.find, string.sub
@ -13,11 +13,11 @@ local concat, getn, tinsert = table.concat, table.getn, table.insert
local ceil = math.ceil
local parse = lxp.lom.parse
module (arg and arg[1])
module (...)
_COPYRIGHT = "Copyright (C) 2003-2006 Kepler Project"
_COPYRIGHT = "Copyright (C) 2003-2007 Kepler Project"
_DESCRIPTION = "LuaXMLRPC is a library to make remote procedure calls using XML-RPC"
_VERSION = "LuaXMLRPC 1.0.0"
_VERSION = "LuaXMLRPC 1.1.0"
---------------------------------------------------------------------
-- XML-RPC Parser

View File

@ -4,8 +4,12 @@
-- $Id$
---------------------------------------------------------------------
require"xmlrpc"
require"cgilua"
local assert, pcall, setmetatable, type, unpack = assert, pcall, setmetatable, type, unpack
local cgilua = require"cgilua"
local os = require"os"
local string = require"string"
local table = require"table"
local xmlrpc = require"xmlrpc"
module("xmlrpc.server")