From 4a529fec124d143c9b8b1a88dc59269ca44054d6 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Fri, 11 Mar 2016 18:46:49 +0000 Subject: [PATCH] Added some comments. FossilOrigin-Name: ffd50b6238d95c7185487a76839f506750bfb8107dfdd40e0004bab4c74756c7 --- src/cw/lw.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/cw/lw.h b/src/cw/lw.h index 203a78ca..4bbde1ab 100644 --- a/src/cw/lw.h +++ b/src/cw/lw.h @@ -44,9 +44,15 @@ #define lw_put_dword(dst,dw)\ (*((uint32_t*)(dst)) = htonl(dw),4) +/** + * Same as #lw_set_byte, but w/o return value + */ #define lw_set_byte(dst,b) \ (*(dst)=b); +/** + * Same as #lw_set_word, but no return value + */ #define lw_set_word(dst,b) \ (*((uint16_t*)(dst)) = htons(w)) @@ -57,19 +63,34 @@ #define lw_set_dword(dst,dw)\ (*((uint32_t*)(dst)) = htonl(dw)) - +/** + * Read a byte from input buffer + * @param src Pointer to input buffer + * @return the byte red + */ #define lw_get_byte(src)\ (*(uint8_t*)(src)) +/** + * Read a word from input buffer and convert it from + * network format to local format. + * @param src Pointer to input buffer + * @return word + */ #define lw_get_word(src) \ (ntohs( *((uint16_t*)(src)))) +/** + * Read a dword from input buffer and convert it from + * network format to local + * @param src Pointer to input bufffer + * @return the dword red + */ #define lw_get_dword(src) \ (ntohl( *((uint32_t*)(src)))) - /* the following functions are defined as static inline and not as macro to avoid any side effects */