IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 9, 2004, 4:50:16 PM (22 years ago)
Author:
desonia
Message:

Changed psList API for iterators, etc.

File:
1 edited

Legend:

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

    r2659 r2681  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-12-07 23:27:25 $
     14*  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-12-10 02:50:14 $
    1616*
    1717*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    352352{
    353353    psList* mdList = NULL;
    354     psList* entryList = NULL;
    355354    psHash* mdTable = NULL;
    356355    psMetadataItem* entry = NULL;
    357     psMetadataItem* entryChild = NULL;
    358356
    359357
     
    375373        }
    376374
    377         if (entry->type == PS_META_LIST) {
    378 
    379             // Table entry has children. Entry and children must be removed from metadata collection's list
    380             psListSetIterator(entryList, PS_LIST_HEAD);
    381             entryChild = psListGetCurrent(entryList);
    382             while(entryChild != NULL) {
    383                 if (!psListRemove(mdList, PS_LIST_UNKNOWN, entryChild)) {
    384                     psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_LIST_FAILED, key);
    385                     return false;
    386                 }
    387                 entryChild = psListGetNext(entryList);
    388             }
    389         } else {
    390 
    391             // Table entry has no children. Remove entry from metadata collection's list
    392             if (!psListRemove(mdList, PS_LIST_UNKNOWN, entry)) {
    393                 psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_LIST_FAILED, key);
    394                 return false;
    395             }
    396         }
    397         // Remove entry from metadata collection's table
    398         if (!psHashRemove(mdTable, key)) {
    399             psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED, key);
    400             return false;
    401         }
    402375    } else {
    403376
     
    414387            return false;
    415388        }
    416         // Use recursive remove, now that key is known
    417         psMetadataRemove(md, PS_LIST_UNKNOWN, key);
     389    }
     390
     391    if (!psListRemoveData(mdList, entry)) {
     392        psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_LIST_FAILED, key);
     393        return false;
     394    }
     395
     396    // Remove entry from metadata collection's table
     397    if (!psHashRemove(mdTable, key)) {
     398        psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psMetadata_REMOVE_TABLE_FAILED, key);
     399        return false;
    418400    }
    419401
Note: See TracChangeset for help on using the changeset viewer.