Changeset 10020
- Timestamp:
- Nov 16, 2006, 2:22:32 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pzgetexp.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pzgetexp.c
r10013 r10020 31 31 #define PRODUCT_LS_CMD "dsproductls" 32 32 33 static bool go (pxConfig *config); 33 34 static psArray *parseFileSets(pxConfig *config, const char *str); 34 35 35 36 int main(int argc, char **argv) 36 37 { 38 psLibInit(NULL); 39 37 40 pxConfig *config = pzgetexpConfig(NULL, argc, argv); 38 41 42 if (!go(config)) { 43 goto FAIL; 44 } 45 46 psFree(config); 47 pmConfigDone(); 48 psLibFinalize(); 49 50 exit(EXIT_SUCCESS); 51 52 FAIL: 53 psFree(config); 54 pmConfigDone(); 55 psLibFinalize(); 56 57 exit(EXIT_FAILURE); 58 } 59 60 static bool go(pxConfig *config) 61 { 62 PS_ASSERT_PTR_NON_NULL(config, NULL); 39 63 // find last fileset/exp_id (if we have one) 40 64 bool haveLastFileSet = false; … … 75 99 } 76 100 77 // XXX debugging 78 fprintf(stderr, "cmd is: %s\n", cmd); 101 psTrace("pzgetexp", PS_LOG_INFO, "cmd is: %s\n", cmd); 79 102 80 103 FILE *output = popen(cmd, "r"); … … 214 237 psString line; 215 238 while ((line = psListGetAndIncrement(lineCursor))) { 239 psTrace("pzgetimfile", PS_LOG_INFO, "parsing line: %s\n", line); 240 216 241 // split line into tokens 217 242 psList *tokens = psStringSplit(line, " ", false); … … 286 311 } 287 312 313 // must be freed after the new metadata is built -- holds the strings 314 psFree(tokenCursor); 315 psFree(tokens); 316 288 317 // add the new metadata to the result set 289 318 psArrayAdd(summitExps, 0, md); 290 319 291 psFree(tokenCursor); 292 psFree(tokens); 320 // debugging 321 if (psTraceGetLevel("pzgetexp") == PS_LOG_INFO) { 322 psString doc = psMetadataConfigFormat(md); 323 psTrace("pzgetexp", PS_LOG_INFO, "parsed line as:\n %s\n", doc); 324 psFree(doc); 325 } 326 327 psFree(md); 293 328 294 329 }
Note:
See TracChangeset
for help on using the changeset viewer.
