Home | History | Annotate | Download | only in src

Lines Matching refs:wp

75 c_true(const char **wp MKSH_A_UNUSED)
81 c_false(const char **wp MKSH_A_UNUSED)
226 c_pwd(const char **wp)
232 while ((optc = ksh_getopt(wp, &builtin_opt, "LP")) != -1)
243 wp += builtin_opt.optind;
245 if (wp[0]) {
269 c_print(const char **wp)
282 if (wp[0][0] == 'e') {
284 wp++;
301 if (*wp && !strcmp(*wp, "-n")) {
304 wp++;
322 while ((s = *wp) && *s == '-' && s[1]) {
339 wp++;
347 while ((optc = ksh_getopt(wp, &builtin_opt, opts)) != -1)
387 if (wp[builtin_opt.optind] &&
388 ksh_isdash(wp[builtin_opt.optind]))
392 wp += builtin_opt.optind;
397 while (*wp != NULL) {
398 s = *wp;
431 if (*++wp != NULL)
491 c_whence(const char **wp)
497 bool iam_whence = wp[0][0] == 'w';
500 while ((optc = ksh_getopt(wp, &builtin_opt, opts)) != -1)
514 wp += builtin_opt.optind;
531 while ((vflag || rv == 0) && (id = *wp++) != NULL) {
622 c_command(const char **wp)
628 return (c_whence(wp));
636 c_typeset(const char **wp)
646 switch (**wp) {
684 while ((i = ksh_getopt(wp, &builtin_opt, opts)) != -1) {
771 if (!(builtin_opt.info & GI_MINUSMINUS) && wp[builtin_opt.optind] &&
772 (wp[builtin_opt.optind][0] == '-' ||
773 wp[builtin_opt.optind][0] == '+') &&
774 wp[builtin_opt.optind][1] == '\0') {
775 thing = wp[builtin_opt.optind][0];
784 if (wp[builtin_opt.optind]) {
812 if (wp[builtin_opt.optind] &&
820 for (i = builtin_opt.optind; wp[i]; i++) {
822 f = findfunc(wp[i], hash(wp[i]),
835 wp[i], f->val.t);
838 } else if (!typeset(wp[i], fset, fclr, field, base)) {
839 bi_errorf("%s: %s", wp[i], "not identifier");
866 } else if (wp[builtin_opt.optind]) {
867 for (i = builtin_opt.optind; wp[i]; i++) {
868 varsearch(e->loc, &vp, wp[i], hash(wp[i]));
999 c_alias(const char **wp)
1008 while ((optc = ksh_getopt(wp, &builtin_opt, "dprtUx")) != -1) {
1045 wp += builtin_opt.optind;
1047 if (!(builtin_opt.info & GI_MINUSMINUS) && *wp &&
1048 (wp[0][0] == '-' || wp[0][0] == '+') && wp[0][1] == '\0') {
1049 prefix = wp[0][0];
1050 wp++;
1061 if (!tflag || *wp) {
1070 if (*wp == NULL) {
1086 for (; *wp != NULL; wp++) {
1087 const char *alias = *wp, *val, *newval;
1145 c_unalias(const char **wp)
1152 while ((optc = ksh_getopt(wp, &builtin_opt, "adt")) != -1)
1175 wp += builtin_opt.optind;
1177 for (; *wp != NULL; wp++) {
1178 ap = ktsearch(t, *wp, hash(*wp));
1207 c_let(const char **wp)
1212 if (wp[1] == NULL)
1216 for (wp++; *wp; wp++)
1217 if (!evaluate(*wp, &val, KSH_RETURN_ERROR, true)) {
1227 c_jobs(const char **wp)
1231 while ((optc = ksh_getopt(wp, &builtin_opt, "lpnz")) != -1)
1249 wp += builtin_opt.optind;
1250 if (!*wp) {
1254 for (; *wp; wp++)
1255 if (j_jobs(*wp, flag, nflag))
1263 c_fgbg(const char **wp)
1265 bool bg = strcmp(*wp, "bg") == 0;
1272 if (ksh_getopt(wp, &builtin_opt, null) == '?')
1274 wp += builtin_opt.optind;
1275 if (*wp)
1276 for (; *wp; wp++)
1277 rv = j_resume(*wp, bg);
1299 c_kill(const char **wp)
1307 if ((p = wp[1]) && *p == '-' && (ksh_isdigit(p[1]) ||
1313 i = (wp[2] && strcmp(wp[2], "--") == 0) ? 3 : 2;
1317 while ((optc = ksh_getopt(wp, &builtin_opt, "ls:")) != -1)
1334 if ((lflag && t) || (!wp[i] && !lflag)) {
1345 if (wp[i]) {
1346 for (; wp[i]; i++) {
1347 if (!bi_getn(wp[i], &n))
1386 for (; (p = wp[i]); i++) {
1414 c_getopts(const char **wp)
1421 if (ksh_getopt(wp, &builtin_opt, null) == '?')
1423 wp += builtin_opt.optind;
1425 opts = *wp++;
1431 var = *wp++;
1446 if (*wp == NULL)
1447 wp = e->loc->next->argv;
1449 *--wp = e->loc->next->argv[0];
1452 for (argc = 0; wp[argc]; argc++)
1456 user_opt.p > strlen(wp[user_opt.optind - 1]))) {
1462 optc = ksh_getopt(wp, &user_opt, opts);
1506 c_bind(const char **wp)
1516 while ((optc = ksh_getopt(wp, &builtin_opt,
1535 wp += builtin_opt.optind;
1537 if (*wp == NULL)
1545 for (; *wp != NULL; wp++) {
1546 if ((cp = cstrchr(*wp, '=')) == NULL)
1549 strdupx(up, *wp, ATEMP);
1550 up[cp++ - *wp] = '\0';
1552 if (x_bind(up ? up : *wp, cp,
1566 c_shift(const char **wp)
1573 if (ksh_getopt(wp, &builtin_opt, null) == '?')
1575 arg = wp[builtin_opt.optind];
1597 c_umask(const char **wp)
1604 while ((optc = ksh_getopt(wp, &builtin_opt, "S")) != -1)
1612 cp = wp[builtin_opt.optind];
1730 c_dot(const char **wp)
1735 if (ksh_getopt(wp, &builtin_opt, null) == '?')
1738 if ((cp = wp[builtin_opt.optind]) == NULL) {
1748 if (wp[builtin_opt.optind + 1]) {
1749 argv = wp + builtin_opt.optind;
1767 c_wait(const char **wp)
1771 if (ksh_getopt(wp, &builtin_opt, null) == '?')
1773 wp += builtin_opt.optind;
1774 if (*wp == NULL) {
1779 for (; *wp; wp++)
1780 rv = waitfor(*wp, &sig);
1790 c_read(const char **wp)
1814 while ((c = ksh_getopt(wp, &builtin_opt, c_read_opts)) != -1)
1869 wp += builtin_opt.optind;
1870 if (*wp == NULL)
1871 *--wp = REPLY;
1873 if (intoarray && wp[1] != NULL) {
1878 if ((ccp = cstrchr(*wp, '?')) != NULL) {
1879 strdupx(allocd, *wp, ATEMP);
1880 allocd[ccp - *wp] = '\0';
1881 *wp = allocd;
2047 vp = global(*wp);
2050 bi_errorf("read-only: %s", *wp);
2098 if (!intoarray && wp[1] == NULL)
2156 vq = global(*wp);
2161 typeset(*wp, EXPORT, 0, 0, 0);
2170 if (intoarray || *++wp != NULL)
2187 c_eval(const char **wp)
2193 if (ksh_getopt(wp, &builtin_opt, null) == '?')
2196 s->u.strv = wp + builtin_opt.optind;
2245 c_trap(const char **wp)
2251 if (ksh_getopt(wp, &builtin_opt, null) == '?')
2253 wp += builtin_opt.optind;
2255 if (*wp == NULL) {
2271 s = (gettrap(*wp, false) == NULL) ? *wp++ : NULL;
2277 wp != NULL)
2278 if ((p = gettrap(*wp++, true)) == NULL) {
2280 "bad signal", wp[-1]);
2288 c_exitreturn(const char **wp)
2293 if (ksh_getopt(wp, &builtin_opt, null) == '?')
2295 arg = wp[builtin_opt.optind];
2305 if (wp[0][0] == 'r') {
2335 c_brkcont(const char **wp)
2342 if (ksh_getopt(wp, &builtin_opt, null) == '?')
2344 arg = wp[builtin_opt.optind];
2373 warningf(true, "%s: %s %s", wp[0], "can't", wp[0]);
2384 wp[0], wp[0], (unsigned int)n - quit);
2387 unwind(*wp[0] == 'b' ? LBREAK : LCONTIN);
2395 c_set(const char **wp)
2402 if (wp[1] == NULL) {
2407 argi = parse_args(wp, OF_SET, &setargs);
2412 wp += argi - 1;
2413 owp = wp;
2415 wp[0] = l->argv[0];
2416 while (*++wp != NULL)
2417 strdupx(*wp, *wp, &l->area);
2418 l->argc = wp - owp - 1;
2420 for (wp = l->argv; (*wp++ = *owp++) != NULL; )
2440 c_unset(const char **wp)
2446 while ((optc = ksh_getopt(wp, &builtin_opt, "fv")) != -1)
2458 wp += builtin_opt.optind;
2459 for (; (id = *wp) != NULL; wp++)
2503 c_times(const char **wp MKSH_A_UNUSED)
2599 char **wp = *app;
2606 while ((optc = ksh_getopt((const char **)wp, &opt, ":p")) != -1)
2621 afree(wp[i], ATEMP);
2622 for (i = 0, j = opt.optind; (wp[i] = wp[j]); i++, j++)
2625 if (!wp[0])
2627 *app = wp;
2632 c_exec(const char **wp MKSH_A_UNUSED)
2658 c_mknod(const char **wp)
2666 while ((optc = ksh_getopt(wp, &builtin_opt, "m:")) != -1) {
2681 argv = &wp[builtin_opt.optind];
2768 c_test(const char **wp)
2781 for (argc = 0; wp[argc]; argc++)
2784 mkssert(wp[0] != NULL);
2786 if (strcmp(wp[0], "[") == 0) {
2787 if (strcmp(wp[--argc], "]") != 0) {
2793 te.pos.wp = wp + 1;
2794 te.wp_end = wp + argc;
2817 rv = test_eval(&te, op, *te.pos.wp++, NULL, true);
2825 swp = te.pos.wp;
2827 lhs = *te.pos.wp++;
2830 rv = test_eval(&te, op, lhs, *te.pos.wp++, true);
2834 te.pos.wp = swp;
2840 swp = te.pos.wp;
2842 te.pos.wp++;
2846 te.pos.wp = swp;
2860 swp = te.pos.wp;
2862 te.pos.wp++;
2863 te.pos.wp++;
2867 te.pos.wp = swp;
2878 te.pos.wp = wp + 1;
3245 if ((te->flags & TEF_DBRACKET) || (&te->pos.wp[1] < te->wp_end &&
3246 !test_isop(TM_BINOP, te->pos.wp[1]))) {
3294 if (te->pos.wp >= te->wp_end)
3298 rv = test_isop(meta, *te->pos.wp);
3302 rv = !strcmp(*te->pos.wp, tokens[(int)meta]) ?
3307 te->pos.wp++;
3315 if (te->pos.wp >= te->wp_end)
3317 return (*te->pos.wp++);
3326 if ((op = te->pos.wp + ofs >= te->wp_end ? NULL : te->pos.wp[ofs]))
3390 c_ulimit(const char **wp)
3546 while ((optc = ksh_getopt(wp, &builtin_opt, opts)) != -1)
3571 if (wp[builtin_opt.optind]) {
3572 if (all || wp[builtin_opt.optind + 1]) {
3576 return (set_ulimit(l, wp[builtin_opt.optind], how));
3653 c_rename(const char **wp)
3658 ++wp;
3659 if (wp[0] && !strcmp(wp[0], "--"))
3661 ++wp;
3664 if (wp[0] == NULL /* first argument */ ||
3665 wp[1] == NULL /* second argument */ ||
3666 wp[2] != NULL /* no further args please */)
3668 else if ((rv = rename(wp[0], wp[1])) != 0) {
3677 c_realpath(const char **wp)
3683 ++wp;
3684 if (wp[0] && !strcmp(wp[0], "--"))
3686 ++wp;
3689 if (wp[0] == NULL || wp[1] != NULL)
3691 else if ((buf = do_realpath(wp[0])) == NULL) {
3693 bi_errorf("%s: %s", wp[0], cstrerror(rv));
3706 c_cat(const char **wp)
3715 while ((rv = ksh_getopt(wp, &builtin_opt, "u")) != -1) {
3725 wp += builtin_opt.optind;
3734 if (*wp) {
3735 fn = *wp++;
3783 } while (*wp);
3792 c_sleep(const char **wp)
3798 ++wp;
3799 if (wp[0] && !strcmp(wp[0], "--"))
3801 ++wp;
3803 if (!wp[0] || wp[1])
3805 else if (parse_usec(wp[0], &tv))
3806 bi_errorf("%s: %s '%s'", Tsynerr, cstrerror(errno), wp[0]);