return ret;
}
-/**
- * Send a callback request passing an options structure and an argument vector.
- *
- * \param options pointer to an arbitrary data structure.
- * \param argc Argument count.
- * \param argv Standard argument vector.
- * \param f The callback function.
- * \param result_handler See \ref send_callback_request.
- * \param private_result_data See \ref send_callback_request.
- *
- * Some command handlers pass command-specific options to a callback, together
- * with a list of further arguments (often a list of audio files). This
- * function allows to pass an arbitrary structure (given as an osl object) and
- * a usual argument vector to the specified callback.
- *
- * \return The return value of the underlying call to \ref
- * send_callback_request().
- *
- * \sa send_standard_callback_request(), send_callback_request().
- */
-int send_option_arg_callback_request(struct osl_object *options,
- int argc, char * const * const argv, afs_callback *f,
- callback_result_handler *result_handler,
- void *private_result_data)
-{
- char *p;
- int i, ret;
- struct osl_object query = {.size = options? options->size : 0};
-
- for (i = 0; i < argc; i++)
- query.size += strlen(argv[i]) + 1;
- query.data = para_malloc(query.size);
- p = query.data;
- if (options) {
- memcpy(query.data, options->data, options->size);
- p += options->size;
- }
- for (i = 0; i < argc; i++) {
- strcpy(p, argv[i]); /* OK */
- p += strlen(argv[i]) + 1;
- }
- ret = send_callback_request(f, &query, result_handler,
- private_result_data);
- free(query.data);
- return ret;
-}
-
-/**
- * Send a callback request with an argument vector only.
- *
- * \param argc The same meaning as in send_option_arg_callback_request().
- * \param argv The same meaning as in send_option_arg_callback_request().
- * \param f The same meaning as in send_option_arg_callback_request().
- * \param result_handler See \ref send_callback_request.
- * \param private_result_data See \ref send_callback_request.
- *
- * This is similar to send_option_arg_callback_request(), but no options buffer
- * is passed to the parent process.
- *
- * \return The return value of the underlying call to
- * send_option_arg_callback_request().
- */
-int send_standard_callback_request(int argc, char * const * const argv,
- afs_callback *f, callback_result_handler *result_handler,
- void *private_result_data)
-{
- return send_option_arg_callback_request(NULL, argc, argv, f, result_handler,
- private_result_data);
-}
-
static int action_if_pattern_matches(struct osl_row *row, void *data)
{
struct pattern_match_data *pmd = data;
int send_callback_request(afs_callback *f, struct osl_object *query,
callback_result_handler *result_handler,
void *private_result_data);
-int send_option_arg_callback_request(struct osl_object *options,
- int argc, char * const * const argv, afs_callback *f,
- callback_result_handler *result_handler,
- void *private_result_data);
-int send_standard_callback_request(int argc, char * const * const argv,
- afs_callback *f, callback_result_handler *result_handler,
- void *private_result_data);
int send_lls_callback_request(afs_callback *f,
const struct lls_command * const cmd,
struct lls_parse_result *lpr, void *private_result_data);