Lines Matching +full:no +full:- +full:wp
4 /*-
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
41 static iconv_t catgets_iconv; /* Or (iconv_t)-1 */
52 static int zlast = -1;
69 Char *cp = t->t_dcom[0]; in isbfunc()
88 if (t->t_dflg & F_AMPERSAND) { in isbfunc()
89 t->t_dflg &= ~F_AMPERSAND; in isbfunc()
101 * non-builtin command. -- JDK 2/4/88 in isbfunc()
114 bp = bp1 + ((bp2 - bp1) >> 1); in isbfunc()
115 if ((i = ((char) *cp) - *bp->bname) == 0 && in isbfunc()
116 (i = StrQcmp(cp, str2short(bp->bname))) == 0) in isbfunc()
134 xechoit(t->t_dcom); in func()
135 setname(bp->bname); in func()
136 i = blklen(t->t_dcom) - 1; in func()
137 if (i < bp->minargs) in func()
139 if (i > bp->maxargs) in func()
141 (*bp->bfunct) (t->t_dcom, t); in func()
221 if (*(ftest = *++v) != '-') in dofiletest()
262 if (vp && vp->vec) in doalias()
263 blkpr(vp->vec), xputchar('\n'); in doalias()
378 lshift(kp->t_dcom, vv - kp->t_dcom); in doif()
391 kp->t_dflg &= F_SAVE; in reexecute()
392 kp->t_dflg |= F_REPEAT; in reexecute()
395 * pgrp's as the jobs would then have no way to get the tty (we can't give in reexecute()
398 execute(kp, (tpgrp > 0 ? tpgrp : -1), NULL, NULL, TRUE); in reexecute()
428 struct whyle *wp; in gotolab() local
434 for (wp = whyles; wp; wp = wp->w_next) in gotolab()
435 if (wp->w_end.type == TCSH_F_SEEK && wp->w_end.f_seek == 0) { in gotolab()
437 btell(&wp->w_end); in gotolab()
440 bseek(&wp->w_end); in gotolab()
461 v--; in doswitch()
527 if (v[0][0] != '(' || v[blklen(v) - 1][0] != ')') in doforeach()
541 nwp->w_fe = nwp->w_fe0 = v; in doforeach()
542 btell(&nwp->w_start); in doforeach()
543 nwp->w_fename = Strsave(cp); in doforeach()
544 nwp->w_next = whyles; in doforeach()
545 nwp->w_end.type = TCSH_F_SEEK; in doforeach()
548 * Pre-read the loop so as to be more comprehensible to a terminal user. in doforeach()
563 SEEKEQ(&whyles->w_start, &lineloc) && in dowhile()
564 whyles->w_fename == 0; in dowhile()
583 nwp->w_start = lineloc; in dowhile()
584 nwp->w_end.type = TCSH_F_SEEK; in dowhile()
585 nwp->w_end.f_seek = 0; in dowhile()
586 nwp->w_end.a_seek = 0; in dowhile()
587 nwp->w_next = whyles; in dowhile()
600 /* We ain't gonna loop no more, no more! */ in dowhile()
609 whyles->w_end.type = TCSH_I_SEEK; in preread()
615 btell(&whyles->w_end); in preread()
626 btell(&whyles->w_end); in doend()
647 if (whyles->w_fename == 0) { in doagain()
648 bseek(&whyles->w_start); in doagain()
656 if (!whyles->w_fe[1]) { in doagain()
660 setv(whyles->w_fename, quote(Strsave(*whyles->w_fe++)), VAR_READWRITE); in doagain()
661 bseek(&whyles->w_start); in doagain()
687 --i; in dorepeat()
714 return -1; in srchx()
721 sp = sp1 + ((sp2 - sp1) >> 1); in srchx()
722 if ((i = *cp - *sp->s_name) == 0 && in srchx()
723 (i = Strcmp(cp, str2short(sp->s_name))) == 0) in srchx()
724 return sp->s_value; in srchx()
730 return (-1); in srchx()
739 if (sp->s_value == n) in isrchx()
740 return (sp->s_name); in isrchx()
753 struct whyle *wp; in search() local
772 ohistent->word = STRNULL; in search()
773 ohistent->next = histent; in search()
774 histent->prev = ohistent; in search()
784 histent->word = Strsave(word.s); in search()
785 histent->next = xmalloc(sizeof(*histent)); in search()
786 histent->next->prev = histent; in search()
787 histent = histent->next; in search()
800 histent->word = Strsave(word.s); in search()
801 histent->next = xmalloc(sizeof(*histent)); in search()
802 histent->next->prev = histent; in search()
803 histent = histent->next; in search()
815 level--; in search()
828 wp = whyles; in search()
829 if (wp) { in search()
830 whyles = wp->w_next; in search()
831 wpfree(wp); in search()
836 level--; in search()
837 wlevel--; in search()
847 level--; in search()
852 level = -1; in search()
858 if (word.len == 0 || word.s[word.len - 1] != ':') in search()
860 word.s[--word.len] = 0; in search()
863 level = -1; in search()
870 if (word.len != 0 && word.s[word.len - 1] == ':') in search()
871 word.s[--word.len] = 0; in search()
875 level = -1; in search()
881 level = -1; in search()
885 ohistent->prev = histgetword(histent); in search()
886 ohistent->prev->next = ohistent; in search()
905 tmp->size = 0; in histgetword()
906 tmp->s = NULL; in histgetword()
911 tmp->len = 0; in histgetword()
953 tmp->len--; in histgetword()
954 if (tmp->len) { in histgetword()
956 histent->word = Strsave(tmp->s); in histgetword()
957 histent->next = xmalloc(sizeof (*histent)); in histgetword()
958 histent->next->prev = histent; in histgetword()
959 histent = histent->next; in histgetword()
963 tmp->len = 0; in histgetword()
966 histent->word = Strsave(tmp->s); in histgetword()
1004 getword(struct Strbuf *wp) in getword() argument
1009 if (wp) in getword()
1010 wp->len = 0; in getword()
1023 if (wp) in getword()
1042 if (wp) in getword()
1043 Strbuf_append1(wp, (Char) c); in getword()
1045 if (!first && wp) { in getword()
1048 if (wp) { in getword()
1049 wp->len = 1; in getword()
1050 Strbuf_terminate(wp); in getword()
1056 if (wp) in getword()
1063 } while (wp == 0); in getword()
1068 wp->len--; in getword()
1069 Strbuf_terminate(wp); in getword()
1109 if (whyles->w_end.type == TCSH_F_SEEK && whyles->w_end.f_seek == 0) { in toend()
1111 btell(&whyles->w_end); in toend()
1112 whyles->w_end.f_seek--; in toend()
1115 bseek(&whyles->w_end); in toend()
1121 wpfree(struct whyle *wp) in wpfree() argument
1123 if (wp->w_fe0) in wpfree()
1124 blkfree(wp->w_fe0); in wpfree()
1125 xfree(wp->w_fename); in wpfree()
1126 xfree(wp); in wpfree()
1145 xprintf("o->type %c o->a_seek %d o->f_seek %d\n", in wfree()
1150 struct whyle *wp = whyles; in wfree() local
1151 nwp = wp->w_next; in wfree()
1154 xprintf("start->type %c start->a_seek %d start->f_seek %d\n", in wfree()
1155 foo[wp->w_start.type+1], in wfree()
1156 wp->w_start.a_seek, wp->w_start.f_seek); in wfree()
1157 xprintf("end->type %c end->a_seek %d end->f_seek %d\n", in wfree()
1158 foo[wp->w_end.type + 1], wp->w_end.a_seek, wp->w_end.f_seek); in wfree()
1164 if (wp->w_end.type != TCSH_I_SEEK && wp->w_start.type == wp->w_end.type && in wfree()
1165 wp->w_start.type == o.type) { in wfree()
1166 if (wp->w_end.type == TCSH_F_SEEK) { in wfree()
1167 if (o.f_seek >= wp->w_start.f_seek && in wfree()
1168 (wp->w_end.f_seek == 0 || o.f_seek < wp->w_end.f_seek)) in wfree()
1172 if (o.a_seek >= wp->w_start.a_seek && in wfree()
1173 (wp->w_end.a_seek == 0 || o.a_seek < wp->w_end.a_seek)) in wfree()
1178 wpfree(wp); in wfree()
1207 if ((vp = adrof(STRecho_style)) != NULL && vp->vec != NULL && in xecho()
1208 vp->vec[0] != NULL) { in xecho()
1209 if (Strcmp(vp->vec[0], STRbsd) == 0) in xecho()
1211 else if (Strcmp(vp->vec[0], STRsysv) == 0) in xecho()
1213 else if (Strcmp(vp->vec[0], STRboth) == 0) in xecho()
1215 else if (Strcmp(vp->vec[0], STRnone) == 0) in xecho()
1286 c = c * 8 + *cp++ - '0'; in xecho()
1288 c = c * 8 + *cp++ - '0'; in xecho()
1290 c = c * 8 + *cp++ - '0'; in xecho()
1294 cp--; in xecho()
1376 /* from "Karl Berry." <karl%mote.umb.edu@relay.cs.net> -- for NeXT things
1387 doprintenv(--v, 0); in dosetenv()
1808 i = i * 8 + *cp++ - '0'; in doumask()
1852 /* Yes, we could have defined _KERNEL, and -I/etc/conf/h, but is that better? */
1892 * Oh well, <asm-generic/resource.h> has it, but <bits/resource.h> does not
2014 { -1, NULL, 0, NULL }
2050 for (lp = limits; lp->limconst >= 0; lp++) in findlim()
2051 if (prefix(cp, str2short(lp->limname))) { in findlim()
2078 for (lp = limits; lp->limconst >= 0; lp++) in dolimit()
2102 * is f too large to cope with. limit f to minint, maxint - X-6768 by in getval()
2114 return restrict_limit((f * lp->limdiv) + 0.5); in getval()
2120 if (lp->limconst != RLIMIT_CPU) in getval()
2124 if (lp->limconst != RLIMIT_CPU) in getval()
2132 if (lp->limconst == RLIMIT_CPU) { in getval()
2143 if (lp->limconst != RLIMIT_CPU) in getval()
2153 if (lp->limconst == RLIMIT_CPU) in getval()
2161 if (lp->limconst == RLIMIT_CPU) in getval()
2170 if (lp->limconst == RLIMIT_CPU) in getval()
2178 if (lp->limconst == RLIMIT_CPU) in getval()
2234 int xdiv = lp->limdiv; in plim()
2236 xprintf("%-13.13s", lp->limname); in plim()
2239 limit = ulimit(lp->limconst, 0); in plim()
2241 if (lp->limconst == RLIMIT_DATA) in plim()
2242 limit -= 0x20000000; in plim()
2245 (void) getrlimit(lp->limconst, &rlim); in plim()
2252 * blocks. Note we cannot pre-multiply cause we might overflow (A/UX) in plim()
2254 if (lp->limconst == RLIMIT_FSIZE) { in plim()
2266 if (lp->limconst == RLIMIT_CPU && in plim()
2272 if (lp->limconst == RLIMIT_CPU) in plim()
2276 xprintf("%ld %s", (long) (limit / xdiv), lp->limscale); in plim()
2290 while (*++v && **v == '-') { in dounlimit()
2307 for (lp = limits; lp->limconst >= 0; lp++) in dounlimit()
2327 (void) getrlimit(lp->limconst, &rlim);
2331 if (limit != RLIM_INFINITY && lp->limconst == RLIMIT_FSIZE)
2344 if (setrlimit(lp->limconst, &rlim) < 0) {
2346 if (limit != RLIM_INFINITY && lp->limconst == RLIMIT_FSIZE)
2349 if (lp->limconst == RLIMIT_DATA)
2352 if (ulimit(toset(lp->limconst), limit) < 0) {
2364 lp->limname, op, type, strerror(err));
2366 return (-1);
2399 if (tpgrp != -1) {
2400 if (grabpgrp(FSHTTY, opgrp) == -1)
2409 /* This is the dreaded EVAL built-in.
2417 * This is also the case for "time eval date" -- stay in same pgrp.
2419 * pgrp, with no way for the shell to get them going again. -IAN!
2439 evalvec = state->evalvec;
2440 evalp = state->evalp;
2443 didcch = state->didcch;
2445 didfds = state->didfds;
2446 if (state->saveIN != SHIN)
2448 if (state->saveOUT != SHOUT)
2450 if (state->saveDIAG != SHDIAG)
2452 close_on_exec(SHIN = dmove(state->saveIN, state->SHIN), 1);
2453 close_on_exec(SHOUT = dmove(state->saveOUT, state->SHOUT), 1);
2454 close_on_exec(SHDIAG = dmove(state->saveDIAG, state->SHDIAG), 1);
2501 (void)close_on_exec(state.saveIN = dcopy(SHIN, -1), 1);
2502 (void)close_on_exec(state.saveOUT = dcopy(SHOUT, -1), 1);
2503 (void)close_on_exec(state.saveDIAG = dcopy(SHDIAG, -1), 1);
2511 my_reenter = 1; /* assume non-zero return val */
2519 (void)close_on_exec(SHIN = dcopy(0, -1), 1);
2520 (void)close_on_exec(SHOUT = dcopy(1, -1), 1);
2521 (void)close_on_exec(SHDIAG = dcopy(2, -1), 1);
2570 maxwidth = max(maxwidth, strlen(b->bname));
2576 rows = (nbfunc + (columns - 1)) / columns;
2581 w = strlen(b->bname);
2582 xprintf("%s", b->bname);
2583 if (col < (columns - 1)) /* Not last column? */
2589 if (row < (rows - 1)) {
2634 if (catgets_iconv == (iconv_t)-1 || orig == s)
2642 dest_size = buf + buf_size - dest;
2644 == (size_t)-1) {
2650 dest = p + (dest - buf);
2674 #ifdef NL_CAT_LOCALE /* POSIX-compliant. */
2680 #else /* pre-POSIX */
2691 xcatgets(catd, 255, 1, "UTF-8"));
2709 if (catgets_iconv != (iconv_t)-1) {
2711 catgets_iconv = (iconv_t)-1;
2714 if (catd != (nl_catd)-1) {
2717 * making us re-enter this code. Prevent infinite recursion
2722 catd = (nl_catd)-1;
2723 while (catclose(oldcatd) == -1 && errno == EINTR)