From b77b304bb58f472e8a9d2f3b6d47fffd38d0c905 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 07 Dec 2021 15:43:35 -0600 Subject: [PATCH] rxgen: Declare generated PKG_TranslateOpCode() Ever since commit 5c77a6ca (rxgen: add *TranslateOpcode functions to XDR code), rxgen generates a PKG_TranslateOpCode function in the relevant .xdr.c source, which can translate an RPC opcode into the RPC name. But we never declare this function in a header file, making it impossible to use without compiler warnings (unless the caller declares the function itself). To make it possible to actually use this function, declare this function in the generated header file. Reviewed-on: https://gerrit.openafs.org/14871 Reviewed-by: Cheyenne Wills Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk (cherry picked from commit 9b2c27fc6d299cb0b23eca3e8cb25b7e0c41b11a) Change-Id: I2479ff7f6579769b3319b2939ffde60fe570c880 --- diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c index 768e42f..59854f4 100644 --- a/src/rxgen/rpc_parse.c +++ b/src/rxgen/rpc_parse.c @@ -2150,6 +2150,8 @@ { f_print(fout,"\nextern int %s%sExecuteRequest(struct rx_call *);\n", prefix, PackagePrefix[PackageIndex]); + f_print(fout,"extern char * %s%sTranslateOpCode(int op);\n", prefix, + PackagePrefix[PackageIndex]); } static void @@ -2161,6 +2163,8 @@ f_print(fout,"\nextern int %s%sExecuteRequest(struct rx_call *);\n", prefix, pprefix); f_print(fout,"\nextern int %sOpCodeIndex(int op);\n", PackagePrefix[PackageIndex]); + f_print(fout, "extern char * %s%sTranslateOpCode(int op);\n", + prefix, pprefix); } void