Changeset 13 for trunk/include/helpers


Ignore:
Timestamp:
Nov 23, 2000, 7:36:41 PM (25 years ago)
Author:
umoeller
Message:

Updates for V0.9.6.

Location:
trunk/include/helpers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/helpers/memdebug.h

    r7 r13  
    4141    extern PFNCBMEMDLOG    G_pMemdLogFunc;
    4242
     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
    43100    void* memdMalloc(size_t stSize,
    44101                     const char *pcszSourceFile,
     
    57114                  const char *pcszFunction);
    58115
     116    void* memdRealloc(void *p,
     117                      size_t stSize,
     118                      const char *pcszSourceFile,
     119                      unsigned long ulLine,
     120                      const char *pcszFunction);
     121
    59122    unsigned long memdReleaseFreed(void);
    60123
     
    64127            #define malloc(ul) memdMalloc(ul, __FILE__, __LINE__, __FUNCTION__)
    65128            #define calloc(n, size) memdCalloc(n, size, __FILE__, __LINE__, __FUNCTION__)
     129            #define realloc(p, ul) memdRealloc(p, ul, __FILE__, __LINE__, __FUNCTION__)
    66130            #define free(p) memdFree(p, __FILE__, __LINE__, __FUNCTION__)
    67131
     
    79143    #ifdef PM_INCLUDED
    80144        /********************************************************************
    81          *                                                                  *
    82          *   XFolder debugging helpers                                      *
    83          *                                                                  *
     145         *
     146         *   XFolder debugging helpers
     147         *
    84148         ********************************************************************/
    85149
     
    94158
    95159        /* ******************************************************************
    96          *                                                                  *
    97          *   Heap debugging window                                          *
    98          *                                                                  *
     160         *
     161         *   Heap debugging window
     162         *
    99163         ********************************************************************/
    100164
  • trunk/include/helpers/stringh.h

    r12 r13  
    6464
    6565    ULONG strhrpl(PSZ *ppszBuf,
    66                   ULONG ulOfs,
     66                  PULONG pulOfs,
    6767                  const char *pcszSearch,
    68                   const char *pcszReplace,
    69                   PULONG pulAfterOfs);
     68                  const char *pcszReplace);
    7069
    7170    ULONG strhWords(PSZ psz);
     
    7473
    7574    PSZ strhThousandsDouble(PSZ pszTarget, double dbl, CHAR cThousands);
     75
     76    PSZ strhVariableDouble(PSZ pszTarget, double dbl, PSZ pszUnits,
     77                           CHAR cThousands);
    7678
    7779    VOID strhFileDate(PSZ pszBuf,
     
    102104                     PSZ *ppszEnd);
    103105
     106    BOOL strhIsWord(const char *pcszBuf,
     107                    const char *p,
     108                    ULONG cbSearch,
     109                    const char *pcszBeginChars,
     110                    const char *pcszEndChars);
     111
    104112    PSZ strhFindWord(const char *pszBuf,
    105113                     const char *pszSearch,
     
    192200     ********************************************************************/
    193201
    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);
    223208
    224209    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 M”ller.
     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
    126/*  ----------------------------------------------------------------<Prolog>-
    227    Name:       sfltree.h
     
    5277     *@@ TREE:
    5378     *      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.
    5492     */
    5593
     
    6199        unsigned long   id;
    62100        TREE_COLOUR     colour;
    63     } TREE;
     101    } TREE, *PTREE;
    64102
    65103    // The tree algorithm needs to know how to sort the data.
  • trunk/include/helpers/xstring.h

    r12 r13  
    7979    #define xstrIsString(psz) ( (psz != 0) && (*(psz) != 0) )
    8080
     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
    8189    ULONG xstrrpl(PXSTRING pxstr,
    82                   ULONG ulOfs,
     90                  PULONG pulOfs,
    8391                  const XSTRING *pstrSearch,
    8492                  const XSTRING *pstrReplace,
    85                   PULONG pulAfterOfs);
     93                  size_t *pShiftTable,
     94                  PBOOL pfRepeatFind);
    8695
    8796    ULONG xstrcrpl(PXSTRING pxstr,
    88                    ULONG ulOfs,
     97                   PULONG pulOfs,
    8998                   const char *pcszSearch,
    90                    const char *pcszReplace,
    91                    PULONG pulAfterOfs);
     99                   const char *pcszReplace);
    92100#endif
    93101
Note: See TracChangeset for help on using the changeset viewer.