1 // $Id: mod_gsbundle.m,v 1.1 2004/06/08 11:15:59 helge Exp $
4 #include "http_config.h"
10 an Apache bundle gets *unloaded* during the config process !!!
13 module MODULE_VAR_EXPORT gsbundle_module;
15 static void *helperLib = NULL;
17 static const char *(*GSBundleModuleLoadBundleCommand)
18 (module *module, cmd_parms *cmd, char *bundlePath) = NULL;
20 /* Called when the LoadBundle config directive is found */
21 static const char *loadBundle
22 (cmd_parms *cmd, void *dummy, char *bundlePath)
24 if (helperLib == NULL) {
28 dirpath = ap_pstrcat(cmd->pool,
29 getenv("GNUSTEP_SYSTEM_ROOT"), "/Libraries/",
30 getenv("GNUSTEP_HOST_CPU"), "/",
31 getenv("GNUSTEP_HOST_OS"), "/",
32 getenv("LIBRARY_COMBO"), "/",
34 path = ap_pstrcat(cmd->pool, dirpath, "libApHelper_d.so", NULL);
36 helperLib = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
37 if (helperLib == NULL) {
38 return ap_pstrcat(cmd->pool,
39 "couldn't load ObjC bundle helper lib:\n '",
44 GSBundleModuleLoadBundleCommand =
45 dlsym(helperLib, "GSBundleModuleLoadBundleCommand");
48 if (GSBundleModuleLoadBundleCommand == NULL){
49 return ap_pstrcat(cmd->pool,
50 "couldn't find load bundle command in helper lib ...",
54 return GSBundleModuleLoadBundleCommand(&gsbundle_module, cmd, bundlePath);
57 /* Config file commands we recognize */
58 static const command_rec gsbundle_cmds[] =
66 "takes bundle-path as arg"
71 module MODULE_VAR_EXPORT gsbundle_module = {
72 STANDARD_MODULE_STUFF,
73 NULL, /* module initializer */
74 NULL, /* create per-dir config structures */
75 NULL, /* merge per-dir config structures */
76 NULL, /* create per-server config structures */
77 NULL, /* merge per-server config structures */
78 gsbundle_cmds, /* table of config file commands */
79 NULL, /* [#8] MIME-typed-dispatched handlers */
80 NULL, /* [#1] URI to filename translation */
81 NULL, /* [#4] validate user id from request */
82 NULL, /* [#5] check if the user is ok _here_ */
83 NULL, /* [#3] check access by host address */
84 NULL, /* [#6] determine MIME type */
85 NULL, /* [#7] pre-run fixups */
86 NULL, /* [#9] log a transaction */
87 NULL, /* [#2] header parser */
88 NULL, /* child_init */
89 NULL, /* child_exit */
90 NULL /* [#0] post read-request */