Update contrib.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Library to add s32strm support for IPC (ie. stream via multiple IPC read/writes instead of
16 * copying to a buffer and streaming to/from there.
27 EXPORT_C void RIpcBuf::Open(const RMessagePtr2& aMessage, TInt aMessageSlot)
30 iMessageSlot = aMessageSlot;
35 EXPORT_C TStreamPos RIpcBuf::DoSeekL(TMark aMark, TStreamLocation aLocation, TInt anOffset)
38 TInt size = iMessage.GetDesLengthL(iMessageSlot);
42 case EStreamBeginning:
51 else if (aMark&EWrite)
53 anOffset += iWritePos;
62 User::Panic(KIpcBufPanic, EIpcBufSeekUnknownLocation);
66 // offset can't be negative or greater than size
67 if (anOffset > size || anOffset < 0)
69 User::Panic(KIpcBufPanic, EIpcBufSeekBadOffset);
76 else if (aMark&EWrite)
81 return TStreamPos(anOffset);
84 EXPORT_C TInt RIpcBuf::DoReadL(TAny *aPtr, TInt aMaxLength)
86 TPtr8 ptr((TUint8*)aPtr, aMaxLength);
87 iMessage.ReadL(iMessageSlot, ptr, iReadPos);
88 TInt len = ptr.Length();
93 EXPORT_C void RIpcBuf::DoWriteL(const TAny* aPtr,TInt aLength)
95 TPtr8 ptr((TUint8*)aPtr, aLength, aLength);
96 iMessage.WriteL(iMessageSlot, ptr, iWritePos);