1 /*************************************************************************** 2 $RCSfile$ 3 ------------------- 4 cvs : $Id$ 5 begin : Sun Jan 04 2004 6 copyright : (C) 2004 by Martin Preuss 7 email : martin@libchipcard.de 8 9 *************************************************************************** 10 * * 11 * This library is free software; you can redistribute it and/or * 12 * modify it under the terms of the GNU Lesser General Public * 13 * License as published by the Free Software Foundation; either * 14 * version 2.1 of the License, or (at your option) any later version. * 15 * * 16 * This library is distributed in the hope that it will be useful, * 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 19 * Lesser General Public License for more details. * 20 * * 21 * You should have received a copy of the GNU Lesser General Public * 22 * License along with this library; if not, write to the Free Software * 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * 24 * MA 02111-1307 USA * 25 * * 26 ***************************************************************************/ 27 28 29 #ifndef GWEN_DEBUG_P_H 30 #define GWEN_DEBUG_P_H 31 32 33 #include <gwenhywfar/debug.h> 34 35 36 typedef enum { 37 GWEN_MemoryDebugEntryTypeUnknown=0, 38 GWEN_MemoryDebugEntryTypeCreate, 39 GWEN_MemoryDebugEntryTypeAttach, 40 GWEN_MemoryDebugEntryTypeFree 41 } GWEN_MEMORY_DEBUG_ENTRY_TYPE; 42 43 44 45 typedef struct GWEN_MEMORY_DEBUG_ENTRY GWEN_MEMORY_DEBUG_ENTRY; 46 struct GWEN_MEMORY_DEBUG_ENTRY { 47 GWEN_MEMORY_DEBUG_ENTRY *next; 48 GWEN_MEMORY_DEBUG_ENTRY_TYPE type; 49 char *file; 50 int line; 51 }; 52 GWEN_MEMORY_DEBUG_ENTRY * 53 GWEN_MemoryDebugEntry_new(GWEN_MEMORY_DEBUG_ENTRY_TYPE t, 54 const char *wFile, 55 int wLine); 56 void GWEN_MemoryDebugEntry_free(GWEN_MEMORY_DEBUG_ENTRY *e); 57 58 59 struct GWEN_MEMORY_DEBUG_OBJECT { 60 GWEN_MEMORY_DEBUG_OBJECT *next; 61 char *name; 62 long int count; 63 GWEN_MEMORY_DEBUG_ENTRY *entries; 64 }; 65 GWEN_MEMORY_DEBUG_OBJECT *GWEN_MemoryDebugObject_new(const char *name); 66 void GWEN_MemoryDebugObject_free(GWEN_MEMORY_DEBUG_OBJECT *o); 67 68 69 GWEN_MEMORY_DEBUG_OBJECT *GWEN_MemoryDebug__FindObject(const char *name); 70 void GWEN_MemoryDebug__DumpObject(GWEN_MEMORY_DEBUG_OBJECT *o, 71 uint32_t mode); 72 73 74 75 uint32_t GWEN_Debug_PrintDec(char *buffer, 76 uint32_t size, 77 uint32_t num, 78 int leadingZero, 79 uint32_t length); 80 81 82 uint32_t GWEN_Debug_PrintHex(char *buffer, 83 uint32_t size, 84 uint32_t num, 85 int leadingZero, 86 int up, 87 uint32_t length); 88 89 90 91 #endif 92 93 94