]>
jfr.im git - irc/quakenet/newserv.git/blob - chandump/chandump.c
3 #include "../core/schedule.h"
4 #include "../channel/channel.h"
5 #include "../lib/version.h"
11 void dodump(void *arg
) {
15 FILE *fp
= fopen("chandump/chandump.txt.1", "w");
19 for(i
=0;i
<CHANNELHASHSIZE
;i
++)
20 for(c
=chantable
[i
];c
;c
=c
->next
)
21 if(c
->channel
&& !IsSecret(c
->channel
))
22 fprintf(fp
, "%s %d%s%s\n", c
->name
->content
, c
->channel
->users
->totalusers
, (c
->channel
->topic
&&c
->channel
->topic
->content
)?" ":"", (c
->channel
->topic
&&c
->channel
->topic
->content
)?c
->channel
->topic
->content
:"");
26 rename("chandump/chandump.txt.1", "chandump/chandump.txt");
30 dumpsched
= (void *)schedulerecurring(time(NULL
), 0, 300, &dodump
, NULL
);
34 deleteschedule(dumpsched
, &dodump
, NULL
);