Lines Matching refs:wp
68 c_true(const char **wp MKSH_A_UNUSED) in c_true()
74 c_false(const char **wp MKSH_A_UNUSED) in c_false()
221 c_pwd(const char **wp) in c_pwd() argument
227 while ((optc = ksh_getopt(wp, &builtin_opt, "LP")) != -1) in c_pwd()
238 wp += builtin_opt.optind; in c_pwd()
240 if (wp[0]) { in c_pwd()
264 c_print(const char **wp) in c_print() argument
277 if (wp[0][0] == 'e') { in c_print()
279 wp++; in c_print()
282 if (*wp && !strcmp(*wp, "-n")) { in c_print()
285 wp++; in c_print()
303 while ((s = *wp) && *s == '-' && s[1]) { in c_print()
320 wp++; in c_print()
328 while ((optc = ksh_getopt(wp, &builtin_opt, opts)) != -1) in c_print()
368 if (wp[builtin_opt.optind] && in c_print()
369 ksh_isdash(wp[builtin_opt.optind])) in c_print()
373 wp += builtin_opt.optind; in c_print()
378 while (*wp != NULL) { in c_print()
379 s = *wp; in c_print()
412 if (*++wp != NULL) in c_print()
472 c_whence(const char **wp) in c_whence() argument
478 bool iam_whence = wp[0][0] == 'w'; in c_whence()
481 while ((optc = ksh_getopt(wp, &builtin_opt, opts)) != -1) in c_whence()
495 wp += builtin_opt.optind; in c_whence()
512 while ((vflag || rv == 0) && (id = *wp++) != NULL) { in c_whence()
603 c_command(const char **wp) in c_command() argument
609 return (c_whence(wp)); in c_command()
614 c_typeset(const char **wp) in c_typeset() argument
624 switch (**wp) { in c_typeset()
663 while ((optc = ksh_getopt(wp, &builtin_opt, opts)) != -1) { in c_typeset()
748 if (!(builtin_opt.info & GI_MINUSMINUS) && wp[builtin_opt.optind] && in c_typeset()
749 (wp[builtin_opt.optind][0] == '-' || in c_typeset()
750 wp[builtin_opt.optind][0] == '+') && in c_typeset()
751 wp[builtin_opt.optind][1] == '\0') { in c_typeset()
752 thing = wp[builtin_opt.optind][0]; in c_typeset()
762 if (wp[builtin_opt.optind]) { in c_typeset()
790 if (wp[builtin_opt.optind]) { in c_typeset()
796 for (i = builtin_opt.optind; wp[i]; i++) { in c_typeset()
798 f = findfunc(wp[i], hash(wp[i]), in c_typeset()
811 wp[i], f->val.t); in c_typeset()
814 } else if (!typeset(wp[i], fset, fclr, field, base)) { in c_typeset()
815 bi_errorf("%s: %s", wp[i], "not identifier"); in c_typeset()
975 c_alias(const char **wp) in c_alias() argument
984 while ((optc = ksh_getopt(wp, &builtin_opt, "dprtUx")) != -1) { in c_alias()
1021 wp += builtin_opt.optind; in c_alias()
1023 if (!(builtin_opt.info & GI_MINUSMINUS) && *wp && in c_alias()
1024 (wp[0][0] == '-' || wp[0][0] == '+') && wp[0][1] == '\0') { in c_alias()
1025 prefix = wp[0][0]; in c_alias()
1026 wp++; in c_alias()
1037 if (!tflag || *wp) { in c_alias()
1046 if (*wp == NULL) { in c_alias()
1062 for (; *wp != NULL; wp++) { in c_alias()
1063 const char *alias = *wp, *val, *newval; in c_alias()
1121 c_unalias(const char **wp) in c_unalias() argument
1128 while ((optc = ksh_getopt(wp, &builtin_opt, "adt")) != -1) in c_unalias()
1151 wp += builtin_opt.optind; in c_unalias()
1153 for (; *wp != NULL; wp++) { in c_unalias()
1154 ap = ktsearch(t, *wp, hash(*wp)); in c_unalias()
1183 c_let(const char **wp) in c_let() argument
1188 if (wp[1] == NULL) in c_let()
1192 for (wp++; *wp; wp++) in c_let()
1193 if (!evaluate(*wp, &val, KSH_RETURN_ERROR, true)) { in c_let()
1203 c_jobs(const char **wp) in c_jobs() argument
1207 while ((optc = ksh_getopt(wp, &builtin_opt, "lpnz")) != -1) in c_jobs()
1225 wp += builtin_opt.optind; in c_jobs()
1226 if (!*wp) { in c_jobs()
1230 for (; *wp; wp++) in c_jobs()
1231 if (j_jobs(*wp, flag, nflag)) in c_jobs()
1239 c_fgbg(const char **wp) in c_fgbg() argument
1241 bool bg = strcmp(*wp, "bg") == 0; in c_fgbg()
1248 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_fgbg()
1250 wp += builtin_opt.optind; in c_fgbg()
1251 if (*wp) in c_fgbg()
1252 for (; *wp; wp++) in c_fgbg()
1253 rv = j_resume(*wp, bg); in c_fgbg()
1275 c_kill(const char **wp) in c_kill() argument
1283 if ((p = wp[1]) && *p == '-' && (ksh_isdigit(p[1]) || in c_kill()
1289 i = (wp[2] && strcmp(wp[2], "--") == 0) ? 3 : 2; in c_kill()
1293 while ((optc = ksh_getopt(wp, &builtin_opt, "ls:")) != -1) in c_kill()
1310 if ((lflag && t) || (!wp[i] && !lflag)) { in c_kill()
1321 if (wp[i]) { in c_kill()
1322 for (; wp[i]; i++) { in c_kill()
1323 if (!bi_getn(wp[i], &n)) in c_kill()
1362 for (; (p = wp[i]); i++) { in c_kill()
1390 c_getopts(const char **wp) in c_getopts() argument
1397 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_getopts()
1399 wp += builtin_opt.optind; in c_getopts()
1401 opts = *wp++; in c_getopts()
1407 var = *wp++; in c_getopts()
1422 if (*wp == NULL) in c_getopts()
1423 wp = e->loc->next->argv; in c_getopts()
1425 *--wp = e->loc->next->argv[0]; in c_getopts()
1428 for (argc = 0; wp[argc]; argc++) in c_getopts()
1432 user_opt.p > strlen(wp[user_opt.optind - 1]))) { in c_getopts()
1438 optc = ksh_getopt(wp, &user_opt, opts); in c_getopts()
1481 c_bind(const char **wp) in c_bind() argument
1491 while ((optc = ksh_getopt(wp, &builtin_opt, in c_bind()
1510 wp += builtin_opt.optind; in c_bind()
1512 if (*wp == NULL) in c_bind()
1520 for (; *wp != NULL; wp++) { in c_bind()
1521 if ((cp = cstrchr(*wp, '=')) == NULL) in c_bind()
1524 strdupx(up, *wp, ATEMP); in c_bind()
1525 up[cp++ - *wp] = '\0'; in c_bind()
1527 if (x_bind(up ? up : *wp, cp, in c_bind()
1540 c_shift(const char **wp) in c_shift() argument
1547 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_shift()
1549 arg = wp[builtin_opt.optind]; in c_shift()
1571 c_umask(const char **wp) in c_umask() argument
1578 while ((optc = ksh_getopt(wp, &builtin_opt, "S")) != -1) in c_umask()
1586 cp = wp[builtin_opt.optind]; in c_umask()
1704 c_dot(const char **wp) in c_dot() argument
1709 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_dot()
1712 if ((cp = wp[builtin_opt.optind]) == NULL) { in c_dot()
1722 if (wp[builtin_opt.optind + 1]) { in c_dot()
1723 argv = wp + builtin_opt.optind; in c_dot()
1741 c_wait(const char **wp) in c_wait() argument
1745 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_wait()
1747 wp += builtin_opt.optind; in c_wait()
1748 if (*wp == NULL) { in c_wait()
1753 for (; *wp; wp++) in c_wait()
1754 rv = waitfor(*wp, &sig); in c_wait()
1763 c_read(const char **wp) in c_read() argument
1788 while ((c = ksh_getopt(wp, &builtin_opt, c_read_opts)) != -1) in c_read()
1843 wp += builtin_opt.optind; in c_read()
1844 if (*wp == NULL) in c_read()
1845 *--wp = REPLY; in c_read()
1847 if (intoarray && wp[1] != NULL) { in c_read()
1852 if ((ccp = cstrchr(*wp, '?')) != NULL) { in c_read()
1853 strdupx(allocd, *wp, ATEMP); in c_read()
1854 allocd[ccp - *wp] = '\0'; in c_read()
1855 *wp = allocd; in c_read()
2021 vp = global(*wp); in c_read()
2024 bi_errorf("%s: %s", *wp, "is read only"); in c_read()
2072 if (!intoarray && wp[1] == NULL) in c_read()
2130 vq = global(*wp); in c_read()
2135 typeset(*wp, EXPORT, 0, 0, 0); in c_read()
2144 if (intoarray || *++wp != NULL) in c_read()
2161 c_eval(const char **wp) in c_eval() argument
2167 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_eval()
2170 s->u.strv = wp + builtin_opt.optind; in c_eval()
2214 c_trap(const char **wp) in c_trap() argument
2220 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_trap()
2222 wp += builtin_opt.optind; in c_trap()
2224 if (*wp == NULL) { in c_trap()
2240 s = (gettrap(*wp, false) == NULL) ? *wp++ : NULL; in c_trap()
2246 while (*wp != NULL) in c_trap()
2247 if ((p = gettrap(*wp++, true)) == NULL) { in c_trap()
2249 "bad signal", wp[-1]); in c_trap()
2257 c_exitreturn(const char **wp) in c_exitreturn() argument
2262 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_exitreturn()
2264 arg = wp[builtin_opt.optind]; in c_exitreturn()
2274 if (wp[0][0] == 'r') { in c_exitreturn()
2301 c_brkcont(const char **wp) in c_brkcont() argument
2307 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_brkcont()
2309 arg = wp[builtin_opt.optind]; in c_brkcont()
2338 warningf(true, "%s: %s %s", wp[0], "can't", wp[0]); in c_brkcont()
2349 wp[0], wp[0], n - quit); in c_brkcont()
2352 unwind(*wp[0] == 'b' ? LBREAK : LCONTIN); in c_brkcont()
2357 c_set(const char **wp) in c_set() argument
2364 if (wp[1] == NULL) { in c_set()
2369 argi = parse_args(wp, OF_SET, &setargs); in c_set()
2374 wp += argi - 1; in c_set()
2375 owp = wp; in c_set()
2377 wp[0] = l->argv[0]; in c_set()
2378 while (*++wp != NULL) in c_set()
2379 strdupx(*wp, *wp, &l->area); in c_set()
2380 l->argc = wp - owp - 1; in c_set()
2382 for (wp = l->argv; (*wp++ = *owp++) != NULL; ) in c_set()
2398 c_unset(const char **wp) in c_unset() argument
2404 while ((optc = ksh_getopt(wp, &builtin_opt, "fv")) != -1) in c_unset()
2416 wp += builtin_opt.optind; in c_unset()
2417 for (; (id = *wp) != NULL; wp++) in c_unset()
2462 c_times(const char **wp MKSH_A_UNUSED) in c_times()
2558 char **wp = *app; in timex_hook() local
2565 while ((optc = ksh_getopt((const char **)wp, &opt, ":p")) != -1) in timex_hook()
2580 afree(wp[i], ATEMP); in timex_hook()
2581 for (i = 0, j = opt.optind; (wp[i] = wp[j]); i++, j++) in timex_hook()
2584 if (!wp[0]) in timex_hook()
2586 *app = wp; in timex_hook()
2591 c_exec(const char **wp MKSH_A_UNUSED) in c_exec()
2615 c_mknod(const char **wp) in c_mknod() argument
2623 while ((optc = ksh_getopt(wp, &builtin_opt, "m:")) != -1) { in c_mknod()
2638 argv = &wp[builtin_opt.optind]; in c_mknod()
2725 c_test(const char **wp) in c_test() argument
2736 for (argc = 0; wp[argc]; argc++) in c_test()
2739 if (strcmp(wp[0], "[") == 0) { in c_test()
2740 if (strcmp(wp[--argc], "]") != 0) { in c_test()
2746 te.pos.wp = wp + 1; in c_test()
2747 te.wp_end = wp + argc; in c_test()
2755 const char **owp = wp, **owpend = te.wp_end; in c_test()
2761 te.pos.wp = te.wp_end - 1; in c_test()
2765 te.pos.wp = owp + 2; in c_test()
2767 te.pos.wp = owp + 1; in c_test()
2788 te.pos.wp--; in c_test()
2803 te.pos.wp = owp + 1; in c_test()
3141 if ((te->flags & TEF_DBRACKET) || (&te->pos.wp[1] < te->wp_end && in test_primary()
3142 !test_isop(TM_BINOP, te->pos.wp[1]))) { in test_primary()
3190 if (te->pos.wp >= te->wp_end) in ptest_isa()
3194 rv = test_isop(meta, *te->pos.wp); in ptest_isa()
3198 rv = !strcmp(*te->pos.wp, tokens[(int)meta]) ? in ptest_isa()
3203 te->pos.wp++; in ptest_isa()
3211 if (te->pos.wp >= te->wp_end) in ptest_getopnd()
3213 return (*te->pos.wp++); in ptest_getopnd()
3222 if ((op = te->pos.wp + ofs >= te->wp_end ? NULL : te->pos.wp[ofs])) in ptest_error()
3286 c_ulimit(const char **wp) in c_ulimit() argument
3380 while ((optc = ksh_getopt(wp, &builtin_opt, opts)) != -1) in c_ulimit()
3406 if (wp[builtin_opt.optind]) { in c_ulimit()
3407 if (all || wp[builtin_opt.optind + 1]) { in c_ulimit()
3411 return (set_ulimit(l, wp[builtin_opt.optind], how)); in c_ulimit()
3488 c_rename(const char **wp) in c_rename() argument
3493 ++wp; in c_rename()
3494 if (wp[0] && !strcmp(wp[0], "--")) in c_rename()
3496 ++wp; in c_rename()
3499 if (wp[0] == NULL /* first argument */ || in c_rename()
3500 wp[1] == NULL /* second argument */ || in c_rename()
3501 wp[2] != NULL /* no further args please */) in c_rename()
3503 else if ((rv = rename(wp[0], wp[1])) != 0) { in c_rename()
3512 c_realpath(const char **wp) in c_realpath() argument
3518 ++wp; in c_realpath()
3519 if (wp[0] && !strcmp(wp[0], "--")) in c_realpath()
3521 ++wp; in c_realpath()
3524 if (wp[0] == NULL || wp[1] != NULL) in c_realpath()
3526 else if ((buf = do_realpath(wp[0])) == NULL) { in c_realpath()
3528 bi_errorf("%s: %s", wp[0], strerror(rv)); in c_realpath()
3541 c_cat(const char **wp) in c_cat() argument
3555 while ((rv = ksh_getopt(wp, &builtin_opt, "u")) != -1) { in c_cat()
3565 wp += builtin_opt.optind; in c_cat()
3569 if (*wp) { in c_cat()
3570 fn = *wp++; in c_cat()
3618 } while (*wp); in c_cat()
3627 c_sleep(const char **wp) in c_sleep() argument
3633 ++wp; in c_sleep()
3634 if (wp[0] && !strcmp(wp[0], "--")) in c_sleep()
3636 ++wp; in c_sleep()
3638 if (!wp[0] || wp[1]) in c_sleep()
3640 else if (parse_usec(wp[0], &tv)) in c_sleep()
3641 bi_errorf("%s: %s '%s'", Tsynerr, strerror(errno), wp[0]); in c_sleep()
3667 c_android_lsmod(const char **wp MKSH_A_UNUSED) in c_android_lsmod()