X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=score.c;h=983589333f088b600d85d9c0271044d7a21f8eb7;hp=f1afd22be7bc5c580312ca8eca3d128d1044dee0;hb=23dd2200dd4fc74025ae87f5c2127f3b0ff71e9b;hpb=a731a7c6e78fb137268b42062d9fb08b4e49a2c8 diff --git a/score.c b/score.c index f1afd22b..98358933 100644 --- a/score.c +++ b/score.c @@ -1,12 +1,9 @@ -/* - * Copyright (C) 2007-2014 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2007 Andre Noll , see file COPYING. */ /** \file score.c Scoring functions to determine the audio file streaming order. */ #include #include +#include #include "para.h" #include "error.h" @@ -33,8 +30,6 @@ static int ptr_compare(const struct osl_object *obj1, const struct osl_object *o * This function first compares the score values as usual integers. If they compare as * equal, the address of \a obj1 and \a obj2 are compared. So this compare function * returns zero if and only if \a obj1 and \a obj2 point to the same memory area. - * - * \sa osl_compare_function. */ static int score_compare(const struct osl_object *obj1, const struct osl_object *obj2) { @@ -71,7 +66,7 @@ static struct osl_column_description score_cols[] = { }, [SCORECOL_SCORE] = { .storage_type = OSL_NO_STORAGE, - .storage_flags = OSL_RBTREE | OSL_FIXED_SIZE, + .storage_flags = OSL_RBTREE | OSL_FIXED_SIZE | OSL_UNIQUE, .name = "score", .compare_function = score_compare, .data_size = sizeof(long) @@ -91,8 +86,6 @@ static struct osl_table_description score_table_desc = { * \param num Result is returned here. * * \return Positive on success, negative on errors. - * - * \sa osl_get_num_rows(). */ int get_num_admissible_files(unsigned *num) { @@ -245,29 +238,12 @@ static int get_score_row_from_aft_row(const struct osl_row *aft_row, * * This is used for the ls command. The \a data parameter is passed as the * second argument to \a func. - * - * \sa admissible_file_loop_reverse(). */ int admissible_file_loop(void *data, osl_rbtree_loop_func *func) { return osl(osl_rbtree_loop(score_table, SCORECOL_SCORE, data, func)); } -/** - * Loop over all files in the score table in reverse order. - * - * \param data As in admissible_file_loop(). - * \param func As in admissible_file_loop(). - * - * \return Same return value as admissible_file_loop(). - * - * \sa admissible_file_loop(), osl_rbtree_loop_reverse(). - */ -int admissible_file_loop_reverse(void *data, osl_rbtree_loop_func *func) -{ - return osl(osl_rbtree_loop_reverse(score_table, SCORECOL_SCORE, data, func)); -} - /** * Get the admissible audio file with highest score. * @@ -300,7 +276,7 @@ int score_get_best(struct osl_row **aft_row, long *score) * \return Positive on success, negative on errors. Possible errors: * Errors returned by osl_get_row() and osl_del_row(). * - * \sa score_add(), score_shutdown(). + * \sa \ref score_add(). */ int score_delete(const struct osl_row *aft_row) {