/external/mksh/src/ |
D | shf.c | 39 static int shf_fillbuf(struct shf *); 40 static int shf_emptybuf(struct shf *, int); 47 struct shf * 50 struct shf *shf; in shf_open() local 57 shf = alloc(sizeof(struct shf) + bsize, ATEMP); in shf_open() 58 shf->areap = ATEMP; in shf_open() 59 shf->buf = (unsigned char *)&shf[1]; in shf_open() 60 shf->bsize = bsize; in shf_open() 61 shf->flags = SHF_ALLOCS; in shf_open() 66 afree(shf, shf->areap); in shf_open() [all …]
|
D | tree.c | 30 static void ptree(struct op *, int, struct shf *); 31 static void pioact(struct shf *, int, struct ioword *); 32 static const char *wdvarput(struct shf *, const char *, int, int); 33 static void vfptreef(struct shf *, int, const char *, va_list); 46 ptree(struct op *t, int indent, struct shf *shf) in ptree() argument 73 fptreef(shf, indent, "%S", t->vars[0]); in ptree() 80 fptreef(shf, indent, "%S ", *w++); in ptree() 82 shf_puts("#no-vars# ", shf); in ptree() 86 fptreef(shf, indent, "%S ", *w++); in ptree() 88 shf_puts("#no-args# ", shf); in ptree() [all …]
|
D | sh.h | 821 struct shf *shf; member 1025 #define shf_fileno(shf) ((shf)->fd) argument 1026 #define shf_setfileno(shf,nfd) ((shf)->fd = (nfd)) argument 1027 #define shf_getc_i(shf) ((shf)->rnleft > 0 ? \ argument 1028 (shf)->rnleft--, *(shf)->rp++ : \ 1029 shf_getchar(shf)) 1030 #define shf_putc_i(c, shf) ((shf)->wnleft == 0 ? \ argument 1031 shf_putchar((c), (shf)) : \ 1032 ((shf)->wnleft--, *(shf)->wp++ = (c))) 1033 #define shf_eof(shf) ((shf)->flags & SHF_EOF) argument [all …]
|
D | main.c | 483 s->u.shf = shf_open(s->file, O_RDONLY, 0, in main_init() 485 if (s->u.shf == NULL) { in main_init() 497 s->u.shf = shf_fdopen(0, SHF_RD | can_seek(0), in main_init() 503 s->u.shf->flags |= SHF_INTERRUPT; in main_init() 677 struct shf *shf; in include() local 682 shf = shf_open(name, O_RDONLY, 0, SHF_MAPHI | SHF_CLEXEC); in include() 683 if (shf == NULL) in include() 695 quitenv(s ? s->u.shf : NULL); in include() 728 s->u.shf = shf; in include() 731 quitenv(s->u.shf); in include() [all …]
|
D | eval.c | 41 struct shf *shf; /* file */ member 421 struct shf shf; in expand() local 423 shf_sopen(NULL, 0, SHF_WR|SHF_DYNAMIC, &shf); in expand() 424 print_value_quoted(&shf, str_val(st->var)); in expand() 425 x.str = shf_sclose(&shf); in expand() 858 while ((c = shf_getc(x.u.shf)) == 0 || c == '\n') in expand() 863 shf_ungetc(c, x.u.shf); in expand() 870 shf_close(x.u.shf); in expand() 1290 struct shf *shf; in comsub() local 1317 shf = shf_open(name = evalstr(io->name, DOTILDE), O_RDONLY, 0, in comsub() [all …]
|
D | misc.c | 1053 print_value_quoted(struct shf *shf, const char *s) in print_value_quoted() argument 1068 shf_puts(s, shf); in print_value_quoted() 1081 shf_putc('\'', shf); in print_value_quoted() 1084 shf_putc('\\', shf); in print_value_quoted() 1086 shf_putc('\'', shf); in print_value_quoted() 1089 shf_putc(c, shf); in print_value_quoted() 1096 shf_putc('$', shf); in print_value_quoted() 1097 shf_putc('\'', shf); in print_value_quoted() 1103 shf_fprintf(shf, "\\u%04X", wc); in print_value_quoted() 1143 shf_putc('\\', shf); in print_value_quoted() [all …]
|
D | histrap.c | 90 struct shf *shf; in c_fc() local 298 if (!(shf = tf->shf)) { in c_fc() 305 shf_fprintf(shf, "%s\n", *hp); in c_fc() 306 if (shf_close(shf) == EOF) { in c_fc() 332 if (!(shf = shf_open(tf->tffn, O_RDONLY, 0, 0))) { in c_fc() 347 while ((n = shf_read(xp, Xnleft(xs, xp), shf)) > 0) { in c_fc() 354 "read", tf->tffn, cstrerror(shf_errno(shf))); in c_fc() 356 shf_close(shf); in c_fc() 359 shf_close(shf); in c_fc()
|
D | lex.c | 1392 char *p = shf_getse(xp, Xnleft(s->xs, xp), s->u.shf); in getsc_line() 1394 if (!p && shf_error(s->u.shf) && in getsc_line() 1395 shf_errno(s->u.shf) == EINTR) { in getsc_line() 1396 shf_clearerr(s->u.shf); in getsc_line() 1418 shf_flush(s->u.shf); in getsc_line() 1436 shf_fdclose(s->u.shf); in getsc_line() 1469 struct shf *shf; in set_prompt() local 1474 shf = shf_sopen(NULL, strlen(ps1) * 2, in set_prompt() 1478 shf_putchar(*ps1++, shf); in set_prompt() 1480 shf_fprintf(shf, "%d", in set_prompt() [all …]
|
D | jobs.c | 136 static struct shf *shl_j; 146 static void j_print(Job *, int, struct shf *); 1458 j_print(Job *j, int how, struct shf *shf) in j_print() argument 1475 shf_fprintf(shf, "%d\n", (int)(j->pgrp ? j->pgrp : in j_print() 1528 shf_fprintf(shf, "[%d] %c ", j->job, jobchar); in j_print() 1530 shf_puts(filler, shf); in j_print() 1534 shf_fprintf(shf, "%5d ", (int)p->pid); in j_print() 1539 shf_fprintf(shf, "%s%s ", in j_print() 1544 shf_fprintf(shf, "%-20s %s%s%s", buf, p->command, in j_print() 1554 shf_fprintf(shf, "%s%5d %-20s %s%s", filler, in j_print() [all …]
|
D | exec.c | 1435 hereinval(const char *content, int sub, char **resbuf, struct shf *shf) in hereinval() argument 1444 quitenv(shf); in hereinval() 1460 shf_puts(ccp, shf); in hereinval() 1472 struct shf *shf; in herein() local 1495 if (!(shf = h->shf) || (fd = open(h->tffn, O_RDONLY, 0)) < 0) { in herein() 1498 !shf ? "create" : "open", h->tffn, cstrerror(i)); in herein() 1499 if (shf) in herein() 1500 shf_close(shf); in herein() 1505 if (hereinval(iop->heredoc, i, NULL, shf) == -2) { in herein() 1511 if (shf_close(shf) == EOF) { in herein()
|
D | funcs.c | 222 static void p_time(struct shf *, bool, long, int, int, 2490 p_time(struct shf *shf, bool posix, long tv_sec, int tv_usec, int width, in p_time() argument 2495 shf_fprintf(shf, "%s%*ld.%02d%s", prefix, width, in p_time() 2498 shf_fprintf(shf, "%s%*ldm%d.%02ds%s", prefix, width, in p_time()
|
/external/mksh/ |
D | Android.mk | 30 src/lex.c src/main.c src/misc.c src/shf.c \
|