IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 23, 2004, 8:46:13 AM (22 years ago)
Author:
harman
Message:

Added more function prototypes

File:
1 edited

Legend:

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

    r1286 r1288  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-23 01:30:29 $
     12 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-07-23 18:46:13 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7171        psPTR     V;                    ///< Pointer to other type of data.
    7272    }
    73     data;                             ///< Union for data types.
     73    data;                               ///< Union for data types.
    7474    char *comment;                      ///< Optional comment ("", not NULL).
    7575    psList *restrict items;             ///< List of psMetadataItems with same name.
     
    142142 */
    143143psMetadata *psMetadataAlloc(
    144     void                                ///< Void
    145 );
    146 
     144    void                                ///< Void.
     145);
     146
     147/** Add existing metadata item to metadata collection.
     148 *
     149 * Add a metadata item that has already been created to the metadata collection.
     150 *
     151 * @return bool: True for success, false for failure.
     152 */
     153bool *psMetadataAddItem(
     154    psMetadata *restrict md,            ///< Metadata collection to insert metadat item.
     155    int where,                          ///< Location to be added.
     156    psMetadataItem *restrict item       ///< Metadata item to be added.
     157);
     158
     159/** Create and add a metadata item to metadata collection.
     160 *
     161 * Creates a new metadata item add to the metadata collection.
     162 *
     163 * @return bool: True for success, false for failure.
     164 */
     165bool *psMetadataAdd(
     166    psMetadata *restrict md,            ///< Metadata collection to insert metadat item.
     167    int where,                          ///< Location to be added.
     168    const char *name,                   ///< Name of metadata item.
     169    int format,                         ///< Binary OR combination of metadata type and metadata flag.
     170    const char *comment,                ///< Comment for metadata item.
     171    ...                                 ///< Arguments for name formatting and metadata item data.
     172);
     173
     174/** Remove an item from metadata collection.
     175 *
     176 * Items may be removed from metadata by specifing a key or location. If the name is null, the where argument
     177 * is used instead. If name is not null, where is set to PS_LIST_UNKNOWN. If the item is found, it is removed
     178 * from the metadata and true is returned.  If the key is not unique, then all items corresponding to it are
     179 * removed.
     180 *
     181 * @return bool: True for success, false for failure.
     182 */
     183bool *psMetadataRemove(
     184    psMetadata *restrict md,            ///< Metadata collection to insert metadat item.
     185    int where,                          ///< Location to be removed.
     186    const char *restrict key            ///< Name of metadata key.
     187);
     188
     189/** Find an item in the metadata collection based on key name.
     190 *
     191 * Items may be found in the metadata by providing a key. If the key is non-unique, the first item is
     192 * returned. If the item is not found, null is returned.
     193 *
     194 * @return psMetadataItem*: Pointer metadata item.
     195 */
     196psMetadataItem *psMetadataLookup(
     197    psMetadata *restrict md,            ///< Metadata collection to insert metadat item.
     198    const char *restrict key            ///< Name of metadata key.
     199);
     200
     201/** Find an item in the metadata collection based on list index.
     202 *
     203 * Items may be found in the metadata by their entry position in the list container.
     204 *
     205 * @return psMetadataItem*: Pointer metadata item.
     206 */
     207psMetadataItem *psMetadataGet(
     208    psMetadata *restrict md,            ///< Metadata collection to insert metadat item.
     209    int where                           ///< Location to be retrieved.
     210);
     211
     212/** Set or reset metadata iterator.
     213 *
     214 * Metadata may be iterated by setting or resetting an iterator to a location in the metadata list.
     215 *
     216 * @return void: void.
     217 */
     218bool psMetadataSetIterator(
     219    psMetadata *restrict md,            ///< Metadata collection to iterate.
     220    int where                           ///< Location of iterator.
     221);
     222
     223/** Get next metadata item.
     224 *
     225 * Get next metadata item in iterator list.
     226 *
     227 * @return psMetadataItem*: Pointer metadata item.
     228 */
     229psMetadataItem *psMetadataGetNext(
     230    psMetadata *restrict md,            ///< Metadata collection to iterate.
     231    const char *restrict match,         ///< Beginning of key name.
     232    int which                           ///< Iterator to be used.
     233);
     234
     235/** Get previous metadata item.
     236 *
     237 * Get previous metadata item in iterator list.
     238 *
     239 * @return psMetadataItem*: Pointer metadata item.
     240 */
     241psMetadataItem *psMetadataGetPrevious(
     242    psMetadata *restrict md,            ///< Metadata collection to iterate.
     243    const char *restrict match,         ///< Beginning of key name.
     244    int which                           ///< Iterator to be used.
     245);
     246
     247/** Print metadata item to file.
     248 *
     249 * Metadata items may be printed to an open file descriptor based on a provided format. The format is a
     250 * sprintf format statement with exactly one % formatting command. If the metadata item type is a numeric
     251 * type, this formatting command must also be numeric, and the type conversion performed to the value to match
     252 * the format type. If the metadata type is a string, the fromatting command must also br for a string. If the
     253 * metadata type is any other data type, printing is not allowed.
     254 *
     255 * @return psMetadataItem*: Pointer metadata item.
     256 */
     257void psMetadataItemPrint(
     258    FILE *fd,                           ///< Pointer to file to write metadata item.
     259    const char *format,                 ///< Format to print metadat item.
     260    const psMetadataItem *restrict md   ///< Metadata item to print.
     261);
     262
     263/** Read metadata header.
     264 *
     265 * Read a metadata header from file. If the file is not found, an error is reported.
     266 *
     267 * @return psMetadata*: Pointer metadata.
     268 */
     269psMetadata *psMetadataReadHeader(
     270    psMetadata *output,                 ///< Resulting metadata frim read.
     271    const char *extname,                ///< File name extension string.
     272    int extnum,                         ///< File name extension number.
     273    const char *filename                ///< Name of file to read.
     274);
     275
     276/** Read metadata header.
     277 *
     278 * Read a metadata header from file. If the file is not found, an error is reported.
     279 *
     280 * @return psMetadata*: Pointer metadata.
     281 */
     282psMetadata *psMetadataFReadHeader(
     283    psMetadata *output,                 ///< Resulting metadata frim read.
     284    const char *extname,                ///< File name extension string.
     285    int extnum,                         ///< File name extension number.
     286    FILE *fd                            ///< Pointer to file to read.
     287);
    147288/// @}
    148289
Note: See TracChangeset for help on using the changeset viewer.