* migrate the WHO struct to strbuf
[citadel.git] / webcit / webserver.c
index 315f26727c641e8c2cd7a317e903056bb1c7617f..a550f49280dd0a5b46028806009e3bacd5a37d55 100644 (file)
@@ -587,7 +587,9 @@ void spawn_another_worker_thread()
 const char foobuf[32];
 const char *nix(void *vptr) {snprintf(foobuf, 32, "%0x", (long) vptr); return foobuf;}
 #endif 
+void InitTemplateCache(void);
 
+extern void LoadZoneFiles(void);
 /*
  * \brief Here's where it all begins.
  * \param argc number of commandline args
@@ -617,8 +619,14 @@ int main(int argc, char **argv)
 
        HandlerHash = NewHash(1, NULL);
        PreferenceHooks = NewHash(1, NULL);
+       WirelessTemplateCache = NewHash(1, NULL);
+       WirelessLocalTemplateCache = NewHash(1, NULL);
+       LocalTemplateCache = NewHash(1, NULL);
+       TemplateCache = NewHash(1, NULL);
+       GlobalNS = NewHash(1, NULL);
+       Iterators = NewHash(1, NULL);
+       LoadZoneFiles();
 
-       initialise_modules();
 
 #ifdef DBG_PRINNT_HOOKS_AT_START
        dbg_PrintHash(HandlerHash, nix, NULL);
@@ -790,6 +798,9 @@ int main(int argc, char **argv)
                perror("chdir");
        }
        LoadIconDir(static_icon_dir);
+       InitTemplateCache();
+
+       initialise_modules();
        initialize_viewdefs();
        initialize_axdefs();
 
@@ -940,6 +951,12 @@ void worker_entry(void)
                                ShutDownLibCitadel ();
                                DeleteHash(&HandlerHash);
                                DeleteHash(&PreferenceHooks);
+                               DeleteHash(&GlobalNS);
+                               DeleteHash(&WirelessTemplateCache);
+                               DeleteHash(&WirelessLocalTemplateCache);
+                               DeleteHash(&TemplateCache);
+                               DeleteHash(&LocalTemplateCache);
+                               DeleteHash(&Iterators);
 #ifdef ENABLE_NLS
                                void ShutdownLocale(void);
 #endif