From 9ca43c73ba29d6b42cd771f1567074418c883c3e Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Wed, 8 Feb 2017 15:21:19 +0100 Subject: Changes knowledge structure, defines protocol. --- src/knowledge/knowledge.c | 12 ++++++++++++ src/knowledge/knowledge.h | 5 ++--- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src/knowledge') diff --git a/src/knowledge/knowledge.c b/src/knowledge/knowledge.c index c9bfc2a..5ce6917 100644 --- a/src/knowledge/knowledge.c +++ b/src/knowledge/knowledge.c @@ -56,3 +56,15 @@ void ZoO_knowledge_unlock_access { pthread_mutex_unlock(&(k->mutex)); } + +void ZoO_knowledge_get_word +( + const struct ZoO_knowledge k [const static 1], + const ZoO_index word_ref, + const ZoO_char * word [const restrict static 1], + ZoO_index word_length [const restrict static 1] +) +{ + *word = k->words[word_ref].word; + *word_length = k->words[word_ref].word_length; +} diff --git a/src/knowledge/knowledge.h b/src/knowledge/knowledge.h index 7f1bb42..e97d84e 100644 --- a/src/knowledge/knowledge.h +++ b/src/knowledge/knowledge.h @@ -61,13 +61,12 @@ int ZoO_knowledge_learn_markov_sequence const struct ZoO_pipe io [const restrict static 1] ); -int ZoO_knowledge_get_word +void ZoO_knowledge_get_word ( const struct ZoO_knowledge k [const static 1], const ZoO_index word_ref, const ZoO_char * word [const restrict static 1], - ZoO_index word_size [const restrict static 1], - const struct ZoO_pipe io [const restrict static 1] + ZoO_index word_length [const restrict static 1] ); /* -- cgit v1.2.3-70-g09d2