xml/cxmllibrary/src/utils/include/cxml_mem.h
branchRCL_3
changeset 21 604ca70b6235
parent 20 889504eac4fb
equal deleted inserted replaced
20:889504eac4fb 21:604ca70b6235
     1 /*
       
     2 * Copyright (c) 2003 - 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /*
       
    20 ** Includes
       
    21 */
       
    22 #include <xml/cxml/cxml_type_def.h>
       
    23 
       
    24 /***************************************************************************
       
    25 **   File: cxml_mem.h
       
    26 **   Purpose:  Provides the interface to memory management
       
    27 **************************************************************************/
       
    28 
       
    29 #ifndef CXML_MEM_H
       
    30 #define CXML_MEM_H
       
    31 
       
    32 #ifdef __cplusplus
       
    33 extern "C" {
       
    34 #endif
       
    35 
       
    36   /*
       
    37 #ifdef _DEBUG
       
    38 #define FEATURE_MEMORY_PROFILE
       
    39 #endif
       
    40 */
       
    41 
       
    42 #define NW_Mem_memset(x, y, z)  CXML_Mem_memset(x, y, z) 
       
    43 #define NW_Mem_memcpy(x, y, z)  CXML_Mem_memcpy(x, y, z) 
       
    44 #define NW_Mem_memmove(x, y, z) CXML_Mem_memmove(x, y, z)
       
    45 #define NW_Mem_memcmp(x, y, z)  CXML_Mem_memcmp(x, y, z) 
       
    46 
       
    47 #ifdef FEATURE_MEMORY_PROFILE
       
    48 #define NW_Mem_Malloc(x)        CXML_Mem_Malloc_Pro(x,__FILE__,__LINE__) 
       
    49 #define NW_Mem_Free(x)          CXML_Mem_Free_Pro(x,__FILE__,__LINE__) 
       
    50 
       
    51 void *CXML_Mem_Malloc_Pro(CXML_Uint32 nbytes, char *file, CXML_Uint32 line);
       
    52 void CXML_Mem_Free_Pro(void *buffer, char *file, CXML_Uint32 line);
       
    53 
       
    54 #define NW_CTX_MEM_PRO_LAST_PTR  26
       
    55 #define NW_CTX_MEM_PRO_SEQ_NO 27
       
    56 
       
    57 #else
       
    58 #define NW_Mem_Malloc(x)        CXML_Mem_Malloc(x) 
       
    59 #define NW_Mem_Free(x)          CXML_Mem_Free(x) 
       
    60 
       
    61 void *CXML_Mem_Malloc(CXML_Uint32 nbytes);
       
    62 void CXML_Mem_Free(void *buffer);
       
    63 #endif
       
    64 
       
    65 /*
       
    66 **-------------------------------------------------------------------------
       
    67 **  External Public Functions
       
    68 **-------------------------------------------------------------------------
       
    69 */
       
    70 
       
    71 void *CXML_Mem_memset(void *s, CXML_Uint32 c, CXML_Uint32 n);
       
    72 
       
    73 void *CXML_Mem_memcpy(void *s1, const void *s2, CXML_Uint32 n);
       
    74 
       
    75 void *CXML_Mem_memmove(void *s1, const void *s2, CXML_Uint32 n);
       
    76 
       
    77 CXML_Int32 CXML_Mem_memcmp(const void *s1, const void *s2, CXML_Uint32 n);
       
    78 
       
    79 #ifdef __cplusplus
       
    80 } /* extern "C" */
       
    81 #endif
       
    82 
       
    83 #endif  /* CXML_MEM_H */
       
    84 
       
    85