Changeset 885
- Timestamp:
- Jun 4, 2004, 3:27:54 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 6 edited
-
sys/psTrace.c (modified) (3 diffs)
-
sys/psTrace.h (modified) (2 diffs)
-
sysUtils/psHash.c (modified) (1 diff)
-
sysUtils/psHash.h (modified) (2 diffs)
-
sysUtils/psTrace.c (modified) (3 diffs)
-
sysUtils/psTrace.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psTrace.c
r560 r885 39 39 40 40 static Component *croot = NULL; // The root of the trace component 41 static FILE *traceFP = NULL; 41 42 /***************************************************************************** 42 43 componentAlloc(): allocate memory for a new node, and initialize members. … … 378 379 va_start(ap, level); 379 380 380 // We indent each message one space foe each level of the message.381 for (i = 0; i < level; i++) {382 putchar(' ');383 }384 385 381 // The following functions get the variable list of parameters with 386 382 // which this function was called, and print them to the standard 387 383 // output. 388 384 fmt = va_arg(ap, char *); 389 vprintf(fmt, ap); 385 386 if (traceFP != NULL) { 387 // We indent each message one space for each level of the message. 388 for (i = 0; i < level; i++) { 389 fprintf(traceFP, " "); 390 } 391 vfprintf(traceFP, fmt, ap); 392 } else { 393 // We indent each message one space for each level of the message. 394 for (i = 0; i < level; i++) { 395 putchar(' '); 396 } 397 vprintf(fmt, ap); 398 } 390 399 va_end(ap); 391 400 } … … 393 402 // NOTE: should we free *fmt as well? Read the man page. 394 403 } 404 405 void psTraceSetDestination(FILE *fp) 406 { 407 traceFP = fp; 408 } -
trunk/psLib/src/sys/psTrace.h
r560 r885 55 55 ; 56 56 57 void psTraceSetDestination(FILE *fp); 58 59 57 60 /* \} */ // End of SystemGroup Functions 58 61 … … 67 70 68 71 #endif 72 -
trunk/psLib/src/sysUtils/psHash.c
r875 r885 13 13 #include "psTrace.h" 14 14 15 void psHashKeyList() 16 { 17 printf("This has not been coded.\n"); 15 psDlist *psHashKeyList(psHash *table) 16 { 17 int i = 0; 18 psDlist *myLinkList = NULL; 19 20 if (table == NULL) { 21 return NULL; 22 } 23 24 myLinkList = psDlistAlloc(NULL); 25 26 for (i=0;i<table->nbucket;i++) { 27 if (table->buckets[i] != NULL) { 28 psDlistAdd(myLinkList, (table->buckets[i])->key, PS_DLIST_HEAD); 29 } 30 } 31 32 return(myLinkList); 18 33 } 19 34 -
trunk/psLib/src/sysUtils/psHash.h
r875 r885 6 6 * \ingroup DataGroup 7 7 */ 8 #include "psDList.h" 9 8 10 9 11 /** DO WE NEED TO DEFINE HashTable? */ … … 59 61 60 62 /// List all keys in table. 61 void psHashKeyList();63 psDlist *psHashKeyList(psHash *table); 62 64 63 65 /* \} */ // End of DataGroup Functions -
trunk/psLib/src/sysUtils/psTrace.c
r560 r885 39 39 40 40 static Component *croot = NULL; // The root of the trace component 41 static FILE *traceFP = NULL; 41 42 /***************************************************************************** 42 43 componentAlloc(): allocate memory for a new node, and initialize members. … … 378 379 va_start(ap, level); 379 380 380 // We indent each message one space foe each level of the message.381 for (i = 0; i < level; i++) {382 putchar(' ');383 }384 385 381 // The following functions get the variable list of parameters with 386 382 // which this function was called, and print them to the standard 387 383 // output. 388 384 fmt = va_arg(ap, char *); 389 vprintf(fmt, ap); 385 386 if (traceFP != NULL) { 387 // We indent each message one space for each level of the message. 388 for (i = 0; i < level; i++) { 389 fprintf(traceFP, " "); 390 } 391 vfprintf(traceFP, fmt, ap); 392 } else { 393 // We indent each message one space for each level of the message. 394 for (i = 0; i < level; i++) { 395 putchar(' '); 396 } 397 vprintf(fmt, ap); 398 } 390 399 va_end(ap); 391 400 } … … 393 402 // NOTE: should we free *fmt as well? Read the man page. 394 403 } 404 405 void psTraceSetDestination(FILE *fp) 406 { 407 traceFP = fp; 408 } -
trunk/psLib/src/sysUtils/psTrace.h
r560 r885 55 55 ; 56 56 57 void psTraceSetDestination(FILE *fp); 58 59 57 60 /* \} */ // End of SystemGroup Functions 58 61 … … 67 70 68 71 #endif 72
Note:
See TracChangeset
for help on using the changeset viewer.
