/*
- * Copyright (C) 2007-2013 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2007-2014 Andre Noll <maan@tuebingen.mpg.de>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
AFSI_SIZE = 32
};
-/**
+/*
* Convert a struct afs_info to an osl object.
*
* \param afsi Pointer to the audio file info to be converted.
*
* \sa load_afsi().
*/
-void save_afsi(struct afs_info *afsi, struct osl_object *obj)
+static void save_afsi(struct afs_info *afsi, struct osl_object *obj)
{
char *buf = obj->data;
memset(buf + AFSI_AUDIO_FORMAT_UNUSED_OFFSET, 0, 2);
}
-/**
- * Get the audio file selector info struct stored in an osl object.
+/*
+ * Get the audio file selector info struct stored in an osl object.
*
* \param afsi Points to the audio_file info structure to be filled in.
* \param obj The osl object holding the data.
*
- * \return Positive on success, negative on errors. Possible errors: \p E_BAD_AFS.
+ * \return Standard.
*
* \sa save_afsi().
*/
-int load_afsi(struct afs_info *afsi, struct osl_object *obj)
+static int load_afsi(struct afs_info *afsi, struct osl_object *obj)
{
char *buf = obj->data;
if (obj->size < AFSI_SIZE)
return osl(osl_get_row(audio_file_table, AFTCOL_HASH, &obj, row));
}
-/**
- * Get the osl object holding the audio file selector info of a row.
+/*
+ * Get the audio file selector info object of a row.
*
* \param row Pointer to a row in the audio file table.
* \param obj Result pointer.
*
* \return Standard.
*/
-int get_afsi_object_of_row(const struct osl_row *row, struct osl_object *obj)
+static int get_afsi_object_of_row(const struct osl_row *row,
+ struct osl_object *obj)
{
return osl(osl_get_object(audio_file_table, row, AFTCOL_AFSI, obj));
}
return load_afsi(afsi, &obj);
}
-/**
+/*
* Get the audio file selector info, given the path of an audio table.
*
* \param path The full path of the audio file.
* \param afsi Result pointer.
*
- * \return Positive on success, negative on errors.
+ * \return Standard.
*/
-int get_afsi_of_path(const char *path, struct afs_info *afsi)
+static int get_afsi_of_path(const char *path, struct afs_info *afsi)
{
struct osl_object obj;
int ret = get_afsi_object_of_path(path, &obj);
}
}
-
static int write_attribute_items(struct para_buffer *b,
const char *att_bitmap, struct afs_info *afsi)
{
AFTCOL_CHUNKS, &chunk_table_obj);
if (ret < 0)
goto err;
- ret = mmap_full_file(path, O_RDONLY, &map.data,
- &map.size, &afd->fd);
+ ret = mmap_full_file(path, O_RDONLY, &map.data, &map.size, &afd->fd);
if (ret < 0)
goto err;
hash_function(map.data, map.size, file_hash);
free(path);
}
return 1;
-
}
/**
out:
if (ret < 0)
para_printf(&cad.pb, "%s\n", para_strerror(-ret));
- else if (cad.flags & CPSI_FLAG_VERBOSE) {
- if (pmd.num_matches > 0)
+ else if (pmd.num_matches > 0) {
+ if (cad.flags & CPSI_FLAG_VERBOSE)
para_printf(&cad.pb, "copied requested afsi from %s "
"to %u files\n", source_path, pmd.num_matches);
- else
- para_printf(&cad.pb, "nothing copied\n");
- }
+ } else
+ para_printf(&cad.pb, "no matches - nothing copied\n");
if (cad.pb.offset)
pass_buffer_as_shm(fd, SBD_OUTPUT, cad.pb.buf, cad.pb.offset);
free(cad.pb.buf);
* is used to pass the status items from the afs process to the command handler
* via a shared memory area and a pipe.
*
- * \return The return value of the underyling call to \ref send_callback_request().
+ * \return The return value of the underlying call to \ref send_callback_request().
*/
int send_afs_status(struct command_context *cc, int parser_friendly)
{
{
int ret;
- switch(event) {
+ switch (event) {
case ATTRIBUTE_REMOVE: {
const struct rmatt_event_data *red = data;
ret = para_printf(pb, "clearing attribute %s (bit %u) from all "