Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

Metadata


Files

file  psMetadata.h
 Contains metadata struuctures, enumerations and functions prototypes.
file  psMetadataConfig.h
 Contains metadata input/output functions.

Data Structures

struct  psMetadata
 Metadata data structure. More...
struct  psMetadataIterator
 Metadata iterator. More...
struct  psMetadataItem
 Metadata item data structure. More...
struct  p_psParseLevelInfo
 A metadata data structure used in parsing arrays. More...

Defines

#define PS_DATA_IS_PRIMITIVE(TYPE)
#define PS_DATA_PRIMITIVE_TYPE(DATATYPE)
#define PS_METADATA_FLAGS_MASK   0xFF000000
#define PS_METADATA_TYPE_MASK   0x00FFFFFF

Enumerations

enum  psMetadataFlags { PS_META_DEFAULT = 0, PS_META_REPLACE = 0x1000000, PS_META_DUPLICATE_OK = 0x2000000, PS_META_NULL = 0x4000000 }
 Option flags for psMetadata functions. More...

Functions

psMetadataItempsMetadataItemAlloc (const char *name, psDataType type, const char *comment,...)
 Create a metadata item.
bool psMemCheckMetadataItem (psPtr ptr)
 Checks the type of a particular pointer.
psMetadataItempsMetadataItemAllocStr (const char *name, const char *comment, const char *value)
 Create a metadata item with specified string data.
psMetadataItempsMetadataItemAllocF32 (const char *name, const char *comment, psF32 value)
 Create a metadata item with specified psF32 data.
psMetadataItempsMetadataItemAllocF64 (const char *name, const char *comment, psF64 value)
 Create a metadata item with specified psF64 data.
psMetadataItempsMetadataItemAllocS32 (const char *name, const char *comment, psS32 value)
 Create a metadata item with specified psS32 data.
psMetadataItempsMetadataItemAllocBool (const char *name, const char *comment, bool value)
 Create a metadata item with specified psBool data.
psMetadataItempsMetadataItemAllocPtr (const char *name, psDataType type, const char *comment, psPtr value)
 Create a metadata item with specified psPtr data.
psMetadataItempsMetadataItemAllocV (const char *name, psDataType type, const char *comment, va_list list)
 Create a metadata item with va_list.
psMetadatapsMetadataAlloc (void)
 Create a metadata collection.
bool psMemCheckMetadata (psPtr ptr)
 Checks the type of a particular pointer.
bool psMetadataAddItem (psMetadata *md, const psMetadataItem *item, int location, psS32 flags)
 Add existing metadata item to metadata collection.
bool psMetadataAdd (psMetadata *md, long location, const char *name, int format, const char *comment,...)
 Create and add a metadata item to metadata collection.
bool psMetadataAddV (psMetadata *md, long location, const char *name, int format, const char *comment, va_list list)
 Create and add a metadata item to metadata collection.
bool psMetadataAddBool (psMetadata *md, long location, const char *name, int format, const char *comment, bool value)
 Add a psBool value to metadata collection.
bool psMetadataAddS32 (psMetadata *md, long location, const char *name, int format, const char *comment, psS32 value)
 Add a psS32 value to metadata collection.
bool psMetadataAddF32 (psMetadata *md, long location, const char *name, int format, const char *comment, psF32 value)
 Add a psF32 value to metadata collection.
bool psMetadataAddF64 (psMetadata *md, long location, const char *name, int format, const char *comment, psF64 value)
 Add a psF64 value to metadata collection.
psBool psMetadataAddList (psMetadata *md, long location, const char *name, int format, const char *comment, psList *value)
 Add a psList to metadata collection.
bool psMetadataAddStr (psMetadata *md, long location, const char *name, int format, const char *comment, const char *value)
 Add a string to metadata collection.
psBool psMetadataAddVector (psMetadata *md, long location, const char *name, int format, const char *comment, psVector *value)
 Add a vector to metadata collection.
psBool psMetadataAddArray (psMetadata *md, long location, const char *name, int format, const char *comment, psArray *value)
 Add a array to metadata collection.
psBool psMetadataAddImage (psMetadata *md, long location, const char *name, int format, const char *comment, psImage *value)
 Add an Image to metadata collection.
psBool psMetadataAddTime (psMetadata *md, long location, const char *name, int format, const char *comment, psTime *value)
 Add a Time to metadata collection.
psBool psMetadataAddHash (psMetadata *md, long location, const char *name, int format, const char *comment, psHash *value)
 Add a Hash to metadata collection.
psBool psMetadataAddLookupTable (psMetadata *md, long location, const char *name, int format, const char *comment, psLookupTable *value)
 Add a LookupTable to metadata collection.
psBool psMetadataAddUnknown (psMetadata *md, long location, const char *name, int format, const char *comment, psPtr value)
 Add an Unknown (psPtr) to metadata collection.
psBool psMetadataAddPtr (psMetadata *md, long location, const char *name, psDataType type, const char *comment, psPtr value)
 Add a psPtr to metadata collection.
psBool psMetadataAddMetadata (psMetadata *md, long location, const char *name, int format, const char *comment, psMetadata *value)
 Add Metadata to metadata collection.
bool psMetadataRemove (psMetadata *md, long location, const char *key)
 Remove an item from metadata collection.
bool psMetadataRemoveKey (psMetadata *md, const char *key)
 Removes an item from metadata by key name.
bool psMetadataRemoveIndex (psMetadata *md, int location)
 Removes an item from metadata by index number.
psMetadataItempsMetadataLookup (const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name.
psF64 psMetadataLookupF64 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its double precision value.
psF32 psMetadataLookupF32 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its single precision value.
psS32 psMetadataLookupS32 (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its integer value.
bool psMetadataLookupBool (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its boolean value.
psPtr psMetadataLookupPtr (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its integer value.
psMetadataItempsMetadataGet (const psMetadata *md, int location)
 Find an item in the metadata collection based on list index.
psMetadataIteratorpsMetadataIteratorAlloc (psMetadata *md, long location, const char *regex)
 Creates a psMetadataIterator to iterate over the specified psMetadata.
bool psMetadataIteratorSet (psMetadataIterator *iterator, long location)
 Set the iterator of the psMetadat to a given position.
psMetadataItempsMetadataGetAndIncrement (psMetadataIterator *iterator)
 Position the specified iterator to the next matching item in psMetadata, given the regular expression of the iterator.
psMetadataItempsMetadataGetAndDecrement (psMetadataIterator *iterator)
 Position the specified iterator to the previous matching item in psMetadata, given the regular expression of the iterator.
psMetadatapsMetadataLookupMD (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its metadata value.
char * psMetadataLookupStr (bool *status, const psMetadata *md, const char *key)
 Find an item in the metadata collection based on key name and return its string value.
void psMetadataPrint (psMetadata *md, int level)
 Print metadata collection to screen.
int psArgumentVerbosity (int *argc, char **argv)
 Implements the various verbosity controls.
int psArgumentGet (int argc, char **argv, const char *arg)
 Checks for an argument and returns its index position if found.
bool psArgumentRemove (int argnum, int *argc, char **argv)
 Removes from the argument list the argument whose index is argnum.
bool psArgumentParse (psMetadata *arguments, int *argc, char **argv)
 Parses the command line arguments into a metadata container of arguments.
void psArgumentHelp (psMetadata *arguments)
 Prints to stdout a guide to the command-line arguments.
p_psParseLevelInfop_psParseLevelInfoAlloc (void)
 Allocates a p_psParseLevelInfo structure.
bool psMetadataItemPrint (FILE *fd, const char *format, const psMetadataItem *item)
 Print metadata item to file.
psMetadatapsMetadataReadHeader (psMetadata *output, char *extName, psS32 extNum, char *fileName)
 Read metadata header.
psMetadatapsMetadataConfigParse (psMetadata *md, unsigned int *nFail, const char *filename, bool overwrite)
 Read metadata configuration file.
psString psMetadataConfigFormat (psMetadata *md)
 Converts a psMetadata structure (including any nested psMetadata) into a configuration file formatted string.
bool psMetadataConfigWrite (psMetadata *md, const char *filename)
 Converts a psMetadata structure (including any nested psMetadata) into a configuration file formatted string that is written out to filename.


Define Documentation

#define PS_DATA_IS_PRIMITIVE TYPE   ) 
 

Value:

(TYPE == PS_DATA_S32 || \
 TYPE == PS_DATA_F32 || \
 TYPE == PS_DATA_F64 || \
 TYPE == PS_DATA_BOOL)

Definition at line 34 of file psMetadata.h.

#define PS_DATA_PRIMITIVE_TYPE DATATYPE   ) 
 

Value:

( \
        (DATATYPE==PS_DATA_S32 || DATATYPE==PS_DATA_F32 || \
         DATATYPE==PS_DATA_F64 || DATATYPE==PS_DATA_BOOL) ? DATATYPE : 0)

Definition at line 40 of file psMetadata.h.

#define PS_METADATA_FLAGS_MASK   0xFF000000
 

Definition at line 58 of file psMetadata.h.

#define PS_METADATA_TYPE_MASK   0x00FFFFFF
 

Definition at line 59 of file psMetadata.h.


Enumeration Type Documentation

enum psMetadataFlags
 

Option flags for psMetadata functions.

Enumeration for the modification of the behaviour in psMetadataAddItem.

See also:
psMetadataAddItem
Enumeration values:
PS_META_DEFAULT  default behaviour (duplicate entry is an error)
PS_META_REPLACE  allow entry to be replaced
PS_META_DUPLICATE_OK  allow duplicate entries
PS_META_NULL  psMetadataItem.data is a NULL value

Definition at line 51 of file psMetadata.h.


Function Documentation

p_psParseLevelInfo* p_psParseLevelInfoAlloc void   ) 
 

Allocates a p_psParseLevelInfo structure.

Returns:
p_psParseLevelInfo* : new p_psParseLevelInfo struct

int psArgumentGet int  argc,
char **  argv,
const char *  arg
 

Checks for an argument and returns its index position if found.

Returns:
int: The index of the element in the argument list, otherwise 0.
Parameters:
argc  number or arguments
argv  the argument list
arg  the specified argument to match

void psArgumentHelp psMetadata arguments  ) 
 

Prints to stdout a guide to the command-line arguments.

Parameters:
arguments  metadata container for arguments

bool psArgumentParse psMetadata arguments,
int *  argc,
char **  argv
 

Parses the command line arguments into a metadata container of arguments.

The input arguments shall contain the list of possible arguments as the keywords providing the default values. As matching arguments are found on the command line, the values shall be read into the arguments metadata, with the appropriate type. The arguments and their values shall be removed from the list of command line arguments as they are processed.

Returns:
bool: False if any argument was encountered that is not present in arguments.
Parameters:
arguments  metadata container for arguments
argc  number or arguments
argv  the argument list

bool psArgumentRemove int  argnum,
int *  argc,
char **  argv
 

Removes from the argument list the argument whose index is argnum.

The number of entries in the argument list shall be decremented.

Returns:
bool: True if the argnum is in the argument list, otherwise false.
Parameters:
argnum  the argument to remove
argc  number or arguments
argv  the argument list

int psArgumentVerbosity int *  argc,
char **  argv
 

Implements the various verbosity controls.

Arguments shall be removed from the argument list as they are processed.

Returns:
int: The resultant logging level.
Parameters:
argc  number or arguments
argv  the argument list

bool psMemCheckMetadata psPtr  ptr  ) 
 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psMetadata structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckMetadataItem psPtr  ptr  ) 
 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psMetadataItem structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMetadataAdd psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
  ...
 

Create and add a metadata item to metadata collection.

Creates a new metadata item add to the metadata collection.

Returns:
bool: True for success, false for failure.
Parameters:
md  Metadata collection to insert metadata item.
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item.
format  Type of metadata item (psMetadataType) and options (psMetadataFlags)
comment  Comment for metadata item.

psBool psMetadataAddArray psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psArray value
 

Add a array to metadata collection.

Returns:
psBool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Vector for metadata item data

bool psMetadataAddBool psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
bool  value
 

Add a psBool value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddF32 psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psF32  value
 

Add a psF32 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddF64 psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psF64  value
 

Add a psF64 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

psBool psMetadataAddHash psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psHash value
 

Add a Hash to metadata collection.

Returns:
psBool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Hash for metadata item data

psBool psMetadataAddImage psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psImage value
 

Add an Image to metadata collection.

Returns:
psBool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Image for metadata item data

bool psMetadataAddItem psMetadata md,
const psMetadataItem item,
int  location,
psS32  flags
 

Add existing metadata item to metadata collection.

Add a metadata item that has already been created to the metadata collection.

Returns:
bool: True for success, false for failure.
Parameters:
md  Metadata collection to insert metadat item.
item  Metadata item to be added.
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
flags  Options flag mask, see psMetadataFlags enum

psBool psMetadataAddList psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psList value
 

Add a psList to metadata collection.

Returns:
psBool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  psList for metadata item data

psBool psMetadataAddLookupTable psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psLookupTable value
 

Add a LookupTable to metadata collection.

Returns:
psBool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  LookupTable for metadata item data

psBool psMetadataAddMetadata psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psMetadata value
 

Add Metadata to metadata collection.

Returns:
psBool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Metadata for metadata item data

psBool psMetadataAddPtr psMetadata md,
long  location,
const char *  name,
psDataType  type,
const char *  comment,
psPtr  value
 

Add a psPtr to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
type  psDataType for metadata item
comment  Comment for metadata item
value  Unknown for metadata item data

bool psMetadataAddS32 psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psS32  value
 

Add a psS32 value to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Value for metadata item data

bool psMetadataAddStr psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
const char *  value
 

Add a string to metadata collection.

Returns:
bool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  String for metadata item data

psBool psMetadataAddTime psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psTime value
 

Add a Time to metadata collection.

Returns:
psBool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Time for metadata item data

psBool psMetadataAddUnknown psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psPtr  value
 

Add an Unknown (psPtr) to metadata collection.

Returns:
psBool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Unknown for metadata item data

bool psMetadataAddV psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
va_list  list
 

Create and add a metadata item to metadata collection.

Creates a new metadata item add to the metadata collection.

Returns:
bool: True for success, false for failure.
Parameters:
md  Metadata collection to insert metadata item.
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item.
format  Type of metadata item (psMetadataType) and options (psMetadataFlags)
comment  Comment for metadata item.
list  Arguments for name formatting and metadata item data.

psBool psMetadataAddVector psMetadata md,
long  location,
const char *  name,
int  format,
const char *  comment,
psVector value
 

Add a vector to metadata collection.

Returns:
psBool: True for success, False for failure.
Parameters:
md  Metadata collection to insert metadata item
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
name  Name of metadata item
format  psMetadataFlag options/flags
comment  Comment for metadata item
value  Vector for metadata item data

psMetadata* psMetadataAlloc void   ) 
 

Create a metadata collection.

Returns an empty metadata container with fully allocated internal metadata containers.

Returns:
psMetadata* : Pointer metadata.

psString psMetadataConfigFormat psMetadata md  ) 
 

Converts a psMetadata structure (including any nested psMetadata) into a configuration file formatted string.

A NULL shall be returned on error.

Returns:
psString: a Configuration File formatted string.
Parameters:
md  The metadata to convert

psMetadata* psMetadataConfigParse psMetadata md,
unsigned int *  nFail,
const char *  filename,
bool  overwrite
 

Read metadata configuration file.

Loads pre-defined settings by parsing a configuration file into a psMetadata structure.

Returns:
psMetadata* : Resulting metadata from read.
Parameters:
md  Resulting metadata from read.
nFail  Number of failed lines.
filename  Name of file to read.
overwrite  Allow overwrite of duplicate specifications.

bool psMetadataConfigWrite psMetadata md,
const char *  filename
 

Converts a psMetadata structure (including any nested psMetadata) into a configuration file formatted string that is written out to filename.

Returns:
bool: True if successful, otherwise false.
Parameters:
md  The metadata to convert
filename  Name of file to write

psMetadataItem* psMetadataGet const psMetadata md,
int  location
 

Find an item in the metadata collection based on list index.

Items may be found in the metadata by their entry position in the list container.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
md  Metadata collection to retrieve metadata item.
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL

psMetadataItem* psMetadataGetAndDecrement psMetadataIterator iterator  ) 
 

Position the specified iterator to the previous matching item in psMetadata, given the regular expression of the iterator.

Returns:
psPtr the psMetadataItem at the original iterator position or NULL if the iterator went past the beginning of the list.
Parameters:
iterator  iterator to move

psMetadataItem* psMetadataGetAndIncrement psMetadataIterator iterator  ) 
 

Position the specified iterator to the next matching item in psMetadata, given the regular expression of the iterator.

Returns:
psPtr the psMetadataItem at the original iterator position or NULL if the iterator went past the end of the list.
Parameters:
iterator  iterator to move

psMetadataItem* psMetadataItemAlloc const char *  name,
psDataType  type,
const char *  comment,
  ...
 

Create a metadata item.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct. The name argument specifies the name to use for this item, and may include sprintf formatting codes. The format entry specifies both the metadata type and optional flags and is created by bit-wise or of the appropriate type and flag. The comment argument is a fixed string used to comment the metadata item. The arguments to the name formatting codes and the metadata itself are passed as arguments following the comment string. The data must be a pointer for any of the elements stored in data.void. The argument list must be interpreted appropriately by the va_list operators in the function specified size and type.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
type  Type of metadata item.
comment  Comment for metadata item.

psMetadataItem* psMetadataItemAllocBool const char *  name,
const char *  comment,
bool  value
 

Create a metadata item with specified psBool data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocF32 const char *  name,
const char *  comment,
psF32  value
 

Create a metadata item with specified psF32 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocF64 const char *  name,
const char *  comment,
psF64  value
 

Create a metadata item with specified psF64 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocPtr const char *  name,
psDataType  type,
const char *  comment,
psPtr  value
 

Create a metadata item with specified psPtr data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
type  Data type of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocS32 const char *  name,
const char *  comment,
psS32  value
 

Create a metadata item with specified psS32 data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocStr const char *  name,
const char *  comment,
const char *  value
 

Create a metadata item with specified string data.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
comment  Comment for metadata item.
value  the value of the metadata item.

psMetadataItem* psMetadataItemAllocV const char *  name,
psDataType  type,
const char *  comment,
va_list  list
 

Create a metadata item with va_list.

Returns a fill psMetadataItem ready for insertion into the psMetadata struct. The name argument specifies the name to use for this item, and may include sprintf formatting codes. The format entry specifies both the metadata type and optional flags and is created by bit-wise or of the appropriate type and flag. The comment argument is a fixed string used to comment the metadata item. The arguments to the name formatting codes and the metadata itself are passed as arguments following the comment string. The data must be a pointer for any of the elements stored in data.void. The argument list must be interpreted appropriately by the va_list operators in the function specified size and type.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
name  Name of metadata item.
type  Type of metadata item.
comment  Comment for metadata item.
list  Arguments for name formatting and metadata item data.

bool psMetadataItemPrint FILE *  fd,
const char *  format,
const psMetadataItem item
 

Print metadata item to file.

Metadata items may be printed to an open file descriptor based on a provided format. The format is a sprintf format statement with exactly one % formatting command. If the metadata item type is a numeric type, this formatting command must also be numeric, and the type conversion performed to the value to match the format type. If the metadata type is a string, the fromatting command must also be for a string. If the metadata type is any other data type, printing is not allowed.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
fd  Pointer to file to write metadata item.
format  Format to print metadata item.
item  Metadata item to print.

psMetadataIterator* psMetadataIteratorAlloc psMetadata md,
long  location,
const char *  regex
 

Creates a psMetadataIterator to iterate over the specified psMetadata.

Supports the subsetting of the metadata via keyword using regular expression. If no regular expression is specified, iteration over the entire psMetadata is performed.

