X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=score.c;h=e233f7352c19af0c6f23a47030d024e334cb0239;hp=ad147bba1ef7dc9ac90fbcb30e20a267e0376160;hb=53d503ce;hpb=cc18590c9eeba5caef75e7d7ac495ac3dbf58c69 diff --git a/score.c b/score.c index ad147bba..e233f735 100644 --- a/score.c +++ b/score.c @@ -7,10 +7,10 @@ /** \file score.c Scoring functions to determine the audio file streaming order. */ #include "para.h" #include "error.h" +#include "string.h" #include "afh.h" #include "afs.h" #include "list.h" -#include "string.h" static struct osl_table *score_table; @@ -330,33 +330,36 @@ int row_belongs_to_score_table(const struct osl_row *aft_row) return ret; } -/** - * Close the score table. - * - * \param flags Options passed to osl_close_table(). - * - * \sa score_init(). - */ -void score_shutdown(enum osl_close_flags flags) +/* Close the score table. */ +static void score_close(void) { - osl_close_table(score_table, flags | OSL_FREE_VOLATILE); + osl_close_table(score_table, OSL_FREE_VOLATILE); score_table = NULL; } /** - * Init the scoring subsystem. + * Open the score table. * - * \param ti Gets filled in by the function. - * \param db The database directory. + * \param dir The database directory. * * \return The return value of the underlying call to osl_open_table(). * * \sa score_shutdown(). */ -int score_init(struct table_info *ti, const char *db) +static int score_open(const char *dir) +{ + score_table_desc.dir = dir; + return osl_open_table(&score_table_desc, &score_table); +} + +/** + * Initialize the scoring subsystem. + * + * \param t Members Gets filled in by the function. + */ +void score_init(struct afs_table *t) { - score_table_desc.dir = db; - ti->desc = &score_table_desc; - ti->flags = TBLFLAG_SKIP_CREATE; - return osl_open_table(ti->desc, &score_table); + t->name = score_table_desc.name; + t->open = score_open; + t->close = score_close; }