IOCCC image by Matt Zucker

The International Obfuscated C Code Contest

2004/hibachi - Best abuse of the guidelines

A CGI capable HTTP server

Author:

To build:

    make

There is an alternate version that is unobfuscated, provided by the author in 2024. See Alternate code below.

Bugs and (Mis)features:

The current status of this entry is:

STATUS: INABIAF - please DO NOT fix

For more detailed information see 2004/hibachi in bugs.html.

To use:

    cd build; ./hibachi-start.sh &

Then use your web browser to visit http://localhost:8008/. When you’re finished make sure to kill hibachi.

NOTE: you must be in the build directory when running hibachi-start.sh for this to work right.

Alternate code:

This version, contained in src-alt/, is an unobfuscated version provided by the author in 2024.

Alternate build:

    make alt

This will run the configure script and then compile and link in (in build-alt/) the binary hibachi.

Alternate use:

    cd build-alt ; ./hibachi-start.sh &

Then with your browser do the same as for the original source.

Judges’ remarks:

This entry violates the guidelines in so many ways! We are not exactly sure how many organisations will be upset with this entry, but we are considering starting an IOCCC standards body just to reign in the likes of Mr Howe.

This entry also has the dubious honour of being the only one to have been submitted with its own configure script.

NOTE: the author states there is a tarball hibachi.tgz but this was extracted so the file does not exist here.

Author’s remarks:

README.TXT (Feb 2004)

Hibachi is a simple, small, and (probably) very secure web server.

There is a hibachi.tgz file (NOTE: this file was removed by the judges after extraction) that unpacks several support files and a subdirectory tree containing the documentation and examples. It can be viewed by:

    tar -zxf hibachi.tgz
    lynx hibachi/localhost/index.html

Or once Hibachi is running, use a web browser (preferably one that supports images and JavaScript, to view the documentation and try some of the CGI examples) to visit: http://localhost:8008/.

Building

To build just the executable:

For Cygwin, FreeBSD, Linux (newer), Mac OS X:

    gcc -o hibachi hibachi.c

For Linux (older):

    gcc -DSHUT_WR=1 -o hibachi hibachi.c

For SunOS:

    gcc -o hibachi hibachi.c -lnsl -lsocket

Since some systems place socket and network functions into other libraries, a GNU autoconf configure script has been provided to figure out the necessary link libraries, to verify all the necessary headers and functions are present, and setup the #! paths for the CGI examples. In which case the preferred build commands are:

    ./configure [--enable-port=number]
    make

To start the server on the default port (8008):

    cd build;
    ./hibachi-start.sh &

To test the server:

    lynx http://localhost:8008/

To stop the server:

    kill %1

Features

Comments

Known Issue

Suggested IOCCC Categories

Changelog

For a list of significant changes made during development, see src/localhost/CHANGELOG.TXT.

Inventory for 2004/hibachi

Primary files

Secondary files


Jump to: top