DVBCore  1.0
Open source DVB engine
inc/dbgmemory.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
00003  * Copyright © 2014 Ocean Blue Software Ltd
00004  *
00005  * This file is part of a DTVKit Software Component
00006  * You are permitted to copy, modify or distribute this file subject to the terms
00007  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
00008  * 
00009  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00010  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
00011  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00012  * 
00013  * If you or your organisation is not a member of DTVKit then you have access
00014  * to this source code outside of the terms of the licence agreement
00015  * and you are expected to delete this and any associated files immediately.
00016  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
00017  *******************************************************************************/
00025 // pre-processor mechanism so multiple inclusions don't cause compilation error
00026 #ifndef _DBGMEMORY_H
00027 #define _DBGMEMORY_H
00028 
00029 #ifndef PGW_ENABLED
00030 #ifndef _STBHEAP_C
00031 // uncomment these #defines for memory write debuging
00032 // you would also need to build the required functionality
00033 // into the stb library ---> ie. by uncommenting the
00034 // relevant #defines in source file stbheap.c
00035 //#define DEBUG_MEMCOPY
00036 //#define DEBUG_TEST_APPHEAP
00037 //#define DEBUG_TEST_STBHEAP
00038 #endif
00039 #endif
00040 
00041 // Define macros and function prototypes associated with debug facilities...
00042 #ifdef DEBUG_MEMCOPY
00043 
00044    #include <stdarg.h>
00045 
00046    #define memcpy(s1, s2, n)  STB_MemCopy((s1), (s2), (n))
00047 void* STB_MemCopy(void *s1, const void *s2, U16BIT n);
00048 
00049    #define memmove(s1, s2, n) STB_MemMove((s1), (s2), (n))
00050 void* STB_MemMove(void *s1, const void *s2, U16BIT n);
00051 
00052    #define memset(s, c, n)    STB_MemSet((s), (c), (n))
00053 void* STB_MemSet(void *s, int c, U16BIT n);
00054 
00055    #define strcpy(s1, s2)    STB_StrCopy((s1), (s2))
00056 char* STB_StrCopy(char *s1, const char *s2);
00057 
00058    #define strncpy(s1, s2, n) STB_StrNCopy((s1), (s2), (n))
00059 char* STB_StrNCopy(char *s1, const char *s2, U16BIT n);
00060 
00061    #define strcat(s1, s2)    STB_StrCat((s1), (s2))
00062 char* STB_StrCat(char *s1, const char *s2);
00063 
00064    #define strncat(s1, s2, n) STB_StrNCat((s1), (s2), (n))
00065 char* STB_StrNCat(char *s1, const char *s2, U16BIT n);
00066 
00067    #define vsprintf(s1, fmt, va)    STB_VSPrintF((s1), (fmt), (va))
00068 int STB_VSPrintF(char *s1, const char *fmt, va_list va);
00069 
00070    #define sprintf                STB_SPrintF
00071 int STB_SPrintF(char *s1, const char *fmt, ...);
00072 
00073    #define snprintf              STB_SNPrintF
00074 int STB_SNPrintF(char *s1, U16BIT n, const char *fmt, ...);
00075 #endif //#ifdef DEBUG_MEMCOPY
00076 
00077 #ifdef DEBUG_TEST_APPHEAP
00078    #define DBG_CHECK_APPHEAP()   STB_CheckAppHeap()
00079 void STB_CheckAppHeap(void);
00080 #else
00081    #define DBG_CHECK_APPHEAP()
00082 #endif //#ifdef DEBUG_TEST_APPHEAP
00083 
00084 #ifdef DEBUG_TEST_STBHEAP
00085    #define DBG_CHECK_STBHEAP()   STB_CheckStbHeap()
00086 void STB_CheckStbHeap(void);
00087 #else
00088    #define DBG_CHECK_STBHEAP()
00089 #endif //#ifdef DEBUG_TEST_STBHEAP
00090 
00091 #endif // _DBGMEMORY_H
00092 
 All Data Structures Files Functions Typedefs Defines