IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 19, 2004, 3:38:34 PM (22 years ago)
Author:
desonia
Message:

cleanup of the IP3 code -- not complete implementation yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sysUtils/psDList.h

    r455 r460  
    99 *  @author Robert Daniel DeSonia, MHPCC
    1010 *
    11  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-04-19 21:06:37 $
     11 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-04-20 01:38:34 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1515 */
    1616
     17/** Special values of index into list */
     18enum {
     19    PS_DLIST_HEAD = 0,                  ///< at head
     20    PS_DLIST_TAIL = -1,                 ///< at tail
     21    PS_DLIST_UNKNOWN = -2,              ///< unknown position
     22    PS_DLIST_PREVIOUS = -3,             ///< previous element
     23    PS_DLIST_CURRENT = -4,              ///< current element
     24    PS_DLIST_NEXT = -5                  ///< next element
     25};
     26
    1727/** Doubly-linked list element */
    1828typedef struct psDlistElem
    1929{
    20     struct psDlistElem *prev;  ///< previous link in list
    21     struct psDlistElem *next;  ///< next link in list
    22     void *data;    ///< real data item
     30    struct psDlistElem *prev;           ///< previous link in list
     31    struct psDlistElem *next;           ///< next link in list
     32    void *data;                         ///< real data item
    2333}
    2434psDlistElem;
     
    2737typedef struct
    2838{
    29     int n;    ///< number of elements on list
    30     psDlistElem *head;   ///< first element on list (may be NULL)
    31     psDlistElem *tail;   ///< last element on list (may be NULL)
    32     psDlistElem *iter;   ///< iteration cursor
     39    int n;                              ///< number of elements on list
     40    psDlistElem *head;                  ///< first element on list (may be NULL)
     41    psDlistElem *tail;                  ///< last element on list (may be NULL)
     42    psDlistElem *iter;                  ///< iteration cursor
     43    int iterIndex;
    3344}
    3445psDlist;
    3546
    36 /** Special values of index into list */
    37 enum {
    38     PS_DLIST_HEAD = 0,   ///< at head
    39     PS_DLIST_TAIL = -1,   ///< at tail
    40     PS_DLIST_UNKNOWN = -2,  ///< unknown position
    41     PS_DLIST_PREV = -3,   ///< previous element
    42     PS_DLIST_NEXT = -4   ///< next element
    43 };
    44 
    45 /** Functions **************************************************************/
    46 /** \addtogroup DataGroup General Data Container Utilities
    47  *  \{
     47/** @addtogroup DataContainers General Data Container Utilities
     48 *  @{
    4849 */
    4950
    5051/** Constructor */
    51 psDlist *psDlistAlloc(void *data) ///< initial data item; may be NULL
    52 ;
     52psDlist *psDlistAlloc(
     53    void *data                      ///< initial data item; may be NULL
     54);
    5355
    5456/** Destructor */
    55 void psDlistFree(psDlist *list,  ///< list to destroy
    56                  void (*elemFree)(void *)) ///< destructor for data on list
    57 ;
    58 
    59 /**** List maintainence functions ****/
     57void psDlistFree(
     58    psDlist *list,                  ///< list to destroy
     59    void (*elemFree)(void *)        ///< destructor for data on list
     60);
    6061
    6162/** Add to list */
    62 psDlist *psDlistAdd(psDlist *list, ///< list to add to (may be NULL)
    63                     void *data,  ///< data item to add
    64                     int where)  ///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL
    65 ;
     63psDlist *psDlistAdd(
     64    psDlist *list,                  ///< list to add to (may be NULL)
     65    void *data,                     ///< data item to add
     66    int where                       ///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL
     67);
    6668
    6769/** Append to a list */
    68 psDlist *psDlistAppend(psDlist *list, ///< list to append to (may be NULL)
    69                        void *data) ///< data item to add
    70 ;
     70psDlist *psDlistAppend(
     71    psDlist *list,                  ///< list to append to (may be NULL)
     72    void *data                      ///< data item to add
     73);
    7174
    7275/** Remove from a list */
    73 void *psDlistRemove(psDlist *list, ///< list to remove element from
    74                     void *data,  ///< data item to remove
    75                     int which)  ///< index of item, or PS_DLIST_UNKNOWN, PS_DLIST_NEXT, PS_DLIST_PREV
    76 ;
     76void *psDlistRemove(
     77    psDlist *list,                  ///< list to remove element from
     78    void *data,                     ///< data item to remove
     79    int which                       ///< index of item, or PS_DLIST_UNKNOWN, PS_DLIST_NEXT, PS_DLIST_PREV
     80);
    7781
    7882/** Retrieve from a list */
    79 void *psDlistGet(const psDlist *list, ///< list to retrieve element from
    80                  int which)  ///< index of item, or PS_DLIST_NEXT, PS_DLIST_PREV, PS_DLIST_UNKNOWN
    81 ;
     83void *psDlistGet(
     84    const psDlist *list,            ///< list to retrieve element from
     85    int which                       ///< index of item, or PS_DLIST_NEXT, PS_DLIST_PREV, PS_DLIST_UNKNOWN
     86);
    8287
    8388/** Set the iterator */
    84 void psDlistSetIterator(psDlist *list, ///< list to retrieve element from
    85                         int where) ///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL
    86 ;
     89void psDlistSetIterator(
     90    psDlist *list,                  ///< list to retrieve element from
     91    int where                       ///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL
     92);
    8793
    8894/** Get next element relative to iter */
    89 void *psDlistGetNext(psDlist *list) ///< list to retrieve element from
    90 ;
     95void *psDlistGetNext(
     96    psDlist *list                   ///< list to retrieve element from
     97);
     98
     99/** Get current element at iter */
     100void *psDlistGetCurrent(
     101    psDlist *list                   ///< list to retrieve element from
     102);
    91103
    92104/** Get prev element relative to iter */
    93 void *psDlistGetPrev(psDlist *list) ///< list to retrieve element from
    94 ;
     105void *psDlistGetPrevious(
     106    psDlist *list                   ///< list to retrieve element from
     107);
    95108
    96109/** Convert doubly-linked list to an array */
    97 psVoidPtrArray *psDlistToArray(psDlist *dlist) ///< List to convert
    98 ;
     110#if 0
     111psVoidPtrArray *psDlistToArray(
     112    psDlist *dlist                  ///< List to convert
     113);
    99114
    100115/** Convert array to a doubly-linked list */
    101 psDlist *psArrayToDlist(psVoidPtrArray *arr) ///< Array to convert
    102 ;
     116psDlist *psArrayToDlist(
     117    psVoidPtrArray *arr             ///< Array to convert
     118);
     119#endif
    103120
    104 /* \} */ // End of DataGroup Functions
     121/// @} End of DataGroup Functions
    105122
    106123#endif
Note: See TracChangeset for help on using the changeset viewer.