Lines Matching defs:buf

129 x_read(char *buf)
136 i = x_emacs(buf);
139 i = x_vi(buf);
201 x_do_comment(char *buf, ssize_t bsize, ssize_t *lenp)
210 if (buf[0] == '#') {
214 if (!saw_nl || buf[i] != '#')
215 buf[j++] = buf[i];
216 saw_nl = buf[i] == '\n';
225 if (buf[i] == '\n')
231 if (buf[i] == '\n')
232 buf[--j] = '#';
233 buf[--j] = buf[i];
235 buf[0] = '#';
564 x_locate_word(const char *buf, int buflen, int pos, int *startp,
582 for (; (start > 0 && IS_WORDC(buf[start - 1])) ||
583 (start > 1 && buf[start - 2] == '\\'); start--)
586 for (end = start; end < buflen && IS_WORDC(buf[end]); end++) {
587 if (buf[end] == '\\' && (end + 1) < buflen)
596 while (p >= 0 && ctype(buf[p], C_SPACE))
598 iscmd = p < 0 || ctype(buf[p], C_EDCMD);
606 if (mksh_cdirsep(buf[p]))
618 x_cf_glob(int *flagsp, const char *buf, int buflen, int pos, int *startp,
625 len = x_locate_word(buf, buflen, pos, startp, &is_command);
643 strndupx(toglob, buf + *startp, len + /* the '*' */ 1, ATEMP);
1213 unsigned char *buf = (unsigned char *)sbuf;
1215 memset(buf, 0, 4);
1216 buf[pos++] = c = x_e_getc();
1220 if ((rtt2asc(buf[0]) >= (unsigned char)0xC2) &&
1221 (rtt2asc(buf[0]) < (unsigned char)0xF0)) {
1229 buf[pos++] = c;
1231 if ((rtt2asc(buf[0]) >= (unsigned char)0xE0) &&
1232 (rtt2asc(buf[0]) < (unsigned char)0xF0)) {
1234 buf[pos++] = c = x_e_getc();
1264 x_emacs(char *buf)
1269 xbp = xbuf = buf;
1270 xend = buf + LINE;
1271 xlp = xcp = xep = buf;
3591 * The format of buf is the alias contents followed by a NUL byte followed
3597 unsigned char *p; /* current position in buf */
3598 unsigned char *buf; /* pointer to macro(s) being expanded */
3609 x_vi(char *buf)
3621 ebuf.cbuf = buf;
3702 if (vs->cbuf != buf)
3703 memcpy(buf, vs->cbuf, vs->linelen);
3705 buf[vs->linelen++] = '\n';
4224 macro.len - (macro.p - macro.buf);
4234 afree(macro.buf, AEDIT);
4240 macro.p = macro.buf = (unsigned char *)nbuf;
4939 putbuf(const char *buf, ssize_t len, bool repl)
4955 memmove(&vs->cbuf[vs->cursor], buf, len);
5360 static struct edstate *buf;
5365 if (cmd == 0 && expanded == EXPAND && buf) {
5366 restore_edstate(vs, buf);
5367 buf = 0;
5371 if (buf) {
5372 free_edstate(buf);
5373 buf = 0;
5384 buf = save_edstate(vs);
5399 i = buf->cursor - end;
5413 static struct edstate *buf;
5421 if (cmd == 0 && expanded == COMPLETE && buf) {
5422 print_expansions(buf, 0);
5426 if (cmd == 0 && expanded == PRINT && buf) {
5427 restore_edstate(vs, buf);
5428 buf = 0;
5432 if (buf) {
5433 free_edstate(buf);
5434 buf = 0;
5489 buf = save_edstate(vs);
5571 afree(macro.buf, AEDIT);