IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1735


Ignore:
Timestamp:
Sep 8, 2004, 1:58:36 PM (22 years ago)
Author:
gusciora
Message:

Optional leading "." in component names.

Location:
trunk/psLib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psTrace.c

    r1733 r1735  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-09-08 22:10:06 $
     11 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-09-08 23:58:36 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    230230                     int level)  // desired trace level
    231231{
     232    char *compName = NULL;
     233
    232234    // If the root component tree does not exist, then initialize it.
    233235    if (cRoot == NULL) {
    234236        initTrace();
    235237    }
     238
     239    if (comp[0] != '.') {
     240        compName = (char *) psAlloc(2 + strlen(comp));
     241        compName[0] = '.';
     242        compName = strcat(compName, comp);
     243    } else {
     244        compName = (char *) comp;
     245    }
     246
    236247    // Add the new component to the component tree.
    237     if ( !componentAdd(comp, level) ) {
    238         psErrorMsg(PS_ERRORNAME_DOMAIN "psTraceSetLevel", PS_ERR_UNKNOWN, false,
    239                    PS_ERRORTEXT_psTrace_FAILED_TO_ADD_COMPONENT,level,comp);
     248    if ( !componentAdd(compName, level) ) {
     249        psErrorMsg(PS_ERRORNAME_DOMAIN "psTraceSetLevel",
     250                   PS_ERR_UNKNOWN,
     251                   false,
     252                   PS_ERRORTEXT_psTrace_FAILED_TO_ADD_COMPONENT,
     253                   level,
     254                   compName);
     255        if (comp[0] != '.') {
     256            psFree(compName);
     257        }
    240258        return false;
     259    }
     260
     261    if (comp[0] != '.') {
     262        psFree(compName);
    241263    }
    242264    return true;
  • trunk/psLib/src/sysUtils/psTrace.c

    r1733 r1735  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-09-08 22:10:06 $
     11 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-09-08 23:58:36 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    230230                     int level)  // desired trace level
    231231{
     232    char *compName = NULL;
     233
    232234    // If the root component tree does not exist, then initialize it.
    233235    if (cRoot == NULL) {
    234236        initTrace();
    235237    }
     238
     239    if (comp[0] != '.') {
     240        compName = (char *) psAlloc(2 + strlen(comp));
     241        compName[0] = '.';
     242        compName = strcat(compName, comp);
     243    } else {
     244        compName = (char *) comp;
     245    }
     246
    236247    // Add the new component to the component tree.
    237     if ( !componentAdd(comp, level) ) {
    238         psErrorMsg(PS_ERRORNAME_DOMAIN "psTraceSetLevel", PS_ERR_UNKNOWN, false,
    239                    PS_ERRORTEXT_psTrace_FAILED_TO_ADD_COMPONENT,level,comp);
     248    if ( !componentAdd(compName, level) ) {
     249        psErrorMsg(PS_ERRORNAME_DOMAIN "psTraceSetLevel",
     250                   PS_ERR_UNKNOWN,
     251                   false,
     252                   PS_ERRORTEXT_psTrace_FAILED_TO_ADD_COMPONENT,
     253                   level,
     254                   compName);
     255        if (comp[0] != '.') {
     256            psFree(compName);
     257        }
    240258        return false;
     259    }
     260
     261    if (comp[0] != '.') {
     262        psFree(compName);
    241263    }
    242264    return true;
Note: See TracChangeset for help on using the changeset viewer.