Lines Matching refs:p

280 clear_line_control (struct line *p)  in clear_line_control()  argument
282 p->used = 0; in clear_line_control()
283 p->insert_index = 0; in clear_line_control()
284 p->retrieve_index = 0; in clear_line_control()
292 struct line *p = xmalloc (sizeof *p); in new_line_control() local
294 p->next = nullptr; in new_line_control()
295 clear_line_control (p); in new_line_control()
297 return p; in new_line_control()
427 struct buffer_record *p; in save_buffer() local
436 for (p = head; p->next; p = p->next) in save_buffer()
438 p->next = buf; in save_buffer()
471 char *p = b->buffer; in load_buffer() local
476 p = mempcpy (p, hold_area, hold_count); in load_buffer()
482 b->bytes_used += read_input (p, bytes_avail - 1); in load_buffer()
669 handle_line_error (const struct control *p, intmax_t repetition) in handle_line_error() argument
674 program_name, quote (imaxtostr (p->lines_required, buf))); in handle_line_error()
689 process_line_count (const struct control *p, intmax_t repetition) in process_line_count() argument
692 intmax_t last_line_to_save = p->lines_required * (repetition + 1); in process_line_count()
700 handle_line_error (p, repetition); in process_line_count()
707 handle_line_error (p, repetition); in process_line_count()
719 handle_line_error (p, repetition); in process_line_count()
723 regexp_error (struct control *p, intmax_t repetition, bool ignore) in regexp_error() argument
726 program_name, quote (global_argv[p->argnum])); in regexp_error()
749 process_regexp (struct control *p, intmax_t repetition) in process_regexp() argument
754 bool ignore = p->ignore; /* If true, skip this section. */ in process_regexp()
763 if (p->offset >= 0) in process_regexp()
770 if (p->repeat_forever) in process_regexp()
780 regexp_error (p, repetition, ignore); in process_regexp()
785 ret = re_search (&p->re_compiled, line->str, line_len, in process_regexp()
810 if (p->repeat_forever) in process_regexp()
820 regexp_error (p, repetition, ignore); in process_regexp()
825 ret = re_search (&p->re_compiled, line->str, line_len, in process_regexp()
838 break_line = current_line + p->offset; in process_regexp()
840 write_to_file (break_line, ignore, p->argnum); in process_regexp()
845 if (p->offset > 0) in process_regexp()
1022 struct control *p; in new_control_record() local
1026 p = &controls[control_used++]; in new_control_record()
1027 p->regexpr = false; in new_control_record()
1028 p->repeat = 0; in new_control_record()
1029 p->repeat_forever = false; in new_control_record()
1030 p->lines_required = 0; in new_control_record()
1031 p->offset = 0; in new_control_record()
1032 return p; in new_control_record()
1041 check_for_offset (struct control *p, char const *str, char const *num) in check_for_offset() argument
1043 if (xstrtoimax (num, nullptr, 10, &p->offset, "") != LONGINT_OK) in check_for_offset()
1054 parse_repeat_count (int argnum, struct control *p, char *str) in parse_repeat_count() argument
1065 p->repeat_forever = true; in parse_repeat_count()
1076 p->repeat = val; in parse_repeat_count()
1094 struct control *p; in extract_regexp() local
1103 p = new_control_record (); in extract_regexp()
1104 p->argnum = argnum; in extract_regexp()
1105 p->ignore = ignore; in extract_regexp()
1107 p->regexpr = true; in extract_regexp()
1108 p->re_compiled.buffer = nullptr; in extract_regexp()
1109 p->re_compiled.allocated = 0; in extract_regexp()
1110 p->re_compiled.fastmap = xmalloc (UCHAR_MAX + 1); in extract_regexp()
1111 p->re_compiled.translate = nullptr; in extract_regexp()
1114 err = re_compile_pattern (str + 1, len, &p->re_compiled); in extract_regexp()
1122 check_for_offset (p, str, closing_delim + 1); in extract_regexp()
1124 return p; in extract_regexp()
1133 struct control *p; /* New control record created. */ in parse_patterns() local
1140 p = extract_regexp (i, *argv[i] == '%', argv[i]); in parse_patterns()
1144 p = new_control_record (); in parse_patterns()
1145 p->argnum = i; in parse_patterns()
1170 p->lines_required = val; in parse_patterns()
1177 parse_repeat_count (i, p, argv[i]); in parse_patterns()