IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1474


Ignore:
Timestamp:
Aug 11, 2004, 10:04:51 AM (22 years ago)
Author:
desonia
Message:

doxygen/formatting.

Location:
trunk/psLib/src
Files:
2 edited

Legend:

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

    r1441 r1474  
    1010 *  @ingroup LinkedList
    1111 *
    12  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-09 23:40:55 $
     12 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-11 20:04:51 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3333 */
    3434enum {
    35     PS_LIST_HEAD = 0,           ///< at head
    36     PS_LIST_TAIL = -1,                     ///< at tail
    37     PS_LIST_PREVIOUS = -2,                 ///< previous element
    38     PS_LIST_CURRENT = -3,                  ///< current element
    39     PS_LIST_NEXT = -4,                     ///< next element
    40     PS_LIST_UNKNOWN = -5                   ///< unknown position (should be last in enum list)
     35    PS_LIST_HEAD = 0,                  ///< at head
     36    PS_LIST_TAIL = -1,                 ///< at tail
     37    PS_LIST_PREVIOUS = -2,             ///< previous element
     38    PS_LIST_CURRENT = -3,              ///< current element
     39    PS_LIST_NEXT = -4,                 ///< next element
     40    PS_LIST_UNKNOWN = -5               ///< unknown position (should be last in enum list)
    4141};
    4242
     
    4444typedef struct psListElem
    4545{
    46     struct psListElem* prev;    ///< previous link in list
    47     struct psListElem* next;    ///< next link in list
    48     void *data;                 ///< real data item
     46    struct psListElem* prev;           ///< previous link in list
     47    struct psListElem* next;           ///< next link in list
     48    void *data;                        ///< real data item
    4949}
    5050psListElem;
     
    5757typedef struct
    5858{
    59     unsigned int size;          ///< number of elements on list
    60     psListElem* head;           ///< first element on list (may be NULL)
    61     psListElem* tail;           ///< last element on list (may be NULL)
    62     psListElem* iter;           ///< iteration cursor
    63     unsigned int iterIndex;     ///< the numeric position of the iteration cursor in the list
    64     pthread_mutex_t lock;       ///< mutex to lock a node during changes
     59    unsigned int size;                 ///< number of elements on list
     60    psListElem* head;                  ///< first element on list (may be NULL)
     61    psListElem* tail;                  ///< last element on list (may be NULL)
     62    psListElem* iter;                  ///< iteration cursor
     63    unsigned int iterIndex;            ///< the numeric position of the iteration cursor in the list
     64    pthread_mutex_t lock;              ///< mutex to lock a node during changes
    6565}
    6666psList;
     
    7070 *  @return psList* A new psList object.
    7171 */
    72 psList* psListAlloc(void *data
    73                     ///< initial data item; may be NULL if no an empty psList is desired
    74                    )
     72psList* psListAlloc(
     73    void *data
     74    ///< initial data item; may be NULL if no an empty psList is desired
     75)
    7576;
    7677
     
    8081 *                      NULL, the return value will also be NULL.
    8182 */
    82 bool psListAdd(psList* restrict list,  ///< list to add to (if NULL, nothing is done)
    83                void *data,      ///< data item to add.  If NULL, list is not modified.
    84                int where        ///< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.
    85               );
     83bool psListAdd(
     84    psList* restrict list,             ///< list to add to (if NULL, nothing is done)
     85    void *data,                        ///< data item to add.  If NULL, list is not modified.
     86    int where                          ///< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.
     87);
    8688
    8789/** Remove an item from a list.  If which parameter is PS_LIST_UNKNOWN,
     
    8991 *  @return bool        TRUE if element is successfully removed, otherwise FALSE.
    9092 */
    91 bool psListRemove(psList* restrict list,
    92                   ///< list to remove element from
    93                   void *data,
    94                   ///< if which is PS_LIST_UNKNOWN, data item to find and remove, otherwise this is ignored.
    95                   int which
    96                   ///< index of item, or PS_LIST_UNKNOWN, PS_LIST_NEXT, PS_LIST_PREV, or numbered location.
    97                  );
     93bool psListRemove(
     94    psList* restrict list,
     95    ///< list to remove element from
     96    void *data,
     97    ///< if which is PS_LIST_UNKNOWN, data item to find and remove, otherwise this is ignored.
     98    int which
     99    ///< index of item, or PS_LIST_UNKNOWN, PS_LIST_NEXT, PS_LIST_PREV, or numbered location.
     100);
    98101
    99102/** Retrieve an item from a list.
     
    104107 *                      NULL is returned.
    105108 */
    106 void *psListGet(psList* restrict list, ///< list to retrieve element from
    107                 int which       ///< index number, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN
    108                );
     109void *psListGet(
     110    psList* restrict list,             ///< list to retrieve element from
     111    int which                          ///< index number, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN
     112);
    109113
    110114/** Set the iterator of the list to a given position.  If where is invalid the
     
    112116 *
    113117 */
    114 void psListSetIterator(psList* restrict list,  ///< list to retrieve element from
    115                        int where        ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
    116                       );
     118void psListSetIterator(
     119    psList* restrict list,             ///< list to retrieve element from
     120    int where                          ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
     121);
    117122
    118123/** Get next element relative to the iterator.  This also moves the iterator to
     
    123128 *                      parameter was NULL.
    124129 */
    125 void *psListGetNext(psList* restrict list      ///< list to retrieve element from
    126                    );
     130void *psListGetNext(
     131    psList* restrict list              ///< list to retrieve element from
     132);
    127133
    128134/** Get current element according to the psList's iterator cursor.  This does
     
    133139 *                      iterator is not valid or list parameter was NULL.
    134140 */
    135 void *psListGetCurrent(psList* restrict list   ///< list to retrieve element from
    136                       );
     141void *psListGetCurrent(
     142    psList* restrict list              ///< list to retrieve element from
     143);
    137144
    138145/** Get previous element relative to list's iterator. This also moves the
     
    143150 *                      parameter was NULL.
    144151 */
    145 void *psListGetPrevious(psList* restrict list  ///< list to retrieve element from
    146                        );
     152void *psListGetPrevious(
     153    psList* restrict list              ///< list to retrieve element from
     154);
    147155
    148156/** Convert a linked list to an array
     
    151159 *                      or NULL if the given dlist parameter is NULL.
    152160 */
    153 psArray* psListToArray(psList* dlist   ///< List to convert
    154                       );
     161psArray* psListToArray(
     162    psList* dlist                      ///< List to convert
     163);
    155164
    156165/** Convert array to a doubly-linked list
     
    159168 *                      or NULL is the given arr parameter is NULL.
    160169 */
    161 psList* psArrayToList(psArray* arr     ///< vector to convert
    162                      );
     170psList* psArrayToList(
     171    psArray* arr                       ///< vector to convert
     172);
    163173
    164 psList* psListSort(psList* list, psComparePtrFcn compare);
     174/** Sort a list via a comparison function.
     175 *
     176 *  The comparison function must return an integer less than, equal to, or
     177 *  greater than zero if the first argument is considered to be respectively
     178 *  less than, equal to, or greater than the second.
     179 *
     180 *  If two members compare as equal, their order in the sorted array is
     181 *  undefined.
     182 *
     183 *  @return psList*     Sorted list.
     184 */
     185psList* psListSort(
     186    psList* list,                      ///< the list to sort
     187    psComparePtrFcn compare            ///< the comparison function
     188);
    165189
    166190/// @} End of DataGroup Functions
  • trunk/psLib/src/types/psList.h

    r1441 r1474  
    1010 *  @ingroup LinkedList
    1111 *
    12  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-09 23:40:55 $
     12 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-11 20:04:51 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3333 */
    3434enum {
    35     PS_LIST_HEAD = 0,           ///< at head
    36     PS_LIST_TAIL = -1,                     ///< at tail
    37     PS_LIST_PREVIOUS = -2,                 ///< previous element
    38     PS_LIST_CURRENT = -3,                  ///< current element
    39     PS_LIST_NEXT = -4,                     ///< next element
    40     PS_LIST_UNKNOWN = -5                   ///< unknown position (should be last in enum list)
     35    PS_LIST_HEAD = 0,                  ///< at head
     36    PS_LIST_TAIL = -1,                 ///< at tail
     37    PS_LIST_PREVIOUS = -2,             ///< previous element
     38    PS_LIST_CURRENT = -3,              ///< current element
     39    PS_LIST_NEXT = -4,                 ///< next element
     40    PS_LIST_UNKNOWN = -5               ///< unknown position (should be last in enum list)
    4141};
    4242
     
    4444typedef struct psListElem
    4545{
    46     struct psListElem* prev;    ///< previous link in list
    47     struct psListElem* next;    ///< next link in list
    48     void *data;                 ///< real data item
     46    struct psListElem* prev;           ///< previous link in list
     47    struct psListElem* next;           ///< next link in list
     48    void *data;                        ///< real data item
    4949}
    5050psListElem;
     
    5757typedef struct
    5858{
    59     unsigned int size;          ///< number of elements on list
    60     psListElem* head;           ///< first element on list (may be NULL)
    61     psListElem* tail;           ///< last element on list (may be NULL)
    62     psListElem* iter;           ///< iteration cursor
    63     unsigned int iterIndex;     ///< the numeric position of the iteration cursor in the list
    64     pthread_mutex_t lock;       ///< mutex to lock a node during changes
     59    unsigned int size;                 ///< number of elements on list
     60    psListElem* head;                  ///< first element on list (may be NULL)
     61    psListElem* tail;                  ///< last element on list (may be NULL)
     62    psListElem* iter;                  ///< iteration cursor
     63    unsigned int iterIndex;            ///< the numeric position of the iteration cursor in the list
     64    pthread_mutex_t lock;              ///< mutex to lock a node during changes
    6565}
    6666psList;
     
    7070 *  @return psList* A new psList object.
    7171 */
    72 psList* psListAlloc(void *data
    73                     ///< initial data item; may be NULL if no an empty psList is desired
    74                    )
     72psList* psListAlloc(
     73    void *data
     74    ///< initial data item; may be NULL if no an empty psList is desired
     75)
    7576;
    7677
     
    8081 *                      NULL, the return value will also be NULL.
    8182 */
    82 bool psListAdd(psList* restrict list,  ///< list to add to (if NULL, nothing is done)
    83                void *data,      ///< data item to add.  If NULL, list is not modified.
    84                int where        ///< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.
    85               );
     83bool psListAdd(
     84    psList* restrict list,             ///< list to add to (if NULL, nothing is done)
     85    void *data,                        ///< data item to add.  If NULL, list is not modified.
     86    int where                          ///< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.
     87);
    8688
    8789/** Remove an item from a list.  If which parameter is PS_LIST_UNKNOWN,
     
    8991 *  @return bool        TRUE if element is successfully removed, otherwise FALSE.
    9092 */
    91 bool psListRemove(psList* restrict list,
    92                   ///< list to remove element from
    93                   void *data,
    94                   ///< if which is PS_LIST_UNKNOWN, data item to find and remove, otherwise this is ignored.
    95                   int which
    96                   ///< index of item, or PS_LIST_UNKNOWN, PS_LIST_NEXT, PS_LIST_PREV, or numbered location.
    97                  );
     93bool psListRemove(
     94    psList* restrict list,
     95    ///< list to remove element from
     96    void *data,
     97    ///< if which is PS_LIST_UNKNOWN, data item to find and remove, otherwise this is ignored.
     98    int which
     99    ///< index of item, or PS_LIST_UNKNOWN, PS_LIST_NEXT, PS_LIST_PREV, or numbered location.
     100);
    98101
    99102/** Retrieve an item from a list.
     
    104107 *                      NULL is returned.
    105108 */
    106 void *psListGet(psList* restrict list, ///< list to retrieve element from
    107                 int which       ///< index number, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN
    108                );
     109void *psListGet(
     110    psList* restrict list,             ///< list to retrieve element from
     111    int which                          ///< index number, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN
     112);
    109113
    110114/** Set the iterator of the list to a given position.  If where is invalid the
     
    112116 *
    113117 */
    114 void psListSetIterator(psList* restrict list,  ///< list to retrieve element from
    115                        int where        ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
    116                       );
     118void psListSetIterator(
     119    psList* restrict list,             ///< list to retrieve element from
     120    int where                          ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
     121);
    117122
    118123/** Get next element relative to the iterator.  This also moves the iterator to
     
    123128 *                      parameter was NULL.
    124129 */
    125 void *psListGetNext(psList* restrict list      ///< list to retrieve element from
    126                    );
     130void *psListGetNext(
     131    psList* restrict list              ///< list to retrieve element from
     132);
    127133
    128134/** Get current element according to the psList's iterator cursor.  This does
     
    133139 *                      iterator is not valid or list parameter was NULL.
    134140 */
    135 void *psListGetCurrent(psList* restrict list   ///< list to retrieve element from
    136                       );
     141void *psListGetCurrent(
     142    psList* restrict list              ///< list to retrieve element from
     143);
    137144
    138145/** Get previous element relative to list's iterator. This also moves the
     
    143150 *                      parameter was NULL.
    144151 */
    145 void *psListGetPrevious(psList* restrict list  ///< list to retrieve element from
    146                        );
     152void *psListGetPrevious(
     153    psList* restrict list              ///< list to retrieve element from
     154);
    147155
    148156/** Convert a linked list to an array
     
    151159 *                      or NULL if the given dlist parameter is NULL.
    152160 */
    153 psArray* psListToArray(psList* dlist   ///< List to convert
    154                       );
     161psArray* psListToArray(
     162    psList* dlist                      ///< List to convert
     163);
    155164
    156165/** Convert array to a doubly-linked list
     
    159168 *                      or NULL is the given arr parameter is NULL.
    160169 */
    161 psList* psArrayToList(psArray* arr     ///< vector to convert
    162                      );
     170psList* psArrayToList(
     171    psArray* arr                       ///< vector to convert
     172);
    163173
    164 psList* psListSort(psList* list, psComparePtrFcn compare);
     174/** Sort a list via a comparison function.
     175 *
     176 *  The comparison function must return an integer less than, equal to, or
     177 *  greater than zero if the first argument is considered to be respectively
     178 *  less than, equal to, or greater than the second.
     179 *
     180 *  If two members compare as equal, their order in the sorted array is
     181 *  undefined.
     182 *
     183 *  @return psList*     Sorted list.
     184 */
     185psList* psListSort(
     186    psList* list,                      ///< the list to sort
     187    psComparePtrFcn compare            ///< the comparison function
     188);
    165189
    166190/// @} End of DataGroup Functions
Note: See TracChangeset for help on using the changeset viewer.