X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=blob.c;h=fa5134d7e0e066a3e8ea0627a11d1482c87b861e;hb=eea3b2008da20a96ebc0d867169d28a0a87d43d6;hp=25dd99e021a91e5ca137fac7cd069e8f117df27b;hpb=f6f50d03a09d6bc423324206d274336e9905bbb4;p=paraslash.git diff --git a/blob.c b/blob.c index 25dd99e0..fa5134d7 100644 --- a/blob.c +++ b/blob.c @@ -1,7 +1,9 @@ #include "para.h" #include "error.h" +#include "afh.h" #include "afs.h" #include "string.h" +#include "net.h" /** \file blob.c Macros and functions for blob handling. */ @@ -104,7 +106,7 @@ int com_lsblob_callback(struct osl_table *table, return ret; } -static int com_lsblob(callback_function *f, __a_unused int fd, int argc, const char **argv) +static int com_lsblob(callback_function *f, int fd, int argc, char * const * const argv) { struct com_lsblob_options clbo = {.flags = 0}; struct osl_object query = {.data = &clbo, .size = sizeof(clbo)}, @@ -137,7 +139,7 @@ static int com_lsblob(callback_function *f, __a_unused int fd, int argc, const c ret = send_option_arg_callback_request(&query, argc - i, argv + i, f, &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; } @@ -160,8 +162,8 @@ static int com_catblob_callback(struct osl_table *table, memcpy(output->data, obj.data, obj.size); return osl_close_disk_object(&obj); } -static int com_catblob(callback_function *f, __a_unused int fd, int argc, - const char **argv) +static int com_catblob(callback_function *f, int fd, int argc, + char * const * const argv) { struct osl_object cat_output = {.data = NULL}; int ret; @@ -172,7 +174,7 @@ static int com_catblob(callback_function *f, __a_unused int fd, int argc, return -E_BLOB_SYNTAX; ret = send_standard_callback_request(1, argv + 1, f, &cat_output); if (ret >= 0 && cat_output.data) - printf("%s\n", (char *)cat_output.data); + ret = send_buffer(fd, (char *)cat_output.data); free(cat_output.data); return ret; @@ -230,7 +232,7 @@ static int com_addblob_callback(struct osl_table *table, } static int com_addblob(callback_function *f, __a_unused int fd, int argc, - const char **argv) + char * const * const argv) { struct osl_object arg_obj; @@ -270,7 +272,7 @@ static int com_rmblob_callback(struct osl_table *table, } static int com_rmblob(callback_function *f, __a_unused int fd, int argc, - const char **argv) + char * const * const argv) { if (argc < 2) return -E_MOOD_SYNTAX; @@ -296,7 +298,7 @@ static int com_mvblob_callback(struct osl_table *table, } static int com_mvblob(callback_function *f, __a_unused int fd, - int argc, const char **argv) + int argc, char * const * const argv) { if (argc != 3) return -E_MOOD_SYNTAX; @@ -310,7 +312,7 @@ static int com_mvblob(callback_function *f, __a_unused int fd, { \ return com_ ## cmd_name ## blob_callback(table_name ## _table, query, output); \ } \ - int com_ ## cmd_name ## cmd_prefix(__a_unused int fd, int argc, const char **argv) \ + int com_ ## cmd_name ## cmd_prefix(int fd, int argc, char * const * const argv) \ { \ return com_ ## cmd_name ## blob(com_ ## cmd_name ## cmd_prefix ## _callback, fd, argc, argv); \ }