/*
 * /var/www/easyinstall/citadel/webcit/modules_init.c
 * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE
 */



#include "sysdep.h"
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <libcitadel.h>
#include "webcit.h"
#include "modules_init.h"
#include "webserver.h"

void LogPrintMessages(long err);
extern long DetailErrorFlags;

void start_modules (void)
{
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting CONTEXT\n");
#endif
	ServerStartModule_CONTEXT();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting DAV\n");
#endif
	ServerStartModule_DAV();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting ICONBAR\n");
#endif
	ServerStartModule_ICONBAR();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting ICONTHEME\n");
#endif
	ServerStartModule_ICONTHEME();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting MSGRENDERERS\n");
#endif
	ServerStartModule_MSGRENDERERS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting PREFERENCES\n");
#endif
	ServerStartModule_PREFERENCES();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting SERV_FUNC\n");
#endif
	ServerStartModule_SERV_FUNC();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting SITECONFIG\n");
#endif
	ServerStartModule_SITECONFIG();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting SMTP_QUEUE\n");
#endif
	ServerStartModule_SMTP_QUEUE();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting STATIC\n");
#endif
	ServerStartModule_STATIC();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting SUBST\n");
#endif
	ServerStartModule_SUBST();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting VCARD\n");
#endif
	ServerStartModule_VCARD();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Starting WEBCIT\n");
#endif
	ServerStartModule_WEBCIT();
}


void initialise_modules (void)
{

#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ADDRBOOK_POPUP\n");
#endif
	InitModule_ADDRBOOK_POPUP();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing AUTH\n");
#endif
	InitModule_AUTH();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing AUTO_COMPLETE\n");
#endif
	InitModule_AUTO_COMPLETE();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing BBSVIEWRENDERERS\n");
#endif
	InitModule_BBSVIEWRENDERERS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing BLOGVIEWRENDERERS\n");
#endif
	InitModule_BLOGVIEWRENDERERS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing CALENDAR\n");
#endif
	InitModule_CALENDAR();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing CALENDAR_VIEW\n");
#endif
	InitModule_CALENDAR_VIEW();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing CONTEXT\n");
#endif
	InitModule_CONTEXT();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing DATE\n");
#endif
	InitModule_DATE();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing DATETIME\n");
#endif
	InitModule_DATETIME();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing DOWNLOAD\n");
#endif
	InitModule_DOWNLOAD();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing GETTEXT\n");
#endif
	InitModule_GETTEXT();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing GRAPHICS\n");
#endif
	InitModule_GRAPHICS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing GROUPDAV\n");
#endif
	InitModule_GROUPDAV();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ICAL_MAPS\n");
#endif
	InitModule_ICAL_MAPS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ICAL_SUBST\n");
#endif
	InitModule_ICAL_SUBST();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ICONBAR\n");
#endif
	InitModule_ICONBAR();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ICONTHEME\n");
#endif
	InitModule_ICONTHEME();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing INETCONF\n");
#endif
	InitModule_INETCONF();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing JSONRENDERER\n");
#endif
	InitModule_JSONRENDERER();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing LISTSUB\n");
#endif
	InitModule_LISTSUB();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing MAILVIEW_RENDERERS\n");
#endif
	InitModule_MAILVIEW_RENDERERS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing MAINMENU\n");
#endif
	InitModule_MAINMENU();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing MARCHLIST\n");
#endif
	InitModule_MARCHLIST();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing MSG\n");
#endif
	InitModule_MSG();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing MSGRENDERERS\n");
#endif
	InitModule_MSGRENDERERS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing NETCONF\n");
#endif
	InitModule_NETCONF();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing NOTES\n");
#endif
	InitModule_NOTES();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing OPENID\n");
#endif
	InitModule_OPENID();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing PAGING\n");
#endif
	InitModule_PAGING();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing PARAMHANDLING\n");
#endif
	InitModule_PARAMHANDLING();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing PREFERENCES\n");
#endif
	InitModule_PREFERENCES();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing PROPFIND\n");
#endif
	InitModule_PROPFIND();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing PUSHMAIL\n");
#endif
	InitModule_PUSHMAIL();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing REPORT\n");
#endif
	InitModule_REPORT();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ROOMCHAT\n");
#endif
	InitModule_ROOMCHAT();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ROOMLIST\n");
#endif
	InitModule_ROOMLIST();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ROOMOPS\n");
#endif
	InitModule_ROOMOPS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ROOMTOKENS\n");
#endif
	InitModule_ROOMTOKENS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ROOMVIEWS\n");
#endif
	InitModule_ROOMVIEWS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing RSS\n");
#endif
	InitModule_RSS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SERVFUNC\n");
#endif
	InitModule_SERVFUNC();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SETUP_WIZARD\n");
#endif
	InitModule_SETUP_WIZARD();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SIEVE\n");
#endif
	InitModule_SIEVE();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SITECONFIG\n");
#endif
	InitModule_SITECONFIG();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SITEMAP\n");
#endif
	InitModule_SITEMAP();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SMTP_QUEUE\n");
#endif
	InitModule_SMTP_QUEUE();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing STATIC\n");
#endif
	InitModule_STATIC();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SUBST\n");
#endif
	InitModule_SUBST();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SUMMARY\n");
#endif
	InitModule_SUMMARY();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SYSMSG\n");
#endif
	InitModule_SYSMSG();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing TASKS\n");
#endif
	InitModule_TASKS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing USEREDIT\n");
#endif
	InitModule_USEREDIT();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing VCARD\n");
#endif
	InitModule_VCARD();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing WEBCIT\n");
#endif
	InitModule_WEBCIT();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing WHO\n");
#endif
	InitModule_WHO();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing WIKI\n");
#endif
	InitModule_WIKI();
}


