Home | History | Annotate | Download | only in src

Lines Matching refs:wp

81 c_true(const char **wp MKSH_A_UNUSED)
87 c_false(const char **wp MKSH_A_UNUSED)
247 c_pwd(const char **wp)
253 while ((optc = ksh_getopt(wp, &builtin_opt, "LP")) != -1)
264 wp += builtin_opt.optind;
266 if (wp[0]) {
290 c_print(const char **wp)
330 if (wp[0][0] == 'e') {
338 ++wp;
340 if (*wp && !strcmp(*wp, "-n")) {
342 ++wp;
364 if ((s = *wp) && *s++ == '-' && *s) {
380 ++wp;
392 while ((c = ksh_getopt(wp, &builtin_opt, opts)) != -1)
421 wp += builtin_opt.optind;
443 if (wp[builtin_opt.optind] &&
444 ksh_isdash(wp[builtin_opt.optind]))
447 wp += builtin_opt.optind;
451 if (*wp == NULL)
459 if (*wp == NULL)
463 while (*wp != NULL) {
464 s = *wp++;
480 s = *wp++;
519 if (*wp != NULL) {
536 w = co.shf->wp - co.shf->buf;
607 c_whence(const char **wp)
612 while ((optc = ksh_getopt(wp, &builtin_opt, Tpv)) != -1)
623 wp += builtin_opt.optind;
625 return (do_whence(wp, pflag ? FC_PATH :
631 c_command(const char **wp)
636 while ((optc = ksh_getopt(wp, &builtin_opt, TpVv)) != -1)
650 wp += builtin_opt.optind;
652 return (do_whence(wp, fcflags, vflag, true));
656 do_whence(const char **wp, int fcflags, bool vflag, bool iscommand)
663 while ((vflag || rv == 0) && (id = *wp++) != NULL) {
767 c_alias(const char **wp)
776 while ((optc = ksh_getopt(wp, &builtin_opt, "dprtUx")) != -1) {
813 wp += builtin_opt.optind;
815 if (!(builtin_opt.info & GI_MINUSMINUS) && *wp &&
816 ctype(wp[0][0], C_MINUS | C_PLUS) && wp[0][1] == '\0') {
817 prefix = wp[0][0];
818 wp++;
830 if (!tflag || *wp) {
839 if (*wp == NULL) {
855 for (; *wp != NULL; wp++) {
856 const char *alias = *wp, *val, *newval;
918 c_unalias(const char **wp)
925 while ((optc = ksh_getopt(wp, &builtin_opt, "adt")) != -1)
948 wp += builtin_opt.optind;
950 for (; *wp != NULL; wp++) {
951 ap = ktsearch(t, *wp, hash(*wp));
980 c_let(const char **wp)
985 if (wp[1] == NULL)
989 for (wp++; *wp; wp++)
990 if (!evaluate(*wp, &val, KSH_RETURN_ERROR, true)) {
1000 c_jobs(const char **wp)
1004 while ((optc = ksh_getopt(wp, &builtin_opt, "lpnz")) != -1)
1022 wp += builtin_opt.optind;
1023 if (!*wp) {
1027 for (; *wp; wp++)
1028 if (j_jobs(*wp, flag, nflag))
1036 c_fgbg(const char **wp)
1038 bool bg = strcmp(*wp, Tbg) == 0;
1045 if (ksh_getopt(wp, &builtin_opt, null) == '?')
1047 wp += builtin_opt.optind;
1048 if (*wp)
1049 for (; *wp; wp++)
1050 rv = j_resume(*wp, bg);
1072 c_kill(const char **wp)
1080 if ((p = wp[1]) && *p == '-' && ctype(p[1], C_DIGIT | C_UPPER)) {
1085 i = (wp[2] && strcmp(wp[2], "--") == 0) ? 3 : 2;
1089 while ((optc = ksh_getopt(wp, &builtin_opt, "ls:")) != -1)
1107 if ((lflag && t) || (!wp[i] && !lflag)) {
1118 if (wp[i]) {
1119 for (; wp[i]; i++) {
1120 if (!bi_getn(wp[i], &n))
1173 for (; (p = wp[i]); i++) {
1202 c_getopts(const char **wp)
1209 if (ksh_getopt(wp, &builtin_opt, null) == '?')
1211 wp += builtin_opt.optind;
1213 opts = *wp++;
1219 var = *wp++;
1234 if (*wp == NULL)
1235 wp = e->loc->next->argv;
1237 *--wp = e->loc->next->argv[0];
1240 for (argc = 0; wp[argc]; argc++)
1244 user_opt.p > strlen(wp[user_opt.optind - 1]))) {
1250 optc = ksh_getopt(wp, &user_opt, opts);
1294 c_bind(const char **wp)
1304 while ((optc = ksh_getopt(wp, &builtin_opt,
1323 wp += builtin_opt.optind;
1325 if (*wp == NULL)
1333 for (; *wp != NULL; wp++) {
1334 if ((cp = cstrchr(*wp, '=')) == NULL)
1337 strdupx(up, *wp, ATEMP);
1338 up[cp++ - *wp] = '\0';
1340 if (x_bind(up ? up : *wp, cp,
1354 c_shift(const char **wp)
1361 if (ksh_getopt(wp, &builtin_opt, null) == '?')
1363 arg = wp[builtin_opt.optind];
1389 c_umask(const char **wp)
1396 while ((optc = ksh_getopt(wp, &builtin_opt, "S")) != -1)
1404 cp = wp[builtin_opt.optind];
1525 c_dot(const char **wp)
1530 if (ksh_getopt(wp, &builtin_opt, null) == '?')
1533 if ((cp = wp[builtin_opt.optind]) == NULL) {
1538 if (!file && errcode == ENOENT && wp[0][0] == 's' &&
1547 if (wp[builtin_opt.optind + 1]) {
1548 argv = wp + builtin_opt.optind;
1571 c_wait(const char **wp)
1575 if (ksh_getopt(wp, &builtin_opt, null) == '?')
1577 wp += builtin_opt.optind;
1578 if (*wp == NULL) {
1583 for (; *wp; wp++)
1584 rv = waitfor(*wp, &sig);
1594 c_read(const char **wp)
1625 while ((c = ksh_getopt(wp, &builtin_opt, c_read_opts)) != -1)
1680 wp += builtin_opt.optind;
1681 if (*wp == NULL)
1682 *--wp = REPLY;
1684 if (intoarray && wp[1] != NULL) {
1689 if ((ccp = cstrchr(*wp, '?')) != NULL) {
1690 strdupx(allocd, *wp, ATEMP);
1691 allocd[ccp - *wp] = '\0';
1692 *wp = allocd;
1870 vp = global(*wp);
1874 bi_errorf(Tf_ro, *wp);
1922 if (!intoarray && wp[1] == NULL)
1998 vq = global(*wp);
2003 typeset(*wp, EXPORT, 0, 0, 0);
2012 if (intoarray || *++wp != NULL)
2029 c_eval(const char **wp)
2035 if (ksh_getopt(wp, &builtin_opt, null) == '?')
2038 s->u.strv = wp + builtin_opt.optind;
2088 c_trap(const char **wp)
2094 if (ksh_getopt(wp, &builtin_opt, null) == '?')
2096 wp += builtin_opt.optind;
2098 if (*wp == NULL) {
2110 if (getn(*wp, &i)) {
2115 s = *wp++;
2123 while (*wp)
2124 if (!(p = gettrap(*wp++, true, true))) {
2125 warningf(true, Tbad_sig_ss, builtin_argv0, wp[-1]);
2133 c_exitreturn(const char **wp)
2137 if (wp[1]) {
2138 if (wp[2])
2140 exstat = bi_getn(wp[1], &n) ? (n & 0xFF) : 1;
2144 if (wp[0][0] == 'r') {
2175 c_brkcont(const char **wp)
2182 if (ksh_getopt(wp, &builtin_opt, null) == '?')
2184 arg = wp[builtin_opt.optind];
2213 warningf(true, Tf_cant_s, wp[0], wp[0]);
2224 wp[0], wp[0], (unsigned int)n - quit);
2227 unwind(*wp[0] == 'b' ? LBREAK : LCONTIN);
2235 c_set(const char **wp)
2242 if (wp[1] == NULL) {
2247 if ((argi = parse_args(wp, OF_SET, &setargs)) < 0)
2251 wp += argi - 1;
2252 owp = wp;
2254 wp[0] = l->argv[0];
2255 while (*++wp != NULL)
2256 strdupx(*wp, *wp, &l->area);
2257 l->argc = wp - owp - 1;
2259 for (wp = l->argv; (*wp++ = *owp++) != NULL; )
2280 c_unset(const char **wp)
2286 while ((optc = ksh_getopt(wp, &builtin_opt, "fv")) != -1)
2298 wp += builtin_opt.optind;
2299 for (; (id = *wp) != NULL; wp++)
2344 c_times(const char **wp MKSH_A_UNUSED)
2440 char **wp = *app;
2447 while ((optc = ksh_getopt((const char **)wp, &opt, ":p")) != -1)
2462 afree(wp[i], ATEMP);
2463 for (i = 0, j = opt.optind; (wp[i] = wp[j]); i++, j++)
2466 if (!wp[0])
2468 *app = wp;
2473 c_exec(const char **wp MKSH_A_UNUSED)
2497 c_mknod(const char **wp)
2505 while ((optc = ksh_getopt(wp, &builtin_opt, "m:")) != -1) {
2520 argv = &wp[builtin_opt.optind];
2606 c_test(const char **wp)
2620 for (argc = 0; wp[argc]; argc++)
2623 if (strcmp(wp[0], Tbracket) == 0) {
2624 if (strcmp(wp[--argc], "]") != 0) {
2630 te.pos.wp = wp + 1;
2631 te.wp_end = wp + argc;
2654 rv = test_eval(&te, op, *te.pos.wp++, NULL, true);
2664 swp = te.pos.wp;
2666 lhs = *te.pos.wp++;
2669 rv = test_eval(&te, op, lhs, *te.pos.wp++, true);
2675 rv = test_eval(&te, TO_STNZE, *te.pos.wp++, NULL, true);
2683 te.pos.wp = swp;
2689 swp = te.pos.wp;
2691 te.pos.wp++;
2695 te.pos.wp = swp;
2709 swp = te.pos.wp;
2711 te.pos.wp++;
2712 te.pos.wp++;
2716 te.pos.wp = swp;
2727 te.pos.wp = wp + 1;
3113 if ((te->flags & TEF_DBRACKET) || (&te->pos.wp[1] < te->wp_end &&
3114 !test_isop(TM_BINOP, te->pos.wp[1]))) {
3162 if (te->pos.wp >= te->wp_end)
3166 rv = test_isop(meta, *te->pos.wp);
3170 rv = !strcmp(*te->pos.wp, tokens[(int)meta]) ?
3175 te->pos.wp++;
3183 if (te->pos.wp >= te->wp_end)
3185 return (*te->pos.wp++);
3194 if ((op = te->pos.wp + ofs >= te->wp_end ? NULL : te->pos.wp[ofs]))
3291 c_ulimit(const char **wp)
3297 while ((optc = ksh_getopt(wp, &builtin_opt, rlimits_opts)) != -1)
3323 if (wp[builtin_opt.optind]) {
3324 if (all || wp[builtin_opt.optind + 1]) {
3328 return (set_ulimit(rlimits[i], wp[builtin_opt.optind], how));
3409 c_rename(const char **wp)
3414 ++wp;
3415 if (wp[0] && !strcmp(wp[0], "--"))
3417 ++wp;
3420 if (wp[0] == NULL /* first argument */ ||
3421 wp[1] == NULL /* second argument */ ||
3422 wp[2] != NULL /* no further args please */)
3424 else if ((rv = rename(wp[0], wp[1])) != 0) {
3433 c_realpath(const char **wp)
3439 ++wp;
3440 if (wp[0] && !strcmp(wp[0], "--"))
3442 ++wp;
3445 if (wp[0] == NULL || wp[1] != NULL)
3447 else if ((buf = do_realpath(wp[0])) == NULL) {
3449 bi_errorf(Tf_sD_s, wp[0], cstrerror(rv));
3462 c_cat(const char **wp)
3472 while ((rv = ksh_getopt(wp, &builtin_opt, "u")) != -1) {
3482 wp += builtin_opt.optind;
3494 if (*wp) {
3495 fn = *wp++;
3557 } while (*wp);
3568 c_sleep(const char **wp)
3574 ++wp;
3575 if (wp[0] && !strcmp(wp[0], "--"))
3577 ++wp;
3579 if (!wp[0] || wp[1])
3581 else if (parse_usec(wp[0], &tv))
3582 bi_errorf(Tf_sD_s_qs, Tsynerr, cstrerror(errno), wp[0]);
3624 c_suspend(const char **wp)
3626 if (wp[1] != NULL) {