{
const struct osl_object obj = {.data = hash, .size = HASH_SIZE};
return osl(osl_get_row(audio_file_table, AFTCOL_HASH, &obj, row));
{
const struct osl_object obj = {.data = hash, .size = HASH_SIZE};
return osl(osl_get_row(audio_file_table, AFTCOL_HASH, &obj, row));
static int make_status_items(struct audio_file_data *afd,
struct afs_info *afsi, char *path, long score,
static int make_status_items(struct audio_file_data *afd,
struct afs_info *afsi, char *path, long score,
int open_and_update_audio_file(struct osl_row *aft_row, long score,
struct audio_file_data *afd)
{
int open_and_update_audio_file(struct osl_row *aft_row, long score,
struct audio_file_data *afd)
{
struct osl_object afsi_obj;
struct afs_info old_afsi, new_afsi;
int ret = get_hash_of_row(aft_row, &aft_hash);
struct osl_object afsi_obj;
struct afs_info old_afsi, new_afsi;
int ret = get_hash_of_row(aft_row, &aft_hash);
opts.mode = mode;
opts.num_patterns = argc - i;
ret = send_option_arg_callback_request(&query, opts.num_patterns,
opts.mode = mode;
opts.num_patterns = argc - i;
ret = send_option_arg_callback_request(&query, opts.num_patterns,
- argv + i, com_ls_callback, rc4_send_result, rc4c);
+ argv + i, com_ls_callback, sc_send_result, scc);
* It's OK to call this with afhi == NULL. In this case, the audio format
* handler info won't be stored in the buffer.
*/
* It's OK to call this with afhi == NULL. In this case, the audio format
* handler info won't be stored in the buffer.
*/
struct afh_info *afhi, uint32_t flags,
uint8_t audio_format_num, struct osl_object *obj)
{
struct afh_info *afhi, uint32_t flags,
uint8_t audio_format_num, struct osl_object *obj)
{
struct osl_row *pb, *aft_row;
struct osl_row *hs;
struct osl_object objs[NUM_AFT_COLUMNS];
struct osl_row *pb, *aft_row;
struct osl_row *hs;
struct osl_object objs[NUM_AFT_COLUMNS];
.max_size_handler = pass_buffer_as_shm, .private_data = &fd};
uint16_t afhi_offset, chunks_offset;
.max_size_handler = pass_buffer_as_shm, .private_data = &fd};
uint16_t afhi_offset, chunks_offset;
objs[AFTCOL_CHUNKS].size = query->size - chunks_offset;
if (pb && !hs) { /* update pb's hash */
char old_asc[2 * HASH_SIZE + 1];
objs[AFTCOL_CHUNKS].size = query->size - chunks_offset;
if (pb && !hs) { /* update pb's hash */
char old_asc[2 * HASH_SIZE + 1];
- /** The socket file descriptor, including rc4 keys. */
- struct rc4_context *rc4c;
+ /** The socket file descriptor, including stream cipher keys. */
+ struct stream_cipher_context *scc;
struct afh_info afhi, *afhi_ptr = NULL;
struct osl_row *pb = NULL, *hs = NULL; /* path brother/hash sister */
struct osl_object map, obj = {.data = NULL}, query;
struct afh_info afhi, *afhi_ptr = NULL;
struct osl_row *pb = NULL, *hs = NULL; /* path brother/hash sister */
struct osl_object map, obj = {.data = NULL}, query;
ret = 1;
if (pb && (pad->flags & ADD_FLAG_LAZY)) { /* lazy is really cheap */
if (pad->flags & ADD_FLAG_VERBOSE)
ret = 1;
if (pb && (pad->flags & ADD_FLAG_LAZY)) { /* lazy is really cheap */
if (pad->flags & ADD_FLAG_VERBOSE)
munmap(map.data, map.size);
close(fd);
if (pad->flags & ADD_FLAG_VERBOSE) {
munmap(map.data, map.size);
close(fd);
if (pad->flags & ADD_FLAG_VERBOSE) {
if (send_ret < 0)
goto out_free;
}
save_add_callback_buffer(hash, path, afhi_ptr, pad->flags, format_num, &obj);
/* Ask afs to consider this entry for adding. */
if (send_ret < 0)
goto out_free;
}
save_add_callback_buffer(hash, path, afhi_ptr, pad->flags, format_num, &obj);
/* Ask afs to consider this entry for adding. */
- ret = send_callback_request(com_add_callback, &obj, rc4_send_result, pad->rc4c);
+ ret = send_callback_request(com_add_callback, &obj, sc_send_result, pad->scc);
munmap(map.data, map.size);
out_free:
if (ret < 0 && send_ret >= 0)
munmap(map.data, map.size);
out_free:
if (ret < 0 && send_ret >= 0)
- ret = rc4_send_va_buffer(rc4c, "%s: %s\n", argv[i],
+ ret = sc_send_va_buffer(scc, "%s: %s\n", argv[i],
- ret = rc4_send_va_buffer(rc4c, "failed to stat %s (%s)\n", path,
+ ret = sc_send_va_buffer(scc, "failed to stat %s (%s)\n", path,
- rc4_send_va_buffer(rc4c, "%s: %s\n", path, para_strerror(-ret));
+ sc_send_va_buffer(scc, "%s: %s\n", path, para_strerror(-ret));
- argv + i, com_touch_callback, rc4_send_result, rc4c);
+ argv + i, com_touch_callback, sc_send_result, scc);
if (i >= argc)
return -E_AFT_SYNTAX;
ret = send_option_arg_callback_request(&query, argc - i, argv + i,
if (i >= argc)
return -E_AFT_SYNTAX;
ret = send_option_arg_callback_request(&query, argc - i, argv + i,
if (!(flags & ~CPSI_FLAG_VERBOSE)) /* no copy flags given */
flags = ~(unsigned)CPSI_FLAG_VERBOSE | flags;
ret = send_option_arg_callback_request(&options, argc - i, argv + i,
if (!(flags & ~CPSI_FLAG_VERBOSE)) /* no copy flags given */
flags = ~(unsigned)CPSI_FLAG_VERBOSE | flags;
ret = send_option_arg_callback_request(&options, argc - i, argv + i,
* \param parser_friendly Whether parser-friendly output format should be used.
*
* As the contents of the afs status items change in time and the command
* \param parser_friendly Whether parser-friendly output format should be used.
*
* As the contents of the afs status items change in time and the command
* is used to pass the status items from the afs process to the command handler
* via a shared memory area and a pipe.
*/
* is used to pass the status items from the afs process to the command handler
* via a shared memory area and a pipe.
*/
{
struct osl_object query = {.data = &parser_friendly,
.size = sizeof(parser_friendly)};
{
struct osl_object query = {.data = &parser_friendly,
.size = sizeof(parser_friendly)};
- return send_callback_request(afs_stat_callback, &query, rc4_send_result, rc4c);
+ return send_callback_request(afs_stat_callback, &query, sc_send_result, scc);