persistentstorage/dbms/security/SC_Defs.h
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Global definitions for DBMS security policy framework
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __SC_DEFS_H__
       
    19 #define __SC_DEFS_H__
       
    20 
       
    21 #include <e32def.h>
       
    22 
       
    23 /**
       
    24 KMaxStmtLength constant represents max allowed text policy file statement length.
       
    25 @internalComponent
       
    26 */
       
    27 const TInt KMaxStmtLength = 256;
       
    28 
       
    29 /**
       
    30 The following three constants (KDBSCMajorVersion, KDBSCMinorVersion, KDBSCBuild) 
       
    31 represent major, minor and build version numbers, currently 
       
    32 supported by the DBMS security policy framework.
       
    33 @internalComponent
       
    34 */
       
    35 
       
    36 /**
       
    37 An enum with consecutive DBSC major version numbers.
       
    38 If a new major version number has to be added, add it at the end of the enum, giving
       
    39 it the next available number m (KDBSCMajorVersion<m>) and change the value of 
       
    40 KDBSCMajorVersion constant.
       
    41 @internalComponent
       
    42 */
       
    43 enum
       
    44 	{
       
    45 	//first security policy file major version.
       
    46 	KDBSCMajorVersion1 = 1
       
    47 	};
       
    48 
       
    49 /**
       
    50 An enum with consecutive DBSC minor version numbers.
       
    51 If a new minor version number has to be added, add it at the end of the enum, giving
       
    52 it the next available number n (KDBSCMinorVersion<m_n>, where m stands for major, n - for minor) 
       
    53 and change the value of KDBSCMinorVersion constant.
       
    54 @internalComponent
       
    55 */
       
    56 enum
       
    57 	{
       
    58 	//first security policy file minor version.
       
    59 	KDBSCMinorVersion1_0 = 0,
       
    60 	//A new section type was added to the set of supported sections in the security
       
    61 	//policy file - "[BACKUP]" with a "SID" statement, for the sid of the process having
       
    62 	//rights to do databases backup and restore.
       
    63 	KDBSCMinorVersion1_1 = 1
       
    64 	};
       
    65 
       
    66 //If a version v has to be compared agianst some other version, use:
       
    67 //(v.maj * 128 + v.min). 128, because v.maj an v.min are 8 bit integers.
       
    68 //The CVERSION macro does the calculation. "C" in the macro name stands for "COMPARABLE".
       
    69 #define CVERSION(maj, min) (((maj) * 128) + (min))
       
    70 
       
    71 //Current software version.
       
    72 const TInt8 KDBSCMajorVersion	= KDBSCMajorVersion1;
       
    73 const TInt8 KDBSCMinorVersion	= KDBSCMinorVersion1_1;
       
    74 const TInt  KDBSCVersion		= CVERSION(KDBSCMajorVersion, KDBSCMinorVersion);
       
    75 
       
    76 const TInt16 KDBSCBuild			= 1;//Stored in the file header, but not used
       
    77 
       
    78 #endif//__SC_DEFS_H__