diff --git a/headers/private/app/PortMessage.h b/headers/private/app/PortMessage.h index 70ace31db0..5aa584457d 100644 --- a/headers/private/app/PortMessage.h +++ b/headers/private/app/PortMessage.h @@ -47,6 +47,7 @@ public: void *Buffer(void) { return _buffer; } ssize_t BufferSize(void) { return _buffersize; } + status_t Read(int64 *data); status_t Read(bool *data); status_t Read(BPoint *data); status_t Read(BRect *data); diff --git a/src/kits/app/PortMessage.cpp b/src/kits/app/PortMessage.cpp index c42b9bcdb6..5d246c4bd3 100644 --- a/src/kits/app/PortMessage.cpp +++ b/src/kits/app/PortMessage.cpp @@ -128,6 +128,22 @@ void PortMessage::SetBuffer(const void *buffer, const ssize_t &size, const bool } } +status_t PortMessage::Read(int64 *data) +{ + if(!data) + return B_BAD_VALUE; + + if( !_buffer || + _buffersize(_buffer+_buffersize)) ) + return B_NO_MEMORY; + + *data=*((int64*)_index); + _index+=sizeof(bool); + + return B_OK; +} + status_t PortMessage::Read(bool *data) { if(!data)