Lines Matching refs:file

39 "[+?The \ajoin field\a is a field in each file on which files are compared. "
58 "\alist\a consists of a file number (either 1 or 2), a period, "
67 "[a:unpairable]#[fileno?Write a line for each unpairable line in file"
71 "[v:suppress]#[fileno?Write a line for each unpairable line in file"
163 File_t file[2];
169 if (jp->file[0].iop && jp->file[0].iop != sfstdin)
170 sfclose(jp->file[0].iop);
171 if (jp->file[1].iop && jp->file[1].iop != sfstdin)
172 sfclose(jp->file[1].iop);
175 if (jp->file[0].fields)
176 free(jp->file[0].fields);
177 if (jp->file[1].fields)
178 free(jp->file[1].fields);
200 if (!(jp->file[0].fields = newof(0, Field_t, NFIELD + 1, 0)) ||
201 !(jp->file[1].fields = newof(0, Field_t, NFIELD + 1, 0)))
206 jp->file[0].maxfields = NFIELD;
207 jp->file[1].maxfields = NFIELD;
292 * read in a record from file <index> and split into fields
298 register File_t* fp = &jp->file[index];
462 #define getrec(p,n,d) (u1 = getrec(p, n, d), sfprintf(sfstdout, "[G%d#%d@%I*d:%-.8s]", __LINE__, n, sizeof(Sfoff_t), sftell(p->file[n].iop), u1), u1)
466 * print field <n> from file <index>
471 register File_t* fp = &jp->file[index];
569 if (mode < 0 && jp->file[0].hit++)
571 if (mode > 0 && jp->file[1].hit++)
580 j = jp->file[i].field;
586 jp->file[i].nfields :
594 k = jp->file[0].nfields;
596 k += jp->file[1].nfields - 1;
599 fp = &jp->file[i];
636 #define outrec(p,n) (sfprintf(sfstdout, "[R#%d,%d,%lld,%lld:%-.*s{%d}:%-.*s{%d}]", __LINE__, i1=n, lo, hi, jp->file[0].fieldlen, cp1, jp->file[0].hit, jp->file[1].fieldlen, cp2, jp->file[1].hit), outrec(p, i1))
655 n1 = jp->file[0].fieldlen;
656 n2 = jp->file[1].fieldlen;
674 n1 = jp->file[0].fieldlen;
680 if (sfseek(jp->file[0].iop, (Sfoff_t)-jp->file[0].reclen, SEEK_CUR) < 0 || !(cp1 = getrec(jp, 0, 0)))
682 error(ERROR_SYSTEM|2, "%s: seek error", jp->file[0].name);
690 if ((lo = sfseek(jp->file[1].iop, (Sfoff_t)0, SEEK_CUR)) < 0)
692 error(ERROR_SYSTEM|2, "%s: seek error", jp->file[1].name);
695 lo -= jp->file[1].reclen;
699 n2 = jp->file[1].fieldlen;
724 n2 = jp->file[1].fieldlen;
731 if (sfseek(jp->file[1].iop, hi, SEEK_SET) != hi)
733 error(ERROR_SYSTEM|2, "%s: seek error", jp->file[1].name);
743 n2 = jp->file[1].fieldlen;
755 n1 = jp->file[0].fieldlen;
760 if ((hi = sfseek(jp->file[1].iop, (Sfoff_t)0, SEEK_CUR)) < 0 ||
761 (hi -= jp->file[1].reclen) < 0 ||
762 sfseek(jp->file[1].iop, lo, SEEK_SET) != lo ||
765 error(ERROR_SYSTEM|2, "%s: seek error", jp->file[1].name);
768 n2 = jp->file[1].fieldlen;
770 if (jp->file[1].discard)
771 sfseek(jp->file[1].iop, (Sfoff_t)-1, SEEK_SET);
779 n1 = jp->file[0].fieldlen;
788 sfseek(jp->file[1].iop, (Sfoff_t)0, SEEK_CUR) < hi &&
789 sfseek(jp->file[1].iop, hi, SEEK_SET) != hi)
791 error(ERROR_SYSTEM|2, "%s: seek error", jp->file[1].name);
797 cp1 = (!cp1 && cmp && hi < 0 && !jp->file[1].hit && ((jp->ooutmode ^ C_ALL) <= 1 || jp->outmode == 2)) ? cp2 : getrec(jp, 1, 0);
811 if (cp1 && jp->file[n].iop == sfstdin)
878 jp->file[0].field = (int)(opt_info.num-1);
886 jp->file[n-'1'].field = (int)(opt_info.num-1);
893 error(2,"%s: file number must be 1 or 2", opt_info.name);
945 jp->file[0].name = cp = *argv++;
953 jp->file[0].discard = 1;
955 jp->file[0].iop = sfstdin;
957 else if (!(jp->file[0].iop = sfopen(NiL, cp, "r")))
962 jp->file[1].name = cp = *argv;
970 jp->file[1].discard = 1;
972 jp->file[1].iop = sfstdin;
974 else if (!(jp->file[1].iop = sfopen(NiL, cp, "r")))
981 sfsetbuf(jp->file[0].iop, jp->file[0].iop, SF_UNBOUND);
982 sfsetbuf(jp->file[1].iop, jp->file[1].iop, SF_UNBOUND);
992 else if (jp->file[0].iop==sfstdin || jp->file[1].iop==sfstdin)