Lines Matching +full:1 +full:p1

10  * 1. Redistributions of source code must retain the above copyright
50 char buf[2048 + 1]; in addfile()
53 err(1, "%s", name); in addfile()
78 if ((tfs = calloc(1, sizeof(FS))) == NULL) in add()
79 err(1, NULL); in add()
95 if ((tfu = calloc(1, sizeof(FU))) == NULL) in add()
96 err(1, NULL); in add()
99 tfu->reps = 1; in add()
133 if (!(tfu->fmt = malloc(p - savep + 1))) in add()
134 err(1, NULL); in add()
135 (void) strlcpy(tfu->fmt, savep, p - savep + 1); in add()
164 while (*++fmt != 0 && strchr(spec + 1, *fmt) != NULL) in size()
174 bcnt += 1; in size()
189 bcnt += 1; in size()
205 unsigned char *p1, *p2, *fmtp; in rewrite() local
218 if ((pr = calloc(1, sizeof(PR))) == NULL) in rewrite()
219 err(1, NULL); in rewrite()
223 for (p1 = fmtp; *p1 && *p1 != '%'; ++p1); in rewrite()
226 if (!*p1) { in rewrite()
239 while (*++p1 != 0 && strchr(spec, *p1) != NULL) in rewrite()
241 if (*p1 == 0) in rewrite()
245 while (*++p1 != 0 && strchr(spec + 1, *p1) != NULL) in rewrite()
247 if (*p1 == 0) in rewrite()
249 if (*p1 == '.' && isdigit(*++p1)) { in rewrite()
251 prec = atoi(p1); in rewrite()
252 while (isdigit(*++p1)); in rewrite()
257 p2 = *p1 ? p1 + 1 : p1; /* Set end pointer -- make sure in rewrite()
260 cs[0] = *p1; /* Set conversion string. */ in rewrite()
261 cs[1] = '\0'; in rewrite()
272 case 0: case 1: in rewrite()
273 pr->bcnt = 1; in rewrite()
276 p1[1] = '\0'; in rewrite()
277 badcnt(p1); in rewrite()
286 cs[1] = cs[0]; in rewrite()
292 case 1: in rewrite()
293 pr->bcnt = 1; in rewrite()
302 p1[1] = '\0'; in rewrite()
303 badcnt(p1); in rewrite()
318 cs[1] = cs[0]; in rewrite()
322 p1[1] = '\0'; in rewrite()
323 badcnt(p1); in rewrite()
342 switch(p1[1]) { in rewrite()
350 switch(p1[2]) { in rewrite()
353 cs[1] = p1[2]; in rewrite()
357 p1[3] = '\0'; in rewrite()
358 badconv(p1); in rewrite()
373 case 0: case 1: in rewrite()
374 pr->bcnt = 1; in rewrite()
377 p1[2] = '\0'; in rewrite()
378 badcnt(p1); in rewrite()
382 p1[2] = '\0'; in rewrite()
383 badconv(p1); in rewrite()
387 p1[1] = '\0'; in rewrite()
388 badconv(p1); in rewrite()
396 p1[0] = '\0'; in rewrite()
397 if (asprintf(&pr->fmt, "%s%s", fmtp, cs) == -1) in rewrite()
398 err(1, NULL); in rewrite()
400 pr->cchar = pr->fmt + (p1 - fmtp); in rewrite()
405 errx(1, "byte count with multiple conversion characters"); in rewrite()
421 * If, rep count is greater than 1, no trailing whitespace in rewrite()
428 if (fu->reps > 1) { in rewrite()
432 for (p1 = pr->fmt, p2 = NULL; *p1; ++p1) in rewrite()
433 p2 = isspace(*p1) ? p1 : NULL; in rewrite()
449 escape(char *p1) in escape() argument
454 for (p2 = p1;; p1++, p2++) { in escape()
455 if (*p1 == '\\') { in escape()
456 p1++; in escape()
457 switch(*p1) { in escape()
485 *p2 = *p1; in escape()
489 *p2 = *p1; in escape()
490 if (*p1 == '\0') in escape()
499 errx(1, "%s: bad byte count", s); in badcnt()
505 errx(1, "%%s: requires a precision or a byte count"); in badsfmt()
511 errx(1, "\"%s\": bad format", fmt); in badfmt()
517 errx(1, "%%%s: bad conversion character", ch); in badconv()
523 errx(1, "missing conversion character"); in badnoconv()