IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 2:57:34 PM (22 years ago)
Author:
desonia
Message:

converted native C types to ps Types, where practical.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psList.h

    r1747 r2204  
    1010 *  @ingroup LinkedList
    1111 *
    12  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-09-09 02:23:27 $
     12 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-10-27 00:57:31 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1717
    1818#include <pthread.h>                   // we need a mutex to make this stuff thread safe.
    19 #include <stdbool.h>                   // we use the bool type.
    2019
    2120#include "psCompare.h"
     
    4645    struct psListElem* prev;           ///< previous link in list
    4746    struct psListElem* next;           ///< next link in list
    48     void *data;                        ///< real data item
     47    psPtr data;                        ///< real data item
    4948}
    5049psListElem;
     
    5756typedef struct
    5857{
    59     unsigned int size;                 ///< number of elements on list
     58    psU32 size;                 ///< number of elements on list
    6059    psListElem* head;                  ///< first element on list (may be NULL)
    6160    psListElem* tail;                  ///< last element on list (may be NULL)
    6261    psListElem* iter;                  ///< iteration cursor
    63     unsigned int iterIndex;            ///< the numeric position of the iteration cursor in the list
     62    psU32 iterIndex;            ///< the numeric position of the iteration cursor in the list
    6463    pthread_mutex_t lock;              ///< mutex to lock a node during changes
    6564}
     
    7170 */
    7271psList* psListAlloc(
    73     void *data
     72    psPtr data
    7473    ///< initial data item; may be NULL if no an empty psList is desired
    7574)
     
    8180 *                      NULL, the return value will also be NULL.
    8281 */
    83 bool psListAdd(
     82psBool psListAdd(
    8483    psList* restrict list,             ///< list to add to (if NULL, nothing is done)
    85     int location,                      ///< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.
    86     void *data                         ///< data item to add.  If NULL, list is not modified.
     84    psS32 location,                      ///< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.
     85    psPtr data                         ///< data item to add.  If NULL, list is not modified.
    8786);
    8887
    8988/** Remove an item from a list.  If location parameter is PS_LIST_UNKNOWN,
    9089 *
    91  *  @return bool        TRUE if element is successfully removed, otherwise FALSE.
     90 *  @return psBool        TRUE if element is successfully removed, otherwise FALSE.
    9291 */
    93 bool psListRemove(
     92psBool psListRemove(
    9493    psList* restrict list,
    9594    ///< list to remove element from
    96     int location,
     95    psS32 location,
    9796    ///< index of item, or PS_LIST_UNKNOWN, PS_LIST_NEXT, PS_LIST_PREV, or numbered location.
    98     void *data
     97    psPtr data
    9998    ///< if location is PS_LIST_UNKNOWN, data item to find and remove, otherwise this is ignored.
    10099);
     
    102101/** Retrieve an item from a list.
    103102 *
    104  *  @return void*       the item corresponding to the location parameter.  If
     103 *  @return psPtr       the item corresponding to the location parameter.  If
    105104 *                      location is invalid (e.g., a numbered index greater
    106105 *                      than the list size or if the list is empty), a
    107106 *                      NULL is returned.
    108107 */
    109 void *psListGet(
     108psPtr psListGet(
    110109    psList* restrict list,             ///< list to retrieve element from
    111     int location                       ///< index number, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN
     110    psS32 location                       ///< index number, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN
    112111);
    113112
     
    118117void psListSetIterator(
    119118    psList* restrict list,             ///< list to retrieve element from
    120     int location                       ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
     119    psS32 location                       ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
    121120);
    122121
     
    124123 *  the next list position.
    125124 *
    126  *  @return void*       the data item next on the list or NULL if the iterator
     125 *  @return psPtr       the data item next on the list or NULL if the iterator
    127126 *                      is already pointing to the last element or the list
    128127 *                      parameter was NULL.
    129128 */
    130 void *psListGetNext(
     129psPtr psListGetNext(
    131130    psList* restrict list              ///< list to retrieve element from
    132131);
     
    135134 *  not move the iterator location.
    136135 *
    137  *  @return void*       the data item cooresponding to current iterator
     136 *  @return psPtr       the data item cooresponding to current iterator
    138137 *                      cursor position of the list, or NULL if either the
    139138 *                      iterator is not valid or list parameter was NULL.
    140139 */
    141 void *psListGetCurrent(
     140psPtr psListGetCurrent(
    142141    psList* restrict list              ///< list to retrieve element from
    143142);
     
    146145 *  iterator to the previous list position.
    147146 *
    148  *  @return void*       the data item previous on the list or NULL if the iterator
     147 *  @return psPtr       the data item previous on the list or NULL if the iterator
    149148 *                      is already pointing to the first element or the list
    150149 *                      parameter was NULL.
    151150 */
    152 void *psListGetPrevious(
     151psPtr psListGetPrevious(
    153152    psList* restrict list              ///< list to retrieve element from
    154153);
Note: See TracChangeset for help on using the changeset viewer.