• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/lukemftp-14/tnftp/libedit/

Lines Matching refs:el

43 #include "el.h"
49 hist_init(EditLine *el)
52 el->el_history.fun = NULL;
53 el->el_history.ref = NULL;
54 el->el_history.buf = (char *) el_malloc(EL_BUFSIZ);
55 el->el_history.sz = EL_BUFSIZ;
56 if (el->el_history.buf == NULL)
58 el->el_history.last = el->el_history.buf;
67 hist_end(EditLine *el)
70 el_free((ptr_t) el->el_history.buf);
71 el->el_history.buf = NULL;
79 hist_set(EditLine *el, hist_fun_t fun, ptr_t ptr)
82 el->el_history.ref = ptr;
83 el->el_history.fun = fun;
93 hist_get(EditLine *el)
98 if (el->el_history.eventno == 0) { /* if really the current line */
99 (void) strncpy(el->el_line.buffer, el->el_history.buf,
100 el->el_history.sz);
101 el->el_line.lastchar = el->el_line.buffer +
102 (el->el_history.last - el->el_history.buf);
105 if (el->el_map.type == MAP_VI)
106 el->el_line.cursor = el->el_line.buffer;
109 el->el_line.cursor = el->el_line.lastchar;
113 if (el->el_history.ref == NULL)
116 hp = HIST_FIRST(el);
121 for (h = 1; h < el->el_history.eventno; h++)
122 if ((hp = HIST_NEXT(el)) == NULL) {
123 el->el_history.eventno = h;
126 (void) strlcpy(el->el_line.buffer, hp,
127 (size_t)(el->el_line.limit - el->el_line.buffer));
128 el->el_line.lastchar = el->el_line.buffer + strlen(el->el_line.buffer);
130 if (el->el_line.lastchar > el->el_line.buffer
131 && el->el_line.lastchar[-1] == '\n')
132 el->el_line.lastchar--;
133 if (el->el_line.lastchar > el->el_line.buffer
134 && el->el_line.lastchar[-1] == ' ')
135 el->el_line.lastchar--;
137 if (el->el_map.type == MAP_VI)
138 el->el_line.cursor = el->el_line.buffer;
141 el->el_line.cursor = el->el_line.lastchar;
151 hist_command(EditLine *el, int argc, const char **argv)
157 if (el->el_history.ref == NULL)
163 for (str = HIST_LAST(el); str != NULL; str = HIST_PREV(el))
164 (void) fprintf(el->el_outfile, "%d %s",
165 el->el_history.ev.num, str);
175 return history(el->el_history.ref, &ev, H_SETSIZE, num);
178 return history(el->el_history.ref, &ev, H_SETUNIQUE, num);
189 hist_enlargebuf(EditLine *el, size_t oldsz, size_t newsz)
193 newbuf = realloc(el->el_history.buf, newsz);
199 el->el_history.last = newbuf +
200 (el->el_history.last - el->el_history.buf);
201 el->el_history.buf = newbuf;
202 el->el_history.sz = newsz;