IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 16, 2004, 10:00:21 AM (22 years ago)
Author:
desonia
Message:

Added some psfits and pslist changes. More work needs to be done to make it match the current SDRS.

File:
1 edited

Legend:

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

    r2273 r2375  
    66 *  @author Robert Daniel DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-11-04 01:04:57 $
     8 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-11-16 20:00:20 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4242    list->size = 0;
    4343    list->head = list->tail = NULL;
    44     list->iter = ITER_INIT_HEAD;
    45     list->iterIndex = PS_LIST_HEAD;
     44    list->p_iter = ITER_INIT_HEAD;
     45    list->p_iterIndex = PS_LIST_HEAD;
    4646
    4747    pthread_mutex_init(&(list->lock), NULL)
     
    127127
    128128        list->size++;
    129         list->iter = elem;
    130         list->iterIndex = list->size - 1;
     129        list->p_iter = elem;
     130        list->p_iterIndex = list->size - 1;
    131131    } else {
    132132        // move ourselves to the given position
     
    152152
    153153        list->size++;
    154         list->iter = elem;
    155         list->iterIndex = cursorIndex;
     154        list->p_iter = elem;
     155        list->p_iterIndex = cursorIndex;
    156156    }
    157157
     
    227227        // removed tail, so iter should be the last element of list to keep it valid
    228228        if (list->size > 0) {
    229             list->iter = list->tail;
    230             list->iterIndex = list->size - 1;
     229            list->p_iter = list->tail;
     230            list->p_iterIndex = list->size - 1;
    231231        } else {
    232             list->iter = ITER_INIT_TAIL;
     232            list->p_iter = ITER_INIT_TAIL;
    233233        }
    234234    } else {
    235235        elem->next->prev = elem->prev;
    236         list->iter = elem->next;
    237         list->iterIndex = cursorIndex;
     236        list->p_iter = elem->next;
     237        list->p_iterIndex = cursorIndex;
    238238    }
    239239
     
    275275
    276276    if (where >= (psS32)list->size) {
    277         list->iter = NULL;
     277        list->p_iter = NULL;
    278278        if (lockList) {
    279279            pthread_mutex_unlock(&list->lock)
     
    285285    switch (where) {
    286286    case PS_LIST_HEAD:
    287         list->iter = ITER_INIT_HEAD;
     287        list->p_iter = ITER_INIT_HEAD;
    288288        break;
    289289
    290290    case PS_LIST_TAIL:
    291         list->iter = ITER_INIT_TAIL;
     291        list->p_iter = ITER_INIT_TAIL;
    292292        break;
    293293
     
    297297
    298298        if (cursor != NULL) {
    299             list->iter = cursor->prev;
    300             list->iterIndex = position - 1;
     299            list->p_iter = cursor->prev;
     300            list->p_iterIndex = position - 1;
    301301        }
    302302        break;
     
    307307
    308308        if (cursor != NULL) {
    309             list->iter = cursor->next;
    310             list->iterIndex = position + 1;
     309            list->p_iter = cursor->next;
     310            list->p_iterIndex = position + 1;
    311311        }
    312312        break;
     
    322322            cursor = listGetIterator(list);
    323323            if (cursor == NULL) {      // reset the iterator if it is invalid
    324                 list->iter = ITER_INIT_HEAD;
    325                 list->iterIndex = 0;
     324                list->p_iter = ITER_INIT_HEAD;
     325                list->p_iterIndex = 0;
    326326            }
    327327
     
    357357    }
    358358
    359     if (list->iter == ITER_INIT_HEAD) {
     359    if (list->p_iter == ITER_INIT_HEAD) {
    360360        return list->head;
    361     } else if (list->iter == ITER_INIT_TAIL) {
     361    } else if (list->p_iter == ITER_INIT_TAIL) {
    362362        return list->tail;
    363363    } else {
    364         return list->iter;
     364        return list->p_iter;
    365365    }
    366366}
     
    368368psS32 listGetIteratorIndex(psList* list)
    369369{
    370     if (list->iter == ITER_INIT_HEAD) {
     370    if (list->p_iter == ITER_INIT_HEAD) {
    371371        return 0;
    372     } else if (list->iter == ITER_INIT_TAIL) {
     372    } else if (list->p_iter == ITER_INIT_TAIL) {
    373373        return list->size - 1;
    374374    } else {
    375         return list->iterIndex;
     375        return list->p_iterIndex;
    376376    }
    377377}
Note: See TracChangeset for help on using the changeset viewer.