/*
- * Copyright (C) 2007-2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2007-2009 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** \file mood.c Paraslash's mood handling functions. */
#include <fnmatch.h>
+#include <osl.h>
#include "para.h"
#include "error.h"
#include "string.h"
* Used for scoring and to determine whether a file is admissible.
*/
struct mood_method {
- /* The name of the method. */
+ /** The name of the method. */
const char *name;
/** Pointer to the mood parser. */
mood_parser *parser;
struct osl_object mood_def;
struct mood_line_parser_data mlpd = {.line_num = 0};
- int ret2, ret = mood_get_name_and_def_by_row(mood_row, &mood_name, &mood_def);
+ int ret = mood_get_name_and_def_by_row(mood_row, &mood_name, &mood_def);
if (ret < 0) {
- ret2 = para_printf(pb, "failed to get mood definition: %s\n",
+ para_printf(pb, "failed to get mood definition: %s\n",
para_strerror(-ret));
return ret;
}
ret = for_each_line_ro(mood_def.data, mood_def.size,
parse_mood_line, &mlpd);
if (ret < 0)
- ret2 = para_printf(pb, "%s line %u: %s\n", mood_name, mlpd.line_num,
+ para_printf(pb, "%s line %u: %s\n", mood_name, mlpd.line_num,
para_strerror(-ret));
out:
osl_close_disk_object(&mood_def);
.data = mood_name,
.size = strlen(mood_name) + 1
};
- ret = osl_get_row(moods_table, BLOBCOL_NAME, &obj, &row);
+ ret = osl(osl_get_row(moods_table, BLOBCOL_NAME, &obj, &row));
if (ret < 0) {
PARA_NOTICE_LOG("no such mood: %s\n", mood_name);
return ret;