From e76917c65873e6b4fdf5bc296d10deed89bdd34b Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Thu, 10 Jul 2003 20:13:23 +0000 Subject: [PATCH] Added Read(int64*) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3947 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/app/PortMessage.h | 1 + src/kits/app/PortMessage.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) 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)