diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-08-27 14:18:15 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-08-27 14:18:15 +0200 |
commit | fa9684d8c6faa8f2e808de9229b254d77844aa2c (patch) | |
tree | 94a5c0bb9c3dd24fb9ae69b5d27675982002c069 /runtime/msg.h | |
parent | d1b092da1eeec18ad4aafdad24f9249871d345a5 (diff) | |
parent | 8c51aa0fdca6d8212ec501661698644ca52bae6d (diff) | |
download | rsyslog-fa9684d8c6faa8f2e808de9229b254d77844aa2c.tar.gz rsyslog-fa9684d8c6faa8f2e808de9229b254d77844aa2c.tar.xz rsyslog-fa9684d8c6faa8f2e808de9229b254d77844aa2c.zip |
Merge branch 'beta'
Diffstat (limited to 'runtime/msg.h')
-rw-r--r-- | runtime/msg.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/runtime/msg.h b/runtime/msg.h index 98b3599a..b006cbec 100644 --- a/runtime/msg.h +++ b/runtime/msg.h @@ -192,6 +192,23 @@ uchar *propIDToName(propid_t propID); extern void (*funcMsgPrepareEnqueue)(msg_t *pMsg); #define MsgPrepareEnqueue(pMsg) funcMsgPrepareEnqueue(pMsg) + +/* ------------------------------ some inline functions ------------------------------ */ + +/* set raw message size. This is needed in some cases where a trunctation is necessary + * but the raw message must not be newly set. The most important (and currently only) + * use case is if we remove trailing LF or NUL characters. Note that the size can NOT + * be extended, only shrunk! + * rgerhards, 2009-08-26 + */ +static inline void +MsgSetRawMsgSize(msg_t *pMsg, size_t newLen) +{ + assert(newLen <= (size_t) pMsg->iLenRawMsg); + pMsg->iLenRawMsg = newLen; +} + + #endif /* #ifndef MSG_H_INCLUDED */ /* vim:set ai: */ |