Home | History | Annotate | Download | only in src

Lines Matching defs:wp

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