Changeset 13 for trunk/include/helpers
- Timestamp:
- Nov 23, 2000, 7:36:41 PM (25 years ago)
- Location:
- trunk/include/helpers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/memdebug.h
r7 r13 41 41 extern PFNCBMEMDLOG G_pMemdLogFunc; 42 42 43 /* ****************************************************************** 44 * 45 * Private declarations 46 * 47 ********************************************************************/ 48 49 #ifdef MEMDEBUG_PRIVATE 50 51 BOOL memdLock(VOID); 52 53 VOID memdUnlock(VOID); 54 55 /* 56 *@@ HEAPITEM: 57 * informational structure created for each 58 * malloc() call by memdMalloc. These are stored 59 * in a global linked list (G_pHeapItemsRoot). 60 * 61 * We cannot use the linklist.c functions for 62 * managing the linked list because these use 63 * malloc in turn, which would lead to infinite 64 * loops. 65 * 66 *@@added V0.9.3 (2000-04-11) [umoeller] 67 */ 68 69 typedef struct _HEAPITEM 70 { 71 struct _HEAPITEM *pNext; // next item in linked list or NULL if last 72 73 void *pAfterMagic; // memory pointer returned by memdMalloc; 74 // this points to after the magic string 75 unsigned long ulSize; // requested size (without magic head and tail) 76 77 const char *pcszSourceFile; // as passed to memdMalloc 78 unsigned long ulLine; // as passed to memdMalloc 79 const char *pcszFunction; // as passed to memdMalloc 80 81 DATETIME dtAllocated; // system date/time at time of memdMalloc call 82 83 ULONG ulTID; // thread ID that memdMalloc was running on 84 85 BOOL fFreed; // TRUE only after item has been freed by memdFree 86 } HEAPITEM, *PHEAPITEM; 87 88 extern PHEAPITEM G_pHeapItemsRoot; 89 extern ULONG G_ulItemsReleased; 90 extern ULONG G_ulBytesReleased; 91 92 #endif // MEMDEBUG_PRIVATE 93 94 /* ****************************************************************** 95 * 96 * Publics 97 * 98 ********************************************************************/ 99 43 100 void* memdMalloc(size_t stSize, 44 101 const char *pcszSourceFile, … … 57 114 const char *pcszFunction); 58 115 116 void* memdRealloc(void *p, 117 size_t stSize, 118 const char *pcszSourceFile, 119 unsigned long ulLine, 120 const char *pcszFunction); 121 59 122 unsigned long memdReleaseFreed(void); 60 123 … … 64 127 #define malloc(ul) memdMalloc(ul, __FILE__, __LINE__, __FUNCTION__) 65 128 #define calloc(n, size) memdCalloc(n, size, __FILE__, __LINE__, __FUNCTION__) 129 #define realloc(p, ul) memdRealloc(p, ul, __FILE__, __LINE__, __FUNCTION__) 66 130 #define free(p) memdFree(p, __FILE__, __LINE__, __FUNCTION__) 67 131 … … 79 143 #ifdef PM_INCLUDED 80 144 /******************************************************************** 81 * *82 * XFolder debugging helpers *83 * *145 * 146 * XFolder debugging helpers 147 * 84 148 ********************************************************************/ 85 149 … … 94 158 95 159 /* ****************************************************************** 96 * *97 * Heap debugging window *98 * *160 * 161 * Heap debugging window 162 * 99 163 ********************************************************************/ 100 164 -
trunk/include/helpers/stringh.h
r12 r13 64 64 65 65 ULONG strhrpl(PSZ *ppszBuf, 66 ULONGulOfs,66 PULONG pulOfs, 67 67 const char *pcszSearch, 68 const char *pcszReplace, 69 PULONG pulAfterOfs); 68 const char *pcszReplace); 70 69 71 70 ULONG strhWords(PSZ psz); … … 74 73 75 74 PSZ strhThousandsDouble(PSZ pszTarget, double dbl, CHAR cThousands); 75 76 PSZ strhVariableDouble(PSZ pszTarget, double dbl, PSZ pszUnits, 77 CHAR cThousands); 76 78 77 79 VOID strhFileDate(PSZ pszBuf, … … 102 104 PSZ *ppszEnd); 103 105 106 BOOL strhIsWord(const char *pcszBuf, 107 const char *p, 108 ULONG cbSearch, 109 const char *pcszBeginChars, 110 const char *pcszEndChars); 111 104 112 PSZ strhFindWord(const char *pszBuf, 105 113 const char *pszSearch, … … 192 200 ********************************************************************/ 193 201 194 char* strhfind (const char *string, 195 const char *pattern, 196 BOOL repeat_find); 197 198 char* strhfind_r (const char *string, 199 const char *pattern); 200 201 char* strhfind_rb (const char *string, 202 const char *pattern, 203 size_t *shift, 204 BOOL *repeat_find); 205 206 void* strhmemfind (const void *block, 207 size_t block_size, 208 const void *pattern, 209 size_t pattern_size, 210 BOOL repeat_find); 211 212 void* strhmemfind_r (const void *block, 213 size_t block_size, 214 const void *pattern, 215 size_t pattern_size); 216 217 void* strhmemfind_rb (const void *in_block, 218 size_t block_size, 219 const void *in_pattern, 220 size_t pattern_size, 221 size_t *shift, 222 BOOL *repeat_find); 202 void* strhmemfind(const void *in_block, 203 size_t block_size, 204 const void *in_pattern, 205 size_t pattern_size, 206 size_t *shift, 207 BOOL *repeat_find); 223 208 224 209 char* strhtxtfind (const char *string, -
trunk/include/helpers/tree.h
r7 r13 1 2 /* 3 *@@sourcefile tree.h: 4 * header file for tree.c (red-black balanced binary trees). 5 * See remarks there. 6 */ 7 8 /* 9 * Written: 97/11/18 Jonathan Schultz <jonathan@imatix.com> 10 * Revised: 98/12/08 Jonathan Schultz <jonathan@imatix.com> 11 * 12 * Copyright (C) 1991-99 iMatix Corporation. 13 * Copyright (C) 2000 Ulrich Mller. 14 * This file is part of the XWorkplace source package. 15 * XWorkplace is free software; you can redistribute it and/or modify 16 * it under the terms of the GNU General Public License as published 17 * by the Free Software Foundation, in version 2 as it comes in the 18 * "COPYING" file of the XWorkplace main distribution. 19 * This program is distributed in the hope that it will be useful, 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 * GNU General Public License for more details. 23 */ 24 25 1 26 /* ----------------------------------------------------------------<Prolog>- 2 27 Name: sfltree.h … … 52 77 *@@ TREE: 53 78 * tree node. 79 * 80 * To use the tree functions, all your structures 81 * must have a TREE structure as their first member. 82 * 83 * Example: 84 * 85 + typedef struct _MYTREENODE 86 + { 87 + TREE tree; 88 + char acMyData[1000]; 89 + } MYTREENODE, *PMYTREENODE; 90 * 91 * See tree.c for an introduction to the tree functions. 54 92 */ 55 93 … … 61 99 unsigned long id; 62 100 TREE_COLOUR colour; 63 } TREE ;101 } TREE, *PTREE; 64 102 65 103 // The tree algorithm needs to know how to sort the data. -
trunk/include/helpers/xstring.h
r12 r13 79 79 #define xstrIsString(psz) ( (psz != 0) && (*(psz) != 0) ) 80 80 81 PSZ xstrFindWord(const XSTRING *pxstr, 82 ULONG ulOfs, 83 const XSTRING *pstrFind, 84 size_t *pShiftTable, 85 PBOOL pfRepeatFind, 86 const char *pcszBeginChars, 87 const char *pcszEndChars); 88 81 89 ULONG xstrrpl(PXSTRING pxstr, 82 ULONGulOfs,90 PULONG pulOfs, 83 91 const XSTRING *pstrSearch, 84 92 const XSTRING *pstrReplace, 85 PULONG pulAfterOfs); 93 size_t *pShiftTable, 94 PBOOL pfRepeatFind); 86 95 87 96 ULONG xstrcrpl(PXSTRING pxstr, 88 ULONGulOfs,97 PULONG pulOfs, 89 98 const char *pcszSearch, 90 const char *pcszReplace, 91 PULONG pulAfterOfs); 99 const char *pcszReplace); 92 100 #endif 93 101
Note:
See TracChangeset
for help on using the changeset viewer.