From: Andre Noll Date: Sun, 6 Sep 2015 19:01:41 +0000 (+0200) Subject: afs: Remove unused call_callback helpers. X-Git-Tag: v0.6.0~2^2~55 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=c6e27c71877391685e30388689137a7d63cac58f afs: Remove unused call_callback helpers. send_option_arg_callback_request() and send_standard_callback_request() have both become unused now that all server commands have been converted to lopsub. This patch gets rid of these functions and removes their declarations from afs.h. --- diff --git a/afs.c b/afs.c index 761a637c..f51039b1 100644 --- a/afs.c +++ b/afs.c @@ -312,76 +312,6 @@ int send_lls_callback_request(afs_callback *f, 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; diff --git a/afs.h b/afs.h index 3d13aea2..3ff94f3b 100644 --- a/afs.h +++ b/afs.h @@ -226,13 +226,6 @@ __must_check int afs_event(enum afs_events event, struct para_buffer *pb, 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);