+
+void initialize_noise_words(void)
+{
+ int i;
+ int len;
+ int ch;
+ noise_word *next;
+
+ memset (noise_words, 0, sizeof(noise_words));
+
+ for (i=0; i<(sizeof(noise_words_init)/sizeof(char *)); ++i)
+ {
+ ch = noise_words_init[i][0] - 'a';
+ len = strlen(noise_words_init[i]);
+
+ next = malloc(sizeof(noise_word));
+ next->len = len;
+ next->word = strdup(noise_words_init[i]);
+ next->next = noise_words[ch];
+ noise_words[ch] = next;
+ }
+}
+
+
+void noise_word_cleanup(void)
+{
+ int i;
+ noise_word *cur, *next;
+
+ CtdlLogPrintf(CTDL_INFO, "Cleaning up fulltext noise words.\n");
+
+ for (i = 0 ; i < 26 ; i++)
+ {
+ cur = noise_words[i];
+ while (cur)
+ {
+ next = cur->next;
+ free(cur->word);
+ free(cur);
+ cur = next;
+ }
+ }
+}
+