* migrate the WHO struct to strbuf
[citadel.git] / webcit / siteconfig.c
index 1a32942eaecb66f947e6e0ca303add2901298224..25e8ae034235c5afbb39b4d7581cba35bb892b4d 100644 (file)
@@ -8,6 +8,39 @@
 #include "webcit.h"
 #include "webserver.h"
 
+
+HashList *ZoneHash = NULL;
+
+
+
+void LoadZoneFiles(void)
+{
+       icalarray *zones;
+       int z;
+       long len;
+       char this_zone[128];
+       char *ZName;
+       HashPos  *it;
+
+       ZoneHash = NewHash(1, NULL);
+       len = sizeof("UTC") + 1;
+       ZName = malloc(len + 1);
+       memcpy(ZName, "UTC", len + 1);
+       Put(ZoneHash, ZName, len, ZName, NULL);
+       zones = icaltimezone_get_builtin_timezones();
+       for (z = 0; z < zones->num_elements; ++z) {
+               strcpy(this_zone, icaltimezone_get_location(icalarray_element_at(zones, z)));
+               len = strlen(this_zone);
+               ZName = (char*)malloc(len +1);
+               memcpy(ZName, this_zone, len + 1);
+               Put(ZoneHash, ZName, len, ZName, NULL);
+       }
+       SortByHashKey(ZoneHash, 0);
+}
+
+
+
+
 /*
  * \brief display all configuration items
  */