Changeset 7924 for trunk/ppStats/src/ppStatsLoop.c
- Timestamp:
- Jul 17, 2006, 5:01:41 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ppStats/src/ppStatsLoop.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStats/src/ppStatsLoop.c
r7910 r7924 1 1 #include <stdio.h> 2 #include <string.h> 2 3 #include <pslib.h> 3 4 #include <psmodules.h> … … 22 23 } 23 24 25 static bool doThis(psList *toDoList, // List of things to do 26 const char *this // The name of "this" 27 ) 28 { 29 if (psListLength(toDoList) == 0) { 30 // No list --- do everything 31 return true; 32 } 33 34 psListIterator *iterator = psListIteratorAlloc(toDoList, PS_LIST_HEAD, false); // Iterator 35 psString test; // Test string, from iteration 36 while ((test = psListGetAndIncrement(iterator))) { 37 if (strcmp(this, test) == 0) { 38 // It's in the list --- do it 39 psFree(iterator); 40 return true; 41 } 42 } 43 psFree(iterator); 44 // Couldn't find it --- don't do it 45 return false; 46 } 47 24 48 25 49 void ppStatsLoop(ppStatsData *data, // The data … … 51 75 } 52 76 const char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of chip 77 78 // Check to see if this is a chip of interest 79 if (!doThis(data->chips, chipName)) { 80 continue; 81 } 82 53 83 psMetadata *chipResults = psMetadataAlloc(); // Metadata to hold the chip-level results 54 84 … … 69 99 } 70 100 const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of cell 101 102 // Check to see if this is a cell of interest 103 if (!doThis(data->cells, cellName)) { 104 continue; 105 } 106 71 107 psMetadata *cellResults = psMetadataAlloc(); // Metadata to hold the cell-level results 72 108 … … 84 120 if (!data->doStats) { 85 121 // Nothing further to do --- don't want to waste our time reading the data 122 continue; 123 } 124 125 pmHDU *hdu = pmHDUFromCell(cell); // HDU for cell 126 if (!hdu || hdu->blankPHU) { 86 127 continue; 87 128 } … … 192 233 psFree(conceptsIter); 193 234 235 if (psListLength(fpaResults->list) == 0) { 236 psError(PS_ERR_UNKNOWN, true, "No output.\n"); 237 return; 238 } 239 194 240 psString output = psMetadataConfigFormat(fpaResults); 195 241 psFree(fpaResults);
Note:
See TracChangeset
for help on using the changeset viewer.
