Mercurial > hg > audiodb
changeset 616:881378d8309d
Now takes DatabasePath on a per-Location basis.
author | mas01mj |
---|---|
date | Fri, 04 Sep 2009 13:47:13 +0000 |
parents | 83f3217ee421 |
children | 5240e74a0607 |
files | sparql/mod_audiodb/Makefile.am sparql/mod_audiodb/README sparql/mod_audiodb/mod_audiodb.c |
diffstat | 3 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/sparql/mod_audiodb/Makefile.am Wed Sep 02 09:32:35 2009 +0000 +++ b/sparql/mod_audiodb/Makefile.am Fri Sep 04 13:47:13 2009 +0000 @@ -7,7 +7,7 @@ EXTRA_DIST = $(SOURCE) $(HEAD) mod_audiodb.so: $(SOURCE) $(HEAD) - @APXS@ -Wc,-g\ -Wall `@APREQ2@ --ldflags --libs --includes` `pkg-config rasqal --cflags --libs` -lrdf -laudioDB -I/usr/include/ $(GLIB_CFLAGS) -c $(SOURCE) + @APXS@ -Wc,-g\ -Wall `@APREQ2@ --ldflags --libs --includes` `pkg-config rasqal --cflags --libs` -lrdf -I/usr/include/ $(GLIB_CFLAGS) -c $(SOURCE) install: mod_audiodb.so @APXS@ -i -a `test -f mod_audiodb.so && echo "mod_audiodb.so" || echo "mod_audiodb.la"`
--- a/sparql/mod_audiodb/README Wed Sep 02 09:32:35 2009 +0000 +++ b/sparql/mod_audiodb/README Fri Sep 04 13:47:13 2009 +0000 @@ -22,8 +22,8 @@ To configure the database, add the following to your site configuration: -DatabasePath "/tmp/test_database.adb" <Location /sparql> + DatabasePath "/tmp/test_database.adb" SetHandler audiodb-sparql-handler </Location>
--- a/sparql/mod_audiodb/mod_audiodb.c Wed Sep 02 09:32:35 2009 +0000 +++ b/sparql/mod_audiodb/mod_audiodb.c Fri Sep 04 13:47:13 2009 +0000 @@ -27,21 +27,21 @@ * Config bits and pieces **/ -static void *create_audiodb_config(apr_pool_t* p, server_rec* s) { +static void *create_audiodb_dir_config(apr_pool_t* p, server_rec* s) { adb_config *config = (adb_config *)apr_pcalloc(p, sizeof(adb_config)); config->dbpath = NULL; return config; } -static const char* set_database_path(cmd_parms *parms, void *mconfig, const char *arg) { +/*static const char* set_database_path(cmd_parms *parms, void *mconfig, const char *arg) { adb_config *config = ap_get_module_config(parms->server->module_config, &audiodb_module); config->dbpath = (char *)arg; return NULL; -} +}*/ static const command_rec mod_audiodb_cmds[] = { - AP_INIT_TAKE1("DatabasePath", set_database_path, NULL, RSRC_CONF, "The AudioDB database to use"), + AP_INIT_TAKE1("DatabasePath", ap_set_file_slot, (void*)APR_OFFSETOF(adb_config, dbpath), ACCESS_CONF, "The AudioDB database to use"), {NULL} }; @@ -64,7 +64,7 @@ rc = OK; - adb_config* config = ap_get_module_config(r->server->module_config, + adb_config* config = ap_get_module_config(r->per_dir_config, &audiodb_module); r->status = HTTP_BAD_REQUEST; @@ -173,9 +173,10 @@ module AP_MODULE_DECLARE_DATA audiodb_module = { STANDARD20_MODULE_STUFF, + create_audiodb_dir_config, NULL, NULL, - create_audiodb_config, + //create_audiodb_config, NULL, mod_audiodb_cmds, mod_audiodb_register_hooks,