diff options
Diffstat (limited to 'store')
31 files changed, 97 insertions, 464 deletions
diff --git a/store/inc/pch/precompiled_store.cxx b/store/inc/pch/precompiled_store.cxx index fa23aac43f84..7fe9c284c5a6 100644 --- a/store/inc/pch/precompiled_store.cxx +++ b/store/inc/pch/precompiled_store.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,3 +28,4 @@ #include "precompiled_store.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/inc/pch/precompiled_store.hxx b/store/inc/pch/precompiled_store.hxx index c6e74b3424bc..fe00b2bb716b 100644 --- a/store/inc/pch/precompiled_store.hxx +++ b/store/inc/pch/precompiled_store.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,3 +31,4 @@ #ifdef PRECOMPILED_HEADERS #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/inc/store/store.h b/store/inc/store/store.h index 0a283a378a29..b4d6626d9d1f 100644 --- a/store/inc/store/store.h +++ b/store/inc/store/store.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,7 +27,7 @@ ************************************************************************/ #ifndef _STORE_STORE_H_ -#define _STORE_STORE_H_ "$Revision: 1.6 $" +#define _STORE_STORE_H_ #include <store/types.h> @@ -409,3 +410,4 @@ storeError SAL_CALL store_remove ( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/inc/store/store.hxx b/store/inc/store/store.hxx index 8e90de321345..e4970845d38b 100644 --- a/store/inc/store/store.hxx +++ b/store/inc/store/store.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -607,3 +608,4 @@ private: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/inc/store/types.h b/store/inc/store/types.h index 1214cacfc92d..272900f11c77 100644 --- a/store/inc/store/types.h +++ b/store/inc/store/types.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,7 +27,7 @@ ************************************************************************/ #ifndef _STORE_TYPES_H_ -#define _STORE_TYPES_H_ "$Revision: 1.8 $" +#define _STORE_TYPES_H_ #include <sal/types.h> #include <rtl/ustring.h> @@ -165,3 +166,4 @@ typedef struct __store_FindData storeFindData; #endif /* _STORE_TYPES_H_ */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx index 7e4ac7bcbb00..b947dd0e3b97 100644 --- a/store/source/lockbyte.cxx +++ b/store/source/lockbyte.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -946,3 +947,5 @@ MemoryLockBytes_createInstance ( } } // namespace store + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/lockbyte.hxx b/store/source/lockbyte.hxx index b2b6c905f9fd..c54b64d538c8 100644 --- a/store/source/lockbyte.hxx +++ b/store/source/lockbyte.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,23 +29,13 @@ #ifndef _STORE_LOCKBYTE_HXX_ #define _STORE_LOCKBYTE_HXX_ -#ifndef _SAL_TYPES_H_ #include "sal/types.h" -#endif -#ifndef _RTL_REF_HXX_ #include "rtl/ref.hxx" -#endif -#ifndef _RTL_USTRING_H_ #include "rtl/ustring.h" -#endif -#ifndef _STORE_TYPES_H_ #include "store/types.h" -#endif -#ifndef _STORE_STORBASE_HXX_ #include "storbase.hxx" -#endif namespace store { @@ -182,3 +173,4 @@ MemoryLockBytes_createInstance ( #endif /* !_STORE_LOCKBYTE_HXX_ */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/object.cxx b/store/source/object.cxx index 40c1cfbbee9c..bebb5f0a170c 100644 --- a/store/source/object.cxx +++ b/store/source/object.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -110,3 +111,5 @@ oslInterlockedCount SAL_CALL OStoreObject::release (void) } } // namespace store + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/object.hxx b/store/source/object.hxx index a3b5ab1c6e63..5f985f5b66af 100644 --- a/store/source/object.hxx +++ b/store/source/object.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,17 +29,11 @@ #ifndef _STORE_OBJECT_HXX_ #define _STORE_OBJECT_HXX_ -#ifndef _SAL_TYPES_H_ #include "sal/types.h" -#endif -#ifndef _RTL_REF_HXX_ #include "rtl/ref.hxx" -#endif -#ifndef _OSL_INTERLCK_H_ #include "osl/interlck.h" -#endif namespace store { @@ -136,3 +131,5 @@ SAL_CALL query (IStoreHandle *pHandle, OStoreObject*) } // namespace store #endif /* !_STORE_OBJECT_HXX_ */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storbase.cxx b/store/source/storbase.cxx index 690bff8d258e..8fd79ba27eff 100644 --- a/store/source/storbase.cxx +++ b/store/source/storbase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -196,3 +197,5 @@ PageData::Allocator::createInstance (rtl::Reference< PageData::Allocator > & rxA OStorePageObject::~OStorePageObject (void) { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx index 9c1e4ea985bf..e2fe649f743b 100644 --- a/store/source/storbase.hxx +++ b/store/source/storbase.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,7 +27,7 @@ ************************************************************************/ #ifndef _STORE_STORBASE_HXX_ -#define _STORE_STORBASE_HXX_ "$Revision: 1.10.8.4 $" +#define _STORE_STORBASE_HXX_ #include "sal/types.h" @@ -952,3 +953,5 @@ inline void OStorePageObject::location (sal_uInt32 nAddr) } // namespace store #endif /* !_STORE_STORBASE_HXX_ */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx index d2612d60b3db..b5f247bf4a99 100644 --- a/store/source/storbios.cxx +++ b/store/source/storbios.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1127,3 +1128,5 @@ storeError OStorePageBIOS::scanNext ( // Done. return store_E_CantSeek; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storbios.hxx b/store/source/storbios.hxx index 439089d41bd6..74cfdc131584 100644 --- a/store/source/storbios.hxx +++ b/store/source/storbios.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -265,3 +266,5 @@ inline bool OStorePageBIOS::ScanContext::isValid (void) const } // namespace store #endif /* !_STORE_STORBIOS_HXX_ */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx index f0e216575277..79c34492e978 100644 --- a/store/source/storcach.cxx +++ b/store/source/storcach.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,6 +32,7 @@ #include "storcach.hxx" #include "sal/types.h" +#include "sal/macros.h" #include "rtl/alloc.h" #include "osl/diagnose.h" @@ -341,7 +343,7 @@ PageCache_Impl::PageCache_Impl (sal_uInt16 nPageSize) m_nHit (0), m_nMissed (0) { - static size_t const theSize = sizeof(m_hash_table_0) / sizeof(m_hash_table_0[0]); + static size_t const theSize = SAL_N_ELEMENTS(m_hash_table_0); STORE_STATIC_ASSERT(theSize == theTableSize); memset(m_hash_table_0, 0, sizeof(m_hash_table_0)); } @@ -559,3 +561,5 @@ PageCache_createInstance ( } } // namespace store + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storcach.hxx b/store/source/storcach.hxx index 7f56a8d83075..46ad5eff15f0 100644 --- a/store/source/storcach.hxx +++ b/store/source/storcach.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,7 +27,7 @@ ************************************************************************/ #ifndef _STORE_STORCACH_HXX -#define _STORE_STORCACH_HXX "$Revision: 1.6.8.2 $" +#define _STORE_STORCACH_HXX #include "sal/types.h" #include "rtl/ref.hxx" @@ -110,3 +111,4 @@ PageCache_createInstance ( #endif /* !_STORE_STORCACH_HXX */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/stordata.cxx b/store/source/stordata.cxx index 901da15c8040..db85ce0eff13 100644 --- a/store/source/stordata.cxx +++ b/store/source/stordata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -723,31 +724,6 @@ OStoreDirectoryPageObject::scope ( return page::SCOPE_UNREACHABLE; } -#if 0 /* NYI */ -/* - * chunk (external data page). - */ -inode::ChunkDescriptor OStoreDirectoryPageObject::chunk (sal_uInt32 nOffset) -{ - // @@@ INSUFFICIENT: NEED SCOPE AS WELL @@@ - sal_uInt32 nCapacity = m_rPage.capacity(); - if (nOffset < nCapacity) - // Internal scope (inode page). - return inode::ChunkDescriptor (nOffset, nCapacity); - else - // External scope (data page). - return inode::ChunkDescriptor (nOffset - nCapacity, data::capacity(m_rPage.m_aDescr)); - - inode::ChunkScope eScope = m_rPage.scope(nOffset); - if (eScope == inode::SCOPE_INTERNAL) - // Inode page (internal scope). - return inode::ChunkDescriptor (nOffset, m_rPage.capacity()); - else - // Data page (external scope). - return inode::ChunkDescriptor (nOffset - m_rPage.capacity(), data::capacity(m_rPage.m_aDescr)); -} -#endif /* NYI */ - /* * read (external data page). */ @@ -1128,3 +1104,5 @@ storeError OStoreDirectoryPageObject::truncate ( // Invalid scope. return store_E_InvalidAccess; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx index 01ea2c0f86ec..61625c32c046 100644 --- a/store/source/stordata.hxx +++ b/store/source/stordata.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -868,3 +869,4 @@ private: #endif /* !_STORE_STORDATA_HXX_ */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/stordir.cxx b/store/source/stordir.cxx index 0b3f16da3cfb..01d4357a2a46 100644 --- a/store/source/stordir.cxx +++ b/store/source/stordir.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,37 +31,19 @@ #include "stordir.hxx" -#ifndef _SAL_TYPES_H_ #include <sal/types.h> -#endif -#ifndef _RTL_TEXTCVT_H_ #include <rtl/textcvt.h> -#endif -#ifndef _RTL_REF_HXX_ #include <rtl/ref.hxx> -#endif -#ifndef _OSL_MUTEX_HXX_ #include <osl/mutex.hxx> -#endif -#ifndef _STORE_TYPES_H_ #include "store/types.h" -#endif -#ifndef _STORE_OBJECT_HXX_ #include "object.hxx" -#endif -#ifndef _STORE_STORBASE_HXX_ #include "storbase.hxx" -#endif -#ifndef _STORE_STORDATA_HXX_ #include "stordata.hxx" -#endif -#ifndef _STORE_STORPAGE_HXX_ #include "storpage.hxx" -#endif using namespace store; @@ -239,3 +222,5 @@ storeError OStoreDirectory_Impl::iterate (storeFindData &rFindData) memset (&rFindData, 0, sizeof (storeFindData)); return store_E_NoMoreFiles; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/stordir.hxx b/store/source/stordir.hxx index 2e3d79e71319..44c14f19cdae 100644 --- a/store/source/stordir.hxx +++ b/store/source/stordir.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,29 +29,15 @@ #ifndef _STORE_STORDIR_HXX_ #define _STORE_STORDIR_HXX_ -#ifndef _SAL_TYPES_H_ #include <sal/types.h> -#endif -#ifndef _RTL_TEXTCVT_H_ #include <rtl/textcvt.h> -#endif -#ifndef _RTL_STRING_H_ #include <rtl/string.h> -#endif -#ifndef _RTL_REF_HXX_ #include <rtl/ref.hxx> -#endif -#ifndef _STORE_OBJECT_HXX_ #include "object.hxx" -#endif -#ifndef _STORE_STORBASE_HXX_ #include "storbase.hxx" -#endif -#ifndef _STORE_STORPAGE_HXX_ #include "storpage.hxx" -#endif namespace store { @@ -147,3 +134,4 @@ SAL_CALL query (IStoreHandle *pHandle, OStoreDirectory_Impl*) #endif /* !_STORE_STORDIR_HXX_ */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/store.cxx b/store/source/store.cxx index fdcce8dd2d00..a77b34acc9ca 100644 --- a/store/source/store.cxx +++ b/store/source/store.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -763,3 +764,5 @@ storeError SAL_CALL store_remove ( // Remove. return xManager->remove (aKey); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storlckb.cxx b/store/source/storlckb.cxx index 5a02131d53eb..658ec52646b6 100644 --- a/store/source/storlckb.cxx +++ b/store/source/storlckb.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -449,3 +450,5 @@ storeError OStoreLockBytes::stat (sal_uInt32 &rnSize) rnSize = aPage.dataLength(); return store_E_None; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storlckb.hxx b/store/source/storlckb.hxx index fd6ef7384613..352095b72bc0 100644 --- a/store/source/storlckb.hxx +++ b/store/source/storlckb.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,7 +27,7 @@ ************************************************************************/ #ifndef _STORE_STORLCKB_HXX_ -#define _STORE_STORLCKB_HXX_ "$Revision: 1.6.8.1 $" +#define _STORE_STORLCKB_HXX_ #include "sal/types.h" @@ -169,3 +170,4 @@ SAL_CALL query (IStoreHandle *pHandle, OStoreLockBytes*) #endif /* !_STORE_STORLCKB_HXX_ */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storpage.cxx b/store/source/storpage.cxx index a49e850061b6..b91528a615df 100644 --- a/store/source/storpage.cxx +++ b/store/source/storpage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -163,71 +164,6 @@ storeError OStorePageManager::find_lookup ( * remove_Impl (possibly down from root). * Internal: Precond: initialized, writeable, exclusive access. */ -#if 0 /* EXP */ -storeError OStorePageManager::remove_Impl (entry & rEntry) -{ - // Find Node and Index. - OStoreBTreeNodeObject aNode; - sal_uInt16 nIndex = 0; - eErrCode = m_aRoot.find_lookup (aNode, nIndex, entry::CompareGreater(rEntry), *this); - - // @@@ - - PageHolderObject< page > xPage (aNode.get()); - page & rPage = (*xPage); - - // Check current page index. - sal_uInt16 i = rPage.find (rEntry), n = rPage.usageCount(); - if (!(i < n)) - { - // Path to entry not exists (Must not happen(?)). - return store_E_NotExists; - } - - // Compare entry. - entry::CompareResult result = rEntry.compare (rPage.m_pData[i]); - - for (; result == entry::COMPARE_GREATER && xPage->depth() > 0; ) - { - // Check next node address. - sal_uInt32 const nAddr = rPage.m_pData[i].m_aLink.location(); - if (nAddr == STORE_PAGE_NULL) - { - // Path to entry not exists (Must not happen(?)). - return store_E_NotExists; - } - - // Load next node page. - eErrCode = loadObjectAt (aNode, nAddr); - - PageHolderObject< page > xNext (aNode.get()); - xNext.swap (xPage); - } - - aNode.remove (nIndex, rEntry, *this); - - - do - { - // Load next node page. - eErrCode = loadObjectAt (aNode, nAddr); - - page const & rPage = (*xPage); - - // Check current page index. - sal_uInt16 i = rPage.find (rEntry), n = rPage.usageCount(); - if (!(i < n)) - { - // Path to entry not exists (Must not happen(?)). - return store_E_NotExists; - } - - // Compare entry. - result = rEntry.compare (rPage.m_pData[i]); - - } while (result == entry::COMPATE_GREATER); -} -#endif /* EXP */ storeError OStorePageManager::remove_Impl (entry & rEntry) { @@ -1055,3 +991,5 @@ storeError OStorePageManager::rebuild ( // Done. return store_E_None; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/storpage.hxx b/store/source/storpage.hxx index bd5d60a72d3c..80841a618e72 100644 --- a/store/source/storpage.hxx +++ b/store/source/storpage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,7 +27,7 @@ ************************************************************************/ #ifndef _STORE_STORPAGE_HXX_ -#define _STORE_STORPAGE_HXX_ "$Revision: 1.6.8.2 $" +#define _STORE_STORPAGE_HXX_ #include "sal/types.h" @@ -224,3 +225,4 @@ SAL_CALL query (IStoreHandle *pHandle, OStorePageManager*) #endif /* !_STORE_STORPAGE_HXX_ */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/stortree.cxx b/store/source/stortree.cxx index 23d7ca778961..508748c3b285 100644 --- a/store/source/stortree.cxx +++ b/store/source/stortree.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -124,22 +125,6 @@ void OStoreBTreeNodeData::remove (sal_uInt16 i) } } -#if 0 /* NYI */ -/* - * merge (with right page). - */ -void OStoreBTreeNodeData::merge (const self& rPageR) -{ - sal_uInt16 const n = usageCount(); - sal_uInt16 const m = rPageR.usageCount(); - if ((n + m) <= capacityCount()) - { - memcpy (&(m_pData[n]), &(rPageR.m_pData[0]), m * sizeof(T)); - usageCount (n + m); - } -} -#endif - /* * split (left half copied from right half of left page). */ @@ -280,25 +265,6 @@ storeError OStoreBTreeNodeObject::remove ( } else { -#if 0 /* NYI */ - // Check for right sibling. - sal_uInt16 const nIndexR = nIndexL + 1; - if (nIndexR < rPage.usageCount()) - { - // Load right link node. - self aNodeR; - eErrCode = rBIOS.loadObjectAt (aNodeR, rPage.m_pData[nIndexR].m_aLink.location()); - if (eErrCode == store_E_None) - { - if (rPageL.queryMerge (rPageR)) - { - rPageL.merge (rPageR); - - eErrCode = rBIOS.free (rPageR.location()); - } - } - } -#endif /* NYI */ // Relink. rPage.m_pData[nIndexL].m_aKey = xPageL->m_pData[0].m_aKey; @@ -580,3 +546,5 @@ storeError OStoreBTreeRootObject::find_insert ( (void) testInvariant("OStoreBTreeRootObject::find_insert(): leave"); return store_E_None; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/source/stortree.hxx b/store/source/stortree.hxx index 820b270b3649..15cb581d1e01 100644 --- a/store/source/stortree.hxx +++ b/store/source/stortree.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,7 +27,7 @@ ************************************************************************/ #ifndef _STORE_STORTREE_HXX -#define _STORE_STORTREE_HXX "$Revision: 1.6.8.2 $" +#define _STORE_STORTREE_HXX #include "sal/types.h" @@ -221,12 +222,6 @@ struct OStoreBTreeNodeData : public store::OStorePageData void insert (sal_uInt16 i, const T& t); void remove (sal_uInt16 i); -#if 0 /* NYI */ - /** merge (with right page). - */ - void merge (const self& rPageR); -#endif - /** split (left half copied from right half of left page). */ void split (const self& rPageL); @@ -343,3 +338,5 @@ private: } // namespace store #endif /* !_STORE_STORTREE_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/workben/t_base.cxx b/store/workben/t_base.cxx index 7f99c287a210..6a96b7c15bb1 100644 --- a/store/workben/t_base.cxx +++ b/store/workben/t_base.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -182,15 +183,6 @@ static void __store_string_newFromUnicode_WithLength ( OUSTRING_TO_OSTRING_CVTFLAGS); } -#if 0 /* UNSUSED */ -static void __store_string_newFromUnicode ( - rtl_String **newString, const rtl_uString *value) -{ - __store_string_newFromUnicode_WithLength ( - newString, value->buffer, value->length); -} -#endif /* UNUSED */ - static void __store_string_newFromUnicode ( rtl_String **newString, const sal_Unicode *value) { @@ -369,3 +361,5 @@ int SAL_CALL main (int argc, char **argv) xBIOS.clear(); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/workben/t_file.cxx b/store/workben/t_file.cxx index f03b0346db4c..6357e7b8a5a6 100644 --- a/store/workben/t_file.cxx +++ b/store/workben/t_file.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,28 +63,6 @@ int SAL_CALL main (int argc, char **argv) argv[1], rtl_str_getLength(argv[1]), osl_getThreadTextEncoding()); -#if 0 /* EXP */ - oslFileError result; - rtl::OUString aPath; - - result = osl_getFileURLFromSystemPath(aFilename.pData, &(aPath.pData)); - if (result != osl_File_E_None) - { - // not SystemPath, assume FileUrl. - aPath = aFilename; - } - if (rtl_ustr_ascii_shortenedCompare_WithLength(aPath.pData->buffer, aPath.pData->length, "file://", 7) != 0) - { - // not FileUrl, assume relative path. - rtl::OUString aBase; - (void) osl_getProcessWorkingDir (&(aBase.pData)); - - // absolute FileUrl. - (void) osl_getAbsoluteFileURL(aBase.pData, aPath.pData, &(aPath.pData)); - } - aFilename = aPath; -#endif /* EXP */ - eErrCode = FileLockBytes_createInstance ( xLockBytes, aFilename.pData, store_AccessReadWrite); if (eErrCode != store_E_None) @@ -242,3 +221,5 @@ int SAL_CALL main (int argc, char **argv) xLockBytes.clear(); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/workben/t_leak.cxx b/store/workben/t_leak.cxx index d4d7b8a840e1..32033268d618 100644 --- a/store/workben/t_leak.cxx +++ b/store/workben/t_leak.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * t_leak.cxx */ @@ -11,9 +12,7 @@ { rtl_Locale * pLocale = 0; osl_getProcessLocale (&pLocale); -#if 0 - rtl_TextEncoding te = osl_getThreadTextEncoding(); - (void) te; -#endif return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/workben/t_page.cxx b/store/workben/t_page.cxx index a0645f00bc58..33ca80ea81a9 100644 --- a/store/workben/t_page.cxx +++ b/store/workben/t_page.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * t_page.cxx */ @@ -126,12 +127,6 @@ SharedCount::Allocator::~Allocator() /*======================================================================*/ -#if 0 /* OLD */ - -typedef store::OStorePageData PageData; - -#else /* NEW */ - #if defined(OSL_BIGENDIAN) #define STORE_DWORD(dword) OSL_SWAPDWORD((dword)) #else @@ -209,8 +204,6 @@ struct PageData } }; -#endif /* NEW */ - class IPageAllocator { public: @@ -707,75 +700,6 @@ public: }; /*======================================================================*/ -#if 0 /* NYI */ -BIOS::load (PageObject & rPage, sal_uInt32 nOffset) -{ - result = m_xCache->readPageAt (rPage.get(), nOffset); - if (result == NotExists) - { - result = m_xLockBytes->readPageAt (rPage.get(), nOffset); - if (result != None) - return result; - - result = rPage.verify(); - if (result != None) - return result; - - result = m_xCache->writePageAt (rPage.get(), nOffset); - } - return result; -} -BIOS::save (PageObject & rPage, sal_uInt32 nOffset) -{ - rPage.guard(); - result = m_xLockBytes->writePageAt (rPage.get(), nOffset); - if (result != None) - return result; - - return m_xCache->writePageAt (rPage.get(), nOffset); -} -BIOS::init (rxLockBytes, eAccessMode, nPageSize) -{ - SuperPage super; - if (eAccessMode == store_AccessCreate) - { - sal_uInt16 pagesize = nPageSize; - if ((STORE_MINIMUM_PAGESIZE > pagesize) || (pagesize > STORE_MAXIMUM_PAGESIZE)) - return store_E_InvalidParameter; - - pagesize = ((pagesize + STORE_MINIMUM_PAGESIZE - 1) & ~(STORE_MINIMUM_PAGESIZE - 1)); - rxLockBytes->init (pagesize); - - super = allocator->construct<SuperPage>(); - super->guard(); - - rxLockBytes->writeAt (0, super, super->size()); - - } - if (eAccessMode != store_AccessCreate) - { - rxLockBytes->readAt (0, &super, super::theSize); - - super.verify(); - } - if (eErrCode != store_E_NotExists) - - -} -#endif /* NYI */ -/*======================================================================*/ - -#if 0 /* NYI */ -class PageCache -{ - std::set<const sal_uInt32, PageObject> m_pages; -public: - storeError readPageAt (PageObject & rPage, sal_uInt32 nOffset); - storeError writePageAt (PageObject const & rPage, sal_uInt32 nOffset); -}; -#endif /* NYI */ - -/*======================================================================*/ class IPageAllocator; class IPageAccess @@ -1225,15 +1149,6 @@ storeError MemoryPageAccess::writePageAt_Impl (PageHolder const & rPage, sal_uIn if (!(pagedata != 0)) return store_E_InvalidParameter; -#if 0 /* NYI */ - sal_uInt16 const bytes = pagedata->size(); // Descr.m_nSize; - OSL_ASSERT(bytes >= PageData::thePageSize); - - offset = rPage.location(); // Descr.m_nAddr; - OSL_ASSERT(nOffset == offset); - - OSL_PRECOND(offset % bytes == 0, "Unaligned page write."); -#endif /* NYI */ return pokeAt (nOffset, pagedata, pagedata->size()); } storeError MemoryPageAccess::peekAt_Impl (sal_uInt32 nOffset, void * pBuffer, sal_uInt32 nBytes) @@ -1374,106 +1289,6 @@ void MappedPageAccess::unmapFile (sal_uInt8 * pData, sal_uInt32 nSize) (void) osl_unmapFile (pData, nSize); } -#if 0 /* NYI */ -storeError MemoryPageAccess_createInstance ( - rtl::Reference< IPageAccess > & rxPageAccess, - storeAccessMode eAccessMode, - sal_uInt16 nPageSize -) -{ - rxPageAccess = new MemoryPageAccess(); - if (!rxPageAccess.is()) - return store_E_OutOfMemory; - - return rxPageAccess->initialize (eAccessMode, nPageSize); -} - -storeError FilePageAccess_createInstance ( - rtl::Reference< IPageAccess > & rxPageAccess, - rtl_uString * pFilename, - storeAccessMode eAccessMode, - sal_uInt16 nPageSize -) -{ - // Acquire file handle. - ResourceHolder<FileHandle> xFile; - result = xFile.get().initialize (pFilename, MODE_TO_NATIVE(eAccessMode)); - if (result != osl_File_E_None) - return ERROR_FROM_NATIVE(result); - - if (eAccessMode == store_AccessReadOnly) - { - ResourceHolder<FileMapping> xMapping; - result = xMapping.get().initialize (xFile.get()); - if (result == osl_File_E_None) - { - const sal_uInt32 nSize = sal::static_int_cast<sal_uInt32>(xMapping.get().m_uSize); - rxPageAccess = new MappedPageAccess (xMapping.get().m_pAddr, nSize); - if (!rxPageAccess.is()) - return store_E_OutOfMemory; - (void) xMapping.release(); - } - } - if (!rxPageAccess.is()) - { - rxPageAccess = new FilePageAccess (xFile.get()); - if (!rxPageAccess.is()) - return store_E_OutOfMemory; - (void) xFile.release(); - } - return rxPageAccess->initialize (eAccessMode, nPageSize); -} -#endif /* NYI */ - -/*======================================================================== - * - * test... - * - *======================================================================*/ -#if 0 /* NYI */ - -struct IDataBlock -{ - virtual sal_uInt16 singleCount() const = 0; - virtual sal_uInt32 singleLink (sal_uInt16 nIndex) const = 0; - virtual void singleLink (sal_uInt16 nIndex, sal_uInt32 nAddr) = 0; - - virtual storeError get() = 0; - virtual storeError put() = 0; - virtual storeError truncate() = 0; -}; - -struct InodePageData : public PageData -{ - virtual INameBlock & getNameBlock() = 0; - virtual IDataBlock & getDataBlock() = 0; -}; - -template< class page_data_type > -page_data_type * query (PageData *, page_data_type *); - -template<> InodePageDataV2* -query (PageData & rData, InodePageDataV2 *) -{ - if (rData.isKindOf(InodePageDataV2::m_nTypeId)) - return static_cast<InodePageDataV2*>(&rData); - return 0; -} - -class InodePageObject : public PageObject -{ -public: - static InodePageObject createInstance (PageData & rData) - { - if (query(&rData, static_cast<InodePageDataV2*>(0))) - return InodePageObjectV2 (static_cast<InodePageDataV2&>(rData)); - else if (query(&rData, static_cast<InodePageDataV1*>(0))) - return InodePageObjectV1 (static_cast<InodePageDataV1&>(rData)); - } -}; - -#endif /* NYI */ - /*======================================================================== * * main. @@ -1482,33 +1297,6 @@ public: #include <stdio.h> -#if 0 /* EXP */ -class Interface -{ -public: - virtual void deallocate(void *) /* = 0 */; -}; - -class Implementation : public Interface -{ - SharedCount m_count; - -public: - Implementation() : Interface() { printf("Ctor(%p)\n", this); } - ~Implementation() { printf("Dtor(%p)\n", this); } - - Implementation (Implementation const & rhs) : Interface(), m_count (rhs.m_count) { printf("CopyCtor(%p)\n", this); } - - virtual void deallocate(void *) {} -}; - -Interface Interface_createInstance() -{ - Implementation aInst; - return aInst; -} -#endif /* EXP */ - int SAL_CALL main (int argc, char ** argv) { OSL_PRECOND(argc >= 1, "t_page: error: insufficient number of arguments."); @@ -1533,12 +1321,6 @@ int SAL_CALL main (int argc, char ** argv) TestClient aClient; aClient.dwim (aBIOS); } -#if 0 /* EXP */ - { - Interface aIfc1 (Interface_createInstance()); - Interface aIfc2 (aIfc1); - } -#endif /* EXP */ if (argc > 1) { @@ -1572,3 +1354,5 @@ int SAL_CALL main (int argc, char ** argv) return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/workben/t_store.cxx b/store/workben/t_store.cxx index 88e77cb07196..19678b2ab86e 100644 --- a/store/workben/t_store.cxx +++ b/store/workben/t_store.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_store.hxx" -#define _T_STORE_CXX "$Revision: 1.7.8.2 $" +#define _T_STORE_CXX #include <sal/types.h> #include <osl/diagnose.h> #include <osl/thread.h> @@ -173,7 +174,7 @@ DirectoryTraveller::DirectoryTraveller ( m_nCount (0) { m_aPath += rName; - m_aPath += OUString::createFromAscii("/"); + m_aPath += OUString(RTL_CONSTASCII_USTRINGPARAM("/")); } /* @@ -369,7 +370,7 @@ int SAL_CALL main (int argc, char **argv) { OUString aName (RTL_CONSTASCII_USTRINGPARAM("demostor-")); aName += OUString::valueOf ((sal_Int32)(i + 1), 10); - aName += OUString::createFromAscii (".dat"); + aName += OUString(RTL_CONSTASCII_USTRINGPARAM (".dat")); #if (_DEMOSTOR_REMOVE == 1) eErrCode = aFile.remove (aPath, aName); @@ -457,7 +458,7 @@ int SAL_CALL main (int argc, char **argv) { // Create symlink to (root) directory. eErrCode = aFile.symlink ( - aPath, OUString::createFromAscii("000000/"), + aPath, OUString(RTL_CONSTASCII_USTRINGPARAM("000000/")), OUString(), aPath); OSL_POSTCOND( ((eErrCode == store_E_None ) || @@ -469,7 +470,7 @@ int SAL_CALL main (int argc, char **argv) eErrCode = aFile.symlink ( aPath, aLinkName, - aPath, OUString::createFromAscii("demostor-1.dat")); + aPath, OUString(RTL_CONSTASCII_USTRINGPARAM("demostor-1.dat"))); OSL_POSTCOND( ((eErrCode == store_E_None ) || (eErrCode == store_E_AlreadyExists) ), @@ -499,23 +500,6 @@ int SAL_CALL main (int argc, char **argv) "t_store::main(): store_createDirectory() failed"); if (eErrCode == store_E_None) { -#if 0 /* NYI */ - // Rename directory. - eErrCode = aFile.rename ( - aPath, "demostor-1.dir/", - aPath, "Renamed demostor-1.dir"); - OSL_POSTCOND( - ((eErrCode == store_E_None ) || - (eErrCode == store_E_AlreadyExists) ), - "t_store::main(): store_rename() failed"); - - eErrCode = aFile.rename ( - aPath, "Renamed demostor-1.dir/", - aPath, "demostor-1.dir"); - OSL_POSTCOND( - (eErrCode == store_E_None), - "t_store::main(): store_rename() failed"); -#endif /* NYI */ } } @@ -533,7 +517,7 @@ int SAL_CALL main (int argc, char **argv) { // Open symlink entry. eErrCode = aRootDir.create ( - aFile, aPath, OUString::createFromAscii("000000"), + aFile, aPath, OUString(RTL_CONSTASCII_USTRINGPARAM("000000")), store_AccessReadOnly); } else @@ -603,3 +587,5 @@ int SAL_CALL main (int argc, char **argv) return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |