]>
jfr.im git - irc/quakenet/newserv.git/blob - qabot/qabot_texts.c
5 #include "../nick/nick.h"
6 #include "../localuser/localuserchannel.h"
7 #include "../core/hooks.h"
8 #include "../core/schedule.h"
9 #include "../lib/array.h"
10 #include "../lib/base64.h"
11 #include "../lib/irc_string.h"
12 #include "../lib/splitline.h"
16 void qabot_freetext(qab_bot
* bot
, qab_text
* text
) {
17 qab_textsection
* section
;
18 qab_textsection
* nsection
;
20 for (section
= text
->sections
; section
; section
= nsection
) {
21 nsection
= section
->next
;
22 qabot_freesection(text
, section
);
26 text
->next
->prev
= text
->prev
;
28 text
->prev
->next
= text
->next
;
30 bot
->texts
= text
->next
;
34 void qabot_freesection(qab_text
* text
, qab_textsection
* section
) {
38 for (line
= section
->lines
; line
; line
= nline
) {
46 section
->next
->prev
= section
->prev
;
48 section
->prev
->next
= section
->next
;
50 text
->sections
= section
->next
;
52 if (text
->section_tail
== section
)
53 text
->section_tail
= section
->prev
;
57 text
->section_count
--;
58 if (text
->section_count
< 0)
59 text
->section_count
= 0;