Lines Matching refs:wp

79 c_true(const char **wp MKSH_A_UNUSED)  in c_true()
85 c_false(const char **wp MKSH_A_UNUSED) in c_false()
232 c_pwd(const char **wp) in c_pwd() argument
238 while ((optc = ksh_getopt(wp, &builtin_opt, "LP")) != -1) in c_pwd()
249 wp += builtin_opt.optind; in c_pwd()
251 if (wp[0]) { in c_pwd()
275 c_print(const char **wp) in c_print() argument
288 if (wp[0][0] == 'e') { in c_print()
290 wp++; in c_print()
307 if (*wp && !strcmp(*wp, "-n")) { in c_print()
310 wp++; in c_print()
328 while ((s = *wp) && *s == '-' && s[1]) { in c_print()
345 wp++; in c_print()
353 while ((optc = ksh_getopt(wp, &builtin_opt, opts)) != -1) in c_print()
393 if (wp[builtin_opt.optind] && in c_print()
394 ksh_isdash(wp[builtin_opt.optind])) in c_print()
398 wp += builtin_opt.optind; in c_print()
403 while (*wp != NULL) { in c_print()
404 s = *wp; in c_print()
437 if (*++wp != NULL) in c_print()
497 c_whence(const char **wp) in c_whence() argument
503 bool iam_whence = wp[0][0] == 'w'; in c_whence()
506 while ((optc = ksh_getopt(wp, &builtin_opt, opts)) != -1) in c_whence()
520 wp += builtin_opt.optind; in c_whence()
537 while ((vflag || rv == 0) && (id = *wp++) != NULL) { in c_whence()
628 c_command(const char **wp) in c_command() argument
634 return (c_whence(wp)); in c_command()
642 c_typeset(const char **wp) in c_typeset() argument
653 switch (**wp) { in c_typeset()
691 while ((i = ksh_getopt(wp, &builtin_opt, opts)) != -1) { in c_typeset()
776 if (!(builtin_opt.info & GI_MINUSMINUS) && wp[builtin_opt.optind] && in c_typeset()
777 (wp[builtin_opt.optind][0] == '-' || in c_typeset()
778 wp[builtin_opt.optind][0] == '+') && in c_typeset()
779 wp[builtin_opt.optind][1] == '\0') { in c_typeset()
780 thing = wp[builtin_opt.optind][0]; in c_typeset()
789 if (wp[builtin_opt.optind]) { in c_typeset()
825 if (wp[builtin_opt.optind] && in c_typeset()
833 for (i = builtin_opt.optind; wp[i]; i++) { in c_typeset()
835 f = findfunc(wp[i], hash(wp[i]), in c_typeset()
848 wp[i], f->val.t); in c_typeset()
851 } else if (!typeset(wp[i], fset, fclr, field, base)) { in c_typeset()
852 bi_errorf("%s: %s", wp[i], "is not an identifier"); in c_typeset()
877 } else if (wp[builtin_opt.optind]) { in c_typeset()
878 for (i = builtin_opt.optind; wp[i]; i++) { in c_typeset()
879 varsearch(e->loc, &vp, wp[i], hash(wp[i])); in c_typeset()
1010 c_alias(const char **wp) in c_alias() argument
1019 while ((optc = ksh_getopt(wp, &builtin_opt, "dprtUx")) != -1) { in c_alias()
1056 wp += builtin_opt.optind; in c_alias()
1058 if (!(builtin_opt.info & GI_MINUSMINUS) && *wp && in c_alias()
1059 (wp[0][0] == '-' || wp[0][0] == '+') && wp[0][1] == '\0') { in c_alias()
1060 prefix = wp[0][0]; in c_alias()
1061 wp++; in c_alias()
1072 if (!tflag || *wp) { in c_alias()
1081 if (*wp == NULL) { in c_alias()
1097 for (; *wp != NULL; wp++) { in c_alias()
1098 const char *alias = *wp, *val, *newval; in c_alias()
1156 c_unalias(const char **wp) in c_unalias() argument
1163 while ((optc = ksh_getopt(wp, &builtin_opt, "adt")) != -1) in c_unalias()
1186 wp += builtin_opt.optind; in c_unalias()
1188 for (; *wp != NULL; wp++) { in c_unalias()
1189 ap = ktsearch(t, *wp, hash(*wp)); in c_unalias()
1218 c_let(const char **wp) in c_let() argument
1223 if (wp[1] == NULL) in c_let()
1227 for (wp++; *wp; wp++) in c_let()
1228 if (!evaluate(*wp, &val, KSH_RETURN_ERROR, true)) { in c_let()
1238 c_jobs(const char **wp) in c_jobs() argument
1242 while ((optc = ksh_getopt(wp, &builtin_opt, "lpnz")) != -1) in c_jobs()
1260 wp += builtin_opt.optind; in c_jobs()
1261 if (!*wp) { in c_jobs()
1265 for (; *wp; wp++) in c_jobs()
1266 if (j_jobs(*wp, flag, nflag)) in c_jobs()
1274 c_fgbg(const char **wp) in c_fgbg() argument
1276 bool bg = strcmp(*wp, "bg") == 0; in c_fgbg()
1283 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_fgbg()
1285 wp += builtin_opt.optind; in c_fgbg()
1286 if (*wp) in c_fgbg()
1287 for (; *wp; wp++) in c_fgbg()
1288 rv = j_resume(*wp, bg); in c_fgbg()
1310 c_kill(const char **wp) in c_kill() argument
1318 if ((p = wp[1]) && *p == '-' && (ksh_isdigit(p[1]) || in c_kill()
1324 i = (wp[2] && strcmp(wp[2], "--") == 0) ? 3 : 2; in c_kill()
1328 while ((optc = ksh_getopt(wp, &builtin_opt, "ls:")) != -1) in c_kill()
1345 if ((lflag && t) || (!wp[i] && !lflag)) { in c_kill()
1356 if (wp[i]) { in c_kill()
1357 for (; wp[i]; i++) { in c_kill()
1358 if (!bi_getn(wp[i], &n)) in c_kill()
1399 for (; (p = wp[i]); i++) { in c_kill()
1427 c_getopts(const char **wp) in c_getopts() argument
1434 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_getopts()
1436 wp += builtin_opt.optind; in c_getopts()
1438 opts = *wp++; in c_getopts()
1444 var = *wp++; in c_getopts()
1459 if (*wp == NULL) in c_getopts()
1460 wp = e->loc->next->argv; in c_getopts()
1462 *--wp = e->loc->next->argv[0]; in c_getopts()
1465 for (argc = 0; wp[argc]; argc++) in c_getopts()
1469 user_opt.p > strlen(wp[user_opt.optind - 1]))) { in c_getopts()
1475 optc = ksh_getopt(wp, &user_opt, opts); in c_getopts()
1519 c_bind(const char **wp) in c_bind() argument
1529 while ((optc = ksh_getopt(wp, &builtin_opt, in c_bind()
1548 wp += builtin_opt.optind; in c_bind()
1550 if (*wp == NULL) in c_bind()
1558 for (; *wp != NULL; wp++) { in c_bind()
1559 if ((cp = cstrchr(*wp, '=')) == NULL) in c_bind()
1562 strdupx(up, *wp, ATEMP); in c_bind()
1563 up[cp++ - *wp] = '\0'; in c_bind()
1565 if (x_bind(up ? up : *wp, cp, in c_bind()
1579 c_shift(const char **wp) in c_shift() argument
1586 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_shift()
1588 arg = wp[builtin_opt.optind]; in c_shift()
1610 c_umask(const char **wp) in c_umask() argument
1617 while ((optc = ksh_getopt(wp, &builtin_opt, "S")) != -1) in c_umask()
1625 cp = wp[builtin_opt.optind]; in c_umask()
1743 c_dot(const char **wp) in c_dot() argument
1748 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_dot()
1751 if ((cp = wp[builtin_opt.optind]) == NULL) { in c_dot()
1761 if (wp[builtin_opt.optind + 1]) { in c_dot()
1762 argv = wp + builtin_opt.optind; in c_dot()
1780 c_wait(const char **wp) in c_wait() argument
1784 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_wait()
1786 wp += builtin_opt.optind; in c_wait()
1787 if (*wp == NULL) { in c_wait()
1792 for (; *wp; wp++) in c_wait()
1793 rv = waitfor(*wp, &sig); in c_wait()
1803 c_read(const char **wp) in c_read() argument
1827 while ((c = ksh_getopt(wp, &builtin_opt, c_read_opts)) != -1) in c_read()
1882 wp += builtin_opt.optind; in c_read()
1883 if (*wp == NULL) in c_read()
1884 *--wp = REPLY; in c_read()
1886 if (intoarray && wp[1] != NULL) { in c_read()
1891 if ((ccp = cstrchr(*wp, '?')) != NULL) { in c_read()
1892 strdupx(allocd, *wp, ATEMP); in c_read()
1893 allocd[ccp - *wp] = '\0'; in c_read()
1894 *wp = allocd; in c_read()
2060 vp = global(*wp); in c_read()
2063 bi_errorf("read-only: %s", *wp); in c_read()
2111 if (!intoarray && wp[1] == NULL) in c_read()
2169 vq = global(*wp); in c_read()
2174 typeset(*wp, EXPORT, 0, 0, 0); in c_read()
2183 if (intoarray || *++wp != NULL) in c_read()
2200 c_eval(const char **wp) in c_eval() argument
2206 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_eval()
2209 s->u.strv = wp + builtin_opt.optind; in c_eval()
2258 c_trap(const char **wp) in c_trap() argument
2264 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_trap()
2266 wp += builtin_opt.optind; in c_trap()
2268 if (*wp == NULL) { in c_trap()
2284 s = (gettrap(*wp, false) == NULL) ? *wp++ : NULL; in c_trap()
2290 while (*wp != NULL) in c_trap()
2291 if ((p = gettrap(*wp++, true)) == NULL) { in c_trap()
2293 "bad signal", wp[-1]); in c_trap()
2301 c_exitreturn(const char **wp) in c_exitreturn() argument
2306 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_exitreturn()
2308 arg = wp[builtin_opt.optind]; in c_exitreturn()
2318 if (wp[0][0] == 'r') { in c_exitreturn()
2348 c_brkcont(const char **wp) in c_brkcont() argument
2355 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_brkcont()
2357 arg = wp[builtin_opt.optind]; in c_brkcont()
2386 warningf(true, "%s: %s %s", wp[0], "can't", wp[0]); in c_brkcont()
2397 wp[0], wp[0], (unsigned int)n - quit); in c_brkcont()
2400 unwind(*wp[0] == 'b' ? LBREAK : LCONTIN); in c_brkcont()
2408 c_set(const char **wp) in c_set() argument
2415 if (wp[1] == NULL) { in c_set()
2420 argi = parse_args(wp, OF_SET, &setargs); in c_set()
2425 wp += argi - 1; in c_set()
2426 owp = wp; in c_set()
2428 wp[0] = l->argv[0]; in c_set()
2429 while (*++wp != NULL) in c_set()
2430 strdupx(*wp, *wp, &l->area); in c_set()
2431 l->argc = wp - owp - 1; in c_set()
2433 for (wp = l->argv; (*wp++ = *owp++) != NULL; ) in c_set()
2454 c_unset(const char **wp) in c_unset() argument
2460 while ((optc = ksh_getopt(wp, &builtin_opt, "fv")) != -1) in c_unset()
2472 wp += builtin_opt.optind; in c_unset()
2473 for (; (id = *wp) != NULL; wp++) in c_unset()
2517 c_times(const char **wp MKSH_A_UNUSED) in c_times()
2613 char **wp = *app; in timex_hook() local
2620 while ((optc = ksh_getopt((const char **)wp, &opt, ":p")) != -1) in timex_hook()
2635 afree(wp[i], ATEMP); in timex_hook()
2636 for (i = 0, j = opt.optind; (wp[i] = wp[j]); i++, j++) in timex_hook()
2639 if (!wp[0]) in timex_hook()
2641 *app = wp; in timex_hook()
2646 c_exec(const char **wp MKSH_A_UNUSED) in c_exec()
2672 c_mknod(const char **wp) in c_mknod() argument
2680 while ((optc = ksh_getopt(wp, &builtin_opt, "m:")) != -1) { in c_mknod()
2695 argv = &wp[builtin_opt.optind]; in c_mknod()
2782 c_test(const char **wp) in c_test() argument
2795 for (argc = 0; wp[argc]; argc++) in c_test()
2798 mkssert(wp[0] != NULL); in c_test()
2800 if (strcmp(wp[0], "[") == 0) { in c_test()
2801 if (strcmp(wp[--argc], "]") != 0) { in c_test()
2807 te.pos.wp = wp + 1; in c_test()
2808 te.wp_end = wp + argc; in c_test()
2831 rv = test_eval(&te, op, *te.pos.wp++, NULL, true); in c_test()
2839 swp = te.pos.wp; in c_test()
2841 lhs = *te.pos.wp++; in c_test()
2844 rv = test_eval(&te, op, lhs, *te.pos.wp++, true); in c_test()
2848 te.pos.wp = swp; in c_test()
2854 swp = te.pos.wp; in c_test()
2856 te.pos.wp++; in c_test()
2860 te.pos.wp = swp; in c_test()
2874 swp = te.pos.wp; in c_test()
2876 te.pos.wp++; in c_test()
2877 te.pos.wp++; in c_test()
2881 te.pos.wp = swp; in c_test()
2892 te.pos.wp = wp + 1; in c_test()
3259 if ((te->flags & TEF_DBRACKET) || (&te->pos.wp[1] < te->wp_end && in test_primary()
3260 !test_isop(TM_BINOP, te->pos.wp[1]))) { in test_primary()
3308 if (te->pos.wp >= te->wp_end) in ptest_isa()
3312 rv = test_isop(meta, *te->pos.wp); in ptest_isa()
3316 rv = !strcmp(*te->pos.wp, tokens[(int)meta]) ? in ptest_isa()
3321 te->pos.wp++; in ptest_isa()
3329 if (te->pos.wp >= te->wp_end) in ptest_getopnd()
3331 return (*te->pos.wp++); in ptest_getopnd()
3340 if ((op = te->pos.wp + ofs >= te->wp_end ? NULL : te->pos.wp[ofs])) in ptest_error()
3417 c_ulimit(const char **wp) in c_ulimit() argument
3423 while ((optc = ksh_getopt(wp, &builtin_opt, rlimits_opts)) != -1) in c_ulimit()
3449 if (wp[builtin_opt.optind]) { in c_ulimit()
3450 if (all || wp[builtin_opt.optind + 1]) { in c_ulimit()
3454 return (set_ulimit(rlimits[i], wp[builtin_opt.optind], how)); in c_ulimit()
3535 c_rename(const char **wp) in c_rename() argument
3540 ++wp; in c_rename()
3541 if (wp[0] && !strcmp(wp[0], "--")) in c_rename()
3543 ++wp; in c_rename()
3546 if (wp[0] == NULL /* first argument */ || in c_rename()
3547 wp[1] == NULL /* second argument */ || in c_rename()
3548 wp[2] != NULL /* no further args please */) in c_rename()
3550 else if ((rv = rename(wp[0], wp[1])) != 0) { in c_rename()
3559 c_realpath(const char **wp) in c_realpath() argument
3565 ++wp; in c_realpath()
3566 if (wp[0] && !strcmp(wp[0], "--")) in c_realpath()
3568 ++wp; in c_realpath()
3571 if (wp[0] == NULL || wp[1] != NULL) in c_realpath()
3573 else if ((buf = do_realpath(wp[0])) == NULL) { in c_realpath()
3575 bi_errorf("%s: %s", wp[0], cstrerror(rv)); in c_realpath()
3588 c_cat(const char **wp) in c_cat() argument
3597 while ((rv = ksh_getopt(wp, &builtin_opt, "u")) != -1) { in c_cat()
3607 wp += builtin_opt.optind; in c_cat()
3616 if (*wp) { in c_cat()
3617 fn = *wp++; in c_cat()
3667 } while (*wp); in c_cat()
3676 c_sleep(const char **wp) in c_sleep() argument
3682 ++wp; in c_sleep()
3683 if (wp[0] && !strcmp(wp[0], "--")) in c_sleep()
3685 ++wp; in c_sleep()
3687 if (!wp[0] || wp[1]) in c_sleep()
3689 else if (parse_usec(wp[0], &tv)) in c_sleep()
3690 bi_errorf("%s: %s '%s'", Tsynerr, cstrerror(errno), wp[0]); in c_sleep()
3732 c_suspend(const char **wp) in c_suspend() argument
3734 if (wp[1] != NULL) { in c_suspend()