X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=score.c;h=a044faa3e23991044763e5838ff45cc3e82d927f;hb=df6c02e4cef98215b797d646508e7e038527b1ea;hp=6c15a0f571e8cd79647493910f64edc7679c947c;hpb=cb6d1dfb9e4067229a4bbde0abd05784d97ef14b;p=paraslash.git diff --git a/score.c b/score.c index 6c15a0f5..a044faa3 100644 --- a/score.c +++ b/score.c @@ -78,7 +78,6 @@ static struct osl_column_description score_cols[] = { }; static struct osl_table_description score_table_desc = { - .dir = DATABASE_DIR, .name = "score", .num_columns = NUM_SCORE_COLUMNS, .flags = 0, @@ -199,7 +198,7 @@ int score_update(const struct osl_row *aft_row, long percent) obj.size = sizeof(long); obj.data = para_malloc(obj.size); *(long *)obj.data = new_score; - PARA_NOTICE_LOG("new score: %ld, position: %u/%u\n", new_score, + PARA_DEBUG_LOG("new score: %ld, position: %u/%u\n", new_score, new_pos, n); return osl_update_object(score_table, row, SCORECOL_SCORE, &obj); } @@ -343,19 +342,22 @@ int row_belongs_to_score_table(const struct osl_row *aft_row) void score_shutdown(enum osl_close_flags flags) { osl_close_table(score_table, flags | OSL_FREE_VOLATILE); + score_table = NULL; } /** * Init the scoring subsystem. * * \param ti Gets filled in by the function. + * \param db 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) +int score_init(struct table_info *ti, const char *db) { + score_table_desc.dir = db; ti->desc = &score_table_desc; ti->flags = TBLFLAG_SKIP_CREATE; int ret = osl_open_table(ti->desc, &ti->table);