Lines Matching refs:ip
74 struct openfile *ip; in main() local
94 for (ip = input; ip->fp != NULL; ip++) in main()
95 linep = gatherline(ip); in main()
99 fputs(ip->sepstring, stdout); in main()
108 struct openfile *ip = input; in getargs() local
122 ip->fp = stdin; in getargs()
123 else if ((ip->fp = fopen(p, "r")) == NULL) { in getargs()
126 if (caph_rights_limit(fileno(ip->fp), &rights_ro) < 0) in getargs()
128 ip->pad = P; in getargs()
129 if (!ip->sepstring) in getargs()
130 ip->sepstring = (S ? (ip-1)->sepstring : ""); in getargs()
131 if (!ip->format) in getargs()
132 ip->format = ((P || F) ? (ip-1)->format : "%s"); in getargs()
133 if (!ip->eol) in getargs()
134 ip->eol = (T ? (ip-1)->eol : '\n'); in getargs()
135 ip++; in getargs()
142 ip->sepstring = p; in getargs()
149 ip->eol = *p; in getargs()
156 ip->pad = 1; in getargs()
171 ip->format = fmtp; in getargs()
180 ip->fp = NULL; in getargs()
181 if (!ip->sepstring) in getargs()
182 ip->sepstring = ""; in getargs()
186 pad(struct openfile *ip) in pad() argument
190 strlcpy(lp, ip->sepstring, line + sizeof(line) - lp); in pad()
192 if (ip->pad) { in pad()
193 snprintf(lp, line + sizeof(line) - lp, ip->format, ""); in pad()
200 gatherline(struct openfile *ip) in gatherline() argument
208 if (ip->eof) in gatherline()
209 return (pad(ip)); in gatherline()
210 for (p = s; (c = fgetc(ip->fp)) != EOF && p < end; p++) in gatherline()
211 if ((*p = c) == ip->eol) in gatherline()
215 ip->eof = 1; in gatherline()
216 if (ferror(ip->fp)) { in gatherline()
219 if (ip->fp == stdin) in gatherline()
222 return (pad(ip)); in gatherline()
224 strlcpy(lp, ip->sepstring, line + sizeof(line) - lp); in gatherline()
226 snprintf(lp, line + sizeof(line) - lp, ip->format, s); in gatherline()