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