Lines Matching refs:hp
79 char **hfirst, **hlast, **hp;
158 hp = first ? hist_get(first, false, false) :
160 if (!hp)
162 return (hist_replace(hp, pat, rep, gflag));
209 for (hp = rflag ? hlast : hfirst;
210 hp >= hfirst && hp <= hlast; hp += rflag ? -1 : 1) {
213 hist_source->line - (int)(histptr - hp));
216 s = *hp;
237 for (hp = rflag ? hlast : hfirst;
238 hp >= hfirst && hp <= hlast; hp += rflag ? -1 : 1)
239 shf_fprintf(shf, "%s\n", *hp);
328 hist_replace(char **hp, const char *pat, const char *rep, bool globr)
333 strdupx(line, *hp, ATEMP);
344 for (s = *hp; (s1 = strstr(s, pat)) && (!any_subst || globr);
374 char **hp = NULL;
378 hp = histptr + (n < 0 ? n : (n - hist_source->line));
379 if ((ptrdiff_t)hp < (ptrdiff_t)history) {
381 hp = hist_get_oldest();
384 hp = NULL;
386 } else if ((ptrdiff_t)hp > (ptrdiff_t)histptr) {
388 hp = hist_get_newest(allow_cur);
391 hp = NULL;
393 } else if (!allow_cur && hp == histptr) {
395 hp = NULL;
404 hp = &history[n];
406 return (hp);
478 char **hp;
486 hp = &history[start];
487 for (; hp >= history && hp <= histptr; hp += incr)
488 if ((anchored && strncmp(*hp, str, len) == 0) ||
489 (!anchored && strstr(*hp, str)))
490 return (hp - history);
624 char **hp;
646 hp = histptr;
648 if (++hp >= history + histsize) { /* remove oldest command */
650 for (hp = history; hp < history + histsize - 1; hp++)
651 hp[0] = hp[1];
653 *hp = c;
654 histptr = hp;
937 char **hp;
940 hp = &histptr[lno - s->line];
941 if (*hp)
942 afree(*hp, APERM);
943 strdupx(*hp, line, APERM);