Changeset 23748 for trunk/psModules/src/config/pmConfigRun.c
- Timestamp:
- Apr 8, 2009, 12:31:09 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/config/pmConfigRun.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/config/pmConfigRun.c
r23447 r23748 41 41 // Add a file to a nominated metadata in the RUN information 42 42 static bool configRunFileAdd(pmConfig *config, // Configuration 43 const pmFPAfile *file, // File to add 43 const char *description, // Description of file 44 const char *name, // Name of file 44 45 const char *target // Name of metadata to which to add 45 46 ) 46 47 { 47 48 PS_ASSERT_PTR_NON_NULL(config, false); 48 PS_ASSERT_PTR_NON_NULL(file, false); 49 PS_ASSERT_STRING_NON_EMPTY(description, false); 50 PS_ASSERT_STRING_NON_EMPTY(name, false); 51 PS_ASSERT_STRING_NON_EMPTY(target, false); 49 52 50 53 psMetadata *run = configRun(config);// RUN information … … 53 56 psAssert(files, "Require list of files"); 54 57 55 const char *name = file->name; // Name of symbolic file56 const char *value = file->origname ? file->origname : file->filename; // The file (system) name57 58 58 psString regex = NULL; // Regular expression for iteration 59 psStringAppend(®ex, "^%s$", name);59 psStringAppend(®ex, "^%s$", description); 60 60 psMetadataIterator *iter = psMetadataIteratorAlloc(files, PS_LIST_HEAD, regex); 61 61 psFree(regex); … … 63 63 while ((item = psMetadataGetAndIncrement(iter))) { 64 64 psAssert(item->type == PS_DATA_STRING, "We only put STRING types here."); 65 if (strcmp(item->data.str, value) == 0) {65 if (strcmp(item->data.str, name) == 0) { 66 66 // It's already present 67 67 psFree(iter); … … 71 71 psFree(iter); 72 72 73 return psMetadataAddStr(files, PS_LIST_TAIL, name, PS_META_DUPLICATE_OK, NULL, value);73 return psMetadataAddStr(files, PS_LIST_TAIL, description, PS_META_DUPLICATE_OK, NULL, name); 74 74 } 75 75 … … 79 79 PS_ASSERT_PTR_NON_NULL(file, false); 80 80 81 return configRunFileAdd(config, file, "FILES.INPUT"); 81 return configRunFileAdd(config, file->name, file->origname ? file->origname : file->filename, 82 "FILES.INPUT"); 83 } 84 85 bool pmConfigRunFilenameAddRead(pmConfig *config, const char *description, const char *name) 86 { 87 PS_ASSERT_PTR_NON_NULL(config, false); 88 PS_ASSERT_STRING_NON_EMPTY(description, false); 89 PS_ASSERT_STRING_NON_EMPTY(name, false); 90 91 return configRunFileAdd(config, description, name, "FILES.INPUT"); 82 92 } 83 93 … … 87 97 PS_ASSERT_PTR_NON_NULL(file, false); 88 98 89 return configRunFileAdd(config, file, "FILES.OUTPUT"); 99 return configRunFileAdd(config, file->name, file->origname ? file->origname : file->filename, 100 "FILES.OUTPUT"); 101 } 102 103 bool pmConfigRunFilenameAddWrite(pmConfig *config, const char *description, const char *name) 104 { 105 PS_ASSERT_PTR_NON_NULL(config, false); 106 PS_ASSERT_STRING_NON_EMPTY(description, false); 107 PS_ASSERT_STRING_NON_EMPTY(name, false); 108 109 return configRunFileAdd(config, description, name, "FILES.OUTPUT"); 90 110 } 91 111
Note:
See TracChangeset
for help on using the changeset viewer.
