head	1.4;
access;
symbols
	netbsd-11-0-RC4:1.4
	netbsd-11-0-RC3:1.4
	netbsd-11-0-RC2:1.4
	netbsd-11-0-RC1:1.4
	perseant-exfatfs-base-20250801:1.4
	netbsd-11:1.4.0.4
	netbsd-11-base:1.4
	netbsd-10-1-RELEASE:1.3
	perseant-exfatfs-base-20240630:1.4
	perseant-exfatfs:1.4.0.2
	perseant-exfatfs-base:1.4
	netbsd-9-4-RELEASE:1.3
	netbsd-10-0-RELEASE:1.3
	netbsd-10-0-RC6:1.3
	netbsd-10-0-RC5:1.3
	netbsd-10-0-RC4:1.3
	netbsd-10-0-RC3:1.3
	netbsd-10-0-RC2:1.3
	netbsd-10-0-RC1:1.3
	netbsd-10:1.3.0.14
	netbsd-10-base:1.3
	netbsd-9-3-RELEASE:1.3
	cjep_sun2x-base1:1.3
	cjep_sun2x:1.3.0.12
	cjep_sun2x-base:1.3
	cjep_staticlib_x-base1:1.3
	netbsd-9-2-RELEASE:1.3
	cjep_staticlib_x:1.3.0.10
	cjep_staticlib_x-base:1.3
	netbsd-9-1-RELEASE:1.3
	phil-wifi-20200421:1.3
	phil-wifi-20200411:1.3
	is-mlppp:1.3.0.8
	is-mlppp-base:1.3
	phil-wifi-20200406:1.3
	netbsd-9-0-RELEASE:1.3
	netbsd-9-0-RC2:1.3
	netbsd-9-0-RC1:1.3
	phil-wifi-20191119:1.3
	netbsd-9:1.3.0.6
	netbsd-9-base:1.3
	phil-wifi-20190609:1.3
	pgoyette-compat-merge-20190127:1.3.2.2
	pgoyette-compat-20190127:1.3
	pgoyette-compat-20190118:1.3
	pgoyette-compat-1226:1.3
	pgoyette-compat-1126:1.3
	pgoyette-compat-1020:1.3
	pgoyette-compat-0930:1.3
	pgoyette-compat-0906:1.3
	pgoyette-compat-0728:1.3
	phil-wifi:1.3.0.4
	phil-wifi-base:1.3
	pgoyette-compat-0625:1.3
	pgoyette-compat:1.3.0.2
	pgoyette-compat-0521:1.3;
locks; strict;
comment	@# @;


1.4
date	2023.03.01.21.06.41;	author nia;	state Exp;
branches;
next	1.3;
commitid	s72O2KvrTIWjSsfE;

1.3
date	2018.05.06.14.41.01;	author sevan;	state Exp;
branches
	1.3.2.1;
next	1.2;
commitid	s6TP3Sc3ihIAgfBA;

1.2
date	2018.05.05.16.24.26;	author wiz;	state Exp;
branches;
next	1.1;
commitid	bFEgFWCskNK1V7BA;

1.1
date	2018.05.05.13.31.48;	author sevan;	state Exp;
branches;
next	;
commitid	3JBmnB0d5jVFX6BA;

1.3.2.1
date	2018.05.06.14.41.01;	author pgoyette;	state dead;
branches;
next	1.3.2.2;
commitid	X5L8kSrBWQcDt7DA;

1.3.2.2
date	2018.05.21.04.35.56;	author pgoyette;	state Exp;
branches;
next	;
commitid	X5L8kSrBWQcDt7DA;


desc
@@


1.4
log
@delete attribution per request of contributor
@
text
@.\"     $NetBSD: bozohttpd.3lua,v 1.3 2018/05/06 14:41:01 sevan 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.
@


1.3
log
@drop redundant repeat-until loop for now. read_request & process_function
functions need further investigation as to why this is not required. In the C
daemon, at the end of main.c this is the exact behaviour that's used.

heads up <wiz> regarding infinite loop.
@
text
@d1 1
a1 1
.\"     $NetBSD: bozohttpd.3lua,v 1.2 2018/05/05 16:24:26 wiz Exp $
a5 3
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Sevan Janiyan <sevan@@NetBSD.org>.
.\"
a92 2
This manual was written by
.An Sevan Janiyan Aq Mt sevan@@NetBSD.org .
@


1.3.2.1
log
@file bozohttpd.3lua was added on branch pgoyette-compat on 2018-05-21 04:35:56 +0000
@
text
@d1 99
@


1.3.2.2
log
@Sync with HEAD
@
text
@a0 99
.\"     $NetBSD: bozohttpd.3lua,v 1.3 2018/05/06 14:41:01 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 <sevan@@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 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 .
This manual was written by
.An Sevan Janiyan Aq Mt sevan@@NetBSD.org .
.Sh BUGS
This manual needs more description of the available functionality.
@


1.2
log
@Remove unnecessary macro. Fix typo.
@
text
@d1 1
a1 1
.\"     $NetBSD: bozohttpd.3lua,v 1.1 2018/05/05 13:31:48 sevan Exp $
d30 1
a30 1
.Dd May 5, 2018
d77 3
a79 6
local numreps = 0
repeat
        req = bozo.read_request(myhttpd)
        bozo.process_request(req)
        bozo.clean_request(req)
until numreps == 0
@


1.1
log
@Add a manual for bozohttpd(3lua)
@
text
@d1 1
a1 1
.\"     $NetBSD$
d59 1
a59 1
Lua binding provides access to functionality availabile in
d68 1
a68 3
for the hostname www.example.com on
.Tn TCP
port 8080.
@

