2013-10-17 12:21:03 +04:00
|
|
|
.\" $NetBSD: luactl.8,v 1.2 2013/10/17 08:21:03 wiz Exp $
|
2013-10-16 23:48:21 +04:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2011 Marc Balmer <marc@msys.ch>
|
|
|
|
.\"
|
|
|
|
.\" Permission to use, copy, modify, and distribute this software for any
|
|
|
|
.\" purpose with or without fee is hereby granted, provided that the above
|
|
|
|
.\" copyright notice and this permission notice appear in all copies.
|
|
|
|
.\"
|
|
|
|
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
.\"
|
2013-10-17 12:21:03 +04:00
|
|
|
.Dd October 17, 2013
|
2013-10-16 23:48:21 +04:00
|
|
|
.Dt LUACTL 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm luactl
|
|
|
|
.Nd control kernel Lua states
|
|
|
|
.Sh SYNOPSIS
|
2013-10-17 12:21:03 +04:00
|
|
|
.Nm
|
2013-10-16 23:48:21 +04:00
|
|
|
.Op Fl cq
|
2013-10-17 12:21:03 +04:00
|
|
|
.Nm
|
2013-10-16 23:48:21 +04:00
|
|
|
.Op Fl cq
|
2013-10-17 12:21:03 +04:00
|
|
|
.Cm create
|
2013-10-16 23:48:21 +04:00
|
|
|
.Ar name
|
|
|
|
.Op desc
|
2013-10-17 12:21:03 +04:00
|
|
|
.Nm
|
2013-10-16 23:48:21 +04:00
|
|
|
.Op Fl cq
|
2013-10-17 12:21:03 +04:00
|
|
|
.Cm destroy
|
2013-10-16 23:48:21 +04:00
|
|
|
.Ar name
|
2013-10-17 12:21:03 +04:00
|
|
|
.Nm
|
2013-10-16 23:48:21 +04:00
|
|
|
.Op Fl cq
|
2013-10-17 12:21:03 +04:00
|
|
|
.Cm require
|
2013-10-16 23:48:21 +04:00
|
|
|
.Ar name module
|
2013-10-17 12:21:03 +04:00
|
|
|
.Nm
|
2013-10-16 23:48:21 +04:00
|
|
|
.Op Fl cq
|
2013-10-17 12:21:03 +04:00
|
|
|
.Cm load
|
2013-10-16 23:48:21 +04:00
|
|
|
.Ar name path
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
program allows the manipulation of Lua states in the kernel.
|
|
|
|
Lua states are created using the
|
2013-10-17 12:21:03 +04:00
|
|
|
.Dq Cm create
|
2013-10-16 23:48:21 +04:00
|
|
|
command (see below),
|
|
|
|
Lua bindings are provided as modules.
|
|
|
|
To make a Lua binding available to a state, it must be
|
2013-10-17 12:21:03 +04:00
|
|
|
.Dq required .
|
2013-10-16 23:48:21 +04:00
|
|
|
If a kernel subsystem is to use a Lua state, a state has to be
|
2013-10-17 12:21:03 +04:00
|
|
|
.Dq assigned
|
2013-10-16 23:48:21 +04:00
|
|
|
to it.
|
|
|
|
Once a module has been
|
2013-10-17 12:21:03 +04:00
|
|
|
.Dq required
|
2013-10-16 23:48:21 +04:00
|
|
|
by a state, it can not be unloaded from memory using the
|
|
|
|
.Xr modunload 8
|
|
|
|
command until the state using it has been destroyed.
|
|
|
|
.Pp
|
2013-10-17 12:21:03 +04:00
|
|
|
Lua code can be loaded from the file system into a state at anytime, please
|
2013-10-16 23:48:21 +04:00
|
|
|
note that code loaded into a state is immediately executed.
|
|
|
|
.Pp
|
|
|
|
When executed without a command,
|
|
|
|
.Nm
|
|
|
|
reads information about the
|
|
|
|
.Tn Lua
|
|
|
|
states and displays it.
|
|
|
|
.Pp
|
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Fl c
|
|
|
|
Create a Lua state before executing the command.
|
2013-10-17 12:21:03 +04:00
|
|
|
This flag is used for the require, assign, and, load commands only, it
|
2013-10-16 23:48:21 +04:00
|
|
|
is ignored for all other commands.
|
|
|
|
.It Fl q
|
|
|
|
Operate quietly i.e. nothing is printed to stdout.
|
|
|
|
.El
|
|
|
|
.Sh COMMANDS
|
|
|
|
.Bl -tag -width Ds
|
2013-10-17 12:21:03 +04:00
|
|
|
.It Cm create Ar name Op Ar desc
|
2013-10-16 23:48:21 +04:00
|
|
|
Create a Lua state with name
|
|
|
|
.Ar name
|
|
|
|
and optional description
|
|
|
|
.Ar desc .
|
2013-10-17 12:21:03 +04:00
|
|
|
.It Cm destroy Ar name
|
2013-10-16 23:48:21 +04:00
|
|
|
Destroy the Lua state
|
|
|
|
.Ar name .
|
2013-10-17 12:21:03 +04:00
|
|
|
.It Cm require Ar name module
|
2013-10-16 23:48:21 +04:00
|
|
|
Let the Lua state
|
|
|
|
.Ar name
|
|
|
|
use the bindings provided in module
|
|
|
|
.Ar module .
|
|
|
|
This is the equivalent of userland Lua code calling the
|
|
|
|
.Sq require
|
|
|
|
function.
|
2013-10-17 12:21:03 +04:00
|
|
|
.It Cm load Ar name Pa path
|
2013-10-16 23:48:21 +04:00
|
|
|
Load Lua code in file
|
|
|
|
.Pa path
|
|
|
|
into the Lua state
|
|
|
|
.Ar name .
|
|
|
|
Note that the path name must contain at least one path separation character
|
|
|
|
.Pq Sq / .
|
|
|
|
.El
|
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width "/dev/lua" -compact
|
|
|
|
.It /dev/lua
|
|
|
|
Lua device file.
|
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr lua 4 ,
|
|
|
|
.Xr module 7 ,
|
2013-10-17 12:21:03 +04:00
|
|
|
.Xr modload 8 ,
|
|
|
|
.Xr modunload 8 ,
|
|
|
|
.Xr lua 9
|
2013-10-16 23:48:21 +04:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command first appeared in
|
2013-10-17 12:21:03 +04:00
|
|
|
.Nx 7.0 .
|
2013-10-16 23:48:21 +04:00
|
|
|
.Sh AUTHORS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
program was written by
|
2013-10-17 12:21:03 +04:00
|
|
|
.An Marc Balmer Aq Mt marc@msys.ch .
|