Added ability to compile without API. See #198.

This commit is contained in:
brectanus
2007-08-10 14:47:48 +00:00
parent e64ac265f4
commit bd3845a62b
4 changed files with 9 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
?? ???? ???? - 2.1.3-rc1
------------------------
* Added ability to compile without an external API (-DNO_MODSEC_API).
27 July 2007 - 2.1.2
--------------------

View File

@@ -29,6 +29,7 @@ APACHECTL = apachectl
INCLUDES = -I /usr/include/libxml2
DEFS = -DWITH_LIBXML2
#DEFS = -DWITH_LIBXML2 -DNO_MODSEC_API
#LIBS = -Lmy/lib/dir -lmylib
CFLAGS = -O2 -g -Wuninitialized -Wall -Wmissing-prototypes -Wshadow -Wunused-variable -Wunused-value -Wchar-subscripts -Wsign-compare

View File

@@ -18,10 +18,12 @@
#include <apr_optional.h>
#if (!defined(NO_MODSEC_API))
/* Optional functions. */
APR_DECLARE_OPTIONAL_FN(void, modsec_register_tfn, (const char *name, void *fn));
APR_DECLARE_OPTIONAL_FN(void, modsec_register_operator, (const char *name, void *fn_init, void *fn_exec));
#endif
/* Configuration functions. */

View File

@@ -950,6 +950,7 @@ static void hook_insert_error_filter(request_rec *r) {
}
#endif
#if (!defined(NO_MODSEC_API))
/**
* This function is exported for other Apache modules to
* register new transformation functions.
@@ -969,6 +970,7 @@ static void modsec_register_operator(const char *name, void *fn_init, void *fn_e
msre_engine_op_register(modsecurity->msre, name, fn_init, fn_exec);
}
}
#endif
/**
* Registers module hooks with Apache.
@@ -993,9 +995,11 @@ static void register_hooks(apr_pool_t *mp) {
NULL
};
#if (!defined(NO_MODSEC_API))
/* Export optional functions. */
APR_REGISTER_OPTIONAL_FN(modsec_register_tfn);
APR_REGISTER_OPTIONAL_FN(modsec_register_operator);
#endif
/* Main hooks */
ap_hook_pre_config(hook_pre_config, NULL, NULL, APR_HOOK_FIRST);