示例#1
0
int main(int argc, char *argv[])
{
	fitsfile *fptr;
	int i, j, status, dataok, hduok, hdunum, hdutype;
	char *hdustr, *datastr;

	for (i=1; i<argc; i++) {

		fits_open_file(&fptr, argv[i], READONLY, &status);
		if (status) { 
			fits_report_error(stderr, status);
			exit(-1); 
		}

		fits_get_num_hdus(fptr, &hdunum, &status);
		if (status) { 
			fprintf(stderr, "Bad get_num_hdus status for '%s' = %d", 
				argv[i], status);
			exit(-1); 
		}

		for (j=0; j<hdunum; j++) {
			fits_movabs_hdu(fptr, hdunum, &hdutype, &status);
			if (status) { 
				fprintf(stderr, "Bad movabs status for '%s[%d]' = %d.", 
					argv[i], j, status);
				exit(-1);
			}
			fits_verify_chksum(fptr, &dataok, &hduok, &status);
			if (status) { 
				fprintf(stderr, "Bad verify status for '%s[%d]' = %d.", 
					argv[i], j, status);
				exit(-1);
			}
			datastr = verify_status(dataok);
			hdustr = verify_status(hduok);
			printf("Verifying '%s[%d]'  data='%s'   hdu='%s'.\n",
			       argv[i], j, datastr, hdustr);
		}
	}
}
示例#2
0
const struct tth *
verify_tth_digest(const struct verify *ctx)
{
	g_return_val_if_fail(verify_status(ctx) == VERIFY_DONE, NULL);
	return &verify_tth.digest;
}
示例#3
0
size_t
verify_tth_leave_count(const struct verify *ctx)
{
	g_return_val_if_fail(verify_status(ctx) == VERIFY_DONE, 0);
	return tt_leave_count(verify_tth.context);
}
示例#4
0
const struct tth *
verify_tth_leaves(const struct verify *ctx)
{
	g_return_val_if_fail(verify_status(ctx) == VERIFY_DONE, NULL);
	return tt_leaves(verify_tth.context);
}