Annotation of src/libexec/httpd/libbozohttpd/libbozohttpd.3, Revision 1.4.14.1
1.4.14.1! martin 1: .\" $NetBSD: libbozohttpd.3,v 1.4 2017/02/04 01:32:54 mrg Exp $
1.1 mrg 2: .\"
3: .\" $eterna: libbozohttpd.3,v 1.2 2010/05/10 02:48:23 mrg Exp $
4: .\"
1.4.14.1! martin 5: .\" Copyright (c) 2009, 2021 The NetBSD Foundation, Inc.
1.1 mrg 6: .\" All rights reserved.
7: .\"
8: .\" This manual page is derived from software contributed to The
9: .\" NetBSD Foundation by Alistair Crooks (agc@NetBSD.org)
10: .\"
11: .\" Redistribution and use in source and binary forms, with or without
12: .\" modification, are permitted provided that the following conditions
13: .\" are met:
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.
19: .\"
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.
31: .\"
1.4.14.1! martin 32: .Dd February 11, 2021
1.1 mrg 33: .Dt LIBBOZOHTTPD 3
34: .Os
35: .Sh NAME
36: .Nm libbozohttpd
37: .Nd embedded web server library
38: .Sh LIBRARY
39: .Lb libbozohttpd
40: .Sh SYNOPSIS
41: .In bozohttpd.h
42: .Ft int
43: .Fo bozo_set_pref
1.4 mrg 44: .Fa "bozohttpd_t *httpd" "bozoprefs_t *prefs" "char *name" "char *value"
1.1 mrg 45: .Fc
46: .Ft char *
47: .Fo bozo_get_pref
48: .Fa "bozoprefs_t *prefs" "char *name"
49: .Fc
50: .Ft int
51: .Fo bozo_set_defaults
52: .Fa "bozohttpd_t *httpd" "bozoprefs_t *prefs"
53: .Fc
54: .Ft void
55: .Fo bozo_setup
56: .Fa "bozohttpd_t *httpd" "bozoprefs_t *prefs" "const char *vhost" "char *slash"
57: .Fc
58: .Ft bozo_httpreq_t *
59: .Fo bozo_read_request
60: .Fa "bozohttpd_t *httpd"
61: .Fc
62: .Ft void
63: .Fo bozo_process_request
64: .Fa "bozo_httpreq_t *"
65: .Fc
66: .Ft void
67: .Fo bozo_clean_request
68: .Fa "bozo_httpreq_t *"
69: .Fc
1.4.14.1! martin 70: .Ft void
! 71: .Fo bozo_cleanup
! 72: .Fa "bozohttpd_t *httpd" "bozoprefs_t *prefs"
! 73: .Fc
1.1 mrg 74: .Sh DESCRIPTION
75: .Nm
76: is a library interface to the
77: .Xr bozohttpd 8
78: web server.
79: The
80: .Nm
81: library can be used to embed a webserver
82: in your applications.
83: .Pp
84: Normal operation sees the
85: .Nm
86: process be initialised using the
87: .Fn bozo_set_defaults
88: function, which will set up the default port
89: and other internal settings, allocating
90: any necessary space as needed.
91: The
92: .Fn bozo_set_defaults
93: function returns 1 on sucess, 0 on failure.
94: .Pp
95: The
96: .Fn bozo_setup
97: function is used to specify the virtual host name
98: for the web server.
99: A NULL host name will mean that
100: .Nm
101: will use the local value for the host name,
102: as returned by
103: .Xr gethostname 3 .
104: This virtual hostname should be a fully qualified domain name.
105: The final argument to
106: .Fn bozo_setup
107: is the name of the directory to serve as the root
108: directory of the web server tree.
109: .Pp
110: Once the server has been set up, it serves
111: requests by using the
112: .Fn bozo_read_request
113: function, which returns a pointer to a request structure,
114: and
115: .Fn bozo_process_request ,
116: which deals with the request, and answers the client.
117: The request space is de-allocated
118: using the
119: .Fn bozo_clean_request
120: function.
121: .Pp
122: Preferences are set
123: using the function
124: .Fn bozo_set_pref
125: function
126: and queried using the two
127: .Fn bozo_get_pref
128: function.
129: This is the main interface for selecting options, and for
130: setting preferences.
1.4.14.1! martin 131: The memory allocated by
! 132: .Fn bozo_setup
! 133: for both the httpd structure and the preferences will be freed.
1.1 mrg 134: .Sh SEE ALSO
135: .Xr gethostname 3 ,
136: .Xr ssl 3 ,
137: .Xr services 5 ,
138: .Xr httpd 8
139: .Sh HISTORY
140: The
141: .Nm
142: library first appeared in
143: .Nx 6.0 .
144: .Sh AUTHORS
1.2 wiz 145: .An Matthew R. Green Aq Mt mrg@eterna.com.au
146: .An Alistair Crooks Aq Mt agc@NetBSD.org
1.1 mrg 147: wrote this high-level interface.
148: .Pp
149: This manual page was written by
150: .An Alistair Crooks .
CVSweb <webmaster@jp.NetBSD.org>