Added s_length() and s_reset() helper functions for easier

for cleaner code and readability where its used.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1674 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Henrik Andersson 2012-11-15 11:20:24 +00:00
parent 2664c4f92a
commit 9b242744da

View File

@ -2,6 +2,7 @@
rdesktop: A Remote Desktop Protocol client.
Parsing primitives
Copyright (C) Matthew Chapman 1999-2008
Copyright 2012 Henrik Andersson <hean01@cendio.se> for Cendio AB
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -41,6 +42,8 @@ typedef struct stream
#define s_check(s) ((s)->p <= (s)->end)
#define s_check_rem(s,n) ((s)->p + n <= (s)->end)
#define s_check_end(s) ((s)->p == (s)->end)
#define s_length(s) ((s)->end - (s)->data)
#define s_reset(s) ((s)->end = (s)->p = (s)->data)
#if defined(L_ENDIAN) && !defined(NEED_ALIGN)
#define in_uint16_le(s,v) { v = *(uint16 *)((s)->p); (s)->p += 2; }