Skip to content

Commit aec636c

Browse files
committed
Add IPCMessageGetBufferLength() for retrieving buffer length from IPC message
The length of the IPC message buffer is stored as part of a larger value. The new helper function extracts the length.
1 parent be04ef1 commit aec636c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/IPCQueue.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ IPCMessageInit(IPCMessage* aMsg)
1919
return 0;
2020
}
2121

22+
uint32_t
23+
IPCMessageGetBufferLength(const IPCMessage* aMsg)
24+
{
25+
return aMsg->mStatus & 0x00ffffff;
26+
}
27+
2228
int
2329
IPCMessageProduce(IPCMessage* aMsg)
2430
{

src/IPCQueue.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ typedef struct
2727
int
2828
IPCMessageInit(IPCMessage* aMsg);
2929

30+
uint32_t
31+
IPCMessageGetBufferLength(const IPCMessage* aMsg);
32+
3033
int
3134
IPCMessageProduce(IPCMessage* aMsg);
3235

0 commit comments

Comments
 (0)