diff options
Diffstat (limited to 'static/netbsd/man3lua')
| -rw-r--r-- | static/netbsd/man3lua/Makefile | 4 | ||||
| -rw-r--r-- | static/netbsd/man3lua/bozohttpd.3lua | 94 | ||||
| -rw-r--r-- | static/netbsd/man3lua/gpio.3lua | 178 | ||||
| -rw-r--r-- | static/netbsd/man3lua/intro.3lua | 85 | ||||
| -rw-r--r-- | static/netbsd/man3lua/libm.3lua | 151 | ||||
| -rw-r--r-- | static/netbsd/man3lua/netpgp.3lua | 89 | ||||
| -rw-r--r-- | static/netbsd/man3lua/sqlite.3lua | 334 | ||||
| -rw-r--r-- | static/netbsd/man3lua/syslog.3lua | 217 |
8 files changed, 1152 insertions, 0 deletions
diff --git a/static/netbsd/man3lua/Makefile b/static/netbsd/man3lua/Makefile new file mode 100644 index 00000000..2a6b184d --- /dev/null +++ b/static/netbsd/man3lua/Makefile @@ -0,0 +1,4 @@ +MAN = $(wildcard *.3lua) + +include ../../mandoc.mk + diff --git a/static/netbsd/man3lua/bozohttpd.3lua b/static/netbsd/man3lua/bozohttpd.3lua new file mode 100644 index 00000000..643a131e --- /dev/null +++ b/static/netbsd/man3lua/bozohttpd.3lua @@ -0,0 +1,94 @@ +.\" $NetBSD: bozohttpd.3lua,v 1.4 2023/03/01 21:06:41 nia Exp $ +.\" +.\" Copyright (c) 2018 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd May 6, 2018 +.Dt BOZOHTTPD 3lua +.Os +.Sh NAME +.Nm bozohttpd +.Nd provides access to +.Xr libbozohttpd 3 +functionality from Lua +.Sh SYNOPSIS +.Cd "local bozo = require 'bozohttpd'" +.Pp +.Bl -tag -width XXXX -compact +.It Dv instance = bozo.new() +.It Dv bozo.init_httpd(instance) +.It Dv prefs = bozo.init_prefs() +.It Dv bozo.set_pref(instance, prefs, name, value) +.It Dv bozo.get_pref(prefs, name) +.It Dv bozo.setup(instance, prefs, host, root) +.It Dv bozo.dynamic_mime(instance, one, two, three, four) +.It Dv bozo.ssl_set_opts(instance, one, two) +.It Dv bozo.cgi_setbin(instance, bin) +.It Dv bozo.cgi_map(instance, 1, 2) +.It Dv req = bozo.read_request(instance) +.It Dv bozo.process_request(req) +.It Dv bozo.clean_request(req) +.El +.Sh DESCRIPTION +The +.Nm +Lua binding provides access to functionality available in +.Xr libbozohttpd 3 . +.Sh EXAMPLES +The following example code demonstrates the process of instantiating an instance +of +.Nm +as a background daemon. +The instance is set to serve files from +.Pa /var/www +for the hostname www.example.com on TCP port 8080. +.Bd -literal +local bozo = require 'bozohttpd' +myhttpd = bozo.new() +bozo.init_httpd(myhttpd) +prefs = bozo.init_prefs() +bozo.set_pref(myhttpd, prefs, "port number", "8080") +bozo.set_pref(myhttpd, prefs, "background", 1) +bozo.setup(myhttpd, prefs, "www.example.com", "/var/www") +req = bozo.read_request(myhttpd) +bozo.process_request(req) +bozo.clean_request(req) +.Ed +.Sh SEE ALSO +.Xr lua 1 , +.Xr luac 1 , +.Xr libbozohttpd 3 , +.Xr intro 3lua +.Sh HISTORY +.Nm +Lua binding first appeared in +.Nx 9.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +Lua binding was written by +.An Alistair Crooks Aq Mt agc@NetBSD.org . +.Sh BUGS +This manual needs more description of the available functionality. diff --git a/static/netbsd/man3lua/gpio.3lua b/static/netbsd/man3lua/gpio.3lua new file mode 100644 index 00000000..cf012bf6 --- /dev/null +++ b/static/netbsd/man3lua/gpio.3lua @@ -0,0 +1,178 @@ +.\" $NetBSD: gpio.3lua,v 1.5 2016/06/11 15:17:34 abhinav Exp $ +.\" +.\" Copyright (c) 2013, 2014 Marc Balmer <mbalmer@NetBSD.org>. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" +.Dd January 7, 2014 +.Dt GPIO 3lua +.Os +.Sh NAME +.Nm gpio +.Nd access +.Xr gpio 4 +pins from Lua +.Sh SYNOPSIS +.Cd "local gpio = require 'gpio'" +.Pp +.Bl -tag -width XXXX -compact +.It Dv gpiodev = gpio.open(path) +.It Dv pins = gpio.info(gpiodev) +.It Dv gpio.close(gpiodev) +.It Dv gpio.set(gpiodev, pin, flags) +.It Dv gpio.unset(gpiodev, pin) +.It Dv state = gpio.read(gpiodev, pin) +.It Dv oldstate = gpio.write(gpiodev, pin, state) +.It Dv gpio.toggle(gpiodev, pin) +.It Dv gpio.attach(gpiodev, driver, offset, mask [, flags]) +.El +.Sh DESCRIPTION +The +.Nm +Lua binding provides access to a +.Xr gpio 4 +device using the +.Xr ioctl 2 +interface. +.Pp +.Bl -tag -width XXXX -compact +.It Dv gpiodev = gpio.open(path) +Open the gpio device and return an object to access its pins. +.Pp +.It Dv pins = gpio.info(gpiodev) +Returns the number of pins. +As with all remaining functions, this can also be called using the : +notation, i.e. as +.Em gpiodev:info() . +.Pp +.It Dv gpio.close(gpiodev) +Close the gpio device. +.Pp +.It Dv gpio.set(gpiodev, pin, flags) +Set gpio pin flags. +Note that the pin number in this and all remaining functions is zero based and +not one based, this to avoid confusion with tools like +.Xr gpioctl 8 +which also number pins starting at zero. +The following flags are defined: +.Pp +.Bl -tag -width XXXX -compact +.It Dv gpio.PIN_INPUT +Pin is an input. +.Pp +.It Dv gpio.PIN_OUTPUT +Pin is an output. +.Pp +.It Dv gpio.PIN_INOUT +Pin is birectional. +.Pp +.It Dv gpio.PIN_OPENDRAIN +Pin is an open-drain output. +.Pp +.It Dv gpio.PIN_PUSHPULL +Pin is a push-pull output. +.Pp +.It Dv gpio.PIN_TRISTATE +Pin is tri-state (output disabled). +.Pp +.It Dv gpio.PIN_PULLUP +Pin has an internal pull-up enabled. +.Pp +.It Dv gpio.PIN_PULLDOWN +Pin has an internal pull-down enabled. +.Pp +.It Dv gpio.PIN_INVIN +Invert input. +.Pp +.It Dv gpio.PIN_INVOUT +Invert output. +.Pp +.It Dv gpio.PIN_USER +Pin accessible by users. +.Pp +.It Dv gpio.PIN_PULSATE +Pulsate pin at a hardware set frequency. +.Pp +.It Dv gpio.PIN_SET +Pin is set. +.El +.Pp +.It Dv gpio.unset(gpiodev, pin) +Unset gpio pin. +.Pp +.It Dv stat = gpio.read(gpiodev, pin) +Read the current pin state. +.Pp +.It Dv oldstate = gpio.write(gpiodev, pin, state) +Write the pin state returning the old state. +The following states are defined: +.Pp +.Bl -tag -width XXXX -compact +.It Dv gpio.PIN_LOW +Pin is in the low state. +.Pp +.It Dv gpio.PIN_HIGH +Pin is in the high state. +.El +.Pp +.It Dv gpio.toggle(gpiodev, pin) +Toggle pin state. +.Pp +.It Dv gpio.attach(gpiodev, driver, offset, mask [, flags]) +Attach a device driver with offset, mask, and optional flags at a pin. +.El +.Sh EXAMPLES +The following example code opens +.Pa /dev/gpio0 +and prints all pin values: +.Bd -literal +local gpio = require 'gpio' + +gpiodev = gpio.open('/dev/gpio0') + +local npins = gpiodev:info() + +for n = 1, npins do + print('pin ' .. n .. ': ' .. gpiodev:read(n - 1)) +end +.Ed +.Sh SEE ALSO +.Xr lua 1 , +.Xr luac 1 , +.Xr intro 3lua , +.Xr gpio 4 +.Sh HISTORY +A +.Nm +manual appeared in +.Nx 7.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +Lua binding was written by +.An Marc Balmer Aq Mt mbalmer@NetBSD.org . diff --git a/static/netbsd/man3lua/intro.3lua b/static/netbsd/man3lua/intro.3lua new file mode 100644 index 00000000..6e72ca27 --- /dev/null +++ b/static/netbsd/man3lua/intro.3lua @@ -0,0 +1,85 @@ +.\" $NetBSD: intro.3lua,v 1.10 2022/11/23 19:20:34 christos Exp $ +.\" +.\" Copyright (c) 2013, 2016 Marc Balmer <mbalmer@NetBSD.org>. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" +.Dd November 23, 2022 +.Dt INTRO 3lua +.Os +.Sh NAME +.Nm intro +.Nd introduction to the Lua modules +.Sh DESCRIPTION +This section provides an overview of the Lua modules, their +functions, error returns and other common definitions and concepts. +.Pp +The Lua modules provided by +.Nx +are: +.Pp +.Bl -tag -width syslog -compact +.It Em bozohttpd +Access +.Xr libbozohttpd 3 +functionality. +.It Em gpio +Access +.Xr gpio 4 +pins. +.It Em libm +Access +.Xr math 3 +functionality. +.It Em netpgp +Access +.Xr libnetpgp 3 +functionality. +.It Em sqlite +Access +.Xr sqlite3 1 +files. +.It Em syslog +Access +.Xr syslog 3 +functionality. +.El +.Sh SEE ALSO +.Xr lua 1 , +.Xr luac 1 , +.Xr bozohttpd 3lua , +.Xr gpio 3lua , +.Xr libm 3lua , +.Xr netpgp 3lua , +.Xr sqlite 3lua , +.Xr syslog 3lua , +.Xr intro 9lua +.Sh HISTORY +An +.Nm +manual for Lua modules appeared in +.Nx 7.0 . diff --git a/static/netbsd/man3lua/libm.3lua b/static/netbsd/man3lua/libm.3lua new file mode 100644 index 00000000..093b4c4b --- /dev/null +++ b/static/netbsd/man3lua/libm.3lua @@ -0,0 +1,151 @@ +.\" +.\" Copyright (c) 2022 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Phillip Rulon +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd November 2, 2022 +.Dt LIBM 3lua +.Os +.Sh NAME +.Nm libm +.Nd Lua interface to the +.Xr math 3 +library +.Sh SYNOPSIS +.Cd "local lm = require 'libm'" +.Sh DESCRIPTION +The +.Nm +Lua binding provides access to the +.Xr math 3 +library. If these functions are given an argument outside the domain +of the function the return value will be NaN. This can be checked with +lm.isnan(). +.Pp +Many of these functions have native equivalents in the Lua math library. +Others, like +.Xr round 3 , +.Xr cbrt 3 , +and the hyperbolic trigonometry functions, are not provided without an +auxiliary module. The functions that are redundant are provided for +completeness. +.Pp +Since these functions map quite closely to the functions in the math +library, detailed information about their behavior can be found in the +man pages for each function in section 3 of the manual. +.Ss List of Functions +.Bl -column "copysignX" "gammaX3XX" "inverse trigonometric funcX" +.It Sy Name Ta Sy Man page Ta Sy Description Ta +.It lm.acos Ta Xr acos 3 Ta inverse trigonometric function Ta +.It lm.acosh Ta Xr acosh 3 Ta inverse hyperbolic function Ta +.It lm.asin Ta Xr asin 3 Ta inverse trigonometric function Ta +.It lm.asinh Ta Xr asinh 3 Ta inverse hyperbolic function Ta +.It lm.atan Ta Xr atan 3 Ta inverse trigonometric function Ta +.It lm.atanh Ta Xr atanh 3 Ta inverse hyperbolic function Ta +.It lm.atan2 Ta Xr atan2 3 Ta inverse trigonometric function Ta +.It lm.cbrt Ta Xr sqrt 3 Ta cube root Ta +.It lm.ceil Ta Xr ceil 3 Ta integer no less than Ta +.It lm.copysign Ta Xr copysign 3 Ta copy sign bit Ta +.It lm.cos Ta Xr cos 3 Ta trigonometric function Ta +.It lm.cosh Ta Xr cosh 3 Ta hyperbolic function Ta +.It lm.erf Ta Xr erf 3 Ta error function Ta +.It lm.erfc Ta Xr erf 3 Ta complementary error function Ta +.It lm.exp Ta Xr exp 3 Ta base e exponential Ta +.It lm.exp2 Ta Xr exp2 3 Ta base 2 exponential Ta +.It lm.expm1 Ta Xr expm1 3 Ta exp(x)\-1 Ta +.It lm.fabs Ta Xr fabs 3 Ta absolute value Ta +.It lm.fdim Ta Xr erf 3 Ta positive difference Ta +.It lm.finite Ta Xr finite 3 Ta test for finity Ta +.It lm.floor Ta Xr floor 3 Ta integer no greater than Ta +.It lm.fma Ta Xr fmod 3 Ta fused multiply-add Ta +.It lm.fmax Ta Xr fmax 3 Ta maximum Ta +.It lm.fmin Ta Xr fmin 3 Ta minimum Ta +.It lm.fmod Ta Xr fmod 3 Ta remainder Ta +.It lm.hypot Ta Xr hypot 3 Ta Euclidean distance Ta +.It lm.ilogb Ta Xr ilogb 3 Ta exponent extraction Ta +.It lm.isinf Ta Xr isinf 3 Ta test for infinity Ta +.It lm.isnan Ta Xr isnan 3 Ta test for not-a-number Ta +.It lm.j0 Ta Xr j0 3 Ta Bessel function Ta +.It lm.j1 Ta Xr j0 3 Ta Bessel function Ta +.It lm.jn Ta Xr j0 3 Ta Bessel function Ta +.It lm.lgamma Ta Xr lgamma 3 Ta log gamma function Ta +.It lm.log Ta Xr log 3 Ta natural logarithm Ta +.It lm.log10 Ta Xr log 3 Ta logarithm to base 10 Ta +.It lm.log1p Ta Xr log 3 Ta log(1+x) Ta +.It lm.nan Ta Xr nan 3 Ta return quiet \*(Na Ta +.It lm.nextafter Ta Xr nextafter 3 Ta next representable number Ta +.It lm.pow Ta Xr pow 3 Ta exponential x**y Ta +.It lm.remainder Ta Xr remainder 3 Ta remainder Ta +.It lm.rint Ta Xr rint 3 Ta round to nearest integer Ta +.It lm.scalbn Ta Xr scalbn 3 Ta exponent adjustment Ta +.It lm.sin Ta Xr sin 3 Ta trigonometric function Ta +.It lm.sinh Ta Xr sinh 3 Ta hyperbolic function Ta +.It lm.sqrt Ta Xr sqrt 3 Ta square root Ta +.It lm.tan Ta Xr tan 3 Ta trigonometric function Ta +.It lm.tanh Ta Xr tanh 3 Ta hyperbolic function Ta +.It lm.trunc Ta Xr trunc 3 Ta nearest integral value Ta +.It lm.y0 Ta Xr j0 3 Ta Bessel function Ta +.It lm.y1 Ta Xr j0 3 Ta Bessel function Ta +.It lm.yn Ta Xr j0 3 Ta Bessel function Ta +.El +.Ss List of Defined Values +.Bl -column "M_2_SQRTPIXX" "1.12837916709551257390XX" "2/sqrt(pi)XXX" +.It Sy Name Ta Sy Value Ta Sy Description +.It lm.M_E 2.7182818284590452354 e +.It lm.M_LOG2E 1.4426950408889634074 log 2e +.It lm.M_LOG10E 0.43429448190325182765 log 10e +.It lm.M_LN2 0.69314718055994530942 log e2 +.It lm.M_LN10 2.30258509299404568402 log e10 +.It lm.M_PI 3.14159265358979323846 pi +.It lm.M_PI_2 1.57079632679489661923 pi/2 +.It lm.M_PI_4 0.78539816339744830962 pi/4 +.It lm.M_1_PI 0.31830988618379067154 1/pi +.It lm.M_2_PI 0.63661977236758134308 2/pi +.It lm.M_2_SQRTPI 1.12837916709551257390 2/sqrt(pi) +.It lm.M_SQRT2 1.41421356237309504880 sqrt(2) +.It lm.M_SQRT1_2 0.70710678118654752440 1/sqrt(2) +.El +.Sh NOTES +The functions finite, isfinite, isinf, and isnan return integers in +the math library, the results are converted to lua boolean values by +this interface. +.Sh BUGS +The single precision float, and long double data types, implemented in +several of the libm routines, are not supported by this interface. +.Pp +The math library has a long development history, but if a bug exists +there, it will certainly exist in this interface as well. +.Sh HISTORY +A +.Nm +Lua binding appeared in +.Nx 9.4 . +.Sh AUTHORS +.An -nosplit +The +.Nm +Lua binding was written by +.An Phillip Rulon . diff --git a/static/netbsd/man3lua/netpgp.3lua b/static/netbsd/man3lua/netpgp.3lua new file mode 100644 index 00000000..0bea23c2 --- /dev/null +++ b/static/netbsd/man3lua/netpgp.3lua @@ -0,0 +1,89 @@ +.\" $NetBSD: netpgp.3lua,v 1.4 2023/03/01 21:07:21 nia Exp $ +.\" +.\" Copyright (c) 2018 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd April 30, 2018 +.Dt NETPGP 3lua +.Os +.Sh NAME +.Nm netpgp +.Nd provides access to +.Xr libnetpgp 3 +functionality from Lua +.Sh SYNOPSIS +.Cd "local netpgp = require 'netpgp'" +.Pp +.Bl -tag -width XXXX -compact +.It Dv instance = netpgp.new() +.It Dv netpgp.homedir(instance, homedir) +.It Dv netpgp.init(instance) +.It Dv netpgp.encrypt_file(instance, file, output, armour) +.It Dv netpgp.decrypt_file(instance, file, output, armour) +.It Dv netpgp.sign_file(instance, file, output, armour, detached) +.It Dv netpgp.clearsign_file(instance, file, output, armour, detached) +.It Dv netpgp.verify_file(instance, file, armour) +.It Dv netpgp.verify_cat_file(instance, file, output, armour) +.It Dv netpgp.list_packets(instance, file, armour) +.It Dv netpgp.setvar(instance, name, value) +.It Dv netpgp.getvar(instance, name, value) +.El +.Sh DESCRIPTION +The +.Nm +Lua binding provides access to functionality available in +.Xr libnetpgp 3 . +.Sh EXAMPLES +The following example code demonstrates the process of encrypting, decrypting, +signing, and verifying a file, in a single script. +.Bd -literal +local netpgp = require 'netpgp' +btc = netpgp.new() +netpgp.setvar(btc, "need seckey", 1) +netpgp.init(btc) + +netpgp.encrypt_file(btc, "scratch", "scratch.gpg", "armoured") +netpgp.decrypt_file(btc, "scratch.gpg", "itch", "armoured") +netpgp.sign_file(btc, "scratch", "scratch.asc", "armoured", "detached") +netpgp.verify_file(btc, "scratch.asc", "armoured") +.Ed +.Sh SEE ALSO +.Xr lua 1 , +.Xr luac 1 , +.Xr libnetpgp 3 , +.Xr intro 3lua +.Sh HISTORY +.Nm +Lua binding first appeared in +.Nx 9.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +Lua binding was written by +.An Alistair Crooks . +.Sh BUGS +This binding currently only provides a subset of the functionality available in +.Xr libnetpgp 3 . +This manual needs more description of the available functionality. diff --git a/static/netbsd/man3lua/sqlite.3lua b/static/netbsd/man3lua/sqlite.3lua new file mode 100644 index 00000000..cfaf9ece --- /dev/null +++ b/static/netbsd/man3lua/sqlite.3lua @@ -0,0 +1,334 @@ +.\" $NetBSD: sqlite.3lua,v 1.4 2014/01/06 09:30:26 wiz Exp $ +.\" +.\" Copyright (c) 2013 Marc Balmer <mbalmer@NetBSD.org>. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" +.Dd October 28, 2013 +.Dt SQLITE 3lua +.Os +.Sh NAME +.Nm sqlite +.Nd access +SQLite3 files from Lua +.Sh SYNOPSIS +.Cd "local sqlite = require 'sqlite'" +.Pp +.Bl -tag -width XXXX -compact +.\" +.\" GENERAL FUNCTIONS +.\" +.It Dv err = sqlite.initialize() +.It Dv sqlite.shutdown() +.It Dv db, err = sqlite.open(file [, flags]) +.It Dv version = sqlite.libversion() +.It Dv version = sqlite.libversion_number() +.It Dv id = sqlite.sourceid() +.\" +.\" DATABASE FUNCTIONS +.\" +.Pp +.It Dv err = sqlite.close(db) +.It Dv stmt, err = sqlite.prepare(db, sql) +.It Dv err = sqlite.exec(db, sql) +.It Dv err = sqlite.errcode(db) +.It Dv msg = sqlite.errmsg(db) +.It Dv res = sqlite.get_autocommit(db) +.It Dv res = sqlite.changes(db) +.\" +.\" STATEMENT FUNCTIONS +.\" +.Pp +.It Dv err = sqlite.bind(stmt, pidx, value) +.It Dv count = sqlite.bind_parameter_count(stmt) +.It Dv pidx = sqlite.bind_parameter_index(stmt, name) +.It Dv name = sqlite.bind_parameter_name(stmt, pidx) +.It Dv err = sqlite.step(stmt) +.It Dv value = sqlite.column(stmt, cidx) +.It Dv sqlite.reset(stmt) +.It Dv sqlite.clear_bindings(stmt) +.It Dv sqlite.finalize(stmt) +.It Dv name = sqlite.column_name(stmt, cidx) +.It Dv count = sqlite.column_count(stmt) +.El +.Sh DESCRIPTION +The +.Nm +Lua binding provides access to SQLite3 files. +.Sh GENERAL FUNCTIONS +.Bl -tag -width XXXX -compact +.It Dv err = sqlite.initialize() +Initialize the SQLite3 library. +Workstation applications using SQLite normally do not need to invoke this +function. +.Pp +.It Dv sqlite.shutdown() +Deallocate any resources that were allocated by +.Fn sqlite.initialize . +Workstation applications using SQLite normally do not need to invoke this +function. +.Pp +.It Dv db, err = sqlite.open(file [, flags]) +Open a database, optionally passing flags. +When called without flags, the database will be opened for reading and +writing and it will be created if it does not yet exist. +The following flags are defined: +.Pp +.Bl -tag -width XXXX -compact +.It Dv sqlite.OPEN_READONLY +The database is opened in read-only mode. +If the database does not already exist, an error is returned. +.Pp +.It Dv sqlite.OPEN_READWRITE +The database is opened for reading and writing if possible, or reading only if +the file is write protected by the operating system. +In either case the database must already exist, otherwise an error is returned. +.Pp +.It Dv sqlite.OPEN_CREATE +The database is opened for reading and writing, and is created if it does not +already exist. +.El +.Pp +.It Dv version = sqlite.libversion() +Return the SQLite3 library version number as a string. +.Pp +.It Dv version = sqlite.libversion_number() +Return the SQLite3 library version number as a number. +.Pp +.It Dv id = sqlite.sourceid() +Return the SQLite3 library source id as a string. +.El +.Sh DATABASE FUNCTIONS +Database functions operate on database objects returned by +.Fn sqlite.open . +.Pp +.Bl -tag -width XXXX -compact +.It Dv err = sqlite.close(db) +Close an open database. +Like with all remaining database functions, this function can also be called +using the Lua "colon" syntactic sugar as +.Em db:close() . +.Pp +.It Dv stmt, err = sqlite.prepare(db, sql) +Return a prepared statement. +.Pp +.It Dv err = sqlite.exec(db, sql) +Directly execute an SQL statement. +Be careful when creating SQL on the fly (SQL injection attacks). +.Pp +.It Dv err = sqlite.errcode(db) +Return the numeric error code. +.Pp +.It Dv msg = sqlite.errmsg(db) +Return the error message as a string. +.Pp +.It Dv res = sqlite.get_autocommit(db) +Return the autocommit flag. +.Pp +.It Dv res = sqlite.changes(db) +This function returns the number of database rows that were changed or inserted +or deleted by the most recently completed SQL statement on the database. +.El +.Sh STATEMENT FUNCTIONS +.Bl -tag -width XXXX -compact +.It Dv err = sqlite.bind(stmt, pidx, value) +Bind +.Ar value +to the parameter +.Ar pidx +in the prepared statement +.Ar stmt . +.Pp +.It Dv count = sqlite.bind_parameter_count(stmt) +Return the number of parameters in the prepared statement +.Ar stmt . +.Pp +.It Dv pidx = sqlite.bind_parameter_index(stmt, name) +Return the parameter index for +.Ar name +in the prepared statement +.Ar stmt . +.Pp +.It Dv name = sqlite.bind_parameter_name(stmt, pidx) +Return the parameter name for the parameter index +.Ar pidx +in the prepared statement +.Ar stmt . +.Pp +.It Dv err = sqlite.step(stmt) +Execute prepared statement +.Ar stmt . +.Pp +.It Dv value = sqlite.column(stmt, cidx) +Return the value at column +.Ar cidx +in the prepared statement +.Ar stmt . +.Pp +.It Dv sqlite.reset(stmt) +The +.Fn sqlite.reset +function is called to reset a prepared statement object back +to its initial state, ready to be re-executed. +.Pp +.It Dv sqlite.clear_bindings(stmt) +Contrary to the intuition of many, +.Fn sqlite.reset +does not reset the bindings on a prepared statement. +Use this routine to reset all host parameters to +.Dv NULL . +.Pp +.It Dv sqlite.finalize(stmt) +The +.Fn sqlite.finalize +function is called to delete a prepared statement. +.Pp +.It Dv name = sqlite.column_name(stmt, cidx) +Return the name assigned to a particular column in the result set of a SELECT +statement. +.Pp +.It Dv count = sqlite.column_count(stmt) +Return the number of columns in the result set returned by the prepared +statement +.Ar stmt . +This routine returns 0 if +.Ar stmt +is an SQL statement that does not return data (for example an UPDATE). +.El +.Sh ERROR CODES +Most functions return an error code, the following error codes +are defined: +.Pp +.Bl -tag -width XXXX -compact +.It Dv sqlite.OK +Successful result. +.Pp +.It Dv sqlite.ERROR +SQL error or missing database. +.Pp +.It Dv sqlite.INTERNAL +Internal logic error in SQLite. +.Pp +.It Dv sqlite.PERM +Access permission denied. +.Pp +.It Dv sqlite.ABORT +Callback routine requested an abort. +.Pp +.It Dv sqlite.BUSY +The database file is locked. +.Pp +.It Dv sqlite.LOCKED +A table in the database is locked. +.Pp +.It Dv sqlite.NOMEM +Out of memory. +.Pp +.It Dv sqlite.READONLY +Attempt to write a readonly database. +.Pp +.It Dv sqlite.INTERRUPT +Operation terminated by +.Fn sqlite3_interrupt . +.Pp +.It Dv sqlite.IOERR +Some kind of disk I/O error occurred. +.Pp +.It Dv sqlite.CORRUPT +The database disk image is malformed. +.Pp +.It Dv sqlite.NOTFOUND +Unknown opcode in +.Fn sqlite3_file_control . +.Pp +.It Dv sqlite.FULL +Insertion failed because database is full. +.Pp +.It Dv sqlite.CANTOPEN +Unable to open the database file. +.Pp +.It Dv sqlite.PROTOCOL +Database lock protocol error. +.Pp +.It Dv sqlite.EMPTY +Database is empty. +.Pp +.It Dv sqlite.SCHEMA +The database schema changed. +.Pp +.It Dv sqlite.TOOBIG +String or BLOB exceeds size limit. +.Pp +.It Dv sqlite.CONSTRAINT +Abort due to constraint violation. +.Pp +.It Dv sqlite.MISMATCH +Data type mismatch. +.Pp +.It Dv sqlite.MISUSE +Library used incorrectly. +.Pp +.It Dv sqlite.NOLFS +Uses OS features not supported on host. +.Pp +.It Dv sqlite.AUTH +Authorization denied. +.Pp +.It Dv sqlite.FORMAT +Auxiliary database format error. +.Pp +.It Dv sqlite.RANGE +2nd parameter to +.Fn sqlite.bind +out of range. +.Pp +.It Dv sqlite.NOTADB +File opened that is not a database file. +.Pp +.It Dv sqlite.ROW +.Fn sqlite.step +has another row ready. +.Pp +.It Dv sqlite.DONE +.Fn sqlite.step +has finished executing. +.El +.Sh SEE ALSO +.Xr lua 1 , +.Xr luac 1 , +.Xr sqlite3 1 , +.Xr intro 3lua +.Sh HISTORY +An +.Nm +manual appeared in +.Nx 7.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +Lua binding was written by +.An Marc Balmer Aq Mt mbalmer@NetBSD.org . diff --git a/static/netbsd/man3lua/syslog.3lua b/static/netbsd/man3lua/syslog.3lua new file mode 100644 index 00000000..47fef2e5 --- /dev/null +++ b/static/netbsd/man3lua/syslog.3lua @@ -0,0 +1,217 @@ +.\" $NetBSD: syslog.3lua,v 1.4 2022/10/15 21:53:21 andvar Exp $ +.\" +.\" Copyright (c) 2013, 2014 Marc Balmer <mbalmer@NetBSD.org>. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" +.Dd January 7, 2014 +.Dt SYSLOG 3lua +.Os +.Sh NAME +.Nm syslog +.Nd access +.Xr syslog 3 +functionality from Lua +.Sh SYNOPSIS +.Cd "local syslog = require 'syslog'" +.Pp +.Bl -tag -width XXXX -compact +.It Dv syslog.openlog(ident, logopt, facility) +.It Dv syslog.syslog(priority, message) +.It Dv syslog.closelog() +.It Dv oldmask = syslog.setlogmask(maskpri) +.El +.Sh DESCRIPTION +The +.Nm +Lua binding provides access to the +.Xr syslog 3 +functionality. +.Pp +.Bl -tag -width XXXX -compact +.Pp +.It Dv syslog.openlog(ident, logopt, facility) +The syslog.openlog() function provides for more specialized processing of the +messages sent by syslog.syslog(). +The parameter +.Ar ident +is a string that will be prepended to every message. +The +.Ar logopt +argument is a bit field specifying logging options, which is formed +by adding one or more of the following values: +.Pp +.Bl -tag -width XXXX -compact +.It Dv syslog.LOG_CONS +If +.Fn syslog.syslog +cannot pass the message to syslogd(8) it will attempt to write the +message to the console (``/dev/console''). +.Pp +.It Dv syslog.LOG_NDELAY +Open the connection to syslogd(8) immediately. +Normally the open is delayed until the first message is logged. +Useful for programs that need to manage the order in which file descriptors are +allocated. +.Pp +.It Dv syslog.LOG_PERROR +Write the message to standard error output as well to the system log. +.Pp +.It Dv syslog.LOG_PID +Log the process id with each message: useful for identifying instantiations of +daemons. +(This PID is placed within brackets between the ident and the message.) +.El +.Pp +The facility parameter encodes a default facility to be assigned to all +messages that do not have an explicit facility encoded: +.Pp +.Bl -tag -width XXXX -compact +.It Dv syslog.LOG_AUTH +The authorization system: login(1), su(1), getty(8), etc. +.Pp +.It Dv syslog.LOG_AUTHPRIV +The same as LOG_AUTH, but logged to a file readable only by selected +individuals. +.Pp +.It Dv syslog.LOG_CRON +The cron daemon: cron(8). +.Pp +.It Dv syslog.LOG_DAEMON +System daemons, such as routed(8), that are not provided for explicitly by other +facilities. +.Pp +.It Dv syslog.LOG_FTP +The file transfer protocol daemon: ftpd(8). +.Pp +.It Dv syslog.LOG_KERN +Messages generated by the kernel. +These cannot be generated by any user processes. +.Pp +.It Dv syslog.LOG_LPR +The line printer spooling system: lpr(1), lpc(8), lpd(8), etc. +.Pp +.It Dv syslog.LOG_MAIL +The mail system. +.Pp +.It Dv syslog.LOG_NEWS +The network news system. +.Pp +.It Dv syslog.LOG_SYSLOG +Messages generated internally by syslogd(8). +.Pp +.It Dv syslog.LOG_USER +Messages generated by random user processes. +This is the default facility identifier if none is specified. +.Pp +.It Dv syslog.LOG_UUCP +The uucp system. +.Pp +.It Dv syslog.LOG_LOCAL0 +Reserved for local use. +Similarly for syslog.LOG_LOCAL1 through syslog.LOG_LOCAL7 +.El +.Pp +.It Dv syslog.syslog(priority, message) +The +.Fn syslog +function writes +.Ar message +to the system message logger. +The message is then written to the system console, log files, logged-in +users, or forwarded to other machines as appropriate (see syslogd(8)). +.Pp +The +.Ar message +is tagged with +.Ar priority . +Priorities are encoded as a +.Ar facility +and a +.Ar level . +The facility describes the part of the system generating the message. +The level is selected from the following ordered (high to low) list: +.Pp +.Bl -tag -width XXXX -compact +.It Dv syslog.LOG_EMERG +A panic condition. +This is normally broadcast to all users. +.Pp +.It Dv syslog.LOG_ALERT +A condition that should be corrected immediately, such as a corrupted system +database. +.Pp +.It Dv syslog.LOG_CRIT +Critical conditions, e.g., hard device errors. +.Pp +.It Dv syslog.LOG_ERR +Errors. +.Pp +.It Dv syslog.LOG_WARNING +Warning messages. +.Pp +.It Dv syslog.LOG_NOTICE +Conditions that are not error conditions, but should possibly be handled +specially. +.Pp +.It Dv syslog.LOG_INFO +Informational messages. +.Pp +.It Dv syslog.LOG_DEBUG +Messages that contain information normally of use only when debugging a program. +.El +.Pp +.It Dv syslog.closelog() +The +.Fn syslog.closelog +function can be used to close the log file. +.Pp +.It Dv oldmask = syslog.setlogmask(maskpri) +The +.Fn setlogmask +function sets the log priority mask to maskpri and returns the previous mask. +Calls to +.Fn syslog +with a priority not set in maskpri are rejected. +.El +.Sh SEE ALSO +.Xr lua 1 , +.Xr luac 1 , +.Xr syslog 3 , +.Xr intro 3lua , +.Xr syslogd 8 +.Sh HISTORY +A +.Nm +Lua binding manual appeared in +.Nx 7.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +Lua binding was written by +.An Marc Balmer Aq Mt mbalmer@NetBSD.org . |
