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); } } }
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; }
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); }
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); }