Returns:
psMetadataIterator* a new psMetadataIterator, of NULL if error occurred
Parameters:
md  the psMetadata to iterate with
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
regex  A regular expression for subsetting the psMetadata. If NULL, no subsetting is performed.

bool psMetadataIteratorSet psMetadataIterator iterator,
long  location
 

Set the iterator of the psMetadat to a given position.

If location is invalid the iterator position is not changed.

Returns:
bool TRUE if iterator successfully set, otherwise FALSE.
Parameters:
iterator  psMetadata iterator
location  index number, PS_LIST_HEAD, or PS_LIST_TAIL

psMetadataItem* psMetadataLookup const psMetadata md,
const char *  key
 

Find an item in the metadata collection based on key name.

Items may be found in the metadata by providing a key. If the key is non-unique, the first item is returned. If the item is not found, null is returned.

Returns:
psMetadataItem* : Pointer metadata item.
Parameters:
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

bool psMetadataLookupBool bool *  status,
const psMetadata md,
const char *  key
 

Find an item in the metadata collection based on key name and return its boolean value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
bool : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psF32 psMetadataLookupF32 bool *  status,
const psMetadata md,
const char *  key
 

Find an item in the metadata collection based on key name and return its single precision value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psF32 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psF64 psMetadataLookupF64 bool *  status,
const psMetadata md,
const char *  key
 

Find an item in the metadata collection based on key name and return its double precision value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psF64 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psMetadata* psMetadataLookupMD bool *  status,
const psMetadata md,
const char *  key
 

Find an item in the metadata collection based on key name and return its metadata value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psMetadata*: Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psPtr psMetadataLookupPtr bool *  status,
const psMetadata md,
const char *  key
 

Find an item in the metadata collection based on key name and return its integer value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
void* : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

psS32 psMetadataLookupS32 bool *  status,
const psMetadata md,
const char *  key
 

Find an item in the metadata collection based on key name and return its integer value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
psS32 : Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

char* psMetadataLookupStr bool *  status,
const psMetadata md,
const char *  key
 

Find an item in the metadata collection based on key name and return its string value.

Items may be found in the metadata by providing a key. If the key is non-unique, the value of the first item is returned. If the item is not found, zero is returned.

Returns:
char*: Value of metadata item.
Parameters:
status  Status of lookup.
md  Metadata collection to lookup metadata item.
key  Name of metadata key.

void psMetadataPrint psMetadata md,
int  level
 

Print metadata collection to screen.

Parameters:
md  Metadata collection to print.
level  the level of metadata items.

psMetadata* psMetadataReadHeader psMetadata output,
char *  extName,
psS32  extNum,
char *  fileName
 

Read metadata header.

Read a metadata header from file. If the file is not found, an error is reported.

Returns:
psMetadata* : Pointer to resulting metadata.
Parameters:
output  Resulting metadata from read.
extName  File name extension string.
extNum  File name extension number. Starts at 1.
fileName  Name of file to read.

bool psMetadataRemove psMetadata md,
long  location,
const char *  key
 

Remove an item from metadata collection.

Items may be removed from metadata by specifing a key or location. If the name is null, the where argument is used instead. If name is not null, where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from the metadata and true is returned. If the key is not unique, then all items corresponding to it are removed.

Returns:
bool: True for success, false for failure.
Parameters:
md  Metadata collection to remove metadata item.
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL
key  Name of metadata key.

bool psMetadataRemoveIndex psMetadata md,
int  location
 

Removes an item from metadata by index number.

Returns:
bool: True for success, false for failure.
Parameters:
md  Metadata collection to remove metadata item.
location  Index number, PS_LIST_HEAD, or PS_LIST_TAIL

bool psMetadataRemoveKey psMetadata md,
const char *  key
 

Removes an item from metadata by key name.

Returns:
bool: True for success, false for failure.
Parameters:
md  Metadata collection to remove metadata item.
key  Name of metadata key.


Generated on Thu Oct 13 14:33:52 2005 for Pan-STARRS Foundation Library by  doxygen 1.4.2