Ignore:
Timestamp:
Dec 9, 2000, 8:19:42 PM (25 years ago)
Author:
umoeller
Message:

Major updates; timers, LVM, miscellaneous.

File:
1 edited

Legend:

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

    r10 r14  
    1313
    1414/*      Copyright (C) 1997-2000 Ulrich M”ller.
    15  *      This file is part of the XWorkplace source package.
    16  *      XWorkplace is free software; you can redistribute it and/or modify
     15 *      This file is part of the "XWorkplace helpers" source package.
     16 *      This is free software; you can redistribute it and/or modify
    1717 *      it under the terms of the GNU General Public License as published
    1818 *      by the Free Software Foundation, in version 2 as it comes in the
     
    3131    #define LINKLIST_HEADER_INCLUDED
    3232
     33    #ifndef XWPENTRY
     34        #error You must define XWPENTRY to contain the standard linkage for the XWPHelpers.
     35    #endif
     36
    3337    // define some basic things to make this work even with standard C
    3438    #if (!defined OS2_INCLUDED) && (!defined _OS2_H) && (!defined __SIMPLES_DEFINED)   // changed V0.9.0 (99-10-22) [umoeller]
     
    9296
    9397    /* ******************************************************************
    94      *                                                                  *
    95      *   List base functions                                            *
    96      *                                                                  *
     98     *
     99     *   List base functions
     100     *
    97101     ********************************************************************/
    98102
    99     void lstInit(PLINKLIST pList, BOOL fItemsFreeable);
     103    void* XWPENTRY lstMalloc(size_t size);
     104    typedef void* XWPENTRY LSTMALLOC(size_t size);
     105    typedef LSTMALLOC *PLSTMALLOC;
     106
     107    void* XWPENTRY lstStrDup(const char *pcsz);
     108    typedef void* XWPENTRY LSTSTRDUP(const char *pcsz);
     109    typedef LSTSTRDUP *PLSTSTRDUP;
     110
     111    void XWPENTRY lstInit(PLINKLIST pList, BOOL fItemsFreeable);
     112    typedef void XWPENTRY LSTINIT(PLINKLIST pList, BOOL fItemsFreeable);
     113    typedef LSTINIT *PLSTINIT;
    100114
    101115    #ifdef __XWPMEMDEBUG__ // setup.h, helpers\memdebug.c
    102         PLINKLIST lstCreateDebug(BOOL fItemsFreeable,
    103                                  const char *file,
    104                                  unsigned long line,
    105                                  const char *function);
     116        PLINKLIST XWPENTRY lstCreateDebug(BOOL fItemsFreeable,
     117                                          const char *file,
     118                                          unsigned long line,
     119                                          const char *function);
     120        typedef PLINKLIST XWPENTRY LSTCREATEDEBUG(BOOL fItemsFreeable,
     121                                          const char *file,
     122                                          unsigned long line,
     123                                          const char *function);
     124        typedef LSTCREATEDEBUG *PLSTCREATEDEBUG;
    106125
    107126        #define lstCreate(b) lstCreateDebug((b), __FILE__, __LINE__, __FUNCTION__)
    108127    #else
    109         PLINKLIST lstCreate(BOOL fItemsFreeable);
    110     #endif
    111 
    112     BOOL lstFree(PLINKLIST pList);
    113 
    114     BOOL lstClear(PLINKLIST pList);
    115 
    116     long lstCountItems(PLINKLIST pList);
    117 
    118     PLISTNODE lstQueryFirstNode(PLINKLIST pList);
    119 
    120     PLISTNODE lstNodeFromIndex(PLINKLIST pList, unsigned long ulIndex);
    121 
    122     PLISTNODE lstNodeFromItem(PLINKLIST pList, void* pItemData);
    123 
    124     void* lstItemFromIndex(PLINKLIST pList, unsigned long ulIndex);
     128        PLINKLIST XWPENTRY lstCreate(BOOL fItemsFreeable);
     129        typedef PLINKLIST XWPENTRY LSTCREATE(BOOL fItemsFreeable);
     130        typedef LSTCREATE *PLSTCREATE;
     131    #endif
     132
     133    BOOL XWPENTRY lstFree(PLINKLIST pList);
     134    typedef BOOL XWPENTRY LSTFREE(PLINKLIST pList);
     135    typedef LSTFREE *PLSTFREE;
     136
     137    BOOL XWPENTRY lstClear(PLINKLIST pList);
     138    typedef BOOL XWPENTRY LSTCLEAR(PLINKLIST pList);
     139    typedef LSTCLEAR *PLSTCLEAR;
     140
     141    long XWPENTRY lstCountItems(PLINKLIST pList);
     142    typedef long XWPENTRY LSTCOUNTITEMS(PLINKLIST pList);
     143    typedef LSTCOUNTITEMS *PLSTCOUNTITEMS;
     144
     145    PLISTNODE XWPENTRY lstQueryFirstNode(PLINKLIST pList);
     146    typedef PLISTNODE XWPENTRY LSTQUERYFIRSTNODE(PLINKLIST pList);
     147    typedef LSTQUERYFIRSTNODE *PLSTQUERYFIRSTNODE;
     148
     149    PLISTNODE XWPENTRY lstNodeFromIndex(PLINKLIST pList, unsigned long ulIndex);
     150    typedef PLISTNODE XWPENTRY LSTNODEFROMINDEX(PLINKLIST pList, unsigned long ulIndex);
     151    typedef LSTNODEFROMINDEX *PLSTNODEFROMINDEX;
     152
     153    PLISTNODE XWPENTRY lstNodeFromItem(PLINKLIST pList, void* pItemData);
     154    typedef PLISTNODE XWPENTRY LSTNODEFROMITEM(PLINKLIST pList, void* pItemData);
     155    typedef LSTNODEFROMITEM *PLSTNODEFROMITEM;
     156
     157    void* XWPENTRY lstItemFromIndex(PLINKLIST pList, unsigned long ulIndex);
     158    typedef void* XWPENTRY LSTITEMFROMINDEX(PLINKLIST pList, unsigned long ulIndex);
     159    typedef LSTITEMFROMINDEX *PLSTITEMFROMINDEX;
    125160
    126161    #ifdef __XWPMEMDEBUG__ // setup.h, helpers\memdebug.c
    127         PLISTNODE lstAppendItemDebug(PLINKLIST pList,
    128                                      void* pNewItemData,
    129                                      const char *file,
    130                                      unsigned long line,
    131                                      const char *function);
     162        PLISTNODE XWPENTRY lstAppendItemDebug(PLINKLIST pList,
     163                                              void* pNewItemData,
     164                                              const char *file,
     165                                              unsigned long line,
     166                                              const char *function);
    132167        #define lstAppendItem(pl, pd) lstAppendItemDebug((pl), (pd), __FILE__, __LINE__, __FUNCTION__)
    133168    #else
    134         PLISTNODE lstAppendItem(PLINKLIST pList, void* pNewItemData);
    135     #endif
    136 
    137     PLISTNODE lstInsertItemBefore(PLINKLIST pList,
    138                                   void* pNewItemData,
    139                                   unsigned long ulIndex);
    140 
    141     BOOL lstRemoveNode(PLINKLIST pList, PLISTNODE pRemoveNode);
    142 
    143     BOOL lstRemoveItem(PLINKLIST pList, void* pRemoveItem);
    144 
    145     BOOL lstSwapNodes(PLISTNODE pNode1,
    146                       PLISTNODE pNode2);
     169        PLISTNODE XWPENTRY lstAppendItem(PLINKLIST pList, void* pNewItemData);
     170        typedef PLISTNODE XWPENTRY LSTAPPENDITEM(PLINKLIST pList, void* pNewItemData);
     171        typedef LSTAPPENDITEM *PLSTAPPENDITEM;
     172    #endif
     173
     174    PLISTNODE XWPENTRY lstInsertItemBefore(PLINKLIST pList,
     175                                           void* pNewItemData,
     176                                           unsigned long ulIndex);
     177    typedef PLISTNODE XWPENTRY LSTINSERTITEMBEFORE(PLINKLIST pList,
     178                                           void* pNewItemData,
     179                                           unsigned long ulIndex);
     180    typedef LSTINSERTITEMBEFORE *PLSTINSERTITEMBEFORE;
     181
     182    BOOL XWPENTRY lstRemoveNode(PLINKLIST pList, PLISTNODE pRemoveNode);
     183    typedef BOOL XWPENTRY LSTREMOVENODE(PLINKLIST pList, PLISTNODE pRemoveNode);
     184    typedef LSTREMOVENODE *PLSTREMOVENODE;
     185
     186    BOOL XWPENTRY lstRemoveItem(PLINKLIST pList, void* pRemoveItem);
     187    typedef BOOL XWPENTRY LSTREMOVEITEM(PLINKLIST pList, void* pRemoveItem);
     188    typedef LSTREMOVEITEM *PLSTREMOVEITEM;
     189
     190    BOOL XWPENTRY lstSwapNodes(PLISTNODE pNode1, PLISTNODE pNode2);
     191    typedef BOOL XWPENTRY LSTSWAPNODES(PLISTNODE pNode1, PLISTNODE pNode2);
     192    typedef LSTSWAPNODES *PLSTSWAPNODES;
    147193
    148194    /* ******************************************************************
    149      *                                                                  *
    150      *   List sorting                                                   *
    151      *                                                                  *
     195     *
     196     *   List sorting
     197     *
    152198     ********************************************************************/
    153199
    154     BOOL lstQuickSort(PLINKLIST pList,
    155                       PFNSORTLIST pfnSort,
    156                       void* pStorage);
    157 
    158     BOOL lstBubbleSort(PLINKLIST pList,
    159                        PFNSORTLIST pfnSort,
    160                        void* pStorage);
     200    BOOL XWPENTRY lstQuickSort(PLINKLIST pList,
     201                               PFNSORTLIST pfnSort,
     202                               void* pStorage);
     203
     204    BOOL XWPENTRY lstBubbleSort(PLINKLIST pList,
     205                                PFNSORTLIST pfnSort,
     206                                void* pStorage);
    161207
    162208#endif
Note: See TracChangeset for help on using the changeset viewer.