Changeset 2204 for trunk/psLib/src/sysUtils/psTrace.c
- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sysUtils/psTrace.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sysUtils/psTrace.c
r1834 r2204 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2004- 09-20 22:03:35$11 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 00:57:31 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 34 34 35 35 PS_DEFAULT_TRACE_LEVEL: This should only be used when adding the 36 intermediate components of a longname. Ie. the "B" in .A.B.C36 intermediate components of a psS64 name. Ie. the "B" in .A.B.C 37 37 38 38 *****************************************************************************/ … … 56 56 57 57 static void componentFree(p_psComponent* comp); 58 static p_psComponent* componentAlloc(const char *name, intlevel);58 static p_psComponent* componentAlloc(const char *name, psS32 level); 59 59 60 60 /***************************************************************************** 61 61 componentAlloc(): allocate memory for a new node, and initialize members. 62 62 *****************************************************************************/ 63 static p_psComponent* componentAlloc(const char *name, intlevel)63 static p_psComponent* componentAlloc(const char *name, psS32 level) 64 64 { 65 65 p_psComponent* comp = psAlloc(sizeof(p_psComponent)); … … 68 68 p_psMemSetDeallocator(comp, (psFreeFcn) componentFree); 69 69 comp->name = psStringCopy(name); 70 p_psMemSetPersistent(( void*)comp->name,true);70 p_psMemSetPersistent((psPtr)comp->name,true); 71 71 comp->level = level; 72 72 comp->n = 0; … … 86 86 87 87 if (comp->subcomp != NULL) { 88 for ( inti = 0; i < comp->n; i++) {88 for (psS32 i = 0; i < comp->n; i++) { 89 89 p_psMemSetPersistent(comp->subcomp[i],false); 90 90 psFree(comp->subcomp[i]); … … 94 94 } 95 95 96 p_psMemSetPersistent(( void*)comp->name,false);97 psFree(( void*)comp->name);96 p_psMemSetPersistent((psPtr)comp->name,false); 97 psFree((psPtr)comp->name); 98 98 } 99 99 … … 115 115 void p_psTraceReset(p_psComponent* currentNode) 116 116 { 117 inti = 0;117 psS32 i = 0; 118 118 119 119 if (NULL == currentNode) { … … 149 149 to ANSI-C. 150 150 *****************************************************************************/ 151 static bool componentAdd(const char *addNodeName, intlevel)152 { 153 inti = 0; // Loop index variable.151 static psBool componentAdd(const char *addNodeName, psS32 level) 152 { 153 psS32 i = 0; // Loop index variable. 154 154 char name[strlen(addNodeName) + 1]; // buffer for writeable copy. 155 155 char *pname = name; 156 156 char *firstComponent = NULL; // first component of name 157 157 p_psComponent* currentNode = cRoot; 158 intnodeExists = 0;158 psS32 nodeExists = 0; 159 159 160 160 // XXX: Verify that this is the correct behavior. … … 240 240 zero 241 241 *****************************************************************************/ 242 bool psTraceSetLevel(const char *comp, // component of interest243 intlevel) // desired trace level242 psBool psTraceSetLevel(const char *comp, // component of interest 243 psS32 level) // desired trace level 244 244 { 245 245 char *compName = NULL; … … 299 299 The trace level of the "name" component. 300 300 *****************************************************************************/ 301 static intdoGetTraceLevel(const char *aname)301 static psS32 doGetTraceLevel(const char *aname) 302 302 { 303 303 char name[strlen(aname) + 1]; // need a writeable copy: for strsep() … … 305 305 char *firstComponent = NULL; // first component of name 306 306 p_psComponent* currentNode = cRoot; 307 inti = 0;308 intdefaultLevel = 0;307 psS32 i = 0; 308 psS32 defaultLevel = 0; 309 309 310 310 if (NULL == currentNode) { … … 365 365 The level of "name" in the root component tree. 366 366 *****************************************************************************/ 367 intpsTraceGetLevel(const char *name)367 psS32 psTraceGetLevel(const char *name) 368 368 { 369 369 char *compName = NULL; 370 inttraceLevel;370 psS32 traceLevel; 371 371 372 372 if (cRoot == NULL) { … … 401 401 *****************************************************************************/ 402 402 static void doPrintTraceLevels(const p_psComponent* comp, 403 intdepth,404 intdefLevel)405 { 406 inti = 0;403 psS32 depth, 404 psS32 defLevel) 405 { 406 psS32 i = 0; 407 407 408 408 if (comp->name[0] == '\0') { … … 472 472 *****************************************************************************/ 473 473 void p_psTrace(const char *comp, // component being traced 474 intlevel, // desired trace level474 psS32 level, // desired trace level 475 475 ...) // arguments 476 476 { 477 477 char *fmt = NULL; 478 478 va_list ap; 479 inti = 0;479 psS32 i = 0; 480 480 481 481 if (NULL == comp) {
Note:
See TracChangeset
for help on using the changeset viewer.
