summaryrefslogtreecommitdiff
path: root/decode_lbx.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-08 11:58:20 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-21 23:47:00 -0700
commitb8160915909e59fc65cc08855fb32fee6f5d89ad (patch)
tree4cb5717e10917d33b66c88a34398b55d31392eb2 /decode_lbx.c
parent5b30118f1504fb065cf0b4aca150703834881d9e (diff)
downloadxscope-b8160915909e59fc65cc08855fb32fee6f5d89ad.tar.gz
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 <alan.coopersmith@oracle.com>
Diffstat (limited to 'decode_lbx.c')
-rw-r--r--decode_lbx.c181
1 files changed, 87 insertions, 94 deletions
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);
}