1 .\" $NetBSD: libbozohttpd.3,v 1.3 2014/03/18 18:20:38 riastradh Exp $
3 .\" $eterna: libbozohttpd.3,v 1.2 2010/05/10 02:48:23 mrg Exp $
5 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
6 .\" All rights reserved.
8 .\" This manual page is derived from software contributed to The
9 .\" NetBSD Foundation by Alistair Crooks (agc@NetBSD.org)
11 .\" Redistribution and use in source and binary forms, with or without
12 .\" modification, are permitted provided that the following conditions
14 .\" 1. Redistributions of source code must retain the above copyright
15 .\" notice, this list of conditions and the following disclaimer.
16 .\" 2. Redistributions in binary form must reproduce the above copyright
17 .\" notice, this list of conditions and the following disclaimer in the
18 .\" documentation and/or other materials provided with the distribution.
20 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 .\" POSSIBILITY OF SUCH DAMAGE.
37 .Nd embedded web server library
44 .Fa "bozoprefs_t *prefs" "char *name" "char *value"
48 .Fa "bozoprefs_t *prefs" "char *name"
52 .Fa "bozohttpd_t *httpd" "bozoprefs_t *prefs"
56 .Fa "bozohttpd_t *httpd" "bozoprefs_t *prefs" "const char *vhost" "char *slash"
60 .Fa "bozohttpd_t *httpd"
63 .Fo bozo_process_request
64 .Fa "bozo_httpreq_t *"
67 .Fo bozo_clean_request
68 .Fa "bozo_httpreq_t *"
72 is a library interface to the
77 library can be used to embed a webserver
80 Normal operation sees the
82 process be initialised using the
84 function, which will set up the default port
85 and other internal settings, allocating
86 any necessary space as needed.
89 function returns 1 on sucess, 0 on failure.
93 function is used to specify the virtual host name
95 A NULL host name will mean that
97 will use the local value for the host name,
100 This virtual hostname should be a fully qualified domain name.
101 The final argument to
103 is the name of the directory to serve as the root
104 directory of the web server tree.
106 Once the server has been set up, it serves
107 requests by using the
108 .Fn bozo_read_request
109 function, which returns a pointer to a request structure,
111 .Fn bozo_process_request ,
112 which deals with the request, and answers the client.
113 The request space is de-allocated
115 .Fn bozo_clean_request
122 and queried using the two
125 This is the main interface for selecting options, and for
135 library first appeared in
138 .An Matthew R. Green Aq Mt mrg@eterna.com.au
139 .An Alistair Crooks Aq Mt agc@NetBSD.org
140 wrote this high-level interface.
142 This manual page was written by
143 .An Alistair Crooks .