-/*
- * Copyright (C) 2007 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2007 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
/** \file score.c Scoring functions to determine the audio file streaming order. */
#include <regex.h>
return NUM_COMPARE(d1, d2);
}
-/**
- * Compare the score of two audio files
- *
- * \param obj1 Pointer to the first score object.
- * \param obj2 Pointer to the second score object.
- *
- * 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.
+/*
+ * This function first compares the score values. If they are equal, the
+ * addresses of the two objects are compared. Thus, the function returns
+ * "equal" only if the two objects alias each other, i.e., point to the same
+ * memory address.
*/
static int score_compare(const struct osl_object *obj1, const struct osl_object *obj2)
{
return osl(osl_get_num_rows(score_table, num));
}
-/**
- * Get the score of the audio file associated with given row of the score table.
- *
- * \param score_row Pointer to the row in the score table.
- * \param score Result is returned here on success.
- *
- * On errors (negative return value) the content of \a score is undefined.
- *
- * \return The return value of the underlying call to osl_get_object().
- */
+/* On errors (negative return value) the content of score is undefined. */
static int get_score_of_row(void *score_row, long *score)
{
struct osl_object obj;
* \param score Result pointer.
* \param aft_row Result pointer.
*
- * \return Negative on errors, positive on success. Possible errors: Errors
- * returned by osl_get_object().
+ * \return Standard.
*/
int get_score_and_aft_row(struct osl_row *score_row, long *score,
struct osl_row **aft_row)
* \param aft_row Points to the row in the aft of the "best" audio file.
* \param score Highest score value in the score table.
*
- * \return Positive on success, negative on errors. Possible errors: Errors
- * returned by osl_rbtree_last_row(), osl_get_object().
+ * \return Standard.
*/
int score_get_best(struct osl_row **aft_row, long *score)
{
*
* \param aft_row The file which is no longer admissible.
*
- * \return Positive on success, negative on errors. Possible errors:
- * Errors returned by osl_get_row() and osl_del_row().
+ * \return Standard.
*
* \sa \ref score_add().
*/
return 1;
}
-/* Close the score table. */
static void score_close(void)
{
osl_close_table(score_table, OSL_FREE_VOLATILE);
score_table = NULL;
}
-/**
- * Open the score table.
- *
- * \param dir Unused.
- *
- * \return The return value of the underlying call to osl_open_table().
- */
static int score_open(__a_unused const char *dir)
{
score_table_desc.dir = NULL; /* this table has only volatile columns */