From b8160915909e59fc65cc08855fb32fee6f5d89ad Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 8 Jul 2012 11:58:20 -0700 Subject: Convert to X.Org standard indentation & cleanup whitespace Performed with util/modular/x-indent-all.sh, followed by manual fixups Signed-off-by: Alan Coopersmith --- decode_lbx.c | 181 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 87 insertions(+), 94 deletions(-) (limited to 'decode_lbx.c') diff --git a/decode_lbx.c b/decode_lbx.c index 5be6483..259aa47 100644 --- a/decode_lbx.c +++ b/decode_lbx.c @@ -15,7 +15,7 @@ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Keith Packard, Network Computing Devices @@ -31,125 +31,118 @@ #include "extensions.h" static unsigned char LBXRequest, LBXError; -unsigned char LBXEvent; /* exported for DecodeEvent in decode11.c */ +unsigned char LBXEvent; /* exported for DecodeEvent in decode11.c */ static void -lbx_decode_req ( - FD fd, - const unsigned char *buf) +lbx_decode_req(FD fd, const unsigned char *buf) { - short Major = IByte (&buf[0]); - short Minor = IByte (&buf[1]); - - switch (Minor) { - case 0: - LbxQueryVersion (fd, buf); - ExtendedReplyExpected (fd, Major, Minor); - break; - case 1: - LbxStartProxy (fd, buf); - break; - case 2: - LbxStopProxy (fd, buf); - break; - case 3: - LbxSwitch (fd, buf); - break; - case 4: - LbxNewClient(fd, buf); - break; - case 5: - LbxCloseClient (fd, buf); - break; - case 6: - LbxModifySequence (fd, buf); - break; - default: - break; - } + short Major = IByte(&buf[0]); + short Minor = IByte(&buf[1]); + + switch (Minor) { + case 0: + LbxQueryVersion(fd, buf); + ExtendedReplyExpected(fd, Major, Minor); + break; + case 1: + LbxStartProxy(fd, buf); + break; + case 2: + LbxStopProxy(fd, buf); + break; + case 3: + LbxSwitch(fd, buf); + break; + case 4: + LbxNewClient(fd, buf); + break; + case 5: + LbxCloseClient(fd, buf); + break; + case 6: + LbxModifySequence(fd, buf); + break; + default: + break; + } } static void -lbx_decode_reply ( - FD fd, - const unsigned char *buf, - short RequestMinor) +lbx_decode_reply(FD fd, const unsigned char *buf, short RequestMinor) { switch (RequestMinor) { case 0: - LbxQueryVersionReply (fd, buf); - break; + LbxQueryVersionReply(fd, buf); + break; default: - break; + break; } } static void -lbx_decode_error ( - FD fd, - const unsigned char *buf) +lbx_decode_error(FD fd, const unsigned char *buf) { short error = IByte(&buf[1]) - LBXError; - + switch (error) { case 0: - break; + break; default: - break; + break; } } static void -lbx_decode_event ( - FD fd, - const unsigned char *buf) +lbx_decode_event(FD fd, const unsigned char *buf) { - short event = IByte(&buf[0]) - LBXEvent; - - switch (event) { - case 0: - LbxSwitchEvent (fd, buf); - break; - case 1: - LbxCloseEvent (fd, buf); - break; - default: - break; - } + short event = IByte(&buf[0]) - LBXEvent; + + switch (event) { + case 0: + LbxSwitchEvent(fd, buf); + break; + case 1: + LbxCloseEvent(fd, buf); + break; + default: + break; + } } void -InitializeLBX ( - const unsigned char *buf) +InitializeLBX(const unsigned char *buf) { - TYPE p; - - LBXRequest = (unsigned char)(buf[9]); - LBXEvent = (unsigned char)(buf[10]); - LBXError = (unsigned char)(buf[11]); - - DefineEValue (&TD[REQUEST], (unsigned long) LBXRequest, "LbxRequest"); - DefineEValue (&TD[REPLY], (unsigned long) LBXRequest, "LbxReply"); - DefineEValue (&TD[EVENT], (unsigned long) LBXEvent, "LbxEvent"); - DefineEValue (&TD[ERROR], (unsigned long) LBXError, "LbxError"); - - p = DefineType(LBXREQUEST, ENUMERATED, "LBXREQUEST", (PrintProcType) PrintENUMERATED); - DefineEValue(p, 0L, "QueryVersion"); - DefineEValue(p, 1L, "StartProxy"); - DefineEValue(p, 2L, "StopProxy"); - DefineEValue(p, 3L, "Switch"); - DefineEValue(p, 4L, "NewClient"); - DefineEValue(p, 5L, "CloseClient"); - DefineEValue(p, 6L, "ModifySequence"); - - p = DefineType(LBXREPLY, ENUMERATED, "LBXREPLY", (PrintProcType) PrintENUMERATED); - DefineEValue (p, 0L, "QueryVersion"); - - p = DefineType(LBXEVENT, ENUMERATED, "LBXEVENT", (PrintProcType) PrintENUMERATED); - DefineEValue (p, 0L, "SwitchEvent"); - DefineEValue (p, 1L, "CloseEvent"); - - InitializeExtensionDecoder(LBXRequest, lbx_decode_req, lbx_decode_reply); - InitializeExtensionErrorDecoder(LBXError, lbx_decode_error); - InitializeExtensionEventDecoder(LBXEvent, lbx_decode_event); + TYPE p; + + LBXRequest = (unsigned char) (buf[9]); + LBXEvent = (unsigned char) (buf[10]); + LBXError = (unsigned char) (buf[11]); + + DefineEValue(&TD[REQUEST], (unsigned long) LBXRequest, "LbxRequest"); + DefineEValue(&TD[REPLY], (unsigned long) LBXRequest, "LbxReply"); + DefineEValue(&TD[EVENT], (unsigned long) LBXEvent, "LbxEvent"); + DefineEValue(&TD[ERROR], (unsigned long) LBXError, "LbxError"); + + p = DefineType(LBXREQUEST, ENUMERATED, "LBXREQUEST", + (PrintProcType) PrintENUMERATED); + DefineEValue(p, 0L, "QueryVersion"); + DefineEValue(p, 1L, "StartProxy"); + DefineEValue(p, 2L, "StopProxy"); + DefineEValue(p, 3L, "Switch"); + DefineEValue(p, 4L, "NewClient"); + DefineEValue(p, 5L, "CloseClient"); + DefineEValue(p, 6L, "ModifySequence"); + + p = DefineType(LBXREPLY, ENUMERATED, "LBXREPLY", + (PrintProcType) PrintENUMERATED); + DefineEValue(p, 0L, "QueryVersion"); + + p = DefineType(LBXEVENT, ENUMERATED, "LBXEVENT", + (PrintProcType) PrintENUMERATED); + DefineEValue(p, 0L, "SwitchEvent"); + DefineEValue(p, 1L, "CloseEvent"); + + InitializeExtensionDecoder(LBXRequest, lbx_decode_req, lbx_decode_reply); + InitializeExtensionErrorDecoder(LBXError, lbx_decode_error); + InitializeExtensionEventDecoder(LBXEvent, lbx_decode_event); } -- cgit v1.2.1