00001 /** @file psMetadata.h 00002 * 00003 * @brief Contains metadata struuctures, enumerations and functions prototypes 00004 * 00005 * This file defines metadata item, metadata type, metadata flags, metadata containers, and function 00006 * prototypes necessary creating psLib metadata APIs 00007 * 00008 * @author Robert DeSonia, MHPCC 00009 * @author Ross Harman, MHPCC 00010 * 00011 * @version $Revision: 1.94 $ $Name: $ 00012 * @date $Date: 2007/01/23 22:47:23 $ 00013 * 00014 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 00015 */ 00016 #ifndef PS_METADATA_H 00017 #define PS_METADATA_H 00018 00019 /// @addtogroup DataContainer Data Containers 00020 /// @{ 00021 00022 #include <stdarg.h> 00023 #include <stdio.h> 00024 #include <sys/types.h> 00025 #include <regex.h> 00026 00027 #include "psHash.h" 00028 #include "psList.h" 00029 #include "psTime.h" 00030 #include "psLookupTable.h" 00031 00032 #define PS_DATA_IS_PRIMITIVE(TYPE) \ 00033 (TYPE == PS_DATA_S8 || \ 00034 TYPE == PS_DATA_S16 || \ 00035 TYPE == PS_DATA_S32 || \ 00036 TYPE == PS_DATA_S64 || \ 00037 TYPE == PS_DATA_U8 || \ 00038 TYPE == PS_DATA_U16 || \ 00039 TYPE == PS_DATA_U32 || \ 00040 TYPE == PS_DATA_U64 || \ 00041 TYPE == PS_DATA_F32 || \ 00042 TYPE == PS_DATA_F64 || \ 00043 TYPE == PS_DATA_BOOL) 00044 00045 #define PS_DATA_PRIMITIVE_TYPE(DATATYPE) ( \ 00046 (DATATYPE==PS_DATA_S8 || DATATYPE==PS_DATA_S16 || \ 00047 DATATYPE==PS_DATA_S32 || DATATYPE==PS_DATA_S64 || DATATYPE==PS_DATA_U8 || \ 00048 DATATYPE==PS_DATA_U16 || DATATYPE==PS_DATA_U32 || DATATYPE==PS_DATA_U64 || \ 00049 DATATYPE==PS_DATA_F32 || DATATYPE==PS_DATA_F64 || DATATYPE==PS_DATA_BOOL) ? DATATYPE : 0) 00050 00051 00052 /** Option flags for psMetadata functions 00053 * 00054 * Enumeration for the modification of the behaviour in psMetadataAddItem. 00055 * 00056 * @see psMetadataAddItem 00057 */ 00058 typedef enum { 00059 PS_META_DEFAULT = 0, ///< default behaviour (duplicate entry is an error) 00060 PS_META_REPLACE = 0x1000000, ///< allow entry to be replaced 00061 PS_META_NO_REPLACE = 0x2000000, ///< duplicate entry is silently skipped 00062 PS_META_DUPLICATE_OK = 0x4000000, ///< allow duplicate entries 00063 PS_META_NULL = 0x8000000 ///< psMetadataItem.data is a NULL value 00064 } psMetadataFlags; 00065 00066 #define PS_METADATA_FLAGS_MASK 0xFF000000 00067 #define PS_METADATA_TYPE_MASK 0x00FFFFFF 00068 00069 /** Metadata data structure. 00070 * 00071 * Struct for holding metadata items. Metadata items are held in two 00072 * containers. The first employs a doubly-linked list to preserve the order 00073 * of the metadata. The second container employs a hash table which 00074 * allows fast lookup when given a metadata keyword. 00075 */ 00076 typedef struct 00077 { 00078 psList* list; ///< Metadata in linked-list 00079 psHash* hash; ///< Metadata in a hash table 00080 void *lock; ///< Optional lock for thread safety 00081 } 00082 psMetadata; 00083 00084 /** Metadata iterator 00085 * 00086 * Iterator for metadata. 00087 */ 00088 typedef struct 00089 { 00090 psListIterator* iter; ///< iterator for the psMetadata's psList 00091 regex_t* regex; ///< the subsetting regular expression 00092 } 00093 psMetadataIterator; 00094 00095 /** Metadata item data structure. 00096 * 00097 * Struct for maintaining metadata items of varying types. It also contains 00098 * information about the item name, flags, comments, and other items with the same name. 00099 */ 00100 typedef struct 00101 { 00102 const psS32 id; ///< Unique ID for metadata item. 00103 psString name; ///< Name of metadata item. 00104 psDataType type; ///< Type of metadata item. 00105 union { 00106 psBool B; ///< boolean data 00107 psS8 S8; ///< Signed 8-bit integer data. 00108 psS16 S16; ///< Signed 16-bit integer data. 00109 psS32 S32; ///< Signed 32-bit integer data. 00110 psS64 S64; ///< Signed 64-bit integer data. 00111 psU8 U8; ///< Unsigned 8-bit integer data. 00112 psU16 U16; ///< Unsigned 16-bit integer data. 00113 psU32 U32; ///< Unsigned 32-bit integer data. 00114 psU64 U64; ///< Unsigned 64-bit integer data. 00115 psF32 F32; ///< Single-precision float data. 00116 psF64 F64; ///< Double-precision float data. 00117 psList *list; ///< List data. 00118 psMetadata *md; ///< Metadata data. 00119 psString str; ///< string data 00120 psPtr V; ///< Pointer to other type of data. 00121 } data; ///< Union for data types. 00122 psString comment; ///< Optional comment ("", not NULL). 00123 } 00124 psMetadataItem; 00125 00126 /** Create a metadata item. 00127 * 00128 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00129 * struct. The name argument specifies the name to use for this item, and 00130 * may include sprintf formatting codes. The format entry specifies both 00131 * the metadata type and optional flags and is created by bit-wise or of the 00132 * appropriate type and flag. The comment argument is a fixed string used to 00133 * comment the metadata item. The arguments to the name formatting codes and 00134 * the metadata itself are passed as arguments following the comment string. 00135 * The data must be a pointer for any of the elements stored in data.void. 00136 * The argument list must be interpreted appropriately by the va_list 00137 * operators in the function specified size and type. 00138 * 00139 * @return psMetadataItem* : Pointer metadata item. 00140 */ 00141 psMetadataItem* psMetadataItemAlloc( 00142 const char *name, ///< Name of metadata item. 00143 psDataType type, ///< Type of metadata item. 00144 const char *comment, ///< Comment for metadata item. 00145 ... ///< Arguments for name formatting and metadata item data. 00146 ) 00147 ; 00148 00149 /** Checks the type of a particular pointer. 00150 * 00151 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 00152 * 00153 * @return bool: True if the pointer matches a psMetadataItem structure, false otherwise. 00154 */ 00155 bool psMemCheckMetadataItem( 00156 psPtr ptr ///< the pointer whose type to check 00157 ); 00158 00159 00160 /** Create a metadata item with specified string data. 00161 * 00162 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00163 * struct. 00164 * 00165 * @return psMetadataItem* : Pointer metadata item. 00166 */ 00167 psMetadataItem* psMetadataItemAllocStr( 00168 const char* name, ///< Name of metadata item. 00169 const char* comment, ///< Comment for metadata item. 00170 const char* value ///< the value of the metadata item. 00171 ); 00172 00173 /** Create a metadata item with specified psF32 data. 00174 * 00175 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00176 * struct. 00177 * 00178 * @return psMetadataItem* : Pointer metadata item. 00179 */ 00180 psMetadataItem* psMetadataItemAllocF32( 00181 const char* name, ///< Name of metadata item. 00182 const char* comment, ///< Comment for metadata item. 00183 psF32 value ///< the value of the metadata item. 00184 ); 00185 00186 /** Create a metadata item with specified psF64 data. 00187 * 00188 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00189 * struct. 00190 * 00191 * @return psMetadataItem* : Pointer metadata item. 00192 */ 00193 psMetadataItem* psMetadataItemAllocF64( 00194 const char* name, ///< Name of metadata item. 00195 const char* comment, ///< Comment for metadata item. 00196 psF64 value ///< the value of the metadata item. 00197 ); 00198 00199 /** Create a metadata item with specified psS8 data. 00200 * 00201 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00202 * struct. 00203 * 00204 * @return psMetadataItem* : Pointer metadata item. 00205 */ 00206 psMetadataItem* psMetadataItemAllocS8( 00207 const char* name, ///< Name of metadata item. 00208 const char* comment, ///< Comment for metadata item. 00209 psS8 value ///< the value of the metadata item. 00210 ); 00211 00212 /** Create a metadata item with specified psS16 data. 00213 * 00214 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00215 * struct. 00216 * 00217 * @return psMetadataItem* : Pointer metadata item. 00218 */ 00219 psMetadataItem* psMetadataItemAllocS16( 00220 const char* name, ///< Name of metadata item. 00221 const char* comment, ///< Comment for metadata item. 00222 psS16 value ///< the value of the metadata item. 00223 ); 00224 00225 /** Create a metadata item with specified psS32 data. 00226 * 00227 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00228 * struct. 00229 * 00230 * @return psMetadataItem* : Pointer metadata item. 00231 */ 00232 psMetadataItem* psMetadataItemAllocS32( 00233 const char* name, ///< Name of metadata item. 00234 const char* comment, ///< Comment for metadata item. 00235 psS32 value ///< the value of the metadata item. 00236 ); 00237 00238 /** Create a metadata item with specified psS64 data. 00239 * 00240 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00241 * struct. 00242 * 00243 * @return psMetadataItem* : Pointer metadata item. 00244 */ 00245 psMetadataItem* psMetadataItemAllocS64( 00246 const char* name, ///< Name of metadata item. 00247 const char* comment, ///< Comment for metadata item. 00248 psS64 value ///< the value of the metadata item. 00249 ); 00250 00251 /** Create a metadata item with specified psU8 data. 00252 * 00253 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00254 * struct. 00255 * 00256 * @return psMetadataItem* : Pointer metadata item. 00257 */ 00258 psMetadataItem* psMetadataItemAllocU8( 00259 const char* name, ///< Name of metadata item. 00260 const char* comment, ///< Comment for metadata item. 00261 psU8 value ///< the value of the metadata item. 00262 ); 00263 00264 /** Create a metadata item with specified psU16 data. 00265 * 00266 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00267 * struct. 00268 * 00269 * @return psMetadataItem* : Pointer metadata item. 00270 */ 00271 psMetadataItem* psMetadataItemAllocU16( 00272 const char* name, ///< Name of metadata item. 00273 const char* comment, ///< Comment for metadata item. 00274 psU16 value ///< the value of the metadata item. 00275 ); 00276 00277 /** Create a metadata item with specified psU32 data. 00278 * 00279 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00280 * struct. 00281 * 00282 * @return psMetadataItem* : Pointer metadata item. 00283 */ 00284 psMetadataItem* psMetadataItemAllocU32( 00285 const char* name, ///< Name of metadata item. 00286 const char* comment, ///< Comment for metadata item. 00287 psU32 value ///< the value of the metadata item. 00288 ); 00289 00290 /** Create a metadata item with specified psU64 data. 00291 * 00292 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00293 * struct. 00294 * 00295 * @return psMetadataItem* : Pointer metadata item. 00296 */ 00297 psMetadataItem* psMetadataItemAllocU64( 00298 const char* name, ///< Name of metadata item. 00299 const char* comment, ///< Comment for metadata item. 00300 psU64 value ///< the value of the metadata item. 00301 ); 00302 00303 /** Create a metadata item with specified psBool data. 00304 * 00305 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00306 * struct. 00307 * 00308 * @return psMetadataItem* : Pointer metadata item. 00309 */ 00310 psMetadataItem* psMetadataItemAllocBool( 00311 const char* name, ///< Name of metadata item. 00312 const char* comment, ///< Comment for metadata item. 00313 bool value ///< the value of the metadata item. 00314 ); 00315 00316 /** Create a metadata item with specified psPtr data. 00317 * 00318 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00319 * struct. 00320 * 00321 * @return psMetadataItem* : Pointer metadata item. 00322 */ 00323 psMetadataItem* psMetadataItemAllocPtr( 00324 const char* name, ///< Name of metadata item. 00325 psDataType type, ///< Data type of metadata item. 00326 const char* comment, ///< Comment for metadata item. 00327 psPtr value ///< the value of the metadata item. 00328 ); 00329 00330 #ifndef SWIG 00331 /** Create a metadata item with va_list. 00332 * 00333 * Returns a fill psMetadataItem ready for insertion into the psMetadata 00334 * struct. The name argument specifies the name to use for this item, and 00335 * may include sprintf formatting codes. The format entry specifies both 00336 * the metadata type and optional flags and is created by bit-wise or of the 00337 * appropriate type and flag. The comment argument is a fixed string used to 00338 * comment the metadata item. The arguments to the name formatting codes and 00339 * the metadata itself are passed as arguments following the comment string. 00340 * The data must be a pointer for any of the elements stored in data.void. 00341 * The argument list must be interpreted appropriately by the va_list 00342 * operators in the function specified size and type. 00343 * 00344 * @return psMetadataItem* : Pointer metadata item. 00345 */ 00346 psMetadataItem* psMetadataItemAllocV( 00347 const char *name, ///< Name of metadata item. 00348 psDataType type, ///< Type of metadata item. 00349 const char *comment, ///< Comment for metadata item. 00350 va_list list ///< Arguments for name formatting and metadata item data. 00351 ); 00352 #endif // #ifndef SWIG 00353 00354 /** Create a metadata collection. 00355 * 00356 * Returns an empty metadata container with fully allocated internal metadata 00357 * containers. 00358 * 00359 * @return psMetadata* : Pointer metadata. 00360 */ 00361 psMetadata* psMetadataAlloc(void); 00362 00363 00364 /** Checks the type of a particular pointer. 00365 * 00366 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 00367 * 00368 * @return bool: True if the pointer matches a psMetadata structure, false otherwise. 00369 */ 00370 bool psMemCheckMetadata( 00371 psPtr ptr ///< the pointer whose type to check 00372 ); 00373 00374 /** Creates a new copy of a psMetadataItem. 00375 * 00376 * @return psMetadataItem*: the copy of the psMetadataItem 00377 */ 00378 psMetadataItem *psMetadataItemCopy( 00379 const psMetadataItem *in ///< metadata item to be copied 00380 ); 00381 00382 /** Create a copy of an existing psMetadata collection. 00383 * 00384 * Creates a new copy of all the psMetadataItems in the psMetadata collection, in, and 00385 * returns them in out, or creates a new container if out is NULL. If an error occurs, 00386 * NULL is returned but out may still have been updated if it is non-NULL. 00387 * 00388 * @return psMetadata*: the copy of the psMetadata container. 00389 */ 00390 psMetadata *psMetadataCopy( 00391 psMetadata *out, ///< output Metadata container for copying. 00392 const psMetadata *in ///< Metadata collection to be copied. 00393 ); 00394 00395 /** Copy a metadata item from one psMetadata to another. 00396 * 00397 * Creates a copy of a psMetadataItem from in and appends it to out. If out is NULL, 00398 * a new container is created. 00399 * 00400 * @return bool: True if successful, otherwise false. 00401 */ 00402 bool psMetadataItemTransfer( 00403 psMetadata *out, ///< output Metadata container for copying. 00404 const psMetadata *in, ///< Metadata collection from which to copy. 00405 const char *key ///< key to identify the metadata item for copying. 00406 ); 00407 00408 /** Add existing metadata item to metadata collection. 00409 * 00410 * Add a metadata item that has already been created to the metadata 00411 * collection. 00412 * 00413 * @return bool: True for success, false for failure. 00414 */ 00415 bool psMetadataAddItem( 00416 psMetadata* md, ///< Metadata collection to insert metadata item. 00417 const psMetadataItem* item, ///< Metadata item to be added. 00418 int location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00419 psS32 flags ///< Options flag mask, see psMetadataFlags enum 00420 ); 00421 00422 /** Create and add a metadata item to metadata collection. 00423 * 00424 * Creates a new metadata item add to the metadata collection. 00425 * 00426 * @return bool: True for success, false for failure. 00427 */ 00428 bool psMetadataAdd( 00429 psMetadata* md, ///< Metadata collection to insert metadata item. 00430 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00431 const char *name, ///< Name of metadata item. 00432 int format, ///< psDataType of metadata item & options (psMetadataFlags) 00433 const char *comment, ///< Comment for metadata item. 00434 ... ///< Arguments for name formatting and metadata item data. 00435 ); 00436 00437 #ifndef SWIG 00438 /** Create and add a metadata item to metadata collection. 00439 * 00440 * Creates a new metadata item add to the metadata collection. 00441 * 00442 * @return bool: True for success, false for failure. 00443 */ 00444 bool psMetadataAddV( 00445 psMetadata* md, ///< Metadata collection to insert metadata item. 00446 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00447 const char *name, ///< Name of metadata item. 00448 int format, ///< psDataType of metadata item & options (psMetadataFlags) 00449 const char *comment, ///< Comment for metadata item. 00450 va_list list ///< Arguments for name formatting and metadata item data. 00451 ); 00452 #endif // #ifndef SWIG 00453 00454 /** Add a psBool value to metadata collection. 00455 * 00456 * @return bool: True for success, False for failure. 00457 */ 00458 bool psMetadataAddBool( 00459 psMetadata* md, ///< Metadata collection to insert metadata item 00460 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00461 const char* name, ///< Name of metadata item 00462 int format, ///< psMetadataFlag options/flags 00463 const char* comment, ///< Comment for metadata item 00464 bool value ///< Value for metadata item data 00465 ); 00466 00467 /** Add a psS8 value to metadata collection. 00468 * 00469 * @return bool: True for success, False for failure. 00470 */ 00471 bool psMetadataAddS8( 00472 psMetadata* md, ///< Metadata collection to insert metadata item 00473 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00474 const char* name, ///< Name of metadata item 00475 int format, ///< psMetadataFlag options/flags 00476 const char* comment, ///< Comment for metadata item 00477 psS8 value ///< Value for metadata item data 00478 ); 00479 00480 /** Add a psS16 value to metadata collection. 00481 * 00482 * @return bool: True for success, False for failure. 00483 */ 00484 bool psMetadataAddS16( 00485 psMetadata* md, ///< Metadata collection to insert metadata item 00486 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00487 const char* name, ///< Name of metadata item 00488 int format, ///< psMetadataFlag options/flags 00489 const char* comment, ///< Comment for metadata item 00490 psS16 value ///< Value for metadata item data 00491 ); 00492 00493 /** Add a psS32 value to metadata collection. 00494 * 00495 * @return bool: True for success, False for failure. 00496 */ 00497 bool psMetadataAddS32( 00498 psMetadata* md, ///< Metadata collection to insert metadata item 00499 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00500 const char* name, ///< Name of metadata item 00501 int format, ///< psMetadataFlag options/flags 00502 const char* comment, ///< Comment for metadata item 00503 psS32 value ///< Value for metadata item data 00504 ); 00505 00506 /** Add a psS64 value to metadata collection. 00507 * 00508 * @return bool: True for success, False for failure. 00509 */ 00510 bool psMetadataAddS64( 00511 psMetadata* md, ///< Metadata collection to insert metadata item 00512 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00513 const char* name, ///< Name of metadata item 00514 int format, ///< psMetadataFlag options/flags 00515 const char* comment, ///< Comment for metadata item 00516 psS64 value ///< Value for metadata item data 00517 ); 00518 00519 /** Add a psU8 value to metadata collection. 00520 * 00521 * @return bool: True for success, False for failure. 00522 */ 00523 bool psMetadataAddU8( 00524 psMetadata* md, ///< Metadata collection to insert metadata item 00525 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00526 const char* name, ///< Name of metadata item 00527 int format, ///< psMetadataFlag options/flags 00528 const char* comment, ///< Comment for metadata item 00529 psU8 value ///< Value for metadata item data 00530 ); 00531 00532 /** Add a psU16 value to metadata collection. 00533 * 00534 * @return bool: True for success, False for failure. 00535 */ 00536 bool psMetadataAddU16( 00537 psMetadata* md, ///< Metadata collection to insert metadata item 00538 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00539 const char* name, ///< Name of metadata item 00540 int format, ///< psMetadataFlag options/flags 00541 const char* comment, ///< Comment for metadata item 00542 psU16 value ///< Value for metadata item data 00543 ); 00544 00545 /** Add a psU32 value to metadata collection. 00546 * 00547 * @return bool: True for success, False for failure. 00548 */ 00549 bool psMetadataAddU32( 00550 psMetadata* md, ///< Metadata collection to insert metadata item 00551 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00552 const char* name, ///< Name of metadata item 00553 int format, ///< psMetadataFlag options/flags 00554 const char* comment, ///< Comment for metadata item 00555 psU32 value ///< Value for metadata item data 00556 ); 00557 00558 /** Add a psU64 value to metadata collection. 00559 * 00560 * @return bool: True for success, False for failure. 00561 */ 00562 bool psMetadataAddU64( 00563 psMetadata* md, ///< Metadata collection to insert metadata item 00564 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00565 const char* name, ///< Name of metadata item 00566 int format, ///< psMetadataFlag options/flags 00567 const char* comment, ///< Comment for metadata item 00568 psU64 value ///< Value for metadata item data 00569 ); 00570 00571 /** Add a psF32 value to metadata collection. 00572 * 00573 * @return bool: True for success, False for failure. 00574 */ 00575 bool psMetadataAddF32( 00576 psMetadata* md, ///< Metadata collection to insert metadata item 00577 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00578 const char* name, ///< Name of metadata item 00579 int format, ///< psMetadataFlag options/flags 00580 const char* comment, ///< Comment for metadata item 00581 psF32 value ///< Value for metadata item data 00582 ); 00583 00584 /** Add a psF64 value to metadata collection. 00585 * 00586 * @return bool: True for success, False for failure. 00587 */ 00588 bool psMetadataAddF64( 00589 psMetadata* md, ///< Metadata collection to insert metadata item 00590 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00591 const char* name, ///< Name of metadata item 00592 int format, ///< psMetadataFlag options/flags 00593 const char* comment, ///< Comment for metadata item 00594 psF64 value ///< Value for metadata item data 00595 ); 00596 00597 /** Add a psList to metadata collection. 00598 * 00599 * @return bool: True for success, False for failure. 00600 */ 00601 bool psMetadataAddList( 00602 psMetadata* md, ///< Metadata collection to insert metadata item 00603 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00604 const char* name, ///< Name of metadata item 00605 int format, ///< psMetadataFlag options/flags 00606 const char* comment, ///< Comment for metadata item 00607 psList* value ///< psList for metadata item data 00608 ); 00609 00610 /** Add a string to metadata collection. 00611 * 00612 * @return bool: True for success, False for failure. 00613 */ 00614 bool psMetadataAddStr( 00615 psMetadata* md, ///< Metadata collection to insert metadata item 00616 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00617 const char* name, ///< Name of metadata item 00618 int format, ///< psMetadataFlag options/flags 00619 const char* comment, ///< Comment for metadata item 00620 const char* value ///< String for metadata item data 00621 ); 00622 00623 /** Add a vector to metadata collection. 00624 * 00625 * @return bool: True for success, False for failure. 00626 */ 00627 bool psMetadataAddVector( 00628 psMetadata* md, ///< Metadata collection to insert metadata item 00629 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00630 const char* name, ///< Name of metadata item 00631 int format, ///< psMetadataFlag options/flags 00632 const char* comment, ///< Comment for metadata item 00633 psVector* value ///< Vector for metadata item data 00634 ); 00635 00636 /** Add a array to metadata collection. 00637 * 00638 * @return bool: True for success, False for failure. 00639 */ 00640 bool psMetadataAddArray( 00641 psMetadata* md, ///< Metadata collection to insert metadata item 00642 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00643 const char* name, ///< Name of metadata item 00644 int format, ///< psMetadataFlag options/flags 00645 const char* comment, ///< Comment for metadata item 00646 psArray* value ///< Vector for metadata item data 00647 ); 00648 00649 /** Add an Image to metadata collection. 00650 * 00651 * @return bool: True for success, False for failure. 00652 */ 00653 bool psMetadataAddImage( 00654 psMetadata* md, ///< Metadata collection to insert metadata item 00655 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00656 const char* name, ///< Name of metadata item 00657 int format, ///< psMetadataFlag options/flags 00658 const char* comment, ///< Comment for metadata item 00659 psImage* value ///< Image for metadata item data 00660 ); 00661 00662 /** Add a Time to metadata collection. 00663 * 00664 * @return bool: True for success, False for failure. 00665 */ 00666 bool psMetadataAddTime( 00667 psMetadata* md, ///< Metadata collection to insert metadata item 00668 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00669 const char* name, ///< Name of metadata item 00670 int format, ///< psMetadataFlag options/flags 00671 const char* comment, ///< Comment for metadata item 00672 psTime* value ///< Time for metadata item data 00673 ); 00674 00675 /** Add a Hash to metadata collection. 00676 * 00677 * @return bool: True for success, False for failure. 00678 */ 00679 bool psMetadataAddHash( 00680 psMetadata* md, ///< Metadata collection to insert metadata item 00681 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00682 const char* name, ///< Name of metadata item 00683 int format, ///< psMetadataFlag options/flags 00684 const char* comment, ///< Comment for metadata item 00685 psHash* value ///< Hash for metadata item data 00686 ); 00687 00688 /** Add a LookupTable to metadata collection. 00689 * 00690 * @return bool: True for success, False for failure. 00691 */ 00692 bool psMetadataAddLookupTable( 00693 psMetadata* md, ///< Metadata collection to insert metadata item 00694 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00695 const char* name, ///< Name of metadata item 00696 int format, ///< psMetadataFlag options/flags 00697 const char* comment, ///< Comment for metadata item 00698 psLookupTable* value ///< LookupTable for metadata item data 00699 ); 00700 00701 /** Add an Unknown (psPtr) to metadata collection. 00702 * 00703 * @return bool: True for success, False for failure. 00704 */ 00705 bool psMetadataAddUnknown( 00706 psMetadata* md, ///< Metadata collection to insert metadata item 00707 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00708 const char* name, ///< Name of metadata item 00709 int format, ///< psMetadataFlag options/flags 00710 const char* comment, ///< Comment for metadata item 00711 psPtr value ///< Unknown for metadata item data 00712 ); 00713 00714 /** Add a psPtr to metadata collection. 00715 * 00716 * @return bool: True for success, False for failure. 00717 */ 00718 bool psMetadataAddPtr( 00719 psMetadata* md, ///< Metadata collection to insert metadata item 00720 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00721 const char* name, ///< Name of metadata item 00722 psDataType type, ///< psDataType for metadata item 00723 const char* comment, ///< Comment for metadata item 00724 psPtr value ///< Unknown for metadata item data 00725 ); 00726 00727 /** Add Metadata to metadata collection. 00728 * 00729 * @return bool: True for success, False for failure. 00730 */ 00731 bool psMetadataAddMetadata( 00732 psMetadata* md, ///< Metadata collection to insert metadata item 00733 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00734 const char* name, ///< Name of metadata item 00735 int format, ///< psMetadataFlag options/flags 00736 const char* comment, ///< Comment for metadata item 00737 psMetadata* value ///< Metadata for metadata item data 00738 ); 00739 00740 /** Removes an item from metadata by key name. 00741 * 00742 * @return bool: True for success, false for failure. 00743 */ 00744 bool psMetadataRemoveKey( 00745 psMetadata *md, ///< Metadata collection to remove metadata item. 00746 const char *key ///< Name of metadata key. 00747 ); 00748 00749 /** Removes an item from metadata by index number. 00750 * 00751 * @return bool: True for success, false for failure. 00752 */ 00753 bool psMetadataRemoveIndex( 00754 psMetadata *md, ///< Metadata collection to remove metadata item. 00755 long location ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00756 ); 00757 00758 /** Find an item in the metadata collection based on key name. 00759 * 00760 * Items may be found in the metadata by providing a key. If the key is 00761 * non-unique, the first item is returned. If the item is not found, null is 00762 * returned. 00763 * 00764 * @return psMetadataItem* : Pointer metadata item. 00765 */ 00766 psMetadataItem* psMetadataLookup( 00767 const psMetadata * md, ///< Metadata collection to lookup metadata item. 00768 const char * key ///< Name of metadata key. 00769 ); 00770 00771 /** Find an item in the metadata collection based on key name and return its double precision value. 00772 * 00773 * Items may be found in the metadata by providing a key. If the key is 00774 * non-unique, the value of the first item is returned. If the item is not found, zero is 00775 * returned. 00776 * 00777 * @return psF64 : Value of metadata item. 00778 */ 00779 psF64 psMetadataLookupF64( 00780 bool *status, ///< Status of lookup. 00781 const psMetadata *md, ///< Metadata collection to lookup metadata item. 00782 const char *key ///< Name of metadata key. 00783 ); 00784 00785 /** Find an item in the metadata collection based on key name and return its single precision value. 00786 * 00787 * Items may be found in the metadata by providing a key. If the key is 00788 * non-unique, the value of the first item is returned. If the item is not found, zero is 00789 * returned. 00790 * 00791 * @return psF32 : Value of metadata item. 00792 */ 00793 psF32 psMetadataLookupF32( 00794 bool *status, ///< Status of lookup. 00795 const psMetadata *md, ///< Metadata collection to lookup metadata item. 00796 const char *key ///< Name of metadata key. 00797 ); 00798 00799 /** Find an item in the metadata collection based on key name and return its integer value. 00800 * 00801 * Items may be found in the metadata by providing a key. If the key is 00802 * non-unique, the value of the first item is returned. If the item is not found, zero is 00803 * returned. 00804 * 00805 * @return psS8 : Value of metadata item. 00806 */ 00807 psS8 psMetadataLookupS8( 00808 bool *status, ///< Status of lookup. 00809 const psMetadata *md, ///< Metadata collection to lookup metadata item. 00810 const char *key ///< Name of metadata key. 00811 ); 00812 00813 /** Find an item in the metadata collection based on key name and return its integer value. 00814 * 00815 * Items may be found in the metadata by providing a key. If the key is 00816 * non-unique, the value of the first item is returned. If the item is not found, zero is 00817 * returned. 00818 * 00819 * @return psS16 : Value of metadata item. 00820 */ 00821 psS16 psMetadataLookupS16( 00822 bool *status, ///< Status of lookup. 00823 const psMetadata *md, ///< Metadata collection to lookup metadata item. 00824 const char *key ///< Name of metadata key. 00825 ); 00826 00827 /** Find an item in the metadata collection based on key name and return its integer value. 00828 * 00829 * Items may be found in the metadata by providing a key. If the key is 00830 * non-unique, the value of the first item is returned. If the item is not found, zero is 00831 * returned. 00832 * 00833 * @return psS32 : Value of metadata item. 00834 */ 00835 psS32 psMetadataLookupS32( 00836 bool *status, ///< Status of lookup. 00837 const psMetadata *md, ///< Metadata collection to lookup metadata item. 00838 const char *key ///< Name of metadata key. 00839 ); 00840 00841 /** Find an item in the metadata collection based on key name and return its integer value. 00842 * 00843 * Items may be found in the metadata by providing a key. If the key is 00844 * non-unique, the value of the first item is returned. If the item is not found, zero is 00845 * returned. 00846 * 00847 * @return psS64 : Value of metadata item. 00848 */ 00849 psS64 psMetadataLookupS64( 00850 bool *status, ///< Status of lookup. 00851 const psMetadata *md, ///< Metadata collection to lookup metadata item. 00852 const char *key ///< Name of metadata key. 00853 ); 00854 00855 /** Find an item in the metadata collection based on key name and return its integer value. 00856 * 00857 * Items may be found in the metadata by providing a key. If the key is 00858 * non-unique, the value of the first item is returned. If the item is not found, zero is 00859 * returned. 00860 * 00861 * @return psU8 : Value of metadata item. 00862 */ 00863 psU8 psMetadataLookupU8( 00864 bool *status, ///< Status of lookup. 00865 const psMetadata *md, ///< Metadata collection to lookup metadata item. 00866 const char *key ///< Name of metadata key. 00867 ); 00868 00869 /** Find an item in the metadata collection based on key name and return its integer value. 00870 * 00871 * Items may be found in the metadata by providing a key. If the key is 00872 * non-unique, the value of the first item is returned. If the item is not found, zero is 00873 * returned. 00874 * 00875 * @return psU16 : Value of metadata item. 00876 */ 00877 psU16 psMetadataLookupU16( 00878 bool *status, ///< Status of lookup. 00879 const psMetadata *md, ///< Metadata collection to lookup metadata item. 00880 const char *key ///< Name of metadata key. 00881 ); 00882 00883 /** Find an item in the metadata collection based on key name and return its integer value. 00884 * 00885 * Items may be found in the metadata by providing a key. If the key is 00886 * non-unique, the value of the first item is returned. If the item is not found, zero is 00887 * returned. 00888 * 00889 * @return psU32 : Value of metadata item. 00890 */ 00891 psU32 psMetadataLookupU32( 00892 bool *status, ///< Status of lookup. 00893 const psMetadata *md, ///< Metadata collection to lookup metadata item. 00894 const char *key ///< Name of metadata key. 00895 ); 00896 00897 /** Find an item in the metadata collection based on key name and return its integer value. 00898 * 00899 * Items may be found in the metadata by providing a key. If the key is 00900 * non-unique, the value of the first item is returned. If the item is not found, zero is 00901 * returned. 00902 * 00903 * @return psU64 : Value of metadata item. 00904 */ 00905 psU64 psMetadataLookupU64( 00906 bool *status, ///< Status of lookup. 00907 const psMetadata *md, ///< Metadata collection to lookup metadata item. 00908 const char *key ///< Name of metadata key. 00909 ); 00910 00911 /** Find an item in the metadata collection based on key name and return its boolean value. 00912 * 00913 * Items may be found in the metadata by providing a key. If the key is 00914 * non-unique, the value of the first item is returned. If the item is not found, zero is 00915 * returned. 00916 * 00917 * @return bool : Value of metadata item. 00918 */ 00919 bool psMetadataLookupBool( 00920 bool *status, ///< Status of lookup. 00921 const psMetadata *md, ///< Metadata collection to lookup metadata item. 00922 const char *key ///< Name of metadata key. 00923 ); 00924 00925 /** Find an item in the metadata collection based on key name and return its integer value. 00926 * 00927 * Items may be found in the metadata by providing a key. If the key is 00928 * non-unique, the value of the first item is returned. If the item is not found, zero is 00929 * returned. 00930 * 00931 * @return void* : Value of metadata item. 00932 */ 00933 psPtr psMetadataLookupPtr( 00934 bool *status, ///< Status of lookup. 00935 const psMetadata* md, ///< Metadata collection to lookup metadata item. 00936 const char *key ///< Name of metadata key. 00937 ); 00938 00939 /** Find an item in the metadata collection based on list index. 00940 * 00941 * Items may be found in the metadata by their entry position in the list 00942 * container. 00943 * 00944 * @return psMetadataItem* : Pointer metadata item. 00945 */ 00946 psMetadataItem* psMetadataGet( 00947 const psMetadata* md, ///< Metadata collection to retrieve metadata item. 00948 int location ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00949 ); 00950 00951 /** Creates a psMetadataIterator to iterate over the specified psMetadata. 00952 * 00953 * Supports the subsetting of the metadata via keyword using regular 00954 * expression. If no regular expression is specified, iteration 00955 * over the entire psMetadata is performed. 00956 * 00957 * @return psMetadataIterator* a new psMetadataIterator, of NULL if error occurred 00958 */ 00959 psMetadataIterator* psMetadataIteratorAlloc( 00960 const psMetadata* md, ///< the psMetadata to iterate with 00961 long location, ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL 00962 const char* regex 00963 ///< A regular expression for subsetting the psMetadata. If NULL, no 00964 ///< subsetting is performed. 00965 ); 00966 00967 /** Set the iterator of the psMetadat to a given position. If location is 00968 * invalid the iterator position is not changed. 00969 * 00970 * @return bool TRUE if iterator successfully set, otherwise FALSE. 00971 */ 00972 bool psMetadataIteratorSet( 00973 psMetadataIterator* iterator, ///< psMetadata iterator 00974 long location ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL 00975 ); 00976 00977 /** Position the specified iterator to the next matching item in psMetadata, 00978 * given the regular expression of the iterator 00979 * 00980 * @return psPtr the psMetadataItem at the original iterator position 00981 * or NULL if the iterator went past the end of the list. 00982 */ 00983 psMetadataItem* psMetadataGetAndIncrement( 00984 psMetadataIterator* iterator ///< iterator to move 00985 ); 00986 00987 /** Position the specified iterator to the previous matching item in psMetadata, 00988 * given the regular expression of the iterator 00989 * 00990 * @return psPtr the psMetadataItem at the original iterator position 00991 * or NULL if the iterator went past the beginning of the 00992 * list. 00993 */ 00994 psMetadataItem* psMetadataGetAndDecrement( 00995 psMetadataIterator* iterator ///< iterator to move 00996 ); 00997 00998 /** Find an item in the metadata collection based on key name and return its metadata value. 00999 * 01000 * Items may be found in the metadata by providing a key. If the key is 01001 * non-unique, the value of the first item is returned. If the item is not found, zero is 01002 * returned. 01003 * 01004 * @return psMetadata*: Value of metadata item. 01005 */ 01006 psMetadata *psMetadataLookupMetadata( 01007 bool *status, ///< Status of lookup. 01008 const psMetadata *md, ///< Metadata collection to lookup metadata item. 01009 const char *key ///< Name of metadata key. 01010 ); 01011 01012 /** Find an item in the metadata collection based on key name and return its string value. 01013 * 01014 * Items may be found in the metadata by providing a key. If the key is 01015 * non-unique, the value of the first item is returned. If the item is not found, zero is 01016 * returned. 01017 * 01018 * @return psString: Value of metadata item. 01019 */ 01020 psString psMetadataLookupStr( 01021 bool *status, ///< Status of lookup. 01022 const psMetadata *md, ///< Metadata collection to lookup metadata item. 01023 const char *key ///< Name of metadata key. 01024 ); 01025 01026 /** Find an item in the metadata collection based on key name and return it as a psTime pointer. 01027 * 01028 * Items may be found in the metadata by providing a key. If the key is 01029 * non-unique, the value of the first item is returned. If the item is not found, zero is 01030 * returned. 01031 * 01032 * @return psTime: Value of metadata item. 01033 */ 01034 01035 psTime *psMetadataLookupTime( 01036 bool *status, ///< Status of lookup. 01037 const psMetadata *md, ///< Metadata collection to lookup metadata item. 01038 const char *key ///< Name of metadata key. 01039 ); 01040 01041 01042 /** Prints metadata collection. 01043 * 01044 * Metadata contents are printed to a valid file descriptor if one exists. Otherwise, 01045 * fd should be NULL and the contents are printed to the screen (stdout). 01046 * 01047 * @return bool: True if successful, otherwise false. 01048 */ 01049 bool psMetadataPrint( 01050 FILE *fd, ///< File Descriptor or NULL 01051 const psMetadata *md, ///< Metadata collection to print. 01052 int level ///< the level of metadata items. 01053 ); 01054 01055 /** Allocates a new psPolynomial1D structure with information from a psMetadata. 01056 * 01057 * Parses a psMetadata container with psPolynomial1D information. The first two 01058 * elements of the metadata folder specify the order of the x & y variables. (ie, 01059 * NORDER_X, NORDER_Y). The following elements are the values of the coefficients 01060 * and the coefficient errors. (ie, VAL_X00_Y00, ERR_X00_Y00, etc.). If the orders 01061 * or any coefficients are missing or have incorrect syntax, NULL is returned. 01062 * 01063 * @return psPolynomial1D*: Newly allocated psPolynomial1D from metadata. 01064 */ 01065 psPolynomial1D *psPolynomial1DfromMetadata( 01066 const psMetadata *folder ///< folder containing the polynomial info. 01067 ); 01068 01069 /** Stores the information from a psPolynomial1D structure in a psMetadata container. 01070 * 01071 * Creates a psMetadata folder with psPolynomial1D information. The first two 01072 * elements of the metadata folder specify the order of the x & y variables. (ie, 01073 * NORDER_X, NORDER_Y). The following elements are the values of the coefficients 01074 * and the coefficient errors. (ie, VAL_X00_Y00, ERR_X00_Y00, etc.). The input 01075 * polynomial must be of ordinary type and have a valid name format. False is also 01076 * returned if any inputs are NULL. *If a particular mask element is non-zero, that 01077 * polynomial coefficient (and error) are skipped. 01078 * 01079 * @return bool: True if successful, otherwise false. 01080 */ 01081 bool psPolynomial1DtoMetadata( 01082 psMetadata *md, ///< Metadata container for polynomial storage. 01083 const psPolynomial1D *poly, ///< Polynomial information to be stored. 01084 const char *format, ///< Name of polynomial folder. 01085 ... ///< Arguments for name formatting. 01086 ); 01087 01088 /** Allocates a new psPolynomial2D structure with information from a psMetadata. 01089 * 01090 * Parses a psMetadata container with psPolynomial2D information. The first two 01091 * elements of the metadata folder specify the order of the x & y variables. (ie, 01092 * NORDER_X, NORDER_Y). The following elements are the values of the coefficients 01093 * and the coefficient errors. (ie, VAL_X00_Y00, ERR_X00_Y00, etc.). If the orders 01094 * or any coefficients are missing or have incorrect syntax, NULL is returned. 01095 * 01096 * @return psPolynomial2D*: Newly allocated psPolynomial2D from metadata. 01097 */ 01098 psPolynomial2D *psPolynomial2DfromMetadata( 01099 const psMetadata *folder ///< folder containing the polynomial info. 01100 ); 01101 01102 /** Stores the information from a psPolynomial2D structure in a psMetadata container. 01103 * 01104 * Creates a psMetadata folder with psPolynomial2D information. The first two 01105 * elements of the metadata folder specify the order of the x & y variables. (ie, 01106 * NORDER_X, NORDER_Y). The following elements are the values of the coefficients 01107 * and the coefficient errors. (ie, VAL_X00_Y00, ERR_X00_Y00, etc.). The input 01108 * polynomial must be of ordinary type and have a valid name format. False is also 01109 * returned if any inputs are NULL. *If a particular mask element is non-zero, that 01110 * polynomial coefficient (and error) are skipped. 01111 * 01112 * @return bool: True if successful, otherwise false. 01113 */ 01114 bool psPolynomial2DtoMetadata( 01115 psMetadata *md, ///< Metadata container for polynomial storage. 01116 const psPolynomial2D *poly, ///< Polynomial information to be stored. 01117 const char *format, ///< Name of polynomial folder. 01118 ... ///< Arguments for name formatting. 01119 ); 01120 01121 /** Allocates a new psPolynomial3D structure with information from a psMetadata. 01122 * 01123 * Parses a psMetadata container with psPolynomial3D information. The first three 01124 * elements of the metadata folder specify the order of the x, y, & z variables. (ie, 01125 * NORDER_X, NORDER_Y, NORDER_Z). The following elements are the values of the 01126 * coefficients and the coefficient errors. (ie, VAL_X00_Y00_Z00, ERR_X00_Y00_Z00, 01127 * etc.). If the orders or any coefficients are missing or have incorrect syntax, 01128 * NULL is returned. 01129 * 01130 * @return psPolynomial3D*: Newly allocated psPolynomial3D from metadata. 01131 */ 01132 psPolynomial3D *psPolynomial3DfromMetadata( 01133 const psMetadata *folder ///< folder containing the polynomial info. 01134 ); 01135 01136 /** Stores the information from a psPolynomial3D structure in a psMetadata container. 01137 * 01138 * Creates a psMetadata folder with psPolynomial3D information. The first three 01139 * elements of the metadata folder specify the order of the x, y, & z variables. (ie, 01140 * NORDER_X, NORDER_Y, NORDER_Z). The following elements are the values of the 01141 * coefficients and the coefficient errors. (ie, VAL_X00_Y00_Z00, ERR_X00_Y00_Z00, 01142 * etc.). The input polynomial must be of ordinary type and have a valid name format. 01143 * False is also returned if any inputs are NULL. *If a particular mask element is 01144 * non-zero, that polynomial coefficient (and error) are skipped. 01145 * 01146 * @return bool: True if successful, otherwise false. 01147 */ 01148 bool psPolynomial3DtoMetadata( 01149 psMetadata *md, ///< Metadata container for polynomial storage. 01150 const psPolynomial3D *poly, ///< Polynomial information to be stored. 01151 const char *format, ///< Name of polynomial folder. 01152 ... ///< Arguments for name formatting. 01153 ); 01154 01155 /** Allocates a new psPolynomial4D structure with information from a psMetadata. 01156 * 01157 * Parses a psMetadata container with psPolynomial4D information. The first four 01158 * elements of the metadata folder specify the order of the x, y, z, & t variables. 01159 * (ie, NORDER_X, NORDER_Y, NORDER_Z, NORDER_T). The following elements are the 01160 * values of the coefficients and the coefficient errors. (ie, VAL_X00_Y00_Z00_T00, 01161 * ERR_X00_Y00_Z00_T00, etc.). If the orders or any coefficients are missing or 01162 * have incorrect syntax, NULL is returned. 01163 * 01164 * @return psPolynomial4D*: Newly allocated psPolynomial4D from metadata. 01165 */ 01166 psPolynomial4D *psPolynomial4DfromMetadata( 01167 const psMetadata *folder ///< folder containing the polynomial info. 01168 ); 01169 01170 /** Stores the information from a psPolynomial4D structure in a psMetadata container. 01171 * 01172 * Creates a psMetadata folder with psPolynomial4D information. The first four 01173 * elements of the metadata folder specify the order of the x, y, z, & t variables. 01174 * (ie, NORDER_X, NORDER_Y, NORDER_Z, NORDER_T). The following elements are the values 01175 * of the coefficients and the coefficient errors. (ie, VAL_X00_Y00_Z00_T00, 01176 * ERR_X00_Y00_Z00_T00, etc.). The input polynomial must be of ordinary type and have 01177 * a valid name format. False is also returned if any inputs are NULL. *If a particular 01178 * mask element is non-zero, that polynomial coefficient (and error) are skipped. 01179 * 01180 * @return bool: True if successful, otherwise false. 01181 */ 01182 bool psPolynomial4DtoMetadata( 01183 psMetadata *md, ///< Metadata container for polynomial storage. 01184 const psPolynomial4D *poly, ///< Polynomial information to be stored. 01185 const char *format, ///< Name of polynomial folder. 01186 ... ///< Arguments for name formatting. 01187 ); 01188 01189 01190 /// Assert on metadata with extant hash and list components 01191 #define PS_ASSERT_METADATA_NON_NULL(NAME, RVAL) \ 01192 if (!(NAME) || !(NAME)->hash || !(NAME)->list) { \ 01193 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \ 01194 "Error: Metadata %s or one of its components is NULL.", \ 01195 #NAME); \ 01196 return RVAL; \ 01197 } 01198 01199 /// @} 01200 #endif // #ifndef PS_METADATA_H
1.5.1