From 428a70fc3bc813f358f0b9e599d380e81769c931 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 6 Dec 2005 21:44:05 +0000 Subject: [PATCH] Added setting file example to config C event code now loads the settings file from the setting server git-svn-id: svn://svn.open-ils.org/ILS/trunk@2242 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/examples/openils.xml.example | 1 + Open-ILS/src/c-apps/oils_event.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Open-ILS/examples/openils.xml.example b/Open-ILS/examples/openils.xml.example index 5b74fc7636..addcdb0623 100644 --- a/Open-ILS/examples/openils.xml.example +++ b/Open-ILS/examples/openils.xml.example @@ -26,6 +26,7 @@ For non-core config info, see the inline documentation within this file /openils/var/templates/strings/ex.ttk /openils/var/templates/strings/perm.ttk + /openils/var/data/ils_events.xml diff --git a/Open-ILS/src/c-apps/oils_event.c b/Open-ILS/src/c-apps/oils_event.c index 284ff238dc..d1c91792fd 100644 --- a/Open-ILS/src/c-apps/oils_event.c +++ b/Open-ILS/src/c-apps/oils_event.c @@ -1,6 +1,7 @@ #include "oils_event.h" #include #include +#include "opensrf/osrf_settings.h" osrfHash* __oilsEventEvents = NULL; @@ -75,9 +76,10 @@ jsonObject* oilsEventToJSON( oilsEvent* event ) { void _oilsEventParseEvents() { - char* xml = "/openils/var/data/ils_events.xml"; /* get me from the settings client */ + char* xml = osrf_settings_host_value("/ils_events"); xmlDocPtr doc = xmlParseFile(xml); + free(xml); int success = 0; __oilsEventEvents = osrfNewHash(); @@ -85,7 +87,6 @@ void _oilsEventParseEvents() { xmlNodePtr root = xmlDocGetRootElement(doc); if( root ) { xmlNodePtr child = root->children; - //osrfLogDebug("Node Name: %s", child->name); while( child ) { if( !strcmp((char*) child->name, "event") ) { xmlChar* code = xmlGetProp( child, BAD_CAST "code"); -- 2.43.2