IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1588


Ignore:
Timestamp:
Aug 18, 2004, 5:58:03 PM (22 years ago)
Author:
Paul Price
Message:

Updating from SDRS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/pslib/include/psMetadata.h

    r753 r1588  
    2222} psMetadataType;
    2323
    24 /** Metadata flags (not exclusive with psMetadataType). */
    25 typedef enum {
    26     PS_META_TYPE_MASK =     0xffff,     ///< the type enum must fit in this mask
    27     PS_META_UNIQUE =       0x10000,     ///< the name must be unique (default)
    28     PS_META_NON_UNIQUE =   0x20000,     ///< the name may be repeated, and should be disambiguated for us
    29 } psMetadataFlags;
    30 
    3124/** A struct to define a single item of metadata */
    3225typedef struct {
    3326    const int id;                       ///< unique ID for this item
    34     char *restrict name;                ///< Name of item
     27    const char *name;                   ///< Name of item
    3528    psMetadataType type;                ///< type of this item
    36     psMetadataFlags flags;              ///< flags associated with this item
    37     union {
     29    const union {
    3830        psS32 S32;                      ///< integer value
    3931        psF32 F32;                      ///< floating value
    4032        psF64 F64;                      ///< double value
    41         void *V;                        ///< other type
     33        void *void;                     ///< other type
    4234    } data;                             ///< value of metadata
    4335    char *comment;                      ///< optional comment ("", not NULL)
    44     psDlist *restrict items;            ///< list of psMetadataItems with the same name
     36    psDlist *items;                     ///< list of psMetadataItems with the same name
    4537} psMetadataItem;
    4638
    4739/** A set of metadata */
    4840typedef struct {
    49     psDlist *restrict list;             ///< list of psMetadataItem
    50     psHash *restrict table;             ///< hash table of the same metadata
     41    psDlist *list;                      ///< list of psMetadataItem
     42    psHash *table;                      ///< hash table of the same metadata
    5143} psMetadata;
    5244
     
    5850/** Constructor */
    5951psMetadataItem *psMetadataItemAlloc(const char *name, ///< name of new item of metadata (sprintf format)
    60                                     int format, ///< type of this piece of metadata + flags
     52                                    psMetadataType type, ///< type of this piece of metadata
    6153                                    const char *comment, ///< comment associated with item
    6254                                    ...)        ///< arguments for name and data
     
    6456
    6557psMetadataItem *psMetadataItemAllocV(const char *name, ///< name of new item of metadata (sprintf format)
    66                                     int format, ///< type of this piece of metadata + flags
     58                                    psMetadataType type, ///< type of this piece of metadata
    6759                                    const char *comment, ///< comment associated with item
    6860                                    va_list ap) ///< arguments for name and data
    69 ;
    70 
    71 /** Destructor */
    72 void psMetadataItemFree(psMetadataItem *ms) ///< piece of metadata to destroy
    7361;
    7462
     
    7765;
    7866
    79 /** Destructor */
    80 void psMetadataFree(psMetadata *md) ///< destroy a set of metadata
    81 ;
    82 
    8367/**** Utilities **********************************************************************/
    8468
    8569/// Add item to the end of the metadata
    86 psMetadataItem *psMetadataAppendItem(psMetadata *restrict md, ///< metadata to add to
    87                                      psMetadataItem *restrict item) ///< Metatdata item to add
     70psMetadataItem *psMetadataAddItem(psMetadata *md, ///< metadata to add to
     71                                  int where, ///< Where to add item
     72                                  psMetadataItem *item) ///< Metatdata item to add
    8873;
    8974
    9075/// Add item to the end of the metadata.  Combines psMetadataItemAlloc and psMetadataAppendItem
    91 psMetadataItem *psMetadataAppend(psMetadata *restrict md, ///< Metadata to add to
    92                                  const char *name, ///< name of new item of metadata (sprintf format)
    93                                  int format, ///< type of this piece of metadata + flags
    94                                  const char *comment, ///< comment associated with item
    95                                  ...)   ///< possible arguments for name format
     76psMetadataItem *psMetadataAdd(psMetadata *md, ///< Metadata to add to
     77                              int where, ///< Where to add item
     78                              const char *name, ///< name of new item of metadata (sprintf format)
     79                              int format, ///< type of this piece of metadata + flags
     80                              const char *comment, ///< comment associated with item
     81                              ...)      ///< possible arguments for name format
    9682;
    9783
    9884/// delete item from the metadata
    99 psMetadataItem *psMetadataRemove(psMetadata *restrict md, ///< metadata to delete from
    100                                  const char *restrict key ///< Key to delete
     85bool *psMetadataRemove(psMetadata *md,  ///< metadata to delete from
     86                       int where,       ///< Where to remove
     87                       const char *key  ///< Key to delete
     88    );
     89
     90/// find the metadata with the specified key
     91psMetadataItem *psMetadataLookup(const psMetadata *md, ///< metadata to look up
     92                                 const char *key ///< Key to find
     93    );
     94
     95/// retrieve the metadata on the basis of entry position
     96psMetadataItem *psMetadataGet(const psMetadata *md, ///< metadata to look up
     97                              int which ///< entry position
    10198    );
    10299
     
    106103
    107104/// get the next item in the sequence
    108 psMetadataItem *psMetadataGetNext(psMetadata *restrict md, ///< metadata to get from
    109                                   const char *restrict match, ///< Match this
     105psMetadataItem *psMetadataGetNext(psMetadata *md, ///< metadata to get from
     106                                  const char *match, ///< String to match
    110107                                  int which ///< Which iterator to use
    111108    );
    112109
    113 /// find the metadata with the specified key
    114 psMetadataItem *psMetadataLookup(const psMetadata *restrict md, ///< metadata to look up
    115                                  const char *restrict key ///< Key to find
     110/// get the next item in the sequence
     111psMetadataItem *psMetadataGetPrevious(psMetadata *md, ///< metadata to get from
     112                                      const char *match, ///< String to match
     113                                      int which ///< Which iterator to use
    116114    );
    117115
    118116/// print metadata item to the specified stream
    119 void psMetadataItemPrint(FILE *fd,              ///< file descriptor to write to
    120                          const psMetadataItem *restrict md, ///< item of metadata to print
    121                          const char *prefix        ///< print this at the beginning of each line
     117void psMetadataItemPrint(FILE *fd,      ///< file descriptor to write to
     118                         const char *format, ///< Format of output
     119                         const psMetadataItem *md ///< item of metadata to print
    122120    );
    123121
Note: See TracChangeset for help on using the changeset viewer.