Configuring and Managing MPE/iX Internet Services (July 2001)

Chapter 9 185
Apache for MPE/iX
Sample Module Code (mod_hw)
STANDARD_MODULE_STUFF,
NULL, /* module initializer */
NULL, /* per-directory config creator */
NULL, /* dir config merger */
NULL, /* server config creator */
NULL, /* server config merger */
NULL, /* command table */
hw_handlers, /* [7] content handlers */
NULL, /* [2] URI-to-filename translation */
NULL, /* [5] check/validate user_id */
NULL, /* [6] check user_id is valid *here* */
NULL, /* [4] check access by host address */
NULL, /* [7] MIME type checker/setter */
NULL, /* [8] fixups */
NULL, /* [9] logger */
NULL, /* [3] header parser */
NULL, /* process initialization */
NULL, /* process exit/cleanup */
NULL /* [1] post read_request handling */
};
hw.c
This file defines a function called helloworld().
shell/iX> cat hw.c
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"
helloworld(request_rec *r)
{
ap_rputs("<HTML>\n", r);
ap_rputs("<HEADER>\n", r);
ap_rputs("<TITLE>Hello There</TITLE>\n", r);
ap_rputs("</HEADER>\n", r);
ap_rputs("<BODY>\n", r);
ap_rprintf(r, "<H1>Hello World!</H1>\n");
ap_rputs("</BODY>\n", r);
ap_rputs("</HTML>\n", r);
}