diff options
Diffstat (limited to 'tools/source/stream/strmos2.cxx')
-rw-r--r-- | tools/source/stream/strmos2.cxx | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/tools/source/stream/strmos2.cxx b/tools/source/stream/strmos2.cxx index d211d7790b08..a35fc7731767 100644 --- a/tools/source/stream/strmos2.cxx +++ b/tools/source/stream/strmos2.cxx @@ -757,108 +757,4 @@ void SvFileStream::SetSize( ULONG nSize ) } } -#if 0 -/************************************************************************* -|* -|* SvSharedMemoryStream::AllocateMemory() -|* -|* Beschreibung STREAM.SDW -|* Ersterstellung CL 05.05.95 -|* Letzte Aenderung CL 05.05.95 -|* -*************************************************************************/ - -sal_Bool SvSharedMemoryStream::AllocateMemory( ULONG nNewSize ) -{ - DBG_ASSERT(aHandle==0,"Keine Handles unter OS/2"); - DBG_ASSERT(nNewSize,"Cannot allocate zero Bytes"); - APIRET nRet = DosAllocSharedMem( (void**)&pBuf, (PSZ)NULL, nNewSize, - PAG_READ | PAG_WRITE | PAG_COMMIT | - OBJ_GIVEABLE | OBJ_GETTABLE | OBJ_ANY); - return( nRet == 0 ); -} - -/************************************************************************* -|* -|* SvSharedMemoryStream::ReAllocateMemory() (Bozo-Algorithmus) -|* -|* Beschreibung STREAM.SDW -|* Ersterstellung CL 05.05.95 -|* Letzte Aenderung CL 05.05.95 -|* -*************************************************************************/ - -sal_Bool SvSharedMemoryStream::ReAllocateMemory( long nDiff ) -{ - DBG_ASSERT(aHandle==0,"Keine Handles unter OS/2"); - sal_Bool bRetVal = FALSE; - ULONG nNewSize = nSize + nDiff; - if( nNewSize ) - { - // neuen Speicher nicht ueber AllocateMemory holen, da wir den - // alten Speicher behalten wollen, falls nicht genuegend Platz - // fuer den neuen Block da ist - char* pNewBuf; - APIRET nRet = DosAllocSharedMem( (void**)&pNewBuf,(PSZ)NULL,nNewSize, - PAG_READ | PAG_WRITE | PAG_COMMIT | - OBJ_GIVEABLE | OBJ_GETTABLE | OBJ_ANY); - DBG_ASSERT(!nRet,"DosAllocSharedMem failed"); - - if( !nRet ) - { - bRetVal = TRUE; // Success! - if( nNewSize < nSize ) // Verkleinern ? - { - memcpy( pNewBuf, pBuf, (size_t)nNewSize ); - if( nPos > nNewSize ) - nPos = 0L; - if( nEndOfData >= nNewSize ) - nEndOfData = nNewSize-1L; - } - else - memcpy( pNewBuf, pBuf, (size_t)nSize ); - - FreeMemory(); // den alten Block loeschen ... - // und den neuen Block in Dienst stellen - pBuf = (sal_uInt8*)pNewBuf; - nSize = nNewSize; - } - } - else - { - bRetVal = TRUE; - FreeMemory(); - pBuf = 0; - nSize = 0; - nEndOfData = 0; - } - return bRetVal; -} - -void SvSharedMemoryStream::FreeMemory() -{ - DBG_ASSERT(aHandle==0,"Keine Handles unter OS/2"); - DosFreeMem( pBuf ); -} - -/************************************************************************* -|* -|* SvSharedMemoryStream::SetHandle() -|* -|* Beschreibung STREAM.SDW -|* Ersterstellung OV 05.10.95 -|* Letzte Aenderung OV 05.10.95 -|* -*************************************************************************/ - -void* SvSharedMemoryStream::SetHandle( void* aNewHandle, sal_Size nSize, - sal_Bool bOwnsData, sal_Size nEOF ) -{ - DBG_ERROR("OS/2 does not support memory handles"); - // return SetBuffer(aNewHandle, nSize, bOwnsData, nEOF ); - return 0; -} - - -#endif // 0 |