Added some documentation
FossilOrigin-Name: 93aa6e28cae8cacd0dc3ce4c9101efff246e08a0b16b07613a0c4016a6405a5e
This commit is contained in:
parent
58e4eacaf6
commit
72027c4ec1
24
src/cw/lw.h
24
src/cw/lw.h
@ -6,13 +6,35 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Put a byte to to an output buffer
|
||||
*
|
||||
* @param dst destination buffer
|
||||
* @param b byte to put
|
||||
* @return 1 (number of bytes put)
|
||||
*/
|
||||
#define lw_put_byte(dst,b) \
|
||||
(*(dst)=b,1)
|
||||
|
||||
/**
|
||||
* Put a word to to an output buffer. The word
|
||||
* is converted to network byte order.
|
||||
*
|
||||
* @param dst destination buffer
|
||||
* @param w word to put
|
||||
* @return 2 (number of bytes put)
|
||||
*/
|
||||
#define lw_put_word(dst,w)\
|
||||
(*((uint16_t*)(dst)) = htons(w),2)
|
||||
|
||||
/**
|
||||
* Put a dword to to an output buffer. The dword
|
||||
* is converted to network byte order.
|
||||
*
|
||||
* @param dst destination buffer
|
||||
* @param dw dword to put
|
||||
* @return 4 (number of bytes put)
|
||||
*/
|
||||
#define lw_put_dword(dst,dw)\
|
||||
(*((uint32_t*)(dst)) = htonl(dw),4)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user