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:
parent
2664c4f92a
commit
9b242744da
3
parse.h
3
parse.h
@ -2,6 +2,7 @@
|
|||||||
rdesktop: A Remote Desktop Protocol client.
|
rdesktop: A Remote Desktop Protocol client.
|
||||||
Parsing primitives
|
Parsing primitives
|
||||||
Copyright (C) Matthew Chapman 1999-2008
|
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
|
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
|
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(s) ((s)->p <= (s)->end)
|
||||||
#define s_check_rem(s,n) ((s)->p + n <= (s)->end)
|
#define s_check_rem(s,n) ((s)->p + n <= (s)->end)
|
||||||
#define s_check_end(s) ((s)->p == (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)
|
#if defined(L_ENDIAN) && !defined(NEED_ALIGN)
|
||||||
#define in_uint16_le(s,v) { v = *(uint16 *)((s)->p); (s)->p += 2; }
|
#define in_uint16_le(s,v) { v = *(uint16 *)((s)->p); (s)->p += 2; }
|
||||||
|
Loading…
Reference in New Issue
Block a user