~lastrosade/jsthttpd

cb9629d3cf9a505202c07c8d6b948cc1568908d7 — Anthony G. Basile 11 years ago b7f1b01
build system: share headers and a convenience library
M configure.ac => configure.ac +1 -0
@@ 16,6 16,7 @@ AC_CHECK_LIB(rt, clock_gettime)
AC_CHECK_HEADERS([arpa/inet.h fcntl.h grp.h memory.h netdb.h netinet/in.h osreldate.h paths.h poll.h stdlib.h string.h sys/devpoll.h sys/event.h sys/param.h sys/poll.h sys/socket.h sys/time.h syslog.h unistd.h])
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_PROG_RANLIB

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T

M extras/Makefile.am => extras/Makefile.am +5 -2
@@ 1,5 1,8 @@
AM_CPPFLAGS = -DWEBDIR='"$(docdir)/www"'

sbin_PROGRAMS = makeweb htpasswd
makeweb_SOURCES = makeweb.c ../config.h
htpasswd_SOURCES = htpasswd.c ../config.h
makeweb_SOURCES = makeweb.c
htpasswd_SOURCES = htpasswd.c

dist_sbin_SCRIPTS = syslogtocern
EXTRA_DIST = syslogtocern

M extras/htpasswd.c => extras/htpasswd.c +6 -3
@@ 8,11 8,14 @@
** if stdin is a pipe or file.  This is necessary for use from CGI.
*/

#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <config.h>

//system headers
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>


M extras/makeweb.c => extras/makeweb.c +7 -6
@@ 32,16 32,17 @@
*/


#include "../config.h"
#include <config.h>

#include <stdlib.h>
#include <unistd.h>
//system headers
#include <errno.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pwd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>


#define LINK "public_html"

M src/Makefile.am => src/Makefile.am +5 -2
@@ 2,8 2,11 @@ bin_PROGRAMS = thttpd
thttpd_SOURCES = thttpd.c thttpd.h \
	fdwatch.c fdwatch.h \
	libhttpd.c libhttpd.h \
	match.c match.h \
	mmc.c mmc.h \
	timers.c timers.h \
	tdate_parse.c tdate_parse.h \
	mime_encodings.h mime_types.h
	mime_encodings.h mime_types.h version.h
thttpd_LDADD = libmatch.a

noinst_LIBRARIES = libmatch.a
libmatch_a_SOURCES = match.c match.h

M src/fdwatch.c => src/fdwatch.c +3 -1
@@ 27,6 27,7 @@

#include <config.h>

//system headers
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>


@@ 59,7 60,8 @@
#include <sys/event.h>
#endif /* HAVE_SYS_EVENT_H */

#include "fdwatch.h"
//local headers
#include <fdwatch.h>

#ifdef HAVE_SELECT
#ifndef FD_SET

M src/libhttpd.c => src/libhttpd.c +9 -7
@@ 27,7 27,6 @@


#include <config.h>
#include "version.h"

#ifdef SHOW_SERVER_VERSION
#define EXPOSED_SERVER_SOFTWARE SERVER_SOFTWARE


@@ 35,6 34,7 @@
#define EXPOSED_SERVER_SOFTWARE "thttpd"
#endif /* SHOW_SERVER_VERSION */

//system headers
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>


@@ 78,12 78,14 @@

extern char* crypt( const char* key, const char* setting );

#include "libhttpd.h"
#include "thttpd.h"
#include "mmc.h"
#include "timers.h"
#include "match.h"
#include "tdate_parse.h"
//local headers
#include <libhttpd.h>
#include <match.h>
#include <mmc.h>
#include <tdate_parse.h>
#include <thttpd.h>
#include <timers.h>
#include <version.h>

#ifndef STDIN_FILENO
#define STDIN_FILENO 0

M src/match.c => src/match.c +4 -1
@@ 27,10 27,13 @@
** SUCH DAMAGE.
*/

#include <config.h>

//system headers
#include <string.h>

#include "match.h"
//local headers
#include <match.h>

static int match_one( const char* pattern, int patternlen, const char* string );


M src/mmc.c => src/mmc.c +4 -2
@@ 27,6 27,7 @@

#include <config.h>

//system headers
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>


@@ 42,8 43,9 @@
#include <sys/mman.h>
#endif /* HAVE_MMAP */

#include "mmc.h"
#include "libhttpd.h"
//local hdeaders
#include <libhttpd.h>
#include <mmc.h>


/* Defines. */

M src/strerror.c => src/strerror.c +4 -2
@@ 15,13 15,15 @@
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include <config.h>

#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)strerror.c  5.1 (Berkeley) 4/9/89";
#endif /* LIBC_SCCS and not lint */

#include <sys/types.h>

//system libraries
#include <stdio.h>
#include <sys/types.h>

char *
strerror(errnum)

M src/tdate_parse.c => src/tdate_parse.c +5 -2
@@ 29,8 29,9 @@
** http://www.acme.com/software/date_parse/
*/

#include <sys/types.h>
#include <config.h>

//system headers
#include <ctype.h>
#ifdef HAVE_MEMORY_H
#include <memory.h>


@@ 38,9 39,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>

#include "tdate_parse.h"
//local headers
#include <tdate_parse.h>


struct strlong {

M src/thttpd.c => src/thttpd.c +9 -7
@@ 27,8 27,8 @@


#include <config.h>
#include "version.h"

//system headers
#include <sys/param.h>
#include <sys/types.h>
#include <sys/time.h>


@@ 54,12 54,14 @@
#endif
#include <unistd.h>

#include "fdwatch.h"
#include "thttpd.h"
#include "libhttpd.h"
#include "mmc.h"
#include "timers.h"
#include "match.h"
//local headers
#include <fdwatch.h>
#include <libhttpd.h>
#include <match.h>
#include <mmc.h>
#include <thttpd.h>
#include <timers.h>
#include <version.h>

#ifndef SHUT_WR
#define SHUT_WR 1

M src/timers.c => src/timers.c +5 -2
@@ 25,13 25,16 @@
** SUCH DAMAGE.
*/

#include <sys/types.h>
#include <config.h>

//system headers
#include <stdlib.h>
#include <stdio.h>
#include <syslog.h>
#include <sys/types.h>

#include "timers.h"
//local headers
#include <timers.h>


#define HASH_SIZE 67

M www/cgi-bin/Makefile.am => www/cgi-bin/Makefile.am +9 -1
@@ 1,5 1,13 @@
bin_PROGRAMS = redirect ssi phf

redirect_SOURCES = redirect.c
ssi_SOURCES = ssi.c ../match.o
redirect_CPPFLAGS = -I$(top_srcdir)/src

ssi_SOURCES = ssi.c
ssi_CPPFLAGS = -I$(top_srcdir)/src
ssi_LDADD = ../../src/libmatch.a

phf_SOURCES = phf.c
phf_CPPFLAGS = -I$(top_srcdir)/src

EXTRA_DIST = printenv

M www/cgi-bin/phf.c => www/cgi-bin/phf.c +5 -1
@@ 33,12 33,16 @@
** SUCH DAMAGE.
*/

#include <config.h>

//system headers
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>

#include <config.h>
//local headers
#include <thttpd.h>

static char* argv0;


M www/cgi-bin/redirect.c => www/cgi-bin/redirect.c +5 -3
@@ 57,14 57,16 @@
** the binary lives.  Perhaps CGI 1.2 will address this.
*/

#include <sys/types.h>
#include <config.h>

//system headers
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>

#include <config.h>

//local headers
#include <thttpd.h>

static char* argv0;


M www/cgi-bin/ssi.c => www/cgi-bin/ssi.c +7 -3
@@ 25,15 25,19 @@
** SUCH DAMAGE.
*/

#include <config.h>

//system headers
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>

#include <config.h>
#include <src/match.h>
//local headers
#include <thttpd.h>
#include <match.h>


#define ST_GROUND 0