10.1. Which Header Files to Use?

Like other C programs, Apache modules must #include a variety of header files declaring the various data types and functions used by the API. The include files are found in the src/include directory beneath the top of the Apache distribution. Almost every module will want to include the following files:

#include "httpd.h" 
#include "http_config.h" 
#include "http_core.h" 
#include "http_log.h" 
#include "http_main.h" 
#include "http_protocol.h" 
#include "http_request.h"

In addition, modules wishing to launch subprocesses will need to include the script utility definitions:

#include "util_script.h"

More rarely used are header files required for the MD5 digest function, URI parsing, and regular expression matching. We explain which header files to include in the sections that deal with those parts of the Apache API.

Get Writing Apache Modules with Perl and C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.