equal
deleted
inserted
replaced
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2009 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" |
|
29 |
23 |
30 #ifdef SQLITE_OS_SYMBIAN |
24 #ifdef SQLITE_OS_SYMBIAN |
31 |
25 |
32 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
26 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
33 ////////////////////////// TStaticFs ///////////////////////////////////////////////////////////////////////////////////////// |
27 ////////////////////////// TStaticFs ///////////////////////////////////////////////////////////////////////////////////////// |
51 TStaticFs::TStaticFs() |
45 TStaticFs::TStaticFs() |
52 { |
46 { |
53 TInt err = Connect(); |
47 TInt err = Connect(); |
54 if(err != KErrNone) |
48 if(err != KErrNone) |
55 { |
49 { |
56 SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TSTATICFS_TSTATICFS, "OS;0x%X;TStaticFs::TStaticFs;err=%d", (TUint)this, err)); |
50 RDebug::Print(_L("===SQLITE OS porting layer, file session creation has failed with err=%d.\r\n"), err); |
57 User::Exit(err); |
51 User::Exit(err); |
58 } |
52 } |
59 } |
53 } |
60 |
54 |
61 /** |
55 /** |
67 |
61 |
68 @see TStaticFs |
62 @see TStaticFs |
69 */ |
63 */ |
70 RFs& TStaticFs::Fs() |
64 RFs& TStaticFs::Fs() |
71 { |
65 { |
72 __ASSERT_DEBUG(TheFs.iFs.Handle() != KNullHandle, __SQLITEPANIC2(ESqliteOsPanicInvalidFs)); |
66 __ASSERT_DEBUG(TheFs.iFs.Handle() != KNullHandle, User::Panic(KPanicCategory, EPanicInvalidFs)); |
73 return TheFs.iFs; |
67 return TheFs.iFs; |
74 } |
68 } |
75 |
69 |
76 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
70 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
77 ////////////////////////// TStaticMutex ////////////////////////////////////////////////////////////////////////////////////// |
71 ////////////////////////// TStaticMutex ////////////////////////////////////////////////////////////////////////////////////// |
95 TStaticMutex::TStaticMutex() |
89 TStaticMutex::TStaticMutex() |
96 { |
90 { |
97 TInt err = Create(); |
91 TInt err = Create(); |
98 if(err != KErrNone) |
92 if(err != KErrNone) |
99 { |
93 { |
100 SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TSTATICMUTEX_TSTATICMUTEX, "OS;0x%X;TStaticMutex::TStaticMutex;err=%d", (TUint)this, err)); |
94 RDebug::Print(_L("===SQLITE OS porting layer, static mutex creation has failed with err=%d.\r\n"), err); |
101 User::Exit(err); |
95 User::Exit(err); |
102 } |
96 } |
103 } |
97 } |
104 |
98 |
105 sqlite3_mutex* StaticMutex(TInt aType) |
99 sqlite3_mutex* StaticMutex(TInt aType) |
106 { |
100 { |
107 __ASSERT_ALWAYS((TUint)aType < (sizeof(TheStaticMutex)/sizeof(TheStaticMutex[0])), __SQLITEPANIC2(ESqliteOsPanicInvalidMutexType)); |
101 __ASSERT_ALWAYS((TUint)aType < (sizeof(TheStaticMutex)/sizeof(TheStaticMutex[0])), User::Panic(KPanicCategory, EPanicInvalidMutexType)); |
108 return &TheStaticMutex[aType]; |
102 return &TheStaticMutex[aType]; |
109 } |
103 } |
110 |
104 |
111 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
105 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
112 ////////////////////////// sqlite3_vfs /////////////////////////////////////////////////////////////////////////////////// |
106 ////////////////////////// sqlite3_vfs /////////////////////////////////////////////////////////////////////////////////// |