Changeset 4977 for trunk/psphot/src/psLibUtils.c
- Timestamp:
- Sep 7, 2005, 6:32:40 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psLibUtils.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psLibUtils.c
r4954 r4977 1 1 # include <strings.h> // for strncasecmp 2 2 # include <pslib.h> 3 # include "psLibUtils.h" 3 4 4 5 // XXX EAM : this is NOT included in the C99 headers ?? … … 157 158 memcpy (tmpVector->data.F32, image->data.F32[row], image->numCols*sizeof(psF32)); 158 159 return(tmpVector); 159 }160 161 // extract config informatin from config data or from image header, if specified162 psF32 pmConfigLookupF32 (bool *status, psMetadata *config, psMetadata *header, char *name) {163 164 char *source;165 char *keyword;166 psF32 value;167 psMetadataItem *item;168 169 // look for the entry in the config collection170 item = psMetadataLookup (config, name);171 if (item == NULL) {172 psLogMsg ("pmConfigLookupF32", 2, "no key %s in config data, trying as header keyword", name);173 value = psMetadataLookupF32 (status, header, name);174 if (*status == false) {175 psAbort ("pmConfigLookupF32", "no key %s in header", name);176 }177 *status = true;178 return (value);179 }180 181 // I'm either expecting a string, with the name "HD:keyword"...182 if (item->type == PS_META_STR) {183 source = item->data.V;184 if (!strncasecmp (source, "HD:", 3)) {185 keyword = &source[3];186 value = psMetadataLookupF32 (status, header, keyword);187 if (*status == false) {188 psAbort ("pmConfigLookupF32", "no key %s in config", name);189 }190 *status = true;191 // psFree (item);192 return (value);193 }194 }195 196 // ... or a value (F32?)197 if (item->type == PS_META_F32) {198 value = item->data.F32;199 // psFree (item);200 return (value);201 }202 203 *status = false;204 psError(PS_ERR_UNKNOWN, true, "invalid item");205 return (0);206 160 } 207 161
Note:
See TracChangeset
for help on using the changeset viewer.