void initialise2_modules (void)
{

#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing MSGRENDERERS\n");
#endif
	InitModule2_MSGRENDERERS();
}


void shutdown_modules (void)
{

#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down CONTEXT\n");
#endif
	ServerShutdownModule_CONTEXT();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down DAV\n");
#endif
	ServerShutdownModule_DAV();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down GETTEXT\n");
#endif
	ServerShutdownModule_GETTEXT();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down ICAL\n");
#endif
	ServerShutdownModule_ICAL();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down ICONBAR\n");
#endif
	ServerShutdownModule_ICONBAR();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down ICONTHEME\n");
#endif
	ServerShutdownModule_ICONTHEME();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down MSGRENDERERS\n");
#endif
	ServerShutdownModule_MSGRENDERERS();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down PREFERENCES\n");
#endif
	ServerShutdownModule_PREFERENCES();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down SERV_FUNC\n");
#endif
	ServerShutdownModule_SERV_FUNC();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down SITECONFIG\n");
#endif
	ServerShutdownModule_SITECONFIG();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down SMTP_QUEUE\n");
#endif
	ServerShutdownModule_SMTP_QUEUE();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down STATIC\n");
#endif
	ServerShutdownModule_STATIC();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down SUBST\n");
#endif
	ServerShutdownModule_SUBST();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down VCARD\n");
#endif
	ServerShutdownModule_VCARD();
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Shutting down WEBCIT\n");
#endif
	ServerShutdownModule_WEBCIT();
}


void session_new_modules (wcsession *sess)
{

#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing GETTEXT\n");
#endif
	SessionNewModule_GETTEXT(sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing PREFERENCES\n");
#endif
	SessionNewModule_PREFERENCES(sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SUBST\n");
#endif
	SessionNewModule_SUBST(sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing TCPSOCKETS\n");
#endif
	SessionNewModule_TCPSOCKETS(sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing WEBCIT\n");
#endif
	SessionNewModule_WEBCIT(sess);
}


void session_attach_modules (wcsession *sess)
{

#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Attaching Session; GETTEXT\n");
#endif
	SessionAttachModule_GETTEXT(sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Attaching Session; PARAMHANDLING\n");
#endif
	SessionAttachModule_PARAMHANDLING(sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Attaching Session; SUBST\n");
#endif
	SessionAttachModule_SUBST(sess);
}


void session_detach_modules (wcsession *sess)
{

#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing MSG\n");
#endif
	SessionDetachModule_MSG(sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing PARAMHANDLING\n");
#endif
	SessionDetachModule_PARAMHANDLING(sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing _PREFERENCES\n");
#endif
	SessionDetachModule__PREFERENCES(sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SIEVE\n");
#endif
	SessionDetachModule_SIEVE(sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SUBST\n");
#endif
	SessionDetachModule_SUBST(sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing WEBCIT\n");
#endif
	SessionDetachModule_WEBCIT(sess);
}


void session_destroy_modules (wcsession **sess)
{

#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing AUTH\n");
#endif
	SessionDestroyModule_AUTH(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing GETTEXT\n");
#endif
	SessionDestroyModule_GETTEXT(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ICONBAR\n");
#endif
	SessionDestroyModule_ICONBAR(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ICONTHEME\n");
#endif
	SessionDestroyModule_ICONTHEME(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing MSGRENDERERS\n");
#endif
	SessionDestroyModule_MSGRENDERERS(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing PAGING\n");
#endif
	SessionDestroyModule_PAGING(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing PREFERENCES\n");
#endif
	SessionDestroyModule_PREFERENCES(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ROOMCHAT\n");
#endif
	SessionDestroyModule_ROOMCHAT(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing ROOMOPS\n");
#endif
	SessionDestroyModule_ROOMOPS(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SERVFUNC\n");
#endif
	SessionDestroyModule_SERVFUNC(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SITECONFIG\n");
#endif
	SessionDestroyModule_SITECONFIG(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing SUBST\n");
#endif
	SessionDestroyModule_SUBST(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing TCPSOCKETS\n");
#endif
	SessionDestroyModule_TCPSOCKETS(*sess);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Initializing WEBCIT\n");
#endif
	SessionDestroyModule_WEBCIT(*sess);
	free((*sess));
	(*sess) = NULL;
}



void http_new_modules (ParsedHttpHdrs *httpreq)
{
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "NEW AUTH\n");
#endif
	HttpNewModule_AUTH(httpreq);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "NEW CONTEXT\n");
#endif
	HttpNewModule_CONTEXT(httpreq);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "NEW TCPSOCKETS\n");
#endif
	HttpNewModule_TCPSOCKETS(httpreq);
}

void http_detach_modules (ParsedHttpHdrs *httpreq)
{
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Detaching AUTH\n");
#endif
	HttpDetachModule_AUTH(httpreq);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Detaching CONTEXT\n");
#endif
	HttpDetachModule_CONTEXT(httpreq);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Detaching TCPSOCKETS\n");
#endif
	HttpDetachModule_TCPSOCKETS(httpreq);
}

void http_destroy_modules (ParsedHttpHdrs *httpreq)
{
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Destructing AUTH\n");
#endif
	HttpDestroyModule_AUTH(httpreq);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Destructing CONTEXT\n");
#endif
	HttpDestroyModule_CONTEXT(httpreq);
#ifdef DBG_PRINNT_HOOKS_AT_START
	syslog(LOG_DEBUG, "Destructing TCPSOCKETS\n");
#endif
	HttpDestroyModule_TCPSOCKETS(httpreq);
}
