X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsitemap.c;h=cab60d43ec01307ceef379db619a34fe0a22c485;hb=4b4dc864ede7c5d8d956febe4a0afb422b78e7c4;hp=37fe310a80ba696f69fc3dc6cc18bfea5e875be8;hpb=adeff234b250f586885cab1965a462709788f7e1;p=citadel.git diff --git a/webcit/sitemap.c b/webcit/sitemap.c index 37fe310a8..cab60d43e 100644 --- a/webcit/sitemap.c +++ b/webcit/sitemap.c @@ -36,7 +36,7 @@ void sitemap_do_bbs(void) { Stat.maxload = INT_MAX; Stat.lowest_found = (-1); Stat.highest_found = (-1); - num_msgs = load_msg_ptrs("MSGS ALL", &Stat, NULL); + num_msgs = load_msg_ptrs("MSGS ALL", NULL, &Stat, NULL); if (num_msgs < 1) return; for (i=0; iroomname = NewStrBufPlain(roomname_plain, -1); + ptr->defview = extract_int(buf, 6); + ptr->next = roomlist; + roomlist = ptr; + } + + return(roomlist); +} + + /* * Entry point for RSS feed generator */ void sitemap(void) { - HashList *roomlist; - HashPos *it; - long HKlen; - const char *HashKey; - folder *room; - + struct sitemap_room_list *roomlist = NULL; output_headers(0, 0, 0, 0, 1, 0); hprintf("Content-type: text/xml\r\n"); hprintf( @@ -148,15 +173,14 @@ void sitemap(void) { wc_printf("\r\n"); wc_printf("\r\n"); - roomlist = GetRoomListHashLKRA(NULL, NULL); - it = GetNewHashPos(roomlist, 0); + roomlist = sitemap_load_roomlist(); - while (GetNextHashPos(roomlist, it, &HKlen, &HashKey, (void *)&room)) + while (roomlist != NULL) { - gotoroom(room->name); + gotoroom(roomlist->roomname); /* Output the messages in this room only if it's a room type we can make sense of */ - switch(room->defview) { + switch(roomlist->defview) { case VIEW_BBS: sitemap_do_bbs(); break; @@ -169,10 +193,12 @@ void sitemap(void) { default: break; } - } - DeleteHashPos(&it); - /* No need to DeleteHash(&roomlist) -- it will be freed when the session closes */ + struct sitemap_room_list *ptr = roomlist; + roomlist = roomlist->next; + FreeStrBuf(&ptr->roomname); + free(ptr); + } wc_printf("\r\n"); wDumpContent(0);