summaryrefslogtreecommitdiff
path: root/parsing.c
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-11-16 23:42:23 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-11-16 23:42:23 +0100
commit517600329eaaa144d3c26b02bab75cd30e49dac9 (patch)
tree7f9afbae97554297ac39ebfcaf9cca241f9871a7 /parsing.c
parent6a9af570e7288df584504c7167ba4c1f76cafced (diff)
Store words.
Diffstat (limited to 'parsing.c')
-rw-r--r--parsing.c15
1 files changed, 15 insertions, 0 deletions
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();