afs: Rename sc_send_result() to afs_cb_result_handler().
authorAndre Noll <maan@systemlinux.org>
Mon, 16 Jan 2012 21:41:06 +0000 (22:41 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 5 May 2012 10:54:53 +0000 (12:54 +0200)
The old name was rather confusing because the "sc" prefix indicates
that this function is part of the stream cipher crypto API, which is
not the case.

afs.c
afs.h
aft.c
attribute.c
blob.c

diff --git a/afs.c b/afs.c
index 04b6961..013fdfe 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -593,7 +593,7 @@ out:
  *
  * \sa \ref callback_result_handler, \ref sc_send_bin_buffer().
  */
-int sc_send_result(struct osl_object *result, void *private)
+int afs_cb_result_handler(struct osl_object *result, void *private)
 {
        struct command_context *cc = private;
        int ret;
@@ -615,7 +615,7 @@ int com_select(struct command_context *cc)
        query.data = cc->argv[1];
        query.size = strlen(cc->argv[1]) + 1;
        return send_callback_request(com_select_callback, &query,
-               &sc_send_result, cc);
+               &afs_cb_result_handler, cc);
 }
 
 static void init_admissible_files(char *arg)
@@ -1051,7 +1051,7 @@ int com_init(struct command_context *cc)
                }
        }
        ret = send_callback_request(create_tables_callback, &query,
-               sc_send_result, cc);
+               afs_cb_result_handler, cc);
        if (ret < 0)
                /* ignore return value */
                sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
@@ -1105,19 +1105,19 @@ int com_check(struct command_context *cc)
                flags = ~0U;
        if (flags & CHECK_AFT) {
                ret = send_callback_request(aft_check_callback, NULL,
-                       sc_send_result, cc);
+                       afs_cb_result_handler, cc);
                if (ret < 0)
                        return ret;
        }
        if (flags & CHECK_PLAYLISTS) {
                ret = send_callback_request(playlist_check_callback,
-                       NULL, sc_send_result, cc);
+                       NULL, afs_cb_result_handler, cc);
                if (ret < 0)
                        return ret;
        }
        if (flags & CHECK_MOODS) {
                ret = send_callback_request(mood_check_callback, NULL,
-                       sc_send_result, cc);
+                       afs_cb_result_handler, cc);
                if (ret < 0)
                        return ret;
        }
diff --git a/afs.h b/afs.h
index ba0d266..73c4664 100644 (file)
--- a/afs.h
+++ b/afs.h
@@ -206,10 +206,9 @@ typedef void callback_function(int fd, const struct osl_object *);
  * \sa \ref send_callback_request().
  */
 typedef int callback_result_handler(struct osl_object *result, void *private);
-int sc_send_result(struct osl_object *result, void *private);
+int afs_cb_result_handler(struct osl_object *result, void *private);
 int pass_buffer_as_shm(char *buf, size_t size, void *fd_ptr);
 
-
 /** Structure passed to the AFS max_size handler. */
 struct afs_max_size_handler_data {
        /** Local socket connecting the command handler and the AFS process. */
diff --git a/aft.c b/aft.c
index dffe3a3..ba65bc2 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -1520,7 +1520,7 @@ int com_ls(struct command_context *cc)
        opts.mode = mode;
        opts.num_patterns = cc->argc - i;
        ret = send_option_arg_callback_request(&query, opts.num_patterns,
-               cc->argv + i, com_ls_callback, sc_send_result, cc);
+               cc->argv + i, com_ls_callback, afs_cb_result_handler, cc);
        return ret;
 }
 
@@ -1913,7 +1913,8 @@ static int add_one_audio_file(const char *path, void *private_data)
        }
        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, sc_send_result, pad->cc);
+       ret = send_callback_request(com_add_callback, &obj,
+               afs_cb_result_handler, pad->cc);
        goto out_free;
 
 out_unmap:
@@ -2185,7 +2186,7 @@ int com_touch(struct command_context *cc)
        if (i >= cc->argc)
                return -E_AFT_SYNTAX;
        ret = send_option_arg_callback_request(&query, cc->argc - i,
-               cc->argv + i, com_touch_callback, sc_send_result, cc);
+               cc->argv + i, com_touch_callback, afs_cb_result_handler, cc);
        if (ret < 0)
                sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
        return ret;
@@ -2296,7 +2297,7 @@ int com_rm(struct command_context *cc)
        if (i >= cc->argc)
                return -E_AFT_SYNTAX;
        ret = send_option_arg_callback_request(&query, cc->argc - i,
-               cc->argv + i, com_rm_callback, sc_send_result, cc);
+               cc->argv + i, com_rm_callback, afs_cb_result_handler, cc);
        if (ret < 0)
                sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
        return ret;
@@ -2455,7 +2456,7 @@ int com_cpsi(struct command_context *cc)
        if (!(flags & ~CPSI_FLAG_VERBOSE)) /* no copy flags given */
                flags = ~(unsigned)CPSI_FLAG_VERBOSE | flags;
        ret = send_option_arg_callback_request(&options, cc->argc - i,
-               cc->argv + i, com_cpsi_callback, sc_send_result, cc);
+               cc->argv + i, com_cpsi_callback, afs_cb_result_handler, cc);
        if (ret < 0)
                sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
        return ret;
@@ -2491,7 +2492,8 @@ int send_afs_status(struct command_context *cc, int parser_friendly)
        struct osl_object query = {.data = &parser_friendly,
                .size = sizeof(parser_friendly)};
 
-       return send_callback_request(afs_stat_callback, &query, sc_send_result, cc);
+       return send_callback_request(afs_stat_callback, &query,
+               afs_cb_result_handler, cc);
 }
 
 /* TODO: optionally fix problems by removing offending rows */
index 9fddc1c..7532711 100644 (file)
@@ -206,7 +206,7 @@ int com_lsatt(struct command_context *cc)
                }
        }
        ret = send_option_arg_callback_request(&options, cc->argc - i, cc->argv + i,
-               com_lsatt_callback, sc_send_result, cc);
+               com_lsatt_callback, afs_cb_result_handler, cc);
        if (!ret) {
                if (cc->argc > 1)
                        ret = sc_send_va_buffer(&cc->scc, "no matches\n");
@@ -369,7 +369,7 @@ int com_addatt(struct command_context *cc)
        if (cc->argc < 2)
                return -E_ATTR_SYNTAX;
        ret = send_standard_callback_request(cc->argc - 1, cc->argv + 1,
-               com_addatt_callback, sc_send_result, cc);
+               com_addatt_callback, afs_cb_result_handler, cc);
        if (ret < 0)
                sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
        return ret;
@@ -414,7 +414,7 @@ int com_mvatt(struct command_context *cc)
        if (cc->argc != 3)
                return -E_ATTR_SYNTAX;
        ret = send_standard_callback_request(cc->argc - 1, cc->argv + 1,
-               com_mvatt_callback, sc_send_result, cc);
+               com_mvatt_callback, afs_cb_result_handler, cc);
        if (ret < 0)
                sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
        return ret;
@@ -488,7 +488,7 @@ int com_rmatt(struct command_context *cc)
        if (cc->argc < 2)
                return -E_ATTR_SYNTAX;
        ret = send_standard_callback_request(cc->argc - 1, cc->argv + 1,
-               com_rmatt_callback, sc_send_result, cc);
+               com_rmatt_callback, afs_cb_result_handler, cc);
        if (ret < 0)
                sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
        return ret;
diff --git a/blob.c b/blob.c
index fea230f..89d993d 100644 (file)
--- a/blob.c
+++ b/blob.c
@@ -197,7 +197,7 @@ static int com_lsblob(callback_function *f, struct command_context *cc)
 //     if (argc > i)
 //             return -E_BLOB_SYNTAX;
        return send_option_arg_callback_request(&options, cc->argc - i,
-               cc->argv + i, f, sc_send_result, cc);
+               cc->argv + i, f, afs_cb_result_handler, cc);
 }
 
 static int cat_blob(struct osl_table *table, struct osl_row *row,
@@ -239,7 +239,7 @@ static int com_catblob(callback_function *f, struct command_context *cc)
        if (cc->argc < 2)
                return -E_BLOB_SYNTAX;
        return send_standard_callback_request(cc->argc - 1, cc->argv + 1, f,
-               sc_send_result, cc);
+               afs_cb_result_handler, cc);
 }
 
 /** Used for removing rows from a blob table. */
@@ -305,7 +305,7 @@ static int com_rmblob(callback_function *f, struct command_context *cc)
        if (cc->argc < 2)
                return -E_MOOD_SYNTAX;
        return send_option_arg_callback_request(NULL, cc->argc - 1, cc->argv + 1, f,
-               sc_send_result, cc);
+               afs_cb_result_handler, cc);
 }
 
 static void com_addblob_callback(struct osl_table *table, __a_unused int fd,