Module Name: src Committed By: sevan Date: Sat May 5 13:31:48 UTC 2018
Modified Files: src/distrib/sets/lists/man: mi src/share/man/man3lua: Makefile Added Files: src/share/man/man3lua: bozohttpd.3lua Log Message: Add a manual for bozohttpd(3lua) To generate a diff of this commit: cvs rdiff -u -r1.1583 -r1.1584 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.6 -r1.7 src/share/man/man3lua/Makefile cvs rdiff -u -r0 -r1.1 src/share/man/man3lua/bozohttpd.3lua Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1583 src/distrib/sets/lists/man/mi:1.1584 --- src/distrib/sets/lists/man/mi:1.1583 Fri May 4 14:23:19 2018 +++ src/distrib/sets/lists/man/mi Sat May 5 13:31:48 2018 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1583 2018/05/04 14:23:19 kamil Exp $ +# $NetBSD: mi,v 1.1584 2018/05/05 13:31:48 sevan Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -661,6 +661,7 @@ ./usr/share/man/cat3/i386/keycap.0 man-obsolete obsolete ./usr/share/man/cat3/libbozohttpd.0 man-sys-catman .cat ./usr/share/man/cat3/libunbound.0 man-netutil-catman .cat,unbound +./usr/share/man/cat3lua/bozohttpd.0 man-sys-catman .cat ./usr/share/man/cat3lua/gpio.0 man-sys-catman .cat ./usr/share/man/cat3lua/gpio.attach.0 man-sys-catman .cat ./usr/share/man/cat3lua/gpio.close.0 man-sys-catman .cat @@ -3847,6 +3848,7 @@ ./usr/share/man/html1/znew.html man-util-htmlman html ./usr/share/man/html3/libbozohttpd.html man-sys-htmlman html ./usr/share/man/html3/libunbound.html man-netutil-htmlman html,unbound +./usr/share/man/html3lua/bozohttpd.html man-sys-htmlman html ./usr/share/man/html3lua/gpio.attach.html man-sys-htmlman html ./usr/share/man/html3lua/gpio.close.html man-sys-htmlman html ./usr/share/man/html3lua/gpio.html man-sys-htmlman html @@ -6709,6 +6711,7 @@ ./usr/share/man/man3/i386/keycap.3 man-obsolete obsolete ./usr/share/man/man3/libbozohttpd.3 man-sys-man .man ./usr/share/man/man3/libunbound.3 man-netutil-man .man,unbound +./usr/share/man/man3lua/bozohttpd.3lua man-sys-man .man ./usr/share/man/man3lua/gpio.3lua man-sys-man .man ./usr/share/man/man3lua/gpio.attach.3lua man-sys-man .man ./usr/share/man/man3lua/gpio.close.3lua man-sys-man .man Index: src/share/man/man3lua/Makefile diff -u src/share/man/man3lua/Makefile:1.6 src/share/man/man3lua/Makefile:1.7 --- src/share/man/man3lua/Makefile:1.6 Mon Apr 30 05:23:08 2018 +++ src/share/man/man3lua/Makefile Sat May 5 13:31:48 2018 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.6 2018/04/30 05:23:08 htodd Exp $ +# $NetBSD: Makefile,v 1.7 2018/05/05 13:31:48 sevan Exp $ -MAN= gpio.3lua intro.3lua netpgp.3lua sqlite.3lua syslog.3lua +MAN= bozohttpd.3lua gpio.3lua intro.3lua netpgp.3lua sqlite.3lua syslog.3lua MLINKS+=gpio.3lua gpio.open.3lua \ gpio.3lua gpio.info.3lua \ Added files: Index: src/share/man/man3lua/bozohttpd.3lua diff -u /dev/null src/share/man/man3lua/bozohttpd.3lua:1.1 --- /dev/null Sat May 5 13:31:48 2018 +++ src/share/man/man3lua/bozohttpd.3lua Sat May 5 13:31:48 2018 @@ -0,0 +1,104 @@ +.\" $NetBSD: bozohttpd.3lua,v 1.1 2018/05/05 13:31:48 sevan Exp $ +.\" +.\" Copyright (c) 2018 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Sevan Janiyan <se...@netbsd.org>. +.\" +.\" 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 5, 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 availabile 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 +.Tn 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") +local numreps = 0 +repeat + req = bozo.read_request(myhttpd) + bozo.process_request(req) + bozo.clean_request(req) +until numreps == 0 +.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 a...@netbsd.org . +This manual was written by +.An Sevan Janiyan Aq Mt se...@netbsd.org . +.Sh BUGS +This manual needs more description of the available functionality.