Home | History | Annotate | Download | only in sh

Lines Matching defs:shellparam

70 struct shparam shellparam;	/* current positional parameters */
158 shellparam.p = argptr;
159 shellparam.reset = 1;
160 /* assert(shellparam.malloc == 0 && shellparam.nparam == 0); */
162 shellparam.nparam++;
392 freeparam(&shellparam);
393 shellparam.malloc = 1;
394 shellparam.nparam = nparam;
395 shellparam.p = newparam;
396 shellparam.optnext = NULL;
445 n = shellparam.nparam - number(*argptr);
448 if (n == 0 || n == shellparam.nparam) /* nothing to do */
451 if (n < 0 || n > shellparam.nparam)
456 for (ap1 = shellparam.p + shellparam.nparam - n;
457 ap1 < shellparam.p + shellparam.nparam; )
459 for (ap2 = shellparam.p + shellparam.nparam, ap1 = ap2 - n;
460 ap1 > shellparam.p; )
464 shellparam.optnext = NULL;
494 if (n > shellparam.nparam)
497 shellparam.nparam -= n;
498 for (ap1 = shellparam.p ; --n >= 0 ; ap1++) {
499 if (shellparam.malloc)
502 ap2 = shellparam.p;
505 shellparam.optnext = NULL;
541 shellparam.optnext = NULL;
542 shellparam.reset = 1;
547 * The getopts builtin. Shellparam.optnext points to the next argument
548 * to be processed. Shellparam.optptr points to the next character to
549 * be processed in the current argument. If shellparam.optnext is NULL,
561 optbase = shellparam.p;
565 if (shellparam.reset == 1) {
566 shellparam.optnext = optbase;
567 shellparam.optptr = NULL;
568 shellparam.reset = 0;
571 return getopts(argv[1], argv[2], optbase, &shellparam.optnext,
572 &shellparam.optptr);