Changeset 4309 for trunk/archive/scripts/src/psAdditionals.c
- Timestamp:
- Jun 17, 2005, 2:48:18 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/archive/scripts/src/psAdditionals.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/scripts/src/psAdditionals.c
r4093 r4309 2 2 #include <string.h> 3 3 #include "pslib.h" 4 #include "p smodule.h"4 #include "papmodule.h" 5 5 6 6 … … 35 35 36 36 37 c onst char *psMetadataLookupString(bool *status, const psMetadata *md, const char *key)37 char *psMetadataLookupString(bool *status, const psMetadata *md, const char *key) 38 38 { 39 39 psMetadataItem *item = psMetadataLookup((psMetadata*)md, key); // The metadata with instruments 40 c onst char *value = NULL;// The value to return40 char *value = NULL; // The value to return 41 41 if (!item) { 42 42 // The given key isn't in the metadata … … 64 64 } 65 65 66 papChip *psMetadataLookupChip(bool *status, const psMetadata *md, const char *key) 67 { 68 psMetadataItem *item = psMetadataLookup((psMetadata*)md, key); // The metadata with instruments 69 papChip *value = NULL; // The value to return 70 if (!item) { 71 // The given key isn't in the metadata 72 if (status) { 73 *status = false; 74 } else { 75 psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n"); 76 } 77 } else if (item->type != PS_META_CHIP) { 78 // The value at the key isn't metadata 79 if (status) { 80 *status = false; 81 } else { 82 psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_META_CHIP, as expected.\n"); 83 } 84 value = NULL; 85 } else { 86 // We have the requested metadata 87 if (status) { 88 *status = true; 89 } 90 value = item->data.V; // The requested metadata 91 } 92 return value; 93 } 94 95 papCell *psMetadataLookupCell(bool *status, const psMetadata *md, const char *key) 96 { 97 psMetadataItem *item = psMetadataLookup((psMetadata*)md, key); // The metadata with instruments 98 papCell *value = NULL; // The value to return 99 if (!item) { 100 // The given key isn't in the metadata 101 if (status) { 102 *status = false; 103 } else { 104 psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n"); 105 } 106 } else if (item->type != PS_META_CELL) { 107 // The value at the key isn't metadata 108 if (status) { 109 *status = false; 110 } else { 111 psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_META_CHIP, as expected.\n"); 112 } 113 value = NULL; 114 } else { 115 // We have the requested metadata 116 if (status) { 117 *status = true; 118 } 119 value = item->data.V; // The requested metadata 120 } 121 return value; 122 } 66 123 67 124 void psMetadataPrint(psMetadata *md, int level)
Note:
See TracChangeset
for help on using the changeset viewer.
