Changeset 1621
- Timestamp:
- Aug 25, 2004, 10:21:41 AM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 6 edited
-
astronomy/psMetadata.c (modified) (7 diffs)
-
astronomy/psMetadata.h (modified) (13 diffs)
-
collections/psMetadata.c (modified) (7 diffs)
-
collections/psMetadata.h (modified) (13 diffs)
-
types/psMetadata.c (modified) (7 diffs)
-
types/psMetadata.h (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psMetadata.c
r1546 r1621 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08- 14 02:55:46$14 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-25 20:21:25 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 39 39 /******************************************************************************/ 40 40 41 #define FITS_ERROR(STRING,PS_ERROR) \ 42 fits_get_errstatus(status, fitsErr); \ 43 psError( __func__, STRING, PS_ERROR, fitsErr); \ 44 status = 0; \ 41 #define FITS_ERROR(STRING,PS_ERROR) \ 42 fits_get_errstatus(status, fitsErr); \ 43 psError(__func__, STRING, PS_ERROR, fitsErr); \ 44 status = 0; \ 45 fits_close_file(fd, &status); \ 46 if(status){ \ 47 fits_get_errstatus(status, fitsErr); \ 48 psError(__func__, "Couldn't close FITS file. FITS error: %s", fitsErr); \ 49 } \ 50 status = 0; \ 45 51 return output; 46 52 … … 657 663 } 658 664 659 psMetadata* psMetadata FReadHeader(psMetadata* output, char *extName, int extNum, fitsfile * fd)665 psMetadata* psMetadataReadHeader(psMetadata* output, char *extName, int extNum, char *fileName) 660 666 { 661 667 bool tempBool; … … 672 678 int keyNum = 0; 673 679 psMetadataType metadataItemType; 674 675 if (fd == NULL) { 676 psError(__func__, "Null FITS file descriptor not allowed"); 680 fitsfile *fd = NULL; 681 682 if(fileName == NULL) { 683 psError(__func__, "Null fileName not allowed"); 684 return NULL; 685 } 686 687 fits_open_file(&fd, fileName, READONLY, &status); 688 if(fd == NULL || status != 0) { 689 FITS_ERROR("FITS error while opening file: %s %s", fileName); 677 690 return NULL; 678 691 } … … 685 698 return NULL; 686 699 } 700 687 701 // Allocate metadata if user didn't 688 702 if (output == NULL) { 689 703 output = psMetadataAlloc(); 690 704 } 705 691 706 // Move to user designated HDU number or HDU name in FITS file. HDU numbers starts at one. 692 707 if (extName != NULL) { … … 704 719 FITS_ERROR("FITS error while reading key %d: %s", keyNum); 705 720 } 721 706 722 // Get each key name. Keywords start at one. 707 723 for (i = 1; i <= numKeys; i++) { … … 714 730 FITS_ERROR("FITS error while determining key %d type: %s", keyNum); 715 731 } else { 716 // Some keywords are still valid even though they don't have a type, like COMMENTS and 717 // HISTORY 732 // Some keywords are still valid if they don't have a type (like COMMENTS and HISTORY) 718 733 keyType = 'C'; 719 734 status = 0; -
trunk/psLib/src/astronomy/psMetadata.h
r1496 r1621 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08- 12 01:23:20$13 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-25 20:21:41 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 72 72 /** Metadata data structure. 73 73 * 74 * Struct for holding metadata items. Metadata items are held in two 75 * containers. The first employs a doubly-linked list to preserve the order 74 * Struct for holding metadata items. Metadata items are held in two 75 * containers. The first employs a doubly-linked list to preserve the order 76 76 * of the metadata. The second container employs a hash table which 77 77 * allows fast lookup when given a metadata keyword. … … 92 92 /** Create a metadata item. 93 93 * 94 * Returns a fill psMetadataItem ready for insertion into the psMetadata 95 * struct. The name argument specifies the name to use for this item, and 94 * Returns a fill psMetadataItem ready for insertion into the psMetadata 95 * struct. The name argument specifies the name to use for this item, and 96 96 * may include sprintf formatting codes. The format entry specifies both 97 * the metadata type and optional flags and is created by bit-wise or of the 98 * appropriate type and flag. The comment argument is a fixed string used to 99 * comment the metadata item. The arguments to the name formatting codes and 100 * the metadata itself are passed as arguments following the comment string. 101 * The data must be a pointer for any of the elements stored in data.void. 102 * The argument list must be interpreted appropriately by the va_list 97 * the metadata type and optional flags and is created by bit-wise or of the 98 * appropriate type and flag. The comment argument is a fixed string used to 99 * comment the metadata item. The arguments to the name formatting codes and 100 * the metadata itself are passed as arguments following the comment string. 101 * The data must be a pointer for any of the elements stored in data.void. 102 * The argument list must be interpreted appropriately by the va_list 103 103 * operators in the function specified size and type. 104 104 * … … 114 114 /** Create a metadata item with va_list. 115 115 * 116 * Returns a fill psMetadataItem ready for insertion into the psMetadata 116 * Returns a fill psMetadataItem ready for insertion into the psMetadata 117 117 * struct. The name argument specifies the name to use for this item, and 118 118 * may include sprintf formatting codes. The format entry specifies both 119 * the metadata type and optional flags and is created by bit-wise or of the 120 * appropriate type and flag. The comment argument is a fixed string used to 121 * comment the metadata item. The arguments to the name formatting codes and 122 * the metadata itself are passed as arguments following the comment string. 123 * The data must be a pointer for any of the elements stored in data.void. 124 * The argument list must be interpreted appropriately by the va_list 119 * the metadata type and optional flags and is created by bit-wise or of the 120 * appropriate type and flag. The comment argument is a fixed string used to 121 * comment the metadata item. The arguments to the name formatting codes and 122 * the metadata itself are passed as arguments following the comment string. 123 * The data must be a pointer for any of the elements stored in data.void. 124 * The argument list must be interpreted appropriately by the va_list 125 125 * operators in the function specified size and type. 126 126 * … … 136 136 /** Create a metadata collection. 137 137 * 138 * Returns an empty metadata container with fully allocated internal metadata 138 * Returns an empty metadata container with fully allocated internal metadata 139 139 * containers. 140 140 * … … 145 145 /** Add existing metadata item to metadata collection. 146 146 * 147 * Add a metadata item that has already been created to the metadata 147 * Add a metadata item that has already been created to the metadata 148 148 * collection. 149 149 * … … 173 173 /** Remove an item from metadata collection. 174 174 * 175 * Items may be removed from metadata by specifing a key or location. If the 176 * name is null, the where argument is used instead. If name is not null, 177 * where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from 178 * the metadata and true is returned. If the key is not unique, then all 175 * Items may be removed from metadata by specifing a key or location. If the 176 * name is null, the where argument is used instead. If name is not null, 177 * where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from 178 * the metadata and true is returned. If the key is not unique, then all 179 179 * items corresponding to it are removed. 180 180 * … … 189 189 /** Find an item in the metadata collection based on key name. 190 190 * 191 * Items may be found in the metadata by providing a key. If the key is 192 * non-unique, the first item is returned. If the item is not found, null is 191 * Items may be found in the metadata by providing a key. If the key is 192 * non-unique, the first item is returned. If the item is not found, null is 193 193 * returned. 194 194 * … … 202 202 /** Find an item in the metadata collection based on list index. 203 203 * 204 * Items may be found in the metadata by their entry position in the list 204 * Items may be found in the metadata by their entry position in the list 205 205 * container. 206 206 * … … 214 214 /** Set or reset metadata iterator. 215 215 * 216 * Metadata may be iterated by setting or resetting an iterator to a location 216 * Metadata may be iterated by setting or resetting an iterator to a location 217 217 * in the metadata list. 218 218 * … … 250 250 /** Print metadata item to file. 251 251 * 252 * Metadata items may be printed to an open file descriptor based on a 253 * provided format. The format is a sprintf format statement with exactly 254 * one % formatting command. If the metadata item type is a numeric type, 255 * this formatting command must also be numeric, and the type conversion 256 * performed to the value to match the format type. If the metadata type is 252 * Metadata items may be printed to an open file descriptor based on a 253 * provided format. The format is a sprintf format statement with exactly 254 * one % formatting command. If the metadata item type is a numeric type, 255 * this formatting command must also be numeric, and the type conversion 256 * performed to the value to match the format type. If the metadata type is 257 257 * a string, the fromatting command must also be for a string. If the 258 258 * metadata type is any other data type, printing is not allowed. … … 268 268 /** Read metadata header. 269 269 * 270 * Read a metadata header from file. If the file is not found, an error is 270 * Read a metadata header from file. If the file is not found, an error is 271 271 * reported. This file is currently unimplemented. 272 272 * … … 275 275 psMetadata* psMetadataReadHeader( 276 276 psMetadata* output, ///< Resulting metadata from read. 277 char *extname, ///< File name extension string.278 int extnum, ///< File name extension number. Starts at 1.279 char *filename ///< Name of file to read.280 );281 282 /** Read metadata header.283 *284 * Read a metadata header from file. If the file is not found, an error is285 * reported.286 *287 * @return psMetadata* : Pointer metadata.288 */289 psMetadata* psMetadataFReadHeader(290 psMetadata* output, ///< Resulting metadata from read.291 277 char *extName, ///< File name extension string. 292 int extNum, ///< File name extension number. 293 fitsfile * fd ///< Pointer tofile to read.278 int extNum, ///< File name extension number. Starts at 1. 279 char *fileName ///< Name of file to read. 294 280 ); 295 281 -
trunk/psLib/src/collections/psMetadata.c
r1546 r1621 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08- 14 02:55:46$14 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-25 20:21:25 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 39 39 /******************************************************************************/ 40 40 41 #define FITS_ERROR(STRING,PS_ERROR) \ 42 fits_get_errstatus(status, fitsErr); \ 43 psError( __func__, STRING, PS_ERROR, fitsErr); \ 44 status = 0; \ 41 #define FITS_ERROR(STRING,PS_ERROR) \ 42 fits_get_errstatus(status, fitsErr); \ 43 psError(__func__, STRING, PS_ERROR, fitsErr); \ 44 status = 0; \ 45 fits_close_file(fd, &status); \ 46 if(status){ \ 47 fits_get_errstatus(status, fitsErr); \ 48 psError(__func__, "Couldn't close FITS file. FITS error: %s", fitsErr); \ 49 } \ 50 status = 0; \ 45 51 return output; 46 52 … … 657 663 } 658 664 659 psMetadata* psMetadata FReadHeader(psMetadata* output, char *extName, int extNum, fitsfile * fd)665 psMetadata* psMetadataReadHeader(psMetadata* output, char *extName, int extNum, char *fileName) 660 666 { 661 667 bool tempBool; … … 672 678 int keyNum = 0; 673 679 psMetadataType metadataItemType; 674 675 if (fd == NULL) { 676 psError(__func__, "Null FITS file descriptor not allowed"); 680 fitsfile *fd = NULL; 681 682 if(fileName == NULL) { 683 psError(__func__, "Null fileName not allowed"); 684 return NULL; 685 } 686 687 fits_open_file(&fd, fileName, READONLY, &status); 688 if(fd == NULL || status != 0) { 689 FITS_ERROR("FITS error while opening file: %s %s", fileName); 677 690 return NULL; 678 691 } … … 685 698 return NULL; 686 699 } 700 687 701 // Allocate metadata if user didn't 688 702 if (output == NULL) { 689 703 output = psMetadataAlloc(); 690 704 } 705 691 706 // Move to user designated HDU number or HDU name in FITS file. HDU numbers starts at one. 692 707 if (extName != NULL) { … … 704 719 FITS_ERROR("FITS error while reading key %d: %s", keyNum); 705 720 } 721 706 722 // Get each key name. Keywords start at one. 707 723 for (i = 1; i <= numKeys; i++) { … … 714 730 FITS_ERROR("FITS error while determining key %d type: %s", keyNum); 715 731 } else { 716 // Some keywords are still valid even though they don't have a type, like COMMENTS and 717 // HISTORY 732 // Some keywords are still valid if they don't have a type (like COMMENTS and HISTORY) 718 733 keyType = 'C'; 719 734 status = 0; -
trunk/psLib/src/collections/psMetadata.h
r1496 r1621 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08- 12 01:23:20$13 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-25 20:21:41 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 72 72 /** Metadata data structure. 73 73 * 74 * Struct for holding metadata items. Metadata items are held in two 75 * containers. The first employs a doubly-linked list to preserve the order 74 * Struct for holding metadata items. Metadata items are held in two 75 * containers. The first employs a doubly-linked list to preserve the order 76 76 * of the metadata. The second container employs a hash table which 77 77 * allows fast lookup when given a metadata keyword. … … 92 92 /** Create a metadata item. 93 93 * 94 * Returns a fill psMetadataItem ready for insertion into the psMetadata 95 * struct. The name argument specifies the name to use for this item, and 94 * Returns a fill psMetadataItem ready for insertion into the psMetadata 95 * struct. The name argument specifies the name to use for this item, and 96 96 * may include sprintf formatting codes. The format entry specifies both 97 * the metadata type and optional flags and is created by bit-wise or of the 98 * appropriate type and flag. The comment argument is a fixed string used to 99 * comment the metadata item. The arguments to the name formatting codes and 100 * the metadata itself are passed as arguments following the comment string. 101 * The data must be a pointer for any of the elements stored in data.void. 102 * The argument list must be interpreted appropriately by the va_list 97 * the metadata type and optional flags and is created by bit-wise or of the 98 * appropriate type and flag. The comment argument is a fixed string used to 99 * comment the metadata item. The arguments to the name formatting codes and 100 * the metadata itself are passed as arguments following the comment string. 101 * The data must be a pointer for any of the elements stored in data.void. 102 * The argument list must be interpreted appropriately by the va_list 103 103 * operators in the function specified size and type. 104 104 * … … 114 114 /** Create a metadata item with va_list. 115 115 * 116 * Returns a fill psMetadataItem ready for insertion into the psMetadata 116 * Returns a fill psMetadataItem ready for insertion into the psMetadata 117 117 * struct. The name argument specifies the name to use for this item, and 118 118 * may include sprintf formatting codes. The format entry specifies both 119 * the metadata type and optional flags and is created by bit-wise or of the 120 * appropriate type and flag. The comment argument is a fixed string used to 121 * comment the metadata item. The arguments to the name formatting codes and 122 * the metadata itself are passed as arguments following the comment string. 123 * The data must be a pointer for any of the elements stored in data.void. 124 * The argument list must be interpreted appropriately by the va_list 119 * the metadata type and optional flags and is created by bit-wise or of the 120 * appropriate type and flag. The comment argument is a fixed string used to 121 * comment the metadata item. The arguments to the name formatting codes and 122 * the metadata itself are passed as arguments following the comment string. 123 * The data must be a pointer for any of the elements stored in data.void. 124 * The argument list must be interpreted appropriately by the va_list 125 125 * operators in the function specified size and type. 126 126 * … … 136 136 /** Create a metadata collection. 137 137 * 138 * Returns an empty metadata container with fully allocated internal metadata 138 * Returns an empty metadata container with fully allocated internal metadata 139 139 * containers. 140 140 * … … 145 145 /** Add existing metadata item to metadata collection. 146 146 * 147 * Add a metadata item that has already been created to the metadata 147 * Add a metadata item that has already been created to the metadata 148 148 * collection. 149 149 * … … 173 173 /** Remove an item from metadata collection. 174 174 * 175 * Items may be removed from metadata by specifing a key or location. If the 176 * name is null, the where argument is used instead. If name is not null, 177 * where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from 178 * the metadata and true is returned. If the key is not unique, then all 175 * Items may be removed from metadata by specifing a key or location. If the 176 * name is null, the where argument is used instead. If name is not null, 177 * where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from 178 * the metadata and true is returned. If the key is not unique, then all 179 179 * items corresponding to it are removed. 180 180 * … … 189 189 /** Find an item in the metadata collection based on key name. 190 190 * 191 * Items may be found in the metadata by providing a key. If the key is 192 * non-unique, the first item is returned. If the item is not found, null is 191 * Items may be found in the metadata by providing a key. If the key is 192 * non-unique, the first item is returned. If the item is not found, null is 193 193 * returned. 194 194 * … … 202 202 /** Find an item in the metadata collection based on list index. 203 203 * 204 * Items may be found in the metadata by their entry position in the list 204 * Items may be found in the metadata by their entry position in the list 205 205 * container. 206 206 * … … 214 214 /** Set or reset metadata iterator. 215 215 * 216 * Metadata may be iterated by setting or resetting an iterator to a location 216 * Metadata may be iterated by setting or resetting an iterator to a location 217 217 * in the metadata list. 218 218 * … … 250 250 /** Print metadata item to file. 251 251 * 252 * Metadata items may be printed to an open file descriptor based on a 253 * provided format. The format is a sprintf format statement with exactly 254 * one % formatting command. If the metadata item type is a numeric type, 255 * this formatting command must also be numeric, and the type conversion 256 * performed to the value to match the format type. If the metadata type is 252 * Metadata items may be printed to an open file descriptor based on a 253 * provided format. The format is a sprintf format statement with exactly 254 * one % formatting command. If the metadata item type is a numeric type, 255 * this formatting command must also be numeric, and the type conversion 256 * performed to the value to match the format type. If the metadata type is 257 257 * a string, the fromatting command must also be for a string. If the 258 258 * metadata type is any other data type, printing is not allowed. … … 268 268 /** Read metadata header. 269 269 * 270 * Read a metadata header from file. If the file is not found, an error is 270 * Read a metadata header from file. If the file is not found, an error is 271 271 * reported. This file is currently unimplemented. 272 272 * … … 275 275 psMetadata* psMetadataReadHeader( 276 276 psMetadata* output, ///< Resulting metadata from read. 277 char *extname, ///< File name extension string.278 int extnum, ///< File name extension number. Starts at 1.279 char *filename ///< Name of file to read.280 );281 282 /** Read metadata header.283 *284 * Read a metadata header from file. If the file is not found, an error is285 * reported.286 *287 * @return psMetadata* : Pointer metadata.288 */289 psMetadata* psMetadataFReadHeader(290 psMetadata* output, ///< Resulting metadata from read.291 277 char *extName, ///< File name extension string. 292 int extNum, ///< File name extension number. 293 fitsfile * fd ///< Pointer tofile to read.278 int extNum, ///< File name extension number. Starts at 1. 279 char *fileName ///< Name of file to read. 294 280 ); 295 281 -
trunk/psLib/src/types/psMetadata.c
r1546 r1621 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08- 14 02:55:46$14 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-25 20:21:25 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 39 39 /******************************************************************************/ 40 40 41 #define FITS_ERROR(STRING,PS_ERROR) \ 42 fits_get_errstatus(status, fitsErr); \ 43 psError( __func__, STRING, PS_ERROR, fitsErr); \ 44 status = 0; \ 41 #define FITS_ERROR(STRING,PS_ERROR) \ 42 fits_get_errstatus(status, fitsErr); \ 43 psError(__func__, STRING, PS_ERROR, fitsErr); \ 44 status = 0; \ 45 fits_close_file(fd, &status); \ 46 if(status){ \ 47 fits_get_errstatus(status, fitsErr); \ 48 psError(__func__, "Couldn't close FITS file. FITS error: %s", fitsErr); \ 49 } \ 50 status = 0; \ 45 51 return output; 46 52 … … 657 663 } 658 664 659 psMetadata* psMetadata FReadHeader(psMetadata* output, char *extName, int extNum, fitsfile * fd)665 psMetadata* psMetadataReadHeader(psMetadata* output, char *extName, int extNum, char *fileName) 660 666 { 661 667 bool tempBool; … … 672 678 int keyNum = 0; 673 679 psMetadataType metadataItemType; 674 675 if (fd == NULL) { 676 psError(__func__, "Null FITS file descriptor not allowed"); 680 fitsfile *fd = NULL; 681 682 if(fileName == NULL) { 683 psError(__func__, "Null fileName not allowed"); 684 return NULL; 685 } 686 687 fits_open_file(&fd, fileName, READONLY, &status); 688 if(fd == NULL || status != 0) { 689 FITS_ERROR("FITS error while opening file: %s %s", fileName); 677 690 return NULL; 678 691 } … … 685 698 return NULL; 686 699 } 700 687 701 // Allocate metadata if user didn't 688 702 if (output == NULL) { 689 703 output = psMetadataAlloc(); 690 704 } 705 691 706 // Move to user designated HDU number or HDU name in FITS file. HDU numbers starts at one. 692 707 if (extName != NULL) { … … 704 719 FITS_ERROR("FITS error while reading key %d: %s", keyNum); 705 720 } 721 706 722 // Get each key name. Keywords start at one. 707 723 for (i = 1; i <= numKeys; i++) { … … 714 730 FITS_ERROR("FITS error while determining key %d type: %s", keyNum); 715 731 } else { 716 // Some keywords are still valid even though they don't have a type, like COMMENTS and 717 // HISTORY 732 // Some keywords are still valid if they don't have a type (like COMMENTS and HISTORY) 718 733 keyType = 'C'; 719 734 status = 0; -
trunk/psLib/src/types/psMetadata.h
r1496 r1621 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08- 12 01:23:20$13 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-25 20:21:41 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 72 72 /** Metadata data structure. 73 73 * 74 * Struct for holding metadata items. Metadata items are held in two 75 * containers. The first employs a doubly-linked list to preserve the order 74 * Struct for holding metadata items. Metadata items are held in two 75 * containers. The first employs a doubly-linked list to preserve the order 76 76 * of the metadata. The second container employs a hash table which 77 77 * allows fast lookup when given a metadata keyword. … … 92 92 /** Create a metadata item. 93 93 * 94 * Returns a fill psMetadataItem ready for insertion into the psMetadata 95 * struct. The name argument specifies the name to use for this item, and 94 * Returns a fill psMetadataItem ready for insertion into the psMetadata 95 * struct. The name argument specifies the name to use for this item, and 96 96 * may include sprintf formatting codes. The format entry specifies both 97 * the metadata type and optional flags and is created by bit-wise or of the 98 * appropriate type and flag. The comment argument is a fixed string used to 99 * comment the metadata item. The arguments to the name formatting codes and 100 * the metadata itself are passed as arguments following the comment string. 101 * The data must be a pointer for any of the elements stored in data.void. 102 * The argument list must be interpreted appropriately by the va_list 97 * the metadata type and optional flags and is created by bit-wise or of the 98 * appropriate type and flag. The comment argument is a fixed string used to 99 * comment the metadata item. The arguments to the name formatting codes and 100 * the metadata itself are passed as arguments following the comment string. 101 * The data must be a pointer for any of the elements stored in data.void. 102 * The argument list must be interpreted appropriately by the va_list 103 103 * operators in the function specified size and type. 104 104 * … … 114 114 /** Create a metadata item with va_list. 115 115 * 116 * Returns a fill psMetadataItem ready for insertion into the psMetadata 116 * Returns a fill psMetadataItem ready for insertion into the psMetadata 117 117 * struct. The name argument specifies the name to use for this item, and 118 118 * may include sprintf formatting codes. The format entry specifies both 119 * the metadata type and optional flags and is created by bit-wise or of the 120 * appropriate type and flag. The comment argument is a fixed string used to 121 * comment the metadata item. The arguments to the name formatting codes and 122 * the metadata itself are passed as arguments following the comment string. 123 * The data must be a pointer for any of the elements stored in data.void. 124 * The argument list must be interpreted appropriately by the va_list 119 * the metadata type and optional flags and is created by bit-wise or of the 120 * appropriate type and flag. The comment argument is a fixed string used to 121 * comment the metadata item. The arguments to the name formatting codes and 122 * the metadata itself are passed as arguments following the comment string. 123 * The data must be a pointer for any of the elements stored in data.void. 124 * The argument list must be interpreted appropriately by the va_list 125 125 * operators in the function specified size and type. 126 126 * … … 136 136 /** Create a metadata collection. 137 137 * 138 * Returns an empty metadata container with fully allocated internal metadata 138 * Returns an empty metadata container with fully allocated internal metadata 139 139 * containers. 140 140 * … … 145 145 /** Add existing metadata item to metadata collection. 146 146 * 147 * Add a metadata item that has already been created to the metadata 147 * Add a metadata item that has already been created to the metadata 148 148 * collection. 149 149 * … … 173 173 /** Remove an item from metadata collection. 174 174 * 175 * Items may be removed from metadata by specifing a key or location. If the 176 * name is null, the where argument is used instead. If name is not null, 177 * where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from 178 * the metadata and true is returned. If the key is not unique, then all 175 * Items may be removed from metadata by specifing a key or location. If the 176 * name is null, the where argument is used instead. If name is not null, 177 * where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from 178 * the metadata and true is returned. If the key is not unique, then all 179 179 * items corresponding to it are removed. 180 180 * … … 189 189 /** Find an item in the metadata collection based on key name. 190 190 * 191 * Items may be found in the metadata by providing a key. If the key is 192 * non-unique, the first item is returned. If the item is not found, null is 191 * Items may be found in the metadata by providing a key. If the key is 192 * non-unique, the first item is returned. If the item is not found, null is 193 193 * returned. 194 194 * … … 202 202 /** Find an item in the metadata collection based on list index. 203 203 * 204 * Items may be found in the metadata by their entry position in the list 204 * Items may be found in the metadata by their entry position in the list 205 205 * container. 206 206 * … … 214 214 /** Set or reset metadata iterator. 215 215 * 216 * Metadata may be iterated by setting or resetting an iterator to a location 216 * Metadata may be iterated by setting or resetting an iterator to a location 217 217 * in the metadata list. 218 218 * … … 250 250 /** Print metadata item to file. 251 251 * 252 * Metadata items may be printed to an open file descriptor based on a 253 * provided format. The format is a sprintf format statement with exactly 254 * one % formatting command. If the metadata item type is a numeric type, 255 * this formatting command must also be numeric, and the type conversion 256 * performed to the value to match the format type. If the metadata type is 252 * Metadata items may be printed to an open file descriptor based on a 253 * provided format. The format is a sprintf format statement with exactly 254 * one % formatting command. If the metadata item type is a numeric type, 255 * this formatting command must also be numeric, and the type conversion 256 * performed to the value to match the format type. If the metadata type is 257 257 * a string, the fromatting command must also be for a string. If the 258 258 * metadata type is any other data type, printing is not allowed. … … 268 268 /** Read metadata header. 269 269 * 270 * Read a metadata header from file. If the file is not found, an error is 270 * Read a metadata header from file. If the file is not found, an error is 271 271 * reported. This file is currently unimplemented. 272 272 * … … 275 275 psMetadata* psMetadataReadHeader( 276 276 psMetadata* output, ///< Resulting metadata from read. 277 char *extname, ///< File name extension string.278 int extnum, ///< File name extension number. Starts at 1.279 char *filename ///< Name of file to read.280 );281 282 /** Read metadata header.283 *284 * Read a metadata header from file. If the file is not found, an error is285 * reported.286 *287 * @return psMetadata* : Pointer metadata.288 */289 psMetadata* psMetadataFReadHeader(290 psMetadata* output, ///< Resulting metadata from read.291 277 char *extName, ///< File name extension string. 292 int extNum, ///< File name extension number. 293 fitsfile * fd ///< Pointer tofile to read.278 int extNum, ///< File name extension number. Starts at 1. 279 char *fileName ///< Name of file to read. 294 280 ); 295 281
Note:
See TracChangeset
for help on using the changeset viewer.
