Changeset 28529 for trunk/ippToPsps/src/ippToPsps.c
- Timestamp:
- Jun 28, 2010, 4:26:47 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/src/ippToPsps.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/src/ippToPsps.c
r28249 r28529 53 53 } 54 54 55 // save XML document for results 56 if (this->resultsXmlDoc) { 57 58 xmlSaveFormatFileEnc(this->resultsPath, this->resultsXmlDoc, "UTF-8", 1); 59 60 xmlFreeDoc(this->resultsXmlDoc); 61 xmlCleanupParser(); 62 xmlMemoryDump(); 63 } 64 55 65 psFree(this->fitsInPath); 56 66 psFree(this->resultsPath); … … 59 69 psFree(this->pmconfig); 60 70 61 if (this->resultsFile) fclose(this->resultsFile);62 71 63 72 for(uint32_t i=0; i<this->numOfInputFiles; i++) … … 246 255 this->fitsInPath = NULL; 247 256 this->resultsPath = NULL; 248 this->results File= NULL;257 this->resultsXmlDoc = NULL; 249 258 this->numOfInputFiles = 0; 250 259 this->inputFiles = NULL; … … 304 313 } 305 314 315 // create a config object 306 316 this->config = ippToPspsConfig_Constructor(this->configsDir); 307 317 if (this->config == NULL) { … … 311 321 } 312 322 313 // ready results file, if necessary323 // create XML document for results 314 324 if (this->resultsPath) { 315 325 316 this->resultsFile = fopen (this->resultsPath, "w+"); 317 318 if (this->resultsFile == NULL) { 319 320 psError(PS_ERR_UNKNOWN, false, "Unable to open results file at %s", this->resultsPath); 321 // not essential to write results, so don't bail out 322 } 323 else { 324 if (fprintf(this->resultsFile, "%s\n", outputName) < 1 ) 325 psError(PS_ERR_IO, false, "Unable to write FITS output filename to'%s'\n", this->resultsPath); 326 } 326 this->resultsXmlDoc = xmlNewDoc(BAD_CAST "1.0"); 327 xmlNodePtr rootNode = xmlNewNode(NULL, BAD_CAST "ippToPsps_Results"); 328 xmlDocSetRootElement(this->resultsXmlDoc, rootNode); 329 xmlNewChild(rootNode, NULL, BAD_CAST "filename", BAD_CAST outputName); 327 330 } 328 331
Note:
See TracChangeset
for help on using the changeset viewer.
