• Home
  • Raw
  • Download

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()
236 c_pwd(const char **wp) in c_pwd() argument
242 while ((optc = ksh_getopt(wp, &builtin_opt, "LP")) != -1) in c_pwd()
253 wp += builtin_opt.optind; in c_pwd()
255 if (wp[0]) { in c_pwd()
279 c_print(const char **wp) in c_print() argument
290 if (wp[0][0] == 'e') { in c_print()
292 ++wp; in c_print()
309 if (*wp && !strcmp(*wp, "-n")) { in c_print()
312 ++wp; in c_print()
331 if ((s = *wp) && *s++ == '-' && *s) { in c_print()
346 ++wp; in c_print()
358 while ((c = ksh_getopt(wp, &builtin_opt, opts)) != -1) in c_print()
398 if (wp[builtin_opt.optind] && in c_print()
399 ksh_isdash(wp[builtin_opt.optind])) in c_print()
403 wp += builtin_opt.optind; in c_print()
408 if (*wp != NULL) { in c_print()
410 s = *wp; in c_print()
445 if (*++wp != NULL) { in c_print()
515 c_whence(const char **wp) in c_whence() argument
521 bool iam_whence = wp[0][0] == 'w'; in c_whence()
524 while ((optc = ksh_getopt(wp, &builtin_opt, opts)) != -1) in c_whence()
538 wp += builtin_opt.optind; in c_whence()
555 while ((vflag || rv == 0) && (id = *wp++) != NULL) { in c_whence()
656 c_command(const char **wp) in c_command() argument
662 return (c_whence(wp)); in c_command()
670 c_typeset(const char **wp) in c_typeset() argument
681 switch (**wp) { in c_typeset()
719 while ((i = ksh_getopt(wp, &builtin_opt, opts)) != -1) { in c_typeset()
808 if (!(builtin_opt.info & GI_MINUSMINUS) && wp[builtin_opt.optind] && in c_typeset()
809 (wp[builtin_opt.optind][0] == '-' || in c_typeset()
810 wp[builtin_opt.optind][0] == '+') && in c_typeset()
811 wp[builtin_opt.optind][1] == '\0') { in c_typeset()
812 thing = wp[builtin_opt.optind][0]; in c_typeset()
821 if (wp[builtin_opt.optind]) { in c_typeset()
857 if (wp[builtin_opt.optind] && in c_typeset()
865 for (i = builtin_opt.optind; wp[i]; i++) { in c_typeset()
867 f = findfunc(wp[i], hash(wp[i]), in c_typeset()
880 wp[i], f->val.t); in c_typeset()
883 } else if (!typeset(wp[i], fset, fclr, field, base)) { in c_typeset()
884 bi_errorf("%s: %s", wp[i], "is not an identifier"); in c_typeset()
909 } else if (wp[builtin_opt.optind]) { in c_typeset()
910 for (i = builtin_opt.optind; wp[i]; i++) { in c_typeset()
911 varsearch(e->loc, &vp, wp[i], hash(wp[i])); in c_typeset()
1042 c_alias(const char **wp) in c_alias() argument
1051 while ((optc = ksh_getopt(wp, &builtin_opt, "dprtUx")) != -1) { in c_alias()
1088 wp += builtin_opt.optind; in c_alias()
1090 if (!(builtin_opt.info & GI_MINUSMINUS) && *wp && in c_alias()
1091 (wp[0][0] == '-' || wp[0][0] == '+') && wp[0][1] == '\0') { in c_alias()
1092 prefix = wp[0][0]; in c_alias()
1093 wp++; in c_alias()
1104 if (!tflag || *wp) { in c_alias()
1113 if (*wp == NULL) { in c_alias()
1129 for (; *wp != NULL; wp++) { in c_alias()
1130 const char *alias = *wp, *val, *newval; in c_alias()
1188 c_unalias(const char **wp) in c_unalias() argument
1195 while ((optc = ksh_getopt(wp, &builtin_opt, "adt")) != -1) in c_unalias()
1218 wp += builtin_opt.optind; in c_unalias()
1220 for (; *wp != NULL; wp++) { in c_unalias()
1221 ap = ktsearch(t, *wp, hash(*wp)); in c_unalias()
1250 c_let(const char **wp) in c_let() argument
1255 if (wp[1] == NULL) in c_let()
1259 for (wp++; *wp; wp++) in c_let()
1260 if (!evaluate(*wp, &val, KSH_RETURN_ERROR, true)) { in c_let()
1270 c_jobs(const char **wp) in c_jobs() argument
1274 while ((optc = ksh_getopt(wp, &builtin_opt, "lpnz")) != -1) in c_jobs()
1292 wp += builtin_opt.optind; in c_jobs()
1293 if (!*wp) { in c_jobs()
1297 for (; *wp; wp++) in c_jobs()
1298 if (j_jobs(*wp, flag, nflag)) in c_jobs()
1306 c_fgbg(const char **wp) in c_fgbg() argument
1308 bool bg = strcmp(*wp, "bg") == 0; in c_fgbg()
1315 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_fgbg()
1317 wp += builtin_opt.optind; in c_fgbg()
1318 if (*wp) in c_fgbg()
1319 for (; *wp; wp++) in c_fgbg()
1320 rv = j_resume(*wp, bg); in c_fgbg()
1342 c_kill(const char **wp) in c_kill() argument
1350 if ((p = wp[1]) && *p == '-' && (ksh_isdigit(p[1]) || in c_kill()
1356 i = (wp[2] && strcmp(wp[2], "--") == 0) ? 3 : 2; in c_kill()
1360 while ((optc = ksh_getopt(wp, &builtin_opt, "ls:")) != -1) in c_kill()
1378 if ((lflag && t) || (!wp[i] && !lflag)) { in c_kill()
1389 if (wp[i]) { in c_kill()
1390 for (; wp[i]; i++) { in c_kill()
1391 if (!bi_getn(wp[i], &n)) in c_kill()
1440 for (; (p = wp[i]); i++) { in c_kill()
1469 c_getopts(const char **wp) in c_getopts() argument
1476 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_getopts()
1478 wp += builtin_opt.optind; in c_getopts()
1480 opts = *wp++; in c_getopts()
1486 var = *wp++; in c_getopts()
1501 if (*wp == NULL) in c_getopts()
1502 wp = e->loc->next->argv; in c_getopts()
1504 *--wp = e->loc->next->argv[0]; in c_getopts()
1507 for (argc = 0; wp[argc]; argc++) in c_getopts()
1511 user_opt.p > strlen(wp[user_opt.optind - 1]))) { in c_getopts()
1517 optc = ksh_getopt(wp, &user_opt, opts); in c_getopts()
1561 c_bind(const char **wp) in c_bind() argument
1571 while ((optc = ksh_getopt(wp, &builtin_opt, in c_bind()
1590 wp += builtin_opt.optind; in c_bind()
1592 if (*wp == NULL) in c_bind()
1600 for (; *wp != NULL; wp++) { in c_bind()
1601 if ((cp = cstrchr(*wp, '=')) == NULL) in c_bind()
1604 strdupx(up, *wp, ATEMP); in c_bind()
1605 up[cp++ - *wp] = '\0'; in c_bind()
1607 if (x_bind(up ? up : *wp, cp, in c_bind()
1621 c_shift(const char **wp) in c_shift() argument
1628 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_shift()
1630 arg = wp[builtin_opt.optind]; in c_shift()
1656 c_umask(const char **wp) in c_umask() argument
1663 while ((optc = ksh_getopt(wp, &builtin_opt, "S")) != -1) in c_umask()
1671 cp = wp[builtin_opt.optind]; in c_umask()
1792 c_dot(const char **wp) in c_dot() argument
1797 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_dot()
1800 if ((cp = wp[builtin_opt.optind]) == NULL) { in c_dot()
1805 if (!file && errcode == ENOENT && wp[0][0] == 's' && in c_dot()
1814 if (wp[builtin_opt.optind + 1]) { in c_dot()
1815 argv = wp + builtin_opt.optind; in c_dot()
1833 c_wait(const char **wp) in c_wait() argument
1837 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_wait()
1839 wp += builtin_opt.optind; in c_wait()
1840 if (*wp == NULL) { in c_wait()
1845 for (; *wp; wp++) in c_wait()
1846 rv = waitfor(*wp, &sig); in c_wait()
1856 c_read(const char **wp) in c_read() argument
1883 while ((c = ksh_getopt(wp, &builtin_opt, c_read_opts)) != -1) in c_read()
1938 wp += builtin_opt.optind; in c_read()
1939 if (*wp == NULL) in c_read()
1940 *--wp = REPLY; in c_read()
1942 if (intoarray && wp[1] != NULL) { in c_read()
1947 if ((ccp = cstrchr(*wp, '?')) != NULL) { in c_read()
1948 strdupx(allocd, *wp, ATEMP); in c_read()
1949 allocd[ccp - *wp] = '\0'; in c_read()
1950 *wp = allocd; in c_read()
2118 vp = global(*wp); in c_read()
2122 bi_errorf("read-only: %s", *wp); in c_read()
2170 if (!intoarray && wp[1] == NULL) in c_read()
2246 vq = global(*wp); in c_read()
2251 typeset(*wp, EXPORT, 0, 0, 0); in c_read()
2260 if (intoarray || *++wp != NULL) in c_read()
2277 c_eval(const char **wp) in c_eval() argument
2283 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_eval()
2286 s->u.strv = wp + builtin_opt.optind; in c_eval()
2335 c_trap(const char **wp) in c_trap() argument
2341 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_trap()
2343 wp += builtin_opt.optind; in c_trap()
2345 if (*wp == NULL) { in c_trap()
2357 if (getn(*wp, &i)) { in c_trap()
2362 s = *wp++; in c_trap()
2370 while (*wp) in c_trap()
2371 if (!(p = gettrap(*wp++, true, true))) { in c_trap()
2373 "bad signal", wp[-1]); in c_trap()
2381 c_exitreturn(const char **wp) in c_exitreturn() argument
2385 if (wp[1]) { in c_exitreturn()
2386 if (wp[2]) in c_exitreturn()
2388 exstat = bi_getn(wp[1], &n) ? (n & 0xFF) : 1; in c_exitreturn()
2392 if (wp[0][0] == 'r') { in c_exitreturn()
2423 c_brkcont(const char **wp) in c_brkcont() argument
2430 if (ksh_getopt(wp, &builtin_opt, null) == '?') in c_brkcont()
2432 arg = wp[builtin_opt.optind]; in c_brkcont()
2461 warningf(true, "%s: %s %s", wp[0], "can't", wp[0]); in c_brkcont()
2472 wp[0], wp[0], (unsigned int)n - quit); in c_brkcont()
2475 unwind(*wp[0] == 'b' ? LBREAK : LCONTIN); in c_brkcont()
2483 c_set(const char **wp) in c_set() argument
2490 if (wp[1] == NULL) { in c_set()
2495 if ((argi = parse_args(wp, OF_SET, &setargs)) < 0) in c_set()
2499 wp += argi - 1; in c_set()
2500 owp = wp; in c_set()
2502 wp[0] = l->argv[0]; in c_set()
2503 while (*++wp != NULL) in c_set()
2504 strdupx(*wp, *wp, &l->area); in c_set()
2505 l->argc = wp - owp - 1; in c_set()
2507 for (wp = l->argv; (*wp++ = *owp++) != NULL; ) in c_set()
2528 c_unset(const char **wp) in c_unset() argument
2534 while ((optc = ksh_getopt(wp, &builtin_opt, "fv")) != -1) in c_unset()
2546 wp += builtin_opt.optind; in c_unset()
2547 for (; (id = *wp) != NULL; wp++) in c_unset()
2591 c_times(const char **wp MKSH_A_UNUSED) in c_times()
2687 char **wp = *app; in timex_hook() local
2694 while ((optc = ksh_getopt((const char **)wp, &opt, ":p")) != -1) in timex_hook()
2709 afree(wp[i], ATEMP); in timex_hook()
2710 for (i = 0, j = opt.optind; (wp[i] = wp[j]); i++, j++) in timex_hook()
2713 if (!wp[0]) in timex_hook()
2715 *app = wp; in timex_hook()
2720 c_exec(const char **wp MKSH_A_UNUSED) in c_exec()
2746 c_mknod(const char **wp) in c_mknod() argument
2754 while ((optc = ksh_getopt(wp, &builtin_opt, "m:")) != -1) { in c_mknod()
2769 argv = &wp[builtin_opt.optind]; in c_mknod()
2856 c_test(const char **wp) in c_test() argument
2869 for (argc = 0; wp[argc]; argc++) in c_test()
2872 if (strcmp(wp[0], "[") == 0) { in c_test()
2873 if (strcmp(wp[--argc], "]") != 0) { in c_test()
2879 te.pos.wp = wp + 1; in c_test()
2880 te.wp_end = wp + argc; in c_test()
2903 rv = test_eval(&te, op, *te.pos.wp++, NULL, true); in c_test()
2913 swp = te.pos.wp; in c_test()
2915 lhs = *te.pos.wp++; in c_test()
2918 rv = test_eval(&te, op, lhs, *te.pos.wp++, true); in c_test()
2922 te.pos.wp = swp; in c_test()
2928 swp = te.pos.wp; in c_test()
2930 te.pos.wp++; in c_test()
2934 te.pos.wp = swp; in c_test()
2948 swp = te.pos.wp; in c_test()
2950 te.pos.wp++; in c_test()
2951 te.pos.wp++; in c_test()
2955 te.pos.wp = swp; in c_test()
2966 te.pos.wp = wp + 1; in c_test()
3333 if ((te->flags & TEF_DBRACKET) || (&te->pos.wp[1] < te->wp_end && in test_primary()
3334 !test_isop(TM_BINOP, te->pos.wp[1]))) { in test_primary()
3382 if (te->pos.wp >= te->wp_end) in ptest_isa()
3386 rv = test_isop(meta, *te->pos.wp); in ptest_isa()
3390 rv = !strcmp(*te->pos.wp, tokens[(int)meta]) ? in ptest_isa()
3395 te->pos.wp++; in ptest_isa()
3403 if (te->pos.wp >= te->wp_end) in ptest_getopnd()
3405 return (*te->pos.wp++); in ptest_getopnd()
3414 if ((op = te->pos.wp + ofs >= te->wp_end ? NULL : te->pos.wp[ofs])) in ptest_error()
3511 c_ulimit(const char **wp) in c_ulimit() argument
3517 while ((optc = ksh_getopt(wp, &builtin_opt, rlimits_opts)) != -1) in c_ulimit()
3543 if (wp[builtin_opt.optind]) { in c_ulimit()
3544 if (all || wp[builtin_opt.optind + 1]) { in c_ulimit()
3548 return (set_ulimit(rlimits[i], wp[builtin_opt.optind], how)); in c_ulimit()
3629 c_rename(const char **wp) in c_rename() argument
3634 ++wp; in c_rename()
3635 if (wp[0] && !strcmp(wp[0], "--")) in c_rename()
3637 ++wp; in c_rename()
3640 if (wp[0] == NULL /* first argument */ || in c_rename()
3641 wp[1] == NULL /* second argument */ || in c_rename()
3642 wp[2] != NULL /* no further args please */) in c_rename()
3644 else if ((rv = rename(wp[0], wp[1])) != 0) { in c_rename()
3653 c_realpath(const char **wp) in c_realpath() argument
3659 ++wp; in c_realpath()
3660 if (wp[0] && !strcmp(wp[0], "--")) in c_realpath()
3662 ++wp; in c_realpath()
3665 if (wp[0] == NULL || wp[1] != NULL) in c_realpath()
3667 else if ((buf = do_realpath(wp[0])) == NULL) { in c_realpath()
3669 bi_errorf("%s: %s", wp[0], cstrerror(rv)); in c_realpath()
3682 c_cat(const char **wp) in c_cat() argument
3692 while ((rv = ksh_getopt(wp, &builtin_opt, "u")) != -1) { in c_cat()
3702 wp += builtin_opt.optind; in c_cat()
3714 if (*wp) { in c_cat()
3715 fn = *wp++; in c_cat()
3772 } while (*wp); in c_cat()
3782 c_sleep(const char **wp) in c_sleep() argument
3788 ++wp; in c_sleep()
3789 if (wp[0] && !strcmp(wp[0], "--")) in c_sleep()
3791 ++wp; in c_sleep()
3793 if (!wp[0] || wp[1]) in c_sleep()
3795 else if (parse_usec(wp[0], &tv)) in c_sleep()
3796 bi_errorf("%s: %s '%s'", Tsynerr, cstrerror(errno), wp[0]); in c_sleep()
3838 c_suspend(const char **wp) in c_suspend() argument
3840 if (wp[1] != NULL) { in c_suspend()