afs.c: Kill unused struct callback_data.
[paraslash.git] / aft.c
diff --git a/aft.c b/aft.c
index aaeab8a39f22abd9e2855eb1d354939c46431111..e682c203adb8678f0ae4db31060f6cbb3ddbe327 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -2,7 +2,9 @@
 #include "error.h"
 #include <sys/mman.h>
 #include <fnmatch.h>
+#include "afh.h"
 #include "afs.h"
+#include "net.h"
 #include "string.h"
 
 int mp3_get_file_info(char *map, size_t numbytes,
@@ -724,7 +726,7 @@ static int print_list_item(struct ls_data *d, struct ls_options *opts,
                return 1;
        }
        if (opts->mode == LS_MODE_VERBOSE) {
-               HASH_TYPE asc_hash[2 * HASH_SIZE + 1];
+               char asc_hash[2 * HASH_SIZE + 1];
                char *att_line, *lyrics_line, *image_line;
 
                hash_to_asc(d->hash, asc_hash);
@@ -1028,7 +1030,7 @@ out:
  * full list: list everything, including afsi, afhi, atts as clear text
  *
  * */
-int com_afs_ls(__a_unused int fd, int argc, const char **argv)
+int com_afs_ls(int fd, int argc, const char **argv)
 {
        int i, ret;
        unsigned flags = 0;
@@ -1134,7 +1136,7 @@ int com_afs_ls(__a_unused int fd, int argc, const char **argv)
        ret = send_option_arg_callback_request(&query, opts.num_patterns,
                argv + i, com_ls_callback, &ls_output);
        if (ret >= 0 && ls_output.data) {
-               printf("%s\n", (char *)ls_output.data);
+               send_buffer(fd, (char *)ls_output.data);
                free(ls_output.data);
        }
        return ret;
@@ -1265,7 +1267,7 @@ static int com_add_callback(const struct osl_object *query,
        char afsi_buf[AFSI_SIZE];
        uint32_t flags = read_u32(buf + AFTROW_FLAGS_OFFSET);
 
-       hash = buf + AFTROW_HASH_OFFSET;
+       hash = (HASH_TYPE *)buf + AFTROW_HASH_OFFSET;
        hash_to_asc(hash, asc);;
        objs[AFTCOL_HASH].data = buf + AFTROW_HASH_OFFSET;
        objs[AFTCOL_HASH].size = HASH_SIZE;
@@ -1435,7 +1437,7 @@ out_free:
        return ret;
 }
 
-int com_add(int fd, int argc, const char **argv)
+int com_add(int fd, int argc, char **argv)
 {
        int i, ret;
        struct private_add_data pad = {.fd = fd, .flags = 0};