Changeset 1387 for trunk/psLib/src/collections/psMetadata.c
- Timestamp:
- Aug 4, 2004, 4:22:42 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/collections/psMetadata.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psMetadata.c
r1385 r1387 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 4 23:37:39$13 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-05 02:22:42 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 266 266 return false; 267 267 } 268 } else 269 if ( value != NULL ) { 270 271 // The key was found and the new metadata item is a folder node. Don't add new metadata item, since 272 // it will wipe out existing node. 273 psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s", 268 } else if ( value != NULL ) { 269 270 // The key was found and the new metadata item is a folder node. Don't add new metadata item, since 271 // it will wipe out existing node. 272 psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s", 273 metadataItem->name ); 274 return false; 275 } else { 276 277 // Duplicate key not found. Add new metadata item to metadata collection's hash 278 if ( !psHashAdd( mdTable, key, metadataItem ) ) { 279 psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s", 274 280 metadataItem->name ); 275 281 return false; 276 } else { 277 278 // Duplicate key not found. Add new metadata item to metadata collection's hash 279 if ( !psHashAdd( mdTable, key, metadataItem ) ) { 280 psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s", 281 metadataItem->name ); 282 return false; 283 } 284 } 282 } 283 } 285 284 286 285 // Add all items to metadata collection's list, even if they have the same metadata item names … … 600 599 psError( __func__, "Null extname AND extnum = 0 not allowed" ); 601 600 return NULL; 602 } else 603 if ( extname && extnum ) { 604 psError( __func__, "Both extname AND extnum arguments should not have values." ); 605 return NULL; 606 } 601 } else if ( extname && extnum ) { 602 psError( __func__, "Both extname AND extnum arguments should not have values." ); 603 return NULL; 604 } 607 605 608 606 // Allocate metadata if user didn't … … 619 617 return output; 620 618 } 621 } else 622 if ( extnum > 0 ) { 623 tempExtname = ( char* ) extname; 624 if ( fits_movnam_hdu( fd, ANY_HDU, tempExtname, 0, &status ) != 0 ) { 625 fits_get_errstatus( status, fitsErr ); 626 psError( __func__, "FITS error while locating header: %s", fitsErr ); 627 status = 0; 628 return output; 629 } 630 } 619 } else if ( extnum > 0 ) { 620 tempExtname = ( char* ) extname; 621 if ( fits_movnam_hdu( fd, ANY_HDU, tempExtname, 0, &status ) != 0 ) { 622 fits_get_errstatus( status, fitsErr ); 623 psError( __func__, "FITS error while locating header: %s", fitsErr ); 624 status = 0; 625 return output; 626 } 627 } 631 628 632 629 // Get number of key names
Note:
See TracChangeset
for help on using the changeset viewer.
