diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-11-16 23:42:23 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-11-16 23:42:23 +0100 |
commit | 517600329eaaa144d3c26b02bab75cd30e49dac9 (patch) | |
tree | 7f9afbae97554297ac39ebfcaf9cca241f9871a7 /parsing.c | |
parent | 6a9af570e7288df584504c7167ba4c1f76cafced (diff) |
Store words.
Diffstat (limited to 'parsing.c')
-rw-r--r-- | parsing.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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(); |