#include "focas1.h" #include "match1.h" /* MEXTRACT -- Extract a single catalog */ mextract (input, output, n) char *input; char *output; int *n; { int i, j; FILE *fin, *fout; fin = mcatopen (input, 0); fout = catopen (output, 1); j = *n; for (i = 0; i < ncats; i++) { rdcathdr (fin, 1); if (i == j) { cmmnt ("mextract"); wtcathdr (fout, 0); } } for (;;) { if (rdmcatob (fin, &mentry, mob)) break; if (mob[j].entnum >= 0) wtcat (&mob[j], fout); } fclose (fin); fclose (fout); }