2 * shib-target.cpp -- General target initialization and finalization routines
4 * Created By: Derek Atkins <derek@ihtfp.com>
9 #include "shib-target.h"
11 #include <log4cpp/Category.hh>
14 using namespace shibboleth;
15 using namespace shibtarget;
21 ShibTargetConfig* g_Config = NULL;
24 /* initialize and finalize the target library: return 0 on success, 1 on failure */
25 extern "C" int shib_target_initialize (const char* app_name, const char* inifile)
28 cerr << "APPLICATION ERROR: No application supplied to shib_target_init\n";
33 log4cpp::Category& log = log4cpp::Category::getInstance("shibtarget.init");
34 log.error("shib_target_initialize: Already initialized");
38 // pre-init the configuration..
39 ShibTargetConfig::preinit();
42 g_Config = &(ShibTargetConfig::init(app_name, inifile));
43 } catch (runtime_error &e) {
44 fprintf(stderr,"shib_target_initialize failed: %s\n",e.what());
51 extern "C" void shib_target_finalize (void)
60 extern "C" ShibSockName shib_target_sockname(void)
62 return (g_Config ? g_Config->m_SocketName : (ShibSockName)0);