Changeset 23244
- Timestamp:
- Mar 10, 2009, 12:29:41 PM (17 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 2 edited
-
camera/pmFPAfileIO.c (modified) (4 diffs)
-
config/pmConfigRun.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfileIO.c
r21363 r23244 22 22 #include "pmFPARead.h" 23 23 #include "pmFPAWrite.h" 24 #include "pmFPAfileIO.h"25 24 #include "pmFPAfileFitsIO.h" 26 25 #include "pmSpan.h" … … 44 43 #include "pmSubtractionIO.h" 45 44 #include "pmConcepts.h" 45 #include "pmConfigRun.h" 46 47 #include "pmFPAfileIO.h" 46 48 47 49 // attempt create, read, write, close, or free pmFPAfiles available in files files are … … 164 166 } 165 167 168 if (!pmConfigRunFileAdd(config, file)) { 169 psError(PS_ERR_UNKNOWN, false, "Unable to add file to run-time information"); 170 return false; 171 } 172 166 173 // select a reading method 167 174 bool status = true; … … 412 419 return false; 413 420 } 421 } 422 423 if (!pmConfigRunFileAdd(config, file)) { 424 psError(PS_ERR_UNKNOWN, false, "Unable to add file to run-time information"); 425 return false; 414 426 } 415 427 -
trunk/psModules/src/config/pmConfigRun.c
r23243 r23244 4 4 5 5 #include <stdio.h> 6 #include <string.h> 6 7 #include <pslib.h> 7 8 … … 25 26 elem = psMetadataAlloc(); 26 27 psMetadataAddMetadata(md, PS_LIST_HEAD, name, 0, comment, elem); 28 psFree(elem); // Drop reference 27 29 } 28 30 return elem; … … 48 50 psAssert(files, "Require list of files"); 49 51 50 return psMetadataAddStr(files, PS_LIST_TAIL, file->name, PS_META_DUPLICATE_OK, NULL, file->filename); 52 const char *name = file->name; // Name of symbolic file 53 const char *value = file->filename; // Value of symbolic file: the file name 54 55 psString regex = NULL; // Regular expression for iteration 56 psStringAppend(®ex, "^%s$", name); 57 psMetadataIterator *iter = psMetadataIteratorAlloc(files, PS_LIST_HEAD, regex); 58 psFree(regex); 59 psMetadataItem *item; // Item from iteration 60 while ((item = psMetadataGetAndIncrement(iter))) { 61 psAssert(item->type == PS_DATA_STRING, "We only put STRING types here."); 62 if (strcmp(item->data.str, value) == 0) { 63 // It's already present 64 psFree(iter); 65 return true; 66 } 67 } 68 psFree(iter); 69 70 return psMetadataAddStr(files, PS_LIST_TAIL, name, PS_META_DUPLICATE_OK, NULL, value); 51 71 } 52 72
Note:
See TracChangeset
for help on using the changeset viewer.
