Home | History | Annotate | Line # | Download | only in httpd
bozohttpd.h revision 1.20.2.2
      1  1.20.2.2      snj /*	$NetBSD: bozohttpd.h,v 1.20.2.2 2016/04/15 19:36:08 snj Exp $	*/
      2       1.3      tls 
      3      1.20      mrg /*	$eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $	*/
      4       1.1      tls 
      5       1.1      tls /*
      6  1.20.2.2      snj  * Copyright (c) 1997-2015 Matthew R. Green
      7       1.1      tls  * All rights reserved.
      8       1.1      tls  *
      9       1.1      tls  * Redistribution and use in source and binary forms, with or without
     10       1.1      tls  * modification, are permitted provided that the following conditions
     11       1.1      tls  * are met:
     12       1.1      tls  * 1. Redistributions of source code must retain the above copyright
     13       1.1      tls  *    notice, this list of conditions and the following disclaimer.
     14       1.1      tls  * 2. Redistributions in binary form must reproduce the above copyright
     15       1.1      tls  *    notice, this list of conditions and the following disclaimer and
     16       1.1      tls  *    dedication in the documentation and/or other materials provided
     17       1.1      tls  *    with the distribution.
     18       1.1      tls  *
     19       1.1      tls  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     20       1.1      tls  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     21       1.1      tls  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     22       1.1      tls  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     23       1.1      tls  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     24       1.1      tls  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     25       1.1      tls  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     26       1.1      tls  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     27       1.1      tls  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28       1.1      tls  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29       1.1      tls  * SUCH DAMAGE.
     30       1.1      tls  *
     31       1.1      tls  */
     32      1.12      mrg #ifndef BOZOHTTOPD_H_
     33      1.12      mrg #define BOZOHTTOPD_H_	1
     34      1.12      mrg 
     35  1.20.2.1  msaitoh #include "netbsd_queue.h"
     36      1.12      mrg 
     37       1.1      tls #include <sys/stat.h>
     38       1.5      mrg 
     39  1.20.2.1  msaitoh #ifndef NO_LUA_SUPPORT
     40  1.20.2.1  msaitoh #include <lua.h>
     41  1.20.2.1  msaitoh #endif
     42       1.1      tls #include <stdio.h>
     43       1.1      tls 
     44  1.20.2.2      snj /* QNX provides a lot of NetBSD things in nbutil.h */
     45  1.20.2.2      snj #ifdef HAVE_NBUTIL_H
     46  1.20.2.2      snj #include <nbutil.h>
     47  1.20.2.2      snj #endif
     48  1.20.2.2      snj 
     49       1.8      mrg /* lots of "const" but gets free()'ed etc at times, sigh */
     50       1.8      mrg 
     51       1.1      tls /* headers */
     52      1.12      mrg typedef struct bozoheaders {
     53       1.4      rtr 	/*const*/ char *h_header;
     54       1.1      tls 	/*const*/ char *h_value;	/* this gets free()'ed etc at times */
     55      1.12      mrg 	SIMPLEQ_ENTRY(bozoheaders)	h_next;
     56      1.12      mrg } bozoheaders_t;
     57  1.20.2.2      snj SIMPLEQ_HEAD(qheaders, bozoheaders);
     58       1.1      tls 
     59  1.20.2.1  msaitoh #ifndef NO_LUA_SUPPORT
     60  1.20.2.1  msaitoh typedef struct lua_handler {
     61  1.20.2.1  msaitoh 	const char	*name;
     62  1.20.2.1  msaitoh 	int		 ref;
     63  1.20.2.1  msaitoh 	SIMPLEQ_ENTRY(lua_handler)	h_next;
     64  1.20.2.1  msaitoh } lua_handler_t;
     65  1.20.2.1  msaitoh 
     66  1.20.2.1  msaitoh typedef struct lua_state_map {
     67  1.20.2.1  msaitoh 	const char 	*script;
     68  1.20.2.1  msaitoh 	const char	*prefix;
     69  1.20.2.1  msaitoh 	lua_State	*L;
     70  1.20.2.1  msaitoh 	SIMPLEQ_HEAD(, lua_handler)	handlers;
     71  1.20.2.1  msaitoh 	SIMPLEQ_ENTRY(lua_state_map)	s_next;
     72  1.20.2.1  msaitoh } lua_state_map_t;
     73  1.20.2.1  msaitoh #endif
     74  1.20.2.1  msaitoh 
     75      1.12      mrg typedef struct bozo_content_map_t {
     76      1.12      mrg 	const char	*name;		/* postfix of file */
     77      1.12      mrg 	const char	*type;		/* matching content-type */
     78      1.12      mrg 	const char	*encoding;	/* matching content-encoding */
     79      1.12      mrg 	const char	*encoding11;	/* matching content-encoding (HTTP/1.1) */
     80      1.12      mrg 	const char	*cgihandler;	/* optional CGI handler */
     81      1.12      mrg } bozo_content_map_t;
     82      1.12      mrg 
     83      1.12      mrg /* this struct holds the bozo constants */
     84      1.12      mrg typedef struct bozo_consts_t {
     85      1.12      mrg 	const char	*http_09;	/* "HTTP/0.9" */
     86      1.12      mrg 	const char	*http_10;	/* "HTTP/1.0" */
     87      1.12      mrg 	const char	*http_11;	/* "HTTP/1.1" */
     88      1.12      mrg 	const char	*text_plain;	/* "text/plain" */
     89      1.12      mrg } bozo_consts_t;
     90      1.12      mrg 
     91      1.12      mrg /* this structure encapsulates all the bozo flags and control vars */
     92      1.12      mrg typedef struct bozohttpd_t {
     93      1.12      mrg 	char		*rootdir;	/* root directory */
     94      1.12      mrg 	int		 numeric;	/* avoid gethostby*() */
     95      1.12      mrg 	char		*virtbase;	/* virtual directory base */
     96      1.12      mrg 	int		 unknown_slash;	/* unknown vhosts go to normal slashdir */
     97      1.12      mrg 	int		 logstderr;	/* log to stderr (even if not tty) */
     98      1.12      mrg 	int		 background;	/* drop into daemon mode */
     99      1.12      mrg 	int		 foreground;	/* keep daemon mode in foreground */
    100      1.18     jmmv 	char		*pidfile;	/* path to the pid file, if any */
    101      1.12      mrg 	size_t		 page_size;	/* page size */
    102      1.12      mrg 	char		*slashdir;	/* www slash directory */
    103      1.12      mrg 	char		*bindport;	/* bind port; default "http" */
    104      1.12      mrg 	char		*bindaddress;	/* address for binding - INADDR_ANY */
    105      1.12      mrg 	int		 debug;		/* debugging level */
    106      1.12      mrg 	char		*virthostname;	/* my name */
    107      1.12      mrg 	const char	*server_software;/* our brand :-) */
    108      1.12      mrg 	const char	*index_html;	/* our home page */
    109      1.12      mrg 	const char	*public_html;	/* ~user/public_html page */
    110      1.12      mrg 	int		 enable_users;	/* enable public_html */
    111  1.20.2.2      snj 	int		 enable_cgi_users;	/* use the cgi handler */
    112      1.12      mrg 	int		*sock;		/* bound sockets */
    113      1.12      mrg 	int		 nsock;		/* number of above */
    114      1.12      mrg 	struct pollfd	*fds;		/* current poll fd set */
    115      1.12      mrg 	int		 request_times;	/* # times a request was processed */
    116      1.12      mrg 	int		 dir_indexing;	/* handle directories */
    117      1.12      mrg 	int		 hide_dots;	/* hide .* */
    118      1.12      mrg 	int		 process_cgi;	/* use the cgi handler */
    119      1.12      mrg 	char		*cgibin;	/* cgi-bin directory */
    120  1.20.2.1  msaitoh #ifndef NO_LUA_SUPPORT
    121  1.20.2.1  msaitoh 	int		 process_lua;	/* use the Lua handler */
    122  1.20.2.1  msaitoh 	SIMPLEQ_HEAD(, lua_state_map)	lua_states;
    123  1.20.2.1  msaitoh #endif
    124      1.12      mrg 	void		*sslinfo;	/* pointer to ssl struct */
    125      1.12      mrg 	int		dynamic_content_map_size;/* size of dyn cont map */
    126      1.12      mrg 	bozo_content_map_t	*dynamic_content_map;/* dynamic content map */
    127      1.12      mrg 	size_t		 mmapsz;	/* size of region to mmap */
    128      1.12      mrg 	char		*getln_buffer;	/* space for getln buffer */
    129      1.12      mrg 	ssize_t		 getln_buflen;	/* length of allocated space */
    130      1.12      mrg 	char		*errorbuf;	/* no dynamic allocation allowed */
    131      1.12      mrg 	bozo_consts_t	 consts;	/* various constants */
    132      1.12      mrg } bozohttpd_t;
    133      1.12      mrg 
    134      1.12      mrg /* bozo_httpreq_t */
    135      1.12      mrg typedef struct bozo_httpreq_t {
    136      1.12      mrg 	bozohttpd_t	*hr_httpd;
    137      1.12      mrg 	int		hr_method;
    138       1.1      tls #define	HTTP_GET	0x01
    139       1.1      tls #define HTTP_POST	0x02
    140       1.1      tls #define HTTP_HEAD	0x03
    141       1.1      tls #define HTTP_OPTIONS	0x04	/* not supported */
    142       1.1      tls #define HTTP_PUT	0x05	/* not supported */
    143       1.1      tls #define HTTP_DELETE	0x06	/* not supported */
    144       1.1      tls #define HTTP_TRACE	0x07	/* not supported */
    145       1.1      tls #define HTTP_CONNECT	0x08	/* not supported */
    146       1.1      tls 	const char *hr_methodstr;
    147  1.20.2.1  msaitoh 	char	*hr_virthostname;	/* server name (if not identical
    148  1.20.2.1  msaitoh 					   to hr_httpd->virthostname) */
    149       1.8      mrg 	char	*hr_file;
    150      1.14      mrg 	char	*hr_oldfile;	/* if we added an index_html */
    151  1.20.2.1  msaitoh 	char	*hr_query;
    152  1.20.2.1  msaitoh 	char	*hr_host;	/* HTTP/1.1 Host: or virtual hostname,
    153  1.20.2.1  msaitoh 				   possibly including a port number */
    154  1.20.2.2      snj #ifndef NO_USER_SUPPORT
    155  1.20.2.2      snj 	char	*hr_user;	/* username if we hit userdir request */
    156  1.20.2.2      snj #endif /* !NO_USER_SUPPORT */
    157       1.1      tls 	const char *hr_proto;
    158       1.1      tls 	const char *hr_content_type;
    159       1.1      tls 	const char *hr_content_length;
    160       1.1      tls 	const char *hr_allow;
    161       1.1      tls 	const char *hr_referrer;
    162       1.5      mrg 	const char *hr_range;
    163       1.7    joerg 	const char *hr_if_modified_since;
    164  1.20.2.1  msaitoh 	const char *hr_accept_encoding;
    165       1.5      mrg 	int         hr_have_range;
    166       1.5      mrg 	off_t       hr_first_byte_pos;
    167       1.5      mrg 	off_t       hr_last_byte_pos;
    168       1.8      mrg 	/*const*/ char *hr_remotehost;
    169       1.8      mrg 	/*const*/ char *hr_remoteaddr;
    170       1.8      mrg 	/*const*/ char *hr_serverport;
    171       1.1      tls #ifdef DO_HTPASSWD
    172       1.9      mrg 	/*const*/ char *hr_authrealm;
    173       1.9      mrg 	/*const*/ char *hr_authuser;
    174       1.9      mrg 	/*const*/ char *hr_authpass;
    175       1.1      tls #endif
    176  1.20.2.2      snj 	struct qheaders		hr_headers;
    177  1.20.2.2      snj 	struct qheaders		hr_replheaders;
    178  1.20.2.2      snj 	int			hr_nheaders;
    179      1.12      mrg } bozo_httpreq_t;
    180       1.1      tls 
    181  1.20.2.1  msaitoh /* helper to access the "active" host name from a httpd/request pair */
    182  1.20.2.1  msaitoh #define	BOZOHOST(HTTPD,REQUEST)	((REQUEST)->hr_virthostname ?		\
    183  1.20.2.1  msaitoh 					(REQUEST)->hr_virthostname :	\
    184  1.20.2.1  msaitoh 					(HTTPD)->virthostname)
    185  1.20.2.1  msaitoh 
    186      1.12      mrg /* structure to hold string based (name, value) pairs with preferences */
    187      1.12      mrg typedef struct bozoprefs_t {
    188  1.20.2.2      snj 	size_t		  size;		/* size of the two arrays */
    189  1.20.2.2      snj 	size_t		  count;	/* # of entries in arrays */
    190      1.12      mrg 	char		**name;		/* names of each entry */
    191      1.12      mrg 	char		**value;	/* values for the name entries */
    192      1.12      mrg } bozoprefs_t;
    193       1.1      tls 
    194  1.20.2.1  msaitoh /* by default write in upto 64KiB chunks, and mmap in upto 64MiB chunks */
    195  1.20.2.1  msaitoh #ifndef BOZO_WRSZ
    196      1.12      mrg #define BOZO_WRSZ	(64 * 1024)
    197  1.20.2.1  msaitoh #endif
    198  1.20.2.1  msaitoh #ifndef BOZO_MMAPSZ
    199      1.12      mrg #define BOZO_MMAPSZ	(BOZO_WRSZ * 1024)
    200  1.20.2.1  msaitoh #endif
    201       1.1      tls 
    202       1.1      tls /* debug flags */
    203       1.1      tls #define DEBUG_NORMAL	1
    204       1.1      tls #define DEBUG_FAT	2
    205       1.1      tls #define DEBUG_OBESE	3
    206       1.1      tls #define DEBUG_EXPLODING	4
    207       1.1      tls 
    208       1.1      tls #define	strornull(x)	((x) ? (x) : "<null>")
    209       1.1      tls 
    210      1.19    joerg #if defined(__GNUC__) && __GNUC__ >= 3
    211      1.19    joerg #define BOZO_PRINTFLIKE(x,y) __attribute__((__format__(__printf__, x,y)))
    212      1.19    joerg #define BOZO_DEAD __attribute__((__noreturn__))
    213      1.19    joerg #endif
    214      1.19    joerg 
    215  1.20.2.1  msaitoh #ifndef NO_DEBUG
    216  1.20.2.1  msaitoh void	debug__(bozohttpd_t *, int, const char *, ...) BOZO_PRINTFLIKE(3, 4);
    217  1.20.2.1  msaitoh #define debug(x)	debug__ x
    218  1.20.2.1  msaitoh #else
    219  1.20.2.1  msaitoh #define	debug(x)
    220  1.20.2.1  msaitoh #endif /* NO_DEBUG */
    221  1.20.2.1  msaitoh 
    222      1.14      mrg int	bozo_http_error(bozohttpd_t *, int, bozo_httpreq_t *, const char *);
    223       1.1      tls 
    224      1.12      mrg int	bozo_check_special_files(bozo_httpreq_t *, const char *);
    225      1.12      mrg char	*bozo_http_date(char *, size_t);
    226  1.20.2.2      snj void	bozo_print_header(bozo_httpreq_t *, struct stat *, const char *,
    227  1.20.2.2      snj 			  const char *);
    228  1.20.2.2      snj char	*bozo_escape_rfc3986(bozohttpd_t *httpd, const char *url, int absolute);
    229  1.20.2.1  msaitoh char	*bozo_escape_html(bozohttpd_t *httpd, const char *url);
    230  1.20.2.2      snj int	bozo_decode_url_percent(bozo_httpreq_t *, char *);
    231       1.1      tls 
    232  1.20.2.2      snj /* these are similar to libc functions, no underscore here */
    233  1.20.2.2      snj void	bozowarn(bozohttpd_t *, const char *, ...)
    234  1.20.2.2      snj 		BOZO_PRINTFLIKE(2, 3);
    235  1.20.2.2      snj void	bozoerr(bozohttpd_t *, int, const char *, ...)
    236  1.20.2.2      snj 		BOZO_PRINTFLIKE(3, 4)
    237  1.20.2.2      snj 		BOZO_DEAD;
    238  1.20.2.2      snj void	bozoasprintf(bozohttpd_t *, char **, const char *, ...)
    239  1.20.2.2      snj 		BOZO_PRINTFLIKE(3, 4);
    240  1.20.2.2      snj char	*bozodgetln(bozohttpd_t *, int, ssize_t *, ssize_t (*)(bozohttpd_t *,
    241  1.20.2.2      snj 		    int, void *, size_t));
    242       1.5      mrg char	*bozostrnsep(char **, const char *, ssize_t *);
    243      1.12      mrg void	*bozomalloc(bozohttpd_t *, size_t);
    244      1.12      mrg void	*bozorealloc(bozohttpd_t *, void *, size_t);
    245  1.20.2.2      snj char	*bozostrdup(bozohttpd_t *, bozo_httpreq_t *, const char *);
    246  1.20.2.2      snj 
    247  1.20.2.2      snj #define bozo_noop	do { /* nothing */ } while (/*CONSTCOND*/0)
    248       1.1      tls 
    249       1.1      tls /* ssl-bozo.c */
    250      1.12      mrg #ifdef NO_SSL_SUPPORT
    251  1.20.2.2      snj #define bozo_ssl_set_opts(w, x, y)	bozo_noop
    252  1.20.2.2      snj #define bozo_ssl_set_ciphers(w, x, y)	bozo_noop
    253  1.20.2.2      snj #define bozo_ssl_init(x)		bozo_noop
    254  1.20.2.2      snj #define bozo_ssl_accept(x)		(0)
    255  1.20.2.2      snj #define bozo_ssl_destroy(x)		bozo_noop
    256      1.12      mrg #else
    257      1.14      mrg void	bozo_ssl_set_opts(bozohttpd_t *, const char *, const char *);
    258  1.20.2.2      snj void	bozo_ssl_set_ciphers(bozohttpd_t *, const char *);
    259      1.14      mrg void	bozo_ssl_init(bozohttpd_t *);
    260  1.20.2.2      snj int	bozo_ssl_accept(bozohttpd_t *);
    261      1.14      mrg void	bozo_ssl_destroy(bozohttpd_t *);
    262       1.1      tls #endif
    263       1.1      tls 
    264       1.1      tls 
    265       1.1      tls /* auth-bozo.c */
    266       1.1      tls #ifdef DO_HTPASSWD
    267  1.20.2.2      snj void	bozo_auth_init(bozo_httpreq_t *);
    268      1.14      mrg int	bozo_auth_check(bozo_httpreq_t *, const char *);
    269      1.14      mrg void	bozo_auth_cleanup(bozo_httpreq_t *);
    270      1.14      mrg int	bozo_auth_check_headers(bozo_httpreq_t *, char *, char *, ssize_t);
    271      1.14      mrg int	bozo_auth_check_special_files(bozo_httpreq_t *, const char *);
    272      1.14      mrg void	bozo_auth_check_401(bozo_httpreq_t *, int);
    273      1.14      mrg void	bozo_auth_cgi_setenv(bozo_httpreq_t *, char ***);
    274      1.14      mrg int	bozo_auth_cgi_count(bozo_httpreq_t *);
    275      1.12      mrg #else
    276  1.20.2.2      snj #define	bozo_auth_init(x)			bozo_noop
    277      1.14      mrg #define	bozo_auth_check(x, y)			0
    278  1.20.2.2      snj #define	bozo_auth_cleanup(x)			bozo_noop
    279      1.14      mrg #define	bozo_auth_check_headers(y, z, a, b)	0
    280      1.14      mrg #define	bozo_auth_check_special_files(x, y)	0
    281  1.20.2.2      snj #define	bozo_auth_check_401(x, y)		bozo_noop
    282  1.20.2.2      snj #define	bozo_auth_cgi_setenv(x, y)		bozo_noop
    283      1.14      mrg #define	bozo_auth_cgi_count(x)			0
    284       1.1      tls #endif /* DO_HTPASSWD */
    285       1.1      tls 
    286       1.1      tls 
    287       1.1      tls /* cgi-bozo.c */
    288      1.12      mrg #ifdef NO_CGIBIN_SUPPORT
    289      1.14      mrg #define	bozo_process_cgi(h)				0
    290       1.1      tls #else
    291      1.14      mrg void	bozo_cgi_setbin(bozohttpd_t *, const char *);
    292      1.14      mrg void	bozo_setenv(bozohttpd_t *, const char *, const char *, char **);
    293      1.14      mrg int	bozo_process_cgi(bozo_httpreq_t *);
    294      1.14      mrg void	bozo_add_content_map_cgi(bozohttpd_t *, const char *, const char *);
    295       1.1      tls #endif /* NO_CGIBIN_SUPPORT */
    296       1.1      tls 
    297       1.1      tls 
    298  1.20.2.1  msaitoh /* lua-bozo.c */
    299  1.20.2.1  msaitoh #ifdef NO_LUA_SUPPORT
    300  1.20.2.1  msaitoh #define bozo_process_lua(h)				0
    301  1.20.2.1  msaitoh #else
    302  1.20.2.1  msaitoh void	bozo_add_lua_map(bozohttpd_t *, const char *, const char *);
    303  1.20.2.1  msaitoh int	bozo_process_lua(bozo_httpreq_t *);
    304  1.20.2.1  msaitoh #endif /* NO_LUA_SUPPORT */
    305  1.20.2.1  msaitoh 
    306  1.20.2.1  msaitoh 
    307       1.1      tls /* daemon-bozo.c */
    308      1.12      mrg #ifdef NO_DAEMON_MODE
    309  1.20.2.2      snj #define bozo_daemon_init(x)				bozo_noop
    310      1.14      mrg #define bozo_daemon_fork(x)				0
    311  1.20.2.2      snj #define bozo_daemon_closefds(x)				bozo_noop
    312      1.12      mrg #else
    313      1.14      mrg void	bozo_daemon_init(bozohttpd_t *);
    314      1.14      mrg int	bozo_daemon_fork(bozohttpd_t *);
    315      1.14      mrg void	bozo_daemon_closefds(bozohttpd_t *);
    316       1.1      tls #endif /* NO_DAEMON_MODE */
    317       1.1      tls 
    318       1.1      tls 
    319       1.1      tls /* tilde-luzah-bozo.c */
    320      1.12      mrg #ifdef NO_USER_SUPPORT
    321  1.20.2.2      snj #define bozo_user_transform(x)				0
    322  1.20.2.2      snj #define bozo_user_free(x)					0
    323       1.8      mrg #else
    324  1.20.2.2      snj int	bozo_user_transform(bozo_httpreq_t *);
    325  1.20.2.2      snj #define bozo_user_free(x)					free(x)
    326       1.1      tls #endif /* NO_USER_SUPPORT */
    327       1.1      tls 
    328       1.1      tls 
    329       1.1      tls /* dir-index-bozo.c */
    330      1.12      mrg #ifdef NO_DIRINDEX_SUPPORT
    331      1.15      mrg #define bozo_dir_index(a, b, c)				0
    332       1.1      tls #else
    333      1.12      mrg int	bozo_dir_index(bozo_httpreq_t *, const char *, int);
    334       1.1      tls #endif /* NO_DIRINDEX_SUPPORT */
    335       1.1      tls 
    336       1.1      tls 
    337       1.1      tls /* content-bozo.c */
    338      1.14      mrg const char *bozo_content_type(bozo_httpreq_t *, const char *);
    339      1.14      mrg const char *bozo_content_encoding(bozo_httpreq_t *, const char *);
    340      1.14      mrg bozo_content_map_t *bozo_match_content_map(bozohttpd_t *, const char *, int);
    341      1.14      mrg bozo_content_map_t *bozo_get_content_map(bozohttpd_t *, const char *);
    342       1.1      tls #ifndef NO_DYNAMIC_CONTENT
    343  1.20.2.2      snj void	bozo_add_content_map_mime(bozohttpd_t *, const char *, const char *,
    344  1.20.2.2      snj 				  const char *, const char *);
    345       1.1      tls #endif
    346      1.12      mrg 
    347      1.12      mrg /* I/O */
    348  1.20.2.1  msaitoh int bozo_printf(bozohttpd_t *, const char *, ...) BOZO_PRINTFLIKE(2, 3);;
    349      1.12      mrg ssize_t bozo_read(bozohttpd_t *, int, void *, size_t);
    350      1.12      mrg ssize_t bozo_write(bozohttpd_t *, int, const void *, size_t);
    351      1.12      mrg int bozo_flush(bozohttpd_t *, FILE *);
    352      1.12      mrg 
    353      1.12      mrg /* misc */
    354      1.12      mrg int bozo_init_httpd(bozohttpd_t *);
    355  1.20.2.2      snj int bozo_init_prefs(bozohttpd_t *, bozoprefs_t *);
    356      1.12      mrg int bozo_set_defaults(bozohttpd_t *, bozoprefs_t *);
    357      1.12      mrg int bozo_setup(bozohttpd_t *, bozoprefs_t *, const char *, const char *);
    358      1.12      mrg bozo_httpreq_t *bozo_read_request(bozohttpd_t *);
    359      1.12      mrg void bozo_process_request(bozo_httpreq_t *);
    360      1.12      mrg void bozo_clean_request(bozo_httpreq_t *);
    361  1.20.2.2      snj bozoheaders_t *addmerge_reqheader(bozo_httpreq_t *, const char *,
    362  1.20.2.2      snj 				  const char *, ssize_t);
    363  1.20.2.2      snj bozoheaders_t *addmerge_replheader(bozo_httpreq_t *, const char *,
    364  1.20.2.2      snj 				   const char *, ssize_t);
    365      1.12      mrg 
    366      1.12      mrg /* variables */
    367  1.20.2.2      snj int bozo_set_pref(bozohttpd_t *, bozoprefs_t *, const char *, const char *);
    368      1.12      mrg char *bozo_get_pref(bozoprefs_t *, const char *);
    369      1.12      mrg 
    370      1.12      mrg #endif	/* BOZOHTTOPD_H_ */
    371