summaryrefslogtreecommitdiffstats
path: root/runtime/msg.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-08-27 14:18:05 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-08-27 14:18:05 +0200
commit8c51aa0fdca6d8212ec501661698644ca52bae6d (patch)
treed6ad4d597142fb7f3a158443baf3cfa684745a4d /runtime/msg.h
parent98f9b91517e1639e365e396674525cef36e21956 (diff)
parent9eae07aa82db12205a31afc4ee2888ba50c3bc3a (diff)
downloadrsyslog-8c51aa0fdca6d8212ec501661698644ca52bae6d.tar.gz
rsyslog-8c51aa0fdca6d8212ec501661698644ca52bae6d.tar.bz2
rsyslog-8c51aa0fdca6d8212ec501661698644ca52bae6d.zip
Merge branch 'v4-devel' into beta
Diffstat (limited to 'runtime/msg.h')
-rw-r--r--runtime/msg.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/runtime/msg.h b/runtime/msg.h
index 0b346f7b..3a02365b 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:
*/