IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1447


Ignore:
Timestamp:
Aug 9, 2004, 3:43:05 PM (22 years ago)
Author:
harman
Message:

Minor corrections from testing

Location:
trunk/psLib/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/psMetadata.c

    r1440 r1447  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-08-09 23:34:57 $
     14*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-08-10 01:43:05 $
    1616*
    1717*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    501501    psMetadataItem* entry = NULL;
    502502
     503
     504    if (md == NULL) {
     505        psError(__func__, "Null metadata collection not allowed");
     506        return NULL;
     507    }
     508
    503509    mdList = md->list;
    504510    if (mdList == NULL) {
     
    507513    }
    508514
     515    psListSetIterator(mdList, which);
     516    entry = psListGetCurrent(mdList);
     517    while (entry != NULL) {
     518        if(match != NULL) {
     519            if (!strncmp(match, entry->name, strlen(match))) {
     520
     521                // Match found
     522                return entry;
     523            }
     524            entry = psListGetNext(mdList);
     525        } else {
     526            return psListGetNext(mdList);
     527        }
     528    }
     529
     530    // Match not found
     531    if (entry == NULL) {
     532        psError(__func__, "Couldn't find metadata item");
     533    }
     534
     535    return entry;
     536}
     537
     538psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, const char *restrict match, int which)
     539{
     540    psList* mdList = NULL;
     541    psMetadataItem* entry = NULL;
     542
     543
     544    if (md == NULL) {
     545        psError(__func__, "Null metadata collection not allowed");
     546        return NULL;
     547    }
     548
    509549    mdList = md->list;
    510550    if (mdList == NULL) {
     
    516556    entry = psListGetCurrent(mdList);
    517557    while (entry != NULL) {
    518         if (!strncmp(match, entry->name, strlen(match))) {
    519 
    520             // Match found
    521             return entry;
    522         }
    523         entry = psListGetNext(mdList);
     558        if(match != NULL) {
     559            if (!strncmp(match, entry->name, strlen(match))) {
     560
     561                // Match found
     562                return entry;
     563            }
     564            entry = psListGetPrevious(mdList);
     565        } else {
     566            return psListGetPrevious(mdList);
     567        }
    524568    }
    525569
    526570    // Match not found
    527571    if (entry == NULL) {
    528         psError(__func__, "Couldn't find metadata item with given match. Match: %s", match);
    529     }
    530 
    531     return entry;
    532 }
    533 
    534 psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, const char *restrict match, int which)
    535 {
    536     psList* mdList = NULL;
    537     psMetadataItem* entry = NULL;
    538 
    539     mdList = md->list;
    540     if (mdList == NULL) {
    541         psError(__func__, "Null metadata list not allowed");
    542         return NULL;
    543     }
    544 
    545     mdList = md->list;
    546     if (mdList == NULL) {
    547         psError(__func__, "Null metadata list not allowed");
    548         return NULL;
    549     }
    550 
    551     psListSetIterator(mdList, which);
    552     entry = psListGetCurrent(mdList);
    553     while (entry != NULL) {
    554         if (!strncmp(match, entry->name, strlen(match))) {
    555 
    556             // Match found
    557             return entry;
    558         }
    559         entry = psListGetPrevious(mdList);
    560     }
    561 
    562     // Match not found
    563     if (entry == NULL) {
    564         psError(__func__, "Couldn't find metadata item with given match. Match: %s", match);
     572        psError(__func__, "Couldn't find metadata item", match);
    565573    }
    566574
  • trunk/psLib/src/collections/psMetadata.c

    r1440 r1447  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-08-09 23:34:57 $
     14*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-08-10 01:43:05 $
    1616*
    1717*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    501501    psMetadataItem* entry = NULL;
    502502
     503
     504    if (md == NULL) {
     505        psError(__func__, "Null metadata collection not allowed");
     506        return NULL;
     507    }
     508
    503509    mdList = md->list;
    504510    if (mdList == NULL) {
     
    507513    }
    508514
     515    psListSetIterator(mdList, which);
     516    entry = psListGetCurrent(mdList);
     517    while (entry != NULL) {
     518        if(match != NULL) {
     519            if (!strncmp(match, entry->name, strlen(match))) {
     520
     521                // Match found
     522                return entry;
     523            }
     524            entry = psListGetNext(mdList);
     525        } else {
     526            return psListGetNext(mdList);
     527        }
     528    }
     529
     530    // Match not found
     531    if (entry == NULL) {
     532        psError(__func__, "Couldn't find metadata item");
     533    }
     534
     535    return entry;
     536}
     537
     538psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, const char *restrict match, int which)
     539{
     540    psList* mdList = NULL;
     541    psMetadataItem* entry = NULL;
     542
     543
     544    if (md == NULL) {
     545        psError(__func__, "Null metadata collection not allowed");
     546        return NULL;
     547    }
     548
    509549    mdList = md->list;
    510550    if (mdList == NULL) {
     
    516556    entry = psListGetCurrent(mdList);
    517557    while (entry != NULL) {
    518         if (!strncmp(match, entry->name, strlen(match))) {
    519 
    520             // Match found
    521             return entry;
    522         }
    523         entry = psListGetNext(mdList);
     558        if(match != NULL) {
     559            if (!strncmp(match, entry->name, strlen(match))) {
     560
     561                // Match found
     562                return entry;
     563            }
     564            entry = psListGetPrevious(mdList);
     565        } else {
     566            return psListGetPrevious(mdList);
     567        }
    524568    }
    525569
    526570    // Match not found
    527571    if (entry == NULL) {
    528         psError(__func__, "Couldn't find metadata item with given match. Match: %s", match);
    529     }
    530 
    531     return entry;
    532 }
    533 
    534 psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, const char *restrict match, int which)
    535 {
    536     psList* mdList = NULL;
    537     psMetadataItem* entry = NULL;
    538 
    539     mdList = md->list;
    540     if (mdList == NULL) {
    541         psError(__func__, "Null metadata list not allowed");
    542         return NULL;
    543     }
    544 
    545     mdList = md->list;
    546     if (mdList == NULL) {
    547         psError(__func__, "Null metadata list not allowed");
    548         return NULL;
    549     }
    550 
    551     psListSetIterator(mdList, which);
    552     entry = psListGetCurrent(mdList);
    553     while (entry != NULL) {
    554         if (!strncmp(match, entry->name, strlen(match))) {
    555 
    556             // Match found
    557             return entry;
    558         }
    559         entry = psListGetPrevious(mdList);
    560     }
    561 
    562     // Match not found
    563     if (entry == NULL) {
    564         psError(__func__, "Couldn't find metadata item with given match. Match: %s", match);
     572        psError(__func__, "Couldn't find metadata item", match);
    565573    }
    566574
  • trunk/psLib/src/types/psMetadata.c

    r1440 r1447  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-08-09 23:34:57 $
     14*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-08-10 01:43:05 $
    1616*
    1717*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    501501    psMetadataItem* entry = NULL;
    502502
     503
     504    if (md == NULL) {
     505        psError(__func__, "Null metadata collection not allowed");
     506        return NULL;
     507    }
     508
    503509    mdList = md->list;
    504510    if (mdList == NULL) {
     
    507513    }
    508514
     515    psListSetIterator(mdList, which);
     516    entry = psListGetCurrent(mdList);
     517    while (entry != NULL) {
     518        if(match != NULL) {
     519            if (!strncmp(match, entry->name, strlen(match))) {
     520
     521                // Match found
     522                return entry;
     523            }
     524            entry = psListGetNext(mdList);
     525        } else {
     526            return psListGetNext(mdList);
     527        }
     528    }
     529
     530    // Match not found
     531    if (entry == NULL) {
     532        psError(__func__, "Couldn't find metadata item");
     533    }
     534
     535    return entry;
     536}
     537
     538psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, const char *restrict match, int which)
     539{
     540    psList* mdList = NULL;
     541    psMetadataItem* entry = NULL;
     542
     543
     544    if (md == NULL) {
     545        psError(__func__, "Null metadata collection not allowed");
     546        return NULL;
     547    }
     548
    509549    mdList = md->list;
    510550    if (mdList == NULL) {
     
    516556    entry = psListGetCurrent(mdList);
    517557    while (entry != NULL) {
    518         if (!strncmp(match, entry->name, strlen(match))) {
    519 
    520             // Match found
    521             return entry;
    522         }
    523         entry = psListGetNext(mdList);
     558        if(match != NULL) {
     559            if (!strncmp(match, entry->name, strlen(match))) {
     560
     561                // Match found
     562                return entry;
     563            }
     564            entry = psListGetPrevious(mdList);
     565        } else {
     566            return psListGetPrevious(mdList);
     567        }
    524568    }
    525569
    526570    // Match not found
    527571    if (entry == NULL) {
    528         psError(__func__, "Couldn't find metadata item with given match. Match: %s", match);
    529     }
    530 
    531     return entry;
    532 }
    533 
    534 psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, const char *restrict match, int which)
    535 {
    536     psList* mdList = NULL;
    537     psMetadataItem* entry = NULL;
    538 
    539     mdList = md->list;
    540     if (mdList == NULL) {
    541         psError(__func__, "Null metadata list not allowed");
    542         return NULL;
    543     }
    544 
    545     mdList = md->list;
    546     if (mdList == NULL) {
    547         psError(__func__, "Null metadata list not allowed");
    548         return NULL;
    549     }
    550 
    551     psListSetIterator(mdList, which);
    552     entry = psListGetCurrent(mdList);
    553     while (entry != NULL) {
    554         if (!strncmp(match, entry->name, strlen(match))) {
    555 
    556             // Match found
    557             return entry;
    558         }
    559         entry = psListGetPrevious(mdList);
    560     }
    561 
    562     // Match not found
    563     if (entry == NULL) {
    564         psError(__func__, "Couldn't find metadata item with given match. Match: %s", match);
     572        psError(__func__, "Couldn't find metadata item", match);
    565573    }
    566574
Note: See TracChangeset for help on using the changeset viewer.