connectivitylayer/isimessage/isimessage_dll/inc/isimessagetrace.h
author Tom Pritchard <tomp@symbian.org>
Mon, 09 Nov 2009 10:36:19 +0000
changeset 4 510c70acdbf6
parent 0 63b37f68c1ce
permissions -rw-r--r--
More tidying up files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     1
/*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     3
* All rights reserved.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     8
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     9
* Initial Contributors:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    11
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    12
* Contributors:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    13
* 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    14
* Description: 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    15
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    16
*/
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    17
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    18
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    19
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    20
#ifndef ISIMESSAGETRACE_H
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    21
#define ISIMESSAGETRACE_H
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    22
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    23
// INCLUDES
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    24
// CONSTANTS
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    25
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    26
// MACROS
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    27
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    28
    #ifdef TRACE_MODE_KERNEL
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    29
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    30
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    31
		#define _LIT_FOR_ASSERT(a) reinterpret_cast< const char* > ( ( ( const TDesC& )( a ) ).Ptr() )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    32
        #define _T(a) a
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    33
    #else 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    34
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    35
		// INCLUDES
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    36
		#include <e32svr.h>	// RDebug
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    37
        #include <e32std.h>
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    38
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    39
		#define _LIT_FOR_ASSERT(a) error
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    40
        #define _T(a) _L(a)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    41
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    42
    #endif // TRACE_MODE_KERNEL
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    43
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    44
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    45
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    46
// macro __TRACE_PRINTF id defined because it is needed in build trace. It has also
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    47
// been included in other trace macros
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    48
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    49
#if defined TRACE_MODE_KERNEL
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    50
	#define __TRACE_PRINTF(a) Kern::Printf a
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    51
#else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    52
	#define __TRACE_PRINTF(a) RDebug::Print a
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    53
#endif
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    54
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    55
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    56
#ifdef _DEBUG
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    57
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    58
    void BuildTraceFunc( const TDesC& aPrefix );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    59
    void DataDumpTraceFunc( const TDesC& aPrefix, const TDesC8& aData );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    60
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    61
    #define BUILD_TRACE( a ) BuildTraceFunc( a )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    62
	#define DATA_DUMP_TRACE( a, b ) DataDumpTraceFunc( a, b )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    63
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    64
    #if defined TRACE_MODE_KERNEL
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    65
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    66
		// define assertions
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    67
            #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled=" __DATE__" "__TIME__, __LINE__ ))
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    68
            #ifdef __WINS__
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    69
                #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__ ))
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    70
            #else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    71
                #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__""),__LINE__ ))
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    72
            #endif  //__WINS__
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    73
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    74
    #else 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    75
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    76
		// define assertions
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    77
        #ifdef __WINS__
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    78
            #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("IsiMessage error, assertion failed: file= TIsi.cpp, line=%d  "),__LINE__) )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    79
        #else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    80
            #define TRACE_ASSERT(a) if (!(a)) __TRACE_PRINTF((_L("IsiMessage error, assertion failed: file= TIsi.cpp, line=%d  "),__LINE__) )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    81
        #endif  //__WINS__
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    82
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    83
    #endif // TRACE_MODE_KERNEL
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    84
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    85
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    86
    #if defined COMPONENT_TRACE_FLAG
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    87
        #define C_TRACE(a) __TRACE_PRINTF(a)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    88
    #else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    89
        #define C_TRACE(a) 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    90
    #endif // COMPONENT_TRACE_FLAG
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    91
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    92
    #if defined API_TRACE_FLAG
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    93
        #define A_TRACE(a) __TRACE_PRINTF(a)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    94
    #else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    95
        #define A_TRACE(a)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    96
    #endif // API_TRACE_FLAG
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    97
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    98
    #if defined EXTENDED_TRACE_FLAG
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    99
        #define E_TRACE(a) __TRACE_PRINTF(a)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   100
	#else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   101
		#define E_TRACE(a)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   102
    #endif // EXTENDED_TRACE_FLAG
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   103
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   104
#else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   105
    #define TRACE_ASSERT(a)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   106
    #define C_TRACE(a)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   107
    #define A_TRACE(a)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   108
    #define E_TRACE(a)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   109
	#define BUILD_TRACE(a)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   110
    #define DATA_DUMP_TRACE(a, b)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   111
#endif // _DEBUG
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   112
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   113
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   114
// Both in UDEB and UREL (Always traces)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   115
#if defined TRACE_MODE_KERNEL
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   116
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   117
        #define ASSERT_RESET_ALWAYS(a,b,c) if(!(a)) { __TRACE_PRINTF(("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__)); Kern::Fault(b,c); }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   118
		#define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( ("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__, __LINE__) )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   119
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   120
        #ifdef __WINS__
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   121
            #define ASSERT_RESET_ALWAYS(a,b,c) if(!(a)) { __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__" ), __LINE__) ); Plat::Fault(_L(b),c); }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   122
            #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( _L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__" ), __LINE__)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   123
        #else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   124
            #define ASSERT_RESET_ALWAYS(a,b,c) if(!(a)) { __TRACE_PRINTF( (_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__"" ), __LINE__) ); Plat::Fault(b,c); }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   125
            #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__" "__TIME__"" ), __LINE__) )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   126
        #endif //WINS
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   127
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   128
#else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   129
    #ifdef __WINS__
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   130
		#define ASSERT_RESET_ALWAYS(a,b,c) if(!(a)) { __TRACE_PRINTF( (_L("Assertion failed: file=TIsi.cpp, line=%d," ), __LINE__) ); User::Panic(b,c); }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   131
        #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file= __FILE__ , line=%d, compiled=__DATE__ __TIME__ "),__LINE__) )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   132
    #else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   133
		#define ASSERT_RESET_ALWAYS(a,b,c) if(!(a)) { __TRACE_PRINTF( (_L("Assertion failed: file=TIsi.cpp, line=%d," ), __LINE__) ); User::Panic(b,c); }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   134
        #define TRACE_ASSERT_ALWAYS __TRACE_PRINTF( (_L("Assertion failed: file=" __FILE__ ", line=%d, compiled="__DATE__ __TIME__""),__LINE__) )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   135
    #endif
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   136
#endif // kernel
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   137
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   138
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   139
// DATA TYPES
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   140
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   141
// FUNCTION PROTOTYPES
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   142
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   143
// FORWARD DECLARATIONS
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   144
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   145
#endif // ISIMESSAGETRACE_H
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   146
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   147
//  End of File