IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 8, 2009, 12:31:09 PM (17 years ago)
Author:
Paul Price
Message:

Adding LOG and TRACE to list of files written in the RUN metadata.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config/pmConfigRun.c

    r23447 r23748  
    4141// Add a file to a nominated metadata in the RUN information
    4242static 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
    4445                             const char *target // Name of metadata to which to add
    4546                             )
    4647{
    4748    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);
    4952
    5053    psMetadata *run = configRun(config);// RUN information
     
    5356    psAssert(files, "Require list of files");
    5457
    55     const char *name = file->name;      // Name of symbolic file
    56     const char *value = file->origname ? file->origname : file->filename; // The file (system) name
    57 
    5858    psString regex = NULL;              // Regular expression for iteration
    59     psStringAppend(&regex, "^%s$", name);
     59    psStringAppend(&regex, "^%s$", description);
    6060    psMetadataIterator *iter = psMetadataIteratorAlloc(files, PS_LIST_HEAD, regex);
    6161    psFree(regex);
     
    6363    while ((item = psMetadataGetAndIncrement(iter))) {
    6464        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) {
    6666            // It's already present
    6767            psFree(iter);
     
    7171    psFree(iter);
    7272
    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);
    7474}
    7575
     
    7979    PS_ASSERT_PTR_NON_NULL(file, false);
    8080
    81     return configRunFileAdd(config, file, "FILES.INPUT");
     81    return configRunFileAdd(config, file->name, file->origname ? file->origname : file->filename,
     82                            "FILES.INPUT");
     83}
     84
     85bool 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");
    8292}
    8393
     
    8797    PS_ASSERT_PTR_NON_NULL(file, false);
    8898
    89     return configRunFileAdd(config, file, "FILES.OUTPUT");
     99    return configRunFileAdd(config, file->name, file->origname ? file->origname : file->filename,
     100                            "FILES.OUTPUT");
     101}
     102
     103bool 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");
    90110}
    91111
Note: See TracChangeset for help on using the changeset viewer.