编程接口与扩展库
XXTouch Elite 完整支持 Lua 编程接口。你可以从 LuaRocks 下载并安装扩展库,然后移植到 XXTouch Elite 中使用。
你也可以参照以下模板,编写自己的扩展库使用。
⏬ Extension_Template.zip (1.9 MB)
Open-Source Credits
/usr/local/xxtouch/lib/
包含了许多预编译好的第三方开源 Lua 扩展库。
你可以从它们的官方网站或开源仓库页面上找到相关版权及更多信息。
lua-zip
- Package Name:
brimworks.zip
- Author:
Brian Maher
- License: MIT License
- Home Page:
https://github.com/brimworks/lua-zip
lua-cjson
- Package Name:
cjson
- Author:
Mark Pulford
- License: MIT License
- Home Page:
https://github.com/mpx/lua-cjson
Copas
Copas
is a dispatcher based on coroutines that can be used for asynchronous networking. For example TCP or UDP based servers. But it also features timers and client support for http(s), ftp and smtp requests.
- Package Name:
copas
- Author:
Thijs Schreijer
- License: MIT License
- Home Page:
https://github.com/lunarmodules/copas
croissant
A Lua REPL and debugger implemented in Lua.
- Author:
Benoit Giannangeli
- License: MIT License
- Home Page:
https://github.com/giann/croissant
Lua-cURLv3
- Package Name:
cURL
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/Lua-cURL/Lua-cURLv3
hump
hump
is a small collection of tools for developing games with LÖVE.
- Package Name:
hump
- Author:
Matthias Richter
- License: MIT License
- Home Page:
https://github.com/vrld/hump
lua-llthreads2
A simple Lua wrapper for pthreads & WIN32 threads.
Each thread gets it’s own lua_State
and there is no shared global state. The parent thread can pass data to a child thread only as parameters when creating the child thread. The child threads can return data back to the parent thread only when it return (i.e. ends). The parent needs to call child:join() to get the return values from a child thread, this call will block until the child thread ends.
The design goals of this module is only provide support for creating new lua_State
and running them in a different thread. This module will not provide any methods of thread-to-thread data passing between running threads (i.e. no locks, no shared state).
- Package Name:
llthreads2
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-llthreads2
lua-lluv
Lua low level binding to libuv
.
libuv
is a multi-platform support library with a focus on asynchronous I/O. It was primarily developed for use by Node.js, but it’s also used by Luvit, Julia, uvloop, and others.
- Package Name:
lluv
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-lluv
lua-lluv-ssl
SSL/TLS sockets for lua-lluv
library.
- Package Name:
lluv.ssl
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-lluv-ssl
lua-lluv-websocket
This library includes stream interface for lua-lluv
and lua-lluv
backend for lua-websockets
.
- Package Name:
lluv.websocket
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-lluv-websocket
lua-lluv-ftp
FTP client for lua-lluv
library.
- Package Name:
lluv.ftp
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-lluv-ftp
lua-lluv-poll-zmq
ZMQ poller for lua-lluv
library.
- Package Name:
lluv.poll_zmq
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-lluv-poll-zmq
lua-lluv-curl
Make asyncronus requests using libuv
and libcurl
.
This module provide async version of curl multi class. Also module implement async request queue class which allows control number of parallel requests.
- Package Name:
lluv.curl
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-lluv-curl
lua-log
- Package Name:
log
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-log
lzmq
Lua binding to ZeroMQ
library.
- Package Name:
lzmq
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/zeromq/lzmq
luasocket
LuaSocket
is a Lua extension library composed of two parts:
- a set of C modules that provide support for the TCP and UDP transport layers, and
- a set of Lua modules that provide functions commonly needed by applications that deal with the Internet.
- Package Name:
socket
- Author:
Caleb Maclennan
- License: MIT License
- Home Page:
https://github.com/lunarmodules/luasocket
neturl
A Robust URL Parser and Builder for Lua.
This small Lua library provides a few functions to parse URL with querystring and build new URL easily.
- Package Name:
net.url
- Author:
Bertrand Mansion
- License: MIT License
- Home Page:
https://github.com/golgote/neturl
lua-path
- Package Name:
path
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-path
lua-pop3
POP3 client library for Lua 5.1 / 5.2 / 5.3.
- Package Name:
pop3
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-pop3
luaposix
This is a POSIX binding for LuaJIT, Lua 5.1, 5.2, 5.3 and 5.4; like most libraries it simply binds to C APIs on the underlying system, so it won’t work on non-POSIX systems. However, it does try to detect the level of POSIX conformance of the underlying system and bind only available APIs.
- Package Name:
posix
- Author:
Gary V. Vaughan
- License: MIT License
- Home Page:
https://github.com/luaposix/luaposix
sirocco
A collection of interactive command line prompts for Lua.
- Package Name:
sirocco
- Author:
Benoit Giannangeli
- License: MIT License
- Home Page:
https://github.com/giann/sirocco
LuaSec
LuaSec
depends on OpenSSL, and integrates with LuaSocket to make it easy to add secure connections to any Lua applications or scripts.
- Package Name:
ssl
- Author:
Bruno Silvestre
- License: LuaSec 1.1.0 License
- Home Page:
https://github.com/brunoos/luasec
lua-term
lua-term
is a Lua module for manipulating a terminal.
- Package Name:
term
- Author:
Rob Hoelz
- License: MIT License
- Home Page:
https://github.com/hoelzro/lua-term
lua-tui
A library for doing things with terminals.
- Package Name:
tui
- Author:
daurnimator
- License: MIT License
- Home Page:
https://github.com/daurnimator/lua-tui
lua-wcwidth
When writing output to a fixed-width output system (such as a terminal), the displayed length of a string does not always match the number of characters (also known as runes, or code points) contained by the string. Some characters occupy two spaces (full-wide characters), and others occupy none.
POSIX.1-2001 and POSIX.1-2008 specify the wcwidth(3) function which can be used to know how many spaces (or cells) must be used to display a Unicode code point. This Lua contains a portable and standalone implementation based on the Unicode Standard release files.
This module is useful mainly for implementing programs which must produce output to terminals, while handling proper alignment for double-width and zero-width Unicode code points.
- Package Name:
wcwidth
- Author:
Adrian Perez
- License: MIT License
- Home Page:
https://github.com/aperezdc/lua-wcwidth
Alien
Alien is a Foreign Function Interface (FFI) for Lua. An FFI lets you call functions in dynamic libraries (.so, .dylib, .dll, etc.) from Lua code without having to write, compile and link a C binding from the library to Lua. In other words, it lets you write extensions that call native code using just Lua.
- Package Name:
alien
- Author:
Fabio Mascarenhas
- License: MIT License
- Home Page:
https://github.com/mascarenhas/alien
ansicolors.lua
ansicolors
is a simple Lua function for printing to the console in color.
- Package Name:
ansicolors
- Author:
Enrique García Cota
- License: MIT License
- Home Page:
https://github.com/kikito/ansicolors.lua
argparse
Argparse
is a feature-rich command line parser for Lua inspired by argparse for Python.
Argparse
supports positional arguments, options, flags, optional arguments, subcommands and more. Argparse automatically generates usage, help and error messages.
- Package Name:
argphase
- Author:
Peter Melnichenko
- License: MIT License
- Home Page:
https://github.com/mpeterv/argparse
lbase64
Pure Lua base64 encoder/decoder. Works with Lua 5.1+ and LuaJIT. Fallbacks to pure Lua bit operations if bit/bit32/native bit operators are not available.
- Package Name:
base64
- Author:
iskolbin
- License: MIT License
- Home Page:
https://github.com/iskolbin/lbase64
binaryheap.lua
Binary heap implementation.
- Package Name:
binaryheap
- Author:
Thijs Schreijer
- License: MIT License
- Home Page:
https://github.com/Tieske/binaryheap.lua
LuaDate
Lua Date and Time module for Lua 5.x.
- Package Name:
date
- Author:
Thijs Schreijer
- License: MIT License
- Home Page:
https://github.com/Tieske/date
lua-ftp
Simple wrapper around LuaSocket
ftp.
- Package Name:
ftp
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-ftp
imap4.lua
Simple IMAP4 protocol wrapper, based on RFC3501.
- Package Name:
imap4
- Author:
Matthias Richter
- License
- Home Page:
https://github.com/vrld/imap4.lua
LuaPanda
- Package Name:
LuaPanda
- Author:
Tencent
- License: BSD 3-Clause License
- Home Page:
https://github.com/Tencent/LuaPanda
LuaUnit
LuaUnit
is a popular unit-testing framework for Lua, with an interface typical of xUnit libraries (Python unittest, Junit, NUnit, ...). It supports several output formats (Text, TAP, JUnit, ...) to be used directly or work with Continuous Integration platforms (Jenkins, Hudson, ...).
LuaUnit
may be installed as a rock or directly added to your project. For simplicity, LuaUnit
is contained into a single-file and has no external dependency.
Tutorial and reference documentation is available on read-the-docs.
LuaUnit
may also be used as an assertion library, to validate assertions inside a running program. In addition, it provides a pretty stringifier which converts any type into a nicely formatted string (including complex nested or recursive tables).
- Package Name:
luaunit
- Author:
Philippe F
- License: BSD License
- Home Page:
https://github.com/bluebird75/luaunit
LuaXML
LuaXML
provides a minimal set of functions for the processing of XML data in Lua. It offers a very simple and natural mapping between the XML data format and Lua tables, which allows one to parse XML data just using Lua’s normal table access and iteration methods: Substatements and text content is represented as array data having numerical keys, attributes and tags use string keys. This representation makes sure that the structure of XML data is exactly preserved in a read/write cycle.
Since version 1.7, LuaXML
consists of a well-optimized portable ISO-standard C file and a small Lua file. It is published under the same liberal licensing conditions as Lua itself (see below). It has been successfully compiled and used under Linux, various flavours of MS Windows, and Mac OS X.
- Package Name:
LuaXML
- Author:
Peter Drahoš
- License: MIT License
- Home Page:
https://github.com/LuaDist/luaxml
lua-protobuf
This project offers a C module for Lua (5.1, 5.2, 5.3, 5.4 and LuaJIT) manipulating Google’s protobuf protocol, both for version 2 and 3 syntax and semantics. It splits to the lower-level and the high-level parts for different goals.
For converting between binary protobuf data with Lua tables, using pb.load()
loads the compiled protobuf schema content (*.pb
file) generated by Google protobuf’s compiler named protoc
and call pb.encode()
/pb.decode()
.
Or use these modules to manipulate the raw wire format in lower-level way:
pb.slice
: a wire format decoding module.pb.buffer
: a buffer implement that use to encode basic types into protobuf’s wire format. It can be used to support streaming decode protobuf data.pb.conv
: a module converting integers in the protobuf wire format.pb.io
: a module access stdin/stdout or other files in binary mode.
If you don’t want to depend Google’s protobuf compiler, protoc.lua
is a pure Lua module translating text-based protobuf schema content into the *.pb
binary format.
- Package Name:
pb
,protoc
- Author:
Xavier Wang
- License: MIT License
- Home Page:
https://github.com/starwing/lua-protobuf
LPeg
LPeg
is a new pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs). This text is a reference manual for the library. For a more formal treatment of LPeg
, as well as some discussion about its implementation, see A Text Pattern-Matching Tool based on Parsing Expression Grammars. (You may also be interested in my talk about LPeg
given at the III Lua Workshop.)
- Package Name:
lpeg
- Author:
Lua.org, PUC-Rio.
- License
- Home Page:
http://www.inf.puc-rio.br/~roberto/lpeg/
- Tree:
v1.0.2
lua-sendmail
Simple wrapper around LuaSocket
smtp.send
.
- Package Name:
sendmail
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-sendmail
Serpent
Lua serializer and pretty printer.
- Package Name:
serpent
- Author:
Paul Kulchenko
- License: MIT License
- Home Page:
https://github.com/pkulchenko/serpent
Lua-Split
- Package Name:
split
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-split
timerwheel.lua
Efficient timer for timeout related timers: fast insertion, deletion, and execution (all as O(1) implemented), but with lesser precision.
This module will not provide the timer/runloop itself. Use your own runloop and call wheel:step
to check and execute timers.
- Package Name:
timerwheel
- Author:
Thijs Schreijer
- License: MIT License
- Home Page:
https://github.com/Tieske/timerwheel.lua
lua-iconv
Lua-iconv
is POSIX iconv
binding for the Lua Programming Language. The iconv
library converts a sequence of characters from one codeset into a sequence of corresponding characters in another codeset. The codesets are those specified in the iconv.new()
call that returned the conversion descriptor, cd.
- Package Name:
iconv
- Author:
Alexandre Erwin Ittner
- License
- Home Page:
https://github.com/ittner/lua-iconv
lua-utf8-simple
- Package Name:
utf8_simple
- Author:
blitmap
- License: MIT License
- Home Page:
https://github.com/blitmap/lua-utf8-simple
LuaSQLite3
- Package Name:
lsqlite3
- Author:
Tiago Dionizio, Doug Currie
- License
- Home Page:
http://lua.sqlite.org
- Tree:
v0.9.5
lua-archive
Lua 5.1 interface to libarchive
.
- Package Name:
archive
- Author:
Brian Maher
- License: MIT License
- Home Page:
https://github.com/brimworks/lua-archive
lua-ev
- Package Name:
ev
- Author:
Brian Maher
- License: MIT License
- Home Page:
https://github.com/brimworks/lua-ev
lua-http-parser
Lua 5.1 interface to ry’s http-parser
.
- Package Name:
http.parser
- Author:
Brian Maher
- License: MIT License
- Home Page:
https://github.com/brimworks/lua-http-parser
lua-openssl
A free, MIT-licensed OpenSSL binding for Lua.
- Package Name:
openssl
- Author:
George Zhao
- License: MIT License
- Home Page:
https://github.com/zhaozg/lua-openssl
lua-spawn
A lua library to spawn programs.
- Package Name:
spawn
- Author:
daurnimator
- License: MIT License
- Home Page:
https://github.com/daurnimator/lua-spawn
lua-vararg
vararg
is a Lua library for manipulation of variable arguements (vararg) of functions. These functions basically allow you to do things with vararg
that cannot be efficiently done in pure Lua but can be easily done through the C API.
Actually, the main motivation for this library was the 'pack' function, which is an elegant alternative for the possible new standard function ’table.pack' and the praised 'apairs'. Also 'pack' allows an interesting implementaiton of tuples in pure Lua.
- Package Name:
vararg
- Author:
Alexey Melnichuk
- License: MIT License
- Home Page:
https://github.com/moteus/lua-vararg
lua-zlib
Lua 5.1 interface to zlib
.
- Package Name:
zlib
- Author:
Brian Maher
- License: MIT License
- Home Page:
https://github.com/brimworks/lua-zlib
luafilesystem
LuaFileSystem
is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution.
LuaFileSystem
offers a portable way to access the underlying directory structure and file attributes. LuaFileSystem
is free software and uses the same license as Lua 5.x (MIT).
- Package Name:
lfs
- Author:
Hisham Muhammad
- License: MIT License
- Home Page:
https://github.com/lunarmodules/luafilesystem
lunix
lunix
is a Lua bindings library module to common Unix system APIs. The module is regularly tested on recent versions of AIX, FreeBSD, Linux/glibc, Linux/musl, NetBSD, OpenBSD, OS X, and Solaris. The best way to describe it is in contradistinction to luaposix, the most popular bindings module for Unix APIs in Lua.
- Package Name:
unix
- Author:
William Ahern
- License: MIT License
- Home Page:
https://github.com/wahern/lunix
lua-websockets
- Package Name:
websocket
- Author:
Gerhard Preuss
- License: MIT License
- Home Page:
https://github.com/lipp/lua-websockets
Lua IMagick
Pure-C Lua bindings to ImageMagick
.
- Package Name:
imagick
- Author:
Epifanov Ivan
- License: Do What The F*ck You Want To Public License
- Home Page:
https://github.com/isage/lua-imagick
lyaml
LibYAML binding for Lua, with a fast C implementation for converting between %YAML 1.1 and Lua tables, and a low-level YAML event parser for implementing more intricate YAML document loading.
- Package Name:
lyaml
- Author:
Gary V. Vaughan
- License: MIT License
- Home Page:
https://github.com/gvvaughan/lyaml
luaexif
luaexif is a Lua binding for libexif. Compatible with Lua 5.1 or later.
- Package Name:
exif
- Author:
Minoki
- License: MIT License
- Home Page:
https://github.com/minoki/luaexif
inspect.lua
This library transforms any Lua value into a human-readable representation. It is especially useful for debugging errors in tables.
The objective here is human understanding (i.e. for debugging), not serialization or compactness.
- Package Name:
inspect
- Author:
Enrique García Cota
- License: MIT License
- Home Page:
https://github.com/kikito/inspect.lua