From 517600329eaaa144d3c26b02bab75cd30e49dac9 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 16 Nov 2010 23:42:23 +0100 Subject: Store words. --- parsing.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'parsing.c') diff --git a/parsing.c b/parsing.c index 6759104..4dc03cd 100644 --- a/parsing.c +++ b/parsing.c @@ -336,6 +336,19 @@ static void save_users(int channel_id) { } } +static void save_words(int channel_id) { + for(int i = 0; i < WORDS_MAX; i++) { + struct word_t *word = &words[i]; + if(!word->name) + continue; + + while(word) { + pg_word_set(channel_id, word); + word = word->next; + } + } +} + void process() { /* Parsing stuff goes here. */ for(int chan_i = 0; chan_i < channel_get_count(); chan_i++) { @@ -344,6 +357,7 @@ void process() { struct channel_t *channel = channel_get(chan_i); int channel_id = pg_channel_get(channel); pg_users_get(channel_id); + pg_word_get(channel_id); printf("Channel %s\n", channel->name); struct channel_file_t *file = channel->files; while(file) { @@ -371,6 +385,7 @@ void process() { } save_users(channel_id); + save_words(channel_id); user_free(); word_free(); -- cgit v1.2.3