equal
deleted
inserted
replaced
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
18 |
18 |
19 /** |
19 /** |
20 @file |
20 @file |
21 */ |
21 */ |
22 #include "os_symbian.h" |
22 #include "os_symbian.h" |
|
23 #include "SqliteUtil.h" |
|
24 #include "OstTraceDefinitions.h" |
|
25 #ifdef OST_TRACE_COMPILER_IN_USE |
|
26 #include "os_symbian_hrdwTraces.h" |
|
27 #endif |
|
28 #include "SqliteTraceDef.h" |
23 |
29 |
24 #ifdef SQLITE_OS_SYMBIAN |
30 #ifdef SQLITE_OS_SYMBIAN |
25 |
31 |
26 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
32 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
27 ////////////////////////// TStaticFs ///////////////////////////////////////////////////////////////////////////////////////// |
33 ////////////////////////// TStaticFs ///////////////////////////////////////////////////////////////////////////////////////// |
45 TStaticFs::TStaticFs() |
51 TStaticFs::TStaticFs() |
46 { |
52 { |
47 TInt err = Connect(); |
53 TInt err = Connect(); |
48 if(err != KErrNone) |
54 if(err != KErrNone) |
49 { |
55 { |
50 RDebug::Print(_L("===SQLITE OS porting layer, file session creation has failed with err=%d.\r\n"), err); |
56 SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TSTATICFS_TSTATICFS, "OS;0x%X;TStaticFs::TStaticFs;err=%d", (TUint)this, err)); |
51 User::Exit(err); |
57 User::Exit(err); |
52 } |
58 } |
53 } |
59 } |
54 |
60 |
55 /** |
61 /** |
61 |
67 |
62 @see TStaticFs |
68 @see TStaticFs |
63 */ |
69 */ |
64 RFs& TStaticFs::Fs() |
70 RFs& TStaticFs::Fs() |
65 { |
71 { |
66 __ASSERT_DEBUG(TheFs.iFs.Handle() != KNullHandle, User::Panic(KPanicCategory, EPanicInvalidFs)); |
72 __ASSERT_DEBUG(TheFs.iFs.Handle() != KNullHandle, __SQLITEPANIC2(ESqliteOsPanicInvalidFs)); |
67 return TheFs.iFs; |
73 return TheFs.iFs; |
68 } |
74 } |
69 |
75 |
70 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
76 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
71 ////////////////////////// TStaticMutex ////////////////////////////////////////////////////////////////////////////////////// |
77 ////////////////////////// TStaticMutex ////////////////////////////////////////////////////////////////////////////////////// |
89 TStaticMutex::TStaticMutex() |
95 TStaticMutex::TStaticMutex() |
90 { |
96 { |
91 TInt err = Create(); |
97 TInt err = Create(); |
92 if(err != KErrNone) |
98 if(err != KErrNone) |
93 { |
99 { |
94 RDebug::Print(_L("===SQLITE OS porting layer, static mutex creation has failed with err=%d.\r\n"), err); |
100 SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TSTATICMUTEX_TSTATICMUTEX, "OS;0x%X;TStaticMutex::TStaticMutex;err=%d", (TUint)this, err)); |
95 User::Exit(err); |
101 User::Exit(err); |
96 } |
102 } |
97 } |
103 } |
98 |
104 |
99 sqlite3_mutex* StaticMutex(TInt aType) |
105 sqlite3_mutex* StaticMutex(TInt aType) |
100 { |
106 { |
101 __ASSERT_ALWAYS((TUint)aType < (sizeof(TheStaticMutex)/sizeof(TheStaticMutex[0])), User::Panic(KPanicCategory, EPanicInvalidMutexType)); |
107 __ASSERT_ALWAYS((TUint)aType < (sizeof(TheStaticMutex)/sizeof(TheStaticMutex[0])), __SQLITEPANIC2(ESqliteOsPanicInvalidMutexType)); |
102 return &TheStaticMutex[aType]; |
108 return &TheStaticMutex[aType]; |
103 } |
109 } |
104 |
110 |
105 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
111 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
106 ////////////////////////// sqlite3_vfs /////////////////////////////////////////////////////////////////////////////////// |
112 ////////////////////////// sqlite3_vfs /////////////////////////////////////////////////////////////////////////////////// |