diff --git a/headers/private/app/PortLink.h b/headers/private/app/PortLink.h index e2943130f3..25800e328e 100644 --- a/headers/private/app/PortLink.h +++ b/headers/private/app/PortLink.h @@ -7,27 +7,24 @@ * Pahtz * Axel Dörfler, axeld@pinc-software.de */ -#ifndef _PORTLINK_H -#define _PORTLINK_H +#ifndef _SERVER_LINK_H +#define _SERVER_LINK_H + #include #include #include + /* - Error checking rules: (for if you don't want to check every return code) - - Calling EndMessage() is optional, implied by Flush() or StartMessage(). - - If you are sending just one message you only need to test Flush() == B_OK - - If you are buffering multiple messages without calling Flush() you must - check EndMessage() == B_OK, or the last Attach() for each message. Check - Flush() at the end. - - If you are reading, check the last Read() or ReadString() you perform. - -*/ + * Error checking rules: (for if you don't want to check every return code) + * - Calling EndMessage() is optional, implied by Flush() or StartMessage(). + * - If you are sending just one message you only need to test Flush() == B_OK + * - If you are buffering multiple messages without calling Flush() you must + * check EndMessage() == B_OK, or the last Attach() for each message. + * Check Flush() at the end. + * - If you are reading, check the last Read() or ReadString() you perform. + */ namespace BPrivate { @@ -60,6 +57,7 @@ class ServerLink { status_t GetNextMessage(int32 &code, bigtime_t timeout = B_INFINITE_TIMEOUT); bool NeedsReply() const; status_t Read(void *data, ssize_t size); + status_t ReadString(char *buffer, size_t bufferSize); status_t ReadString(char **string); status_t ReadRegion(BRegion *region); status_t ReadShape(BShape *shape); @@ -173,6 +171,12 @@ ServerLink::Read(void *data, ssize_t size) return fReceiver->Read(data, size); } +inline status_t +ServerLink::ReadString(char *buffer, size_t bufferSize) +{ + return fReceiver->ReadString(buffer, bufferSize); +} + inline status_t ServerLink::ReadString(char **string) { @@ -187,4 +191,4 @@ ServerLink::Read(Type *data) } // namespace BPrivate -#endif /* _PORTLINK_H */ +#endif /* _SERVER_LINK_H */