Commit 884bbd65 authored by Ole Streicher's avatar Ole Streicher

New upstream version 4.18

parent 95878a66
......@@ -245,7 +245,7 @@ void get_toolname(char *taskname)
void get_toolversion(char *taskvers);
void get_toolversion(char *taskvers)
{
strcpy(taskvers, "4.16");
strcpy(taskvers, "4.18");
return;
}
......
......@@ -96,6 +96,11 @@ HISTORY
* 2013-08-12 W Pence v4.17
* Ignore blank keywords preceding the END keyword.
* Support (partially at least) files with PCOUNT > 2GB.
* 2016-04-13 B Irby v4.18
* Change verify_fits from void to int; check return
* status for abort conditions and set nerrs (as it
* is not set by close_report) in this case for the
* one-line file summary.
*/
#define TOOLSUB ftverify
......@@ -138,7 +143,7 @@ int ftverify (void)
char errreport[PIL_LINESIZE];
static char taskname[80] = "ftverify";
static char version[8] = "4.17";
static char version[8] = "4.18";
/* Register taskname and version. */
......@@ -240,7 +245,7 @@ int ftverify_work(
FILE *runfile = 0;
FILE *outfptr = 0;
FILE *list=0;
int status = 0, filestatus, runnum;
int status = 0, vfstatus = 0, filestatus, runnum;
char * p;
char task[80],runchars[30];
char tversion[80];
......@@ -336,10 +341,18 @@ int ftverify_work(
/* process each file */
if (list == NULL) {
verify_fits(infile,outfptr);
vfstatus = verify_fits(infile,outfptr);
if (outfptr == NULL) { /* print one-line file summary */
nerrs = get_total_err();
/* verify_fits returns a non-zero status for catastrophic
* file I/O problems (an abort), and in this case total_err
* is not updated via close_report(), so we need to set
* nerrs accordingly for the one-line file summary. */
if (vfstatus) nerrs = 1; else nerrs = get_total_err();
nwarns = get_total_warn();
filestatus = ((nerrs+nwarns)>0) ? 1 : 0;
if (filestatus)
{
......@@ -356,11 +369,18 @@ int ftverify_work(
}
else {
while((p = fgets(infile, FLEN_FILENAME, list))!= NULL) {
verify_fits(infile,outfptr);
vfstatus = verify_fits(infile,outfptr);
if (outfptr == NULL) { /* print one-line file summary */
nerrs = get_total_err();
/* verify_fits returns a non-zero status for catastrophic
* file I/O problems (an abort), and in this case total_err
* is not updated via close_report(), so we need to set
* nerrs accordingly for the one-line file summary. */
if (vfstatus) nerrs = 1; else nerrs = get_total_err();
nwarns = get_total_warn();
filestatus = ((nerrs+nwarns) >0) ? 1 : 0;
if (filestatus)
{
......
......@@ -120,7 +120,7 @@ typedef struct {
int index;
}ColName;
void verify_fits(char *infile, FILE *out);
int verify_fits(char *infile, FILE *out);
void leave_early (FILE* out);
void close_err(FILE* out);
void init_hdu(fitsfile *infits, FILE *out, int hdunum, int hdutype,
......
......@@ -36,7 +36,7 @@ static int curtype; /* current HDU type */
*
*******************************************************************************/
/* routine to verify individual fitsfile */
void verify_fits(char *infile, FILE *out)
int verify_fits(char *infile, FILE *out)
{
char rootnam[FLEN_FILENAME] = ""; /* Input Fits file root name */
fitsfile *infits; /* input fits file pointer */
......@@ -56,7 +56,7 @@ void verify_fits(char *infile, FILE *out)
pfile = p;
p += (len -1);
for (i = len - 1; i >= 0 && isspace((int)*p); i--) {*p = '\0'; p--;}
if(!strlen(pfile)) return;
if(!strlen(pfile)) return status;
#ifndef WEBTOOL
wrtout(out," ");
......@@ -70,20 +70,23 @@ void verify_fits(char *infile, FILE *out)
if(ffrtnm(pfile, rootnam, &status)) {
wrtserr(out,"",&status,2);
leave_early(out);
return;
status = 1;
return status;
}
if(fits_open_file(&infits, rootnam, READONLY, &status)) {
wrtserr(out,"",&status,2);
leave_early(out);
return;
status = 1;
return status;
}
/* get the total hdus */
if(fits_get_num_hdus(infits, &totalhdu, &status)) {
wrtserr(out,"",&status,2);
leave_early(out);
return;
status = 1;
return status;
}
/* initialize the report */
......@@ -135,6 +138,8 @@ void verify_fits(char *infile, FILE *out)
/* close the input fitsfile */
fits_close_file(infits, &status);
return status;
}
void leave_early (FILE* out)
......@@ -1826,6 +1831,7 @@ void test_tbl(fitsfile *infits, /* input fits file */
strchr(tform[i],'M') == NULL &&
strchr(tform[i],'I') == NULL &&
strchr(tform[i],'J') == NULL &&
strchr(tform[i],'K') == NULL &&
strchr(tform[i],'B') == NULL &&
strchr(tform[i],'X') == NULL ){
sprintf(errmes,
......@@ -1870,6 +1876,7 @@ void test_tbl(fitsfile *infits, /* input fits file */
strchr(tform[i],'M') == NULL &&
strchr(tform[i],'I') == NULL &&
strchr(tform[i],'J') == NULL &&
strchr(tform[i],'K') == NULL &&
strchr(tform[i],'B') == NULL &&
strchr(tform[i],'X') == NULL ){
sprintf(errmes,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment