+StrBuf* GetNHBuf(int i, int allocit, StrBuf **NotifyHostList)
+{
+ if ((NotifyHostList[i] == NULL) && (allocit != 0))
+ NotifyHostList[i] = NewStrBuf();
+ return NotifyHostList[i];
+}
+
+
+StrBuf** GetNotifyHosts(void)
+{
+ char NotifyHostsBuf[SIZ];
+ StrBuf *Host;
+ StrBuf *File;
+ StrBuf *NotifyBuf;
+ int notify;
+ const char *pchs, *pche;
+ const char *NextHost = NULL;
+ StrBuf **NotifyHostList;
+ int num_notify;
+
+ /* See if we have any Notification Hosts configured */
+ num_notify = get_hosts(NotifyHostsBuf, "notify");
+ if (num_notify < 1)
+ return(NULL);
+
+ NotifyHostList = malloc(sizeof(StrBuf*) * 2 * (num_notify + 1));
+ memset(NotifyHostList, 0, sizeof(StrBuf*) * 2 * (num_notify + 1));
+
+ NotifyBuf = NewStrBufPlain(NotifyHostsBuf, -1);
+ /* get all configured notifiers's */
+ for (notify=0; notify<num_notify; notify++) {
+
+ Host = GetNHBuf(notify * 2, 1, NotifyHostList);
+ StrBufExtract_NextToken(Host, NotifyBuf, &NextHost, '|');
+ pchs = ChrPtr(Host);
+ pche = strchr(pchs, ':');
+ if (pche == NULL) {
+ CtdlLogPrintf(CTDL_ERR,
+ __FILE__": filename not found in %s.\n",
+ pchs);
+ continue;
+ }
+ File = GetNHBuf(notify * 2 + 1, 1, NotifyHostList);
+ StrBufPlain(File, pchs, pche - pchs);
+ StrBufCutLeft(Host, pche - pchs + 1);
+ }
+ return NotifyHostList;
+}
+
+