From 3199c6fb39f02b36a07ef65bf4b07d6ec340944d Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Wed, 12 Aug 2009 14:18:25 -0700 Subject: Convert extension decoding to function pointer tables Each extension now registers it's own request, reply, event & error decoding functions as needed in the central table, instead of a cascading block of if/else statements to modify for each new extension added. Signed-off-by: Alan Coopersmith --- decode_bigreq.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'decode_bigreq.c') diff --git a/decode_bigreq.c b/decode_bigreq.c index be0d597..3b324e7 100644 --- a/decode_bigreq.c +++ b/decode_bigreq.c @@ -31,9 +31,9 @@ #include "bigreqscope.h" #include "extensions.h" -unsigned char BIGREQRequest; +static unsigned char BIGREQRequest; -void +static void bigreq_decode_req ( FD fd, const unsigned char *buf) @@ -51,7 +51,7 @@ bigreq_decode_req ( } } -void +static void bigreq_decode_reply ( FD fd, const unsigned char *buf, @@ -78,4 +78,7 @@ InitializeBIGREQ( p = DefineType(BIGREQREPLY, ENUMERATED, "BIGREQREPLY", (PrintProcType) PrintENUMERATED); DefineEValue (p, 0L, "BigreqEnable"); + + InitializeExtensionDecoder(BIGREQRequest, bigreq_decode_req, + bigreq_decode_reply); } -- cgit v1.2.1