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);
ret = 1;
if (pb && (pad->flags & ADD_FLAG_LAZY)) { /* lazy is really cheap */
if (pad->flags & ADD_FLAG_VERBOSE)
- send_ret = pad->cc->use_sideband?
- send_sb_va(&pad->cc->scc, SBD_OUTPUT,
- "lazy-ignore: %s\n", path)
- :
- sc_send_va_buffer(&pad->cc->scc,
- "lazy-ignore: %s\n", path);
+ send_ret = send_sb_va(&pad->cc->scc, SBD_OUTPUT,
+ "lazy-ignore: %s\n", path);
goto out_free;
}
/* We still want to add this file. Compute its hash. */
ret = 1;
if (pb && hs && hs == pb && !(pad->flags & ADD_FLAG_FORCE)) {
if (pad->flags & ADD_FLAG_VERBOSE)
- send_ret = pad->cc->use_sideband?
- send_sb_va(&pad->cc->scc, SBD_OUTPUT,
- "%s exists, not forcing update\n", path)
- :
- sc_send_va_buffer(&pad->cc->scc,
- "%s exists, not forcing update\n", path);
+ send_ret = send_sb_va(&pad->cc->scc, SBD_OUTPUT,
+ "%s exists, not forcing update\n", path);
goto out_unmap;
}
/*
munmap(map.data, map.size);
close(fd);
if (pad->flags & ADD_FLAG_VERBOSE) {
- send_ret = pad->cc->use_sideband?
- send_sb_va(&pad->cc->scc, SBD_OUTPUT,
- "adding %s\n", path)
- :
- sc_send_va_buffer(&pad->cc->scc,
- "adding %s\n", path);
+ send_ret = send_sb_va(&pad->cc->scc, SBD_OUTPUT,
+ "adding %s\n", path);
if (send_ret < 0)
goto out_free;
}
munmap(map.data, map.size);
out_free:
if (ret < 0 && send_ret >= 0)
- send_ret = pad->cc->use_sideband?
- send_sb_va(&pad->cc->scc, SBD_ERROR_LOG,
- "failed to add %s (%s)\n", path,
- para_strerror(-ret))
- :
- sc_send_va_buffer(&pad->cc->scc,
- "failed to add %s (%s)\n", path,
- para_strerror(-ret));
+ send_ret = send_sb_va(&pad->cc->scc, SBD_ERROR_LOG,
+ "failed to add %s (%s)\n", path, para_strerror(-ret));
free(obj.data);
clear_afhi(afhi_ptr);
/* Stop adding files only on send errors. */
char *path;
ret = verify_path(cc->argv[i], &path);
if (ret < 0) {
- ret = cc->use_sideband?
- send_sb_va(&cc->scc, SBD_ERROR_LOG, "%s: %s\n",
- cc->argv[i], para_strerror(-ret))
- :
- sc_send_va_buffer(&cc->scc, "%s: %s\n",
+ ret = send_sb_va(&cc->scc, SBD_ERROR_LOG, "%s: %s\n",
cc->argv[i], para_strerror(-ret));
if (ret < 0)
return ret;
}
ret = stat(path, &statbuf);
if (ret < 0) {
- ret = cc->use_sideband?
- send_sb_va(&cc->scc, SBD_ERROR_LOG,
- "failed to stat %s (%s)\n", path,
- strerror(errno))
- :
- sc_send_va_buffer(&cc->scc,
- "failed to stat %s (%s)\n", path,
- strerror(errno));
+ ret = send_sb_va(&cc->scc, SBD_ERROR_LOG,
+ "failed to stat %s (%s)\n", path,
+ strerror(errno));
free(path);
if (ret < 0)
return ret;
else
ret = add_one_audio_file(path, &pad);
if (ret < 0) {
- if (cc->use_sideband)
- send_sb_va(&cc->scc, SBD_OUTPUT, "%s: %s\n", path,
- para_strerror(-ret));
- else
- sc_send_va_buffer(&cc->scc, "%s: %s\n", path,
- para_strerror(-ret));
+ send_sb_va(&cc->scc, SBD_OUTPUT, "%s: %s\n", path,
+ para_strerror(-ret));
free(path);
return ret;
}