diff options
author | Niels de Vos <ndevos@redhat.com> | 2017-03-13 14:01:24 +0100 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2017-03-17 15:11:09 +0100 |
commit | 5d3d0bc59c1115117e6e624d12227d53a474b2ec (patch) | |
tree | 85139ac97fa680ce3b52c1ff4250bb29069a12a9 /rpc/block_clnt.c | |
parent | 30e5f195a1b80ffe304b2ed70e0a2d8253d0cc42 (diff) |
build: use rpcgen to generate all XDR code
Remove all generated files and have them generated when needed. This
build a libgbrpcxdr.la archive with the .o files that gets linked into
the libgbrpc.la archive. 'rpcgen' generates .c code that triggers
warnings for various compilers. This is not something that can easily be
fixed, so add rpc-pragmas.h (like GlusterFS does) to prevent these
warnings.
There are some functions used by gluster-blockd.c that are not part of
the header and were manually added to block.h. Because block.h get
regenerated now, these functions have been added to a new file
block_svc.h.
Note that generated and compiled files land in $(top_builddir). This
directory does not need to be the same as $(top_srcdir).
Change-Id: I0e764d159d6d785699537eed4e24b16883218038
Fixes: #2
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'rpc/block_clnt.c')
-rw-r--r-- | rpc/block_clnt.c | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/rpc/block_clnt.c b/rpc/block_clnt.c deleted file mode 100644 index 4c10231..0000000 --- a/rpc/block_clnt.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#include <memory.h> /* for memset */ -#include "block.h" - -/* Default timeout can be changed using clnt_control() */ -static struct timeval TIMEOUT = { 25, 0 }; - -blockResponse * -block_create_cli_1(blockCreateCli *argp, CLIENT *clnt) -{ - static blockResponse clnt_res; - - memset((char *)&clnt_res, 0, sizeof(clnt_res)); - if (clnt_call (clnt, BLOCK_CREATE_CLI, - (xdrproc_t) xdr_blockCreateCli, (caddr_t) argp, - (xdrproc_t) xdr_blockResponse, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -blockResponse * -block_list_cli_1(blockListCli *argp, CLIENT *clnt) -{ - static blockResponse clnt_res; - - memset((char *)&clnt_res, 0, sizeof(clnt_res)); - if (clnt_call (clnt, BLOCK_LIST_CLI, - (xdrproc_t) xdr_blockListCli, (caddr_t) argp, - (xdrproc_t) xdr_blockResponse, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -blockResponse * -block_info_cli_1(blockInfoCli *argp, CLIENT *clnt) -{ - static blockResponse clnt_res; - - memset((char *)&clnt_res, 0, sizeof(clnt_res)); - if (clnt_call (clnt, BLOCK_INFO_CLI, - (xdrproc_t) xdr_blockInfoCli, (caddr_t) argp, - (xdrproc_t) xdr_blockResponse, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -blockResponse * -block_delete_cli_1(blockDeleteCli *argp, CLIENT *clnt) -{ - static blockResponse clnt_res; - - memset((char *)&clnt_res, 0, sizeof(clnt_res)); - if (clnt_call (clnt, BLOCK_DELETE_CLI, - (xdrproc_t) xdr_blockDeleteCli, (caddr_t) argp, - (xdrproc_t) xdr_blockResponse, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -blockResponse * -block_create_1(blockCreate *argp, CLIENT *clnt) -{ - static blockResponse clnt_res; - - memset((char *)&clnt_res, 0, sizeof(clnt_res)); - if (clnt_call (clnt, BLOCK_CREATE, - (xdrproc_t) xdr_blockCreate, (caddr_t) argp, - (xdrproc_t) xdr_blockResponse, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} - -blockResponse * -block_delete_1(blockDelete *argp, CLIENT *clnt) -{ - static blockResponse clnt_res; - - memset((char *)&clnt_res, 0, sizeof(clnt_res)); - if (clnt_call (clnt, BLOCK_DELETE, - (xdrproc_t) xdr_blockDelete, (caddr_t) argp, - (xdrproc_t) xdr_blockResponse, (caddr_t) &clnt_res, - TIMEOUT) != RPC_SUCCESS) { - return (NULL); - } - return (&clnt_res); -} |