Changeset 23447
- Timestamp:
- Mar 19, 2009, 4:32:11 PM (17 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 3 edited
-
camera/pmFPAfileIO.c (modified) (2 diffs)
-
config/pmConfigRun.c (modified) (4 diffs)
-
config/pmConfigRun.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfileIO.c
r23272 r23447 166 166 } 167 167 168 if (!pmConfigRunFileAdd (config, file)) {168 if (!pmConfigRunFileAddRead(config, file)) { 169 169 psError(PS_ERR_UNKNOWN, false, "Unable to add file to run-time information"); 170 170 return false; … … 421 421 } 422 422 423 if (!pmConfigRunFileAdd (config, file)) {423 if (!pmConfigRunFileAddWrite(config, file)) { 424 424 psError(PS_ERR_UNKNOWN, false, "Unable to add file to run-time information"); 425 425 return false; -
trunk/psModules/src/config/pmConfigRun.c
r23272 r23447 39 39 } 40 40 41 42 bool pmConfigRunFileAdd(pmConfig *config, const pmFPAfile *file) 41 // Add a file to a nominated metadata in the RUN information 42 static bool configRunFileAdd(pmConfig *config, // Configuration 43 const pmFPAfile *file, // File to add 44 const char *target // Name of metadata to which to add 45 ) 43 46 { 44 47 PS_ASSERT_PTR_NON_NULL(config, false); … … 47 50 psMetadata *run = configRun(config);// RUN information 48 51 psAssert(run, "Require run-time information"); 49 psMetadata *files = configElement(run, "FILES", "Filerules used during execution");52 psMetadata *files = configElement(run, target, "Filerules used during execution"); 50 53 psAssert(files, "Require list of files"); 51 54 … … 71 74 } 72 75 73 psArray *pmConfigRunFileGet(pmConfig *config, const char *name)76 bool pmConfigRunFileAddRead(pmConfig *config, const pmFPAfile *file) 74 77 { 75 78 PS_ASSERT_PTR_NON_NULL(config, false); 76 PS_ASSERT_ STRING_NON_EMPTY(name, false);79 PS_ASSERT_PTR_NON_NULL(file, false); 77 80 81 return configRunFileAdd(config, file, "FILES.INPUT"); 82 } 83 84 bool pmConfigRunFileAddWrite(pmConfig *config, const pmFPAfile *file) 85 { 86 PS_ASSERT_PTR_NON_NULL(config, false); 87 PS_ASSERT_PTR_NON_NULL(file, false); 88 89 return configRunFileAdd(config, file, "FILES.OUTPUT"); 90 } 91 92 // Get an array of filenames from the nominated RUN information 93 static psArray *configRunFileGet(pmConfig *config, // Configuration 94 const char *name, // Name of file 95 const char *source // Source metadata for file 96 ) 97 { 78 98 psMetadata *run = configRun(config);// RUN information 79 99 psAssert(run, "Require run-time information"); 80 psMetadata *files = configElement(run, "FILES", "Filerules used during execution");100 psMetadata *files = configElement(run, source, "Filerules used during execution"); 81 101 psAssert(files, "Require list of files"); 102 103 if (psListLength(files->list) == 0) { 104 // Can't find anything 105 return NULL; 106 } 82 107 83 108 psList *list = psListAlloc(NULL); // List of file names … … 104 129 105 130 return array; 131 } 132 133 134 psArray *pmConfigRunFileGet(pmConfig *config, const char *name) 135 { 136 PS_ASSERT_PTR_NON_NULL(config, false); 137 PS_ASSERT_STRING_NON_EMPTY(name, false); 138 139 // Try the input and output, in turn 140 psArray *files = configRunFileGet(config, name, "FILES.INPUT"); // Files from RUN metadata 141 if (!files) { 142 configRunFileGet(config, name, "FILES.OUTPUT"); 143 } 144 145 return files; 106 146 } 107 147 -
trunk/psModules/src/config/pmConfigRun.h
r23268 r23447 6 6 #include <pmFPAfile.h> 7 7 8 /// Add a file to the list of files used in the run-time information 9 bool pmConfigRunFileAdd( 8 /// Add a file to the list of files read in the run-time information 9 bool pmConfigRunFileAddRead( 10 pmConfig *config, ///< Configuration 11 const pmFPAfile *file ///< File to add 12 ); 13 14 /// Add a file to the list of files written in the run-time information 15 bool pmConfigRunFileAddWrite( 10 16 pmConfig *config, ///< Configuration 11 17 const pmFPAfile *file ///< File to add
Note:
See TracChangeset
for help on using the changeset viewer.
