Lines Matching refs:shellparam
59 struct shparam shellparam; /* current positional parameters */ variable
115 shellparam.p = argptr; in procargs()
116 shellparam.reset = 1; in procargs()
119 shellparam.nparam++; in procargs()
332 freeparam(&shellparam); in setparam()
333 shellparam.malloc = 1; in setparam()
334 shellparam.nparam = argc; in setparam()
335 shellparam.p = newparam; in setparam()
336 shellparam.optp = NULL; in setparam()
337 shellparam.reset = 1; in setparam()
338 shellparam.optnext = NULL; in setparam()
377 if (n > shellparam.nparam) in shiftcmd()
380 shellparam.nparam -= n; in shiftcmd()
381 if (shellparam.malloc) in shiftcmd()
383 ckfree(shellparam.p[i]); in shiftcmd()
384 memmove(shellparam.p, shellparam.p + n, in shiftcmd()
385 (shellparam.nparam + 1) * sizeof(shellparam.p[0])); in shiftcmd()
386 shellparam.reset = 1; in shiftcmd()
419 shellparam.reset = 1; in getoptsreset()
438 if (shellparam.reset == 1) { in getoptscmd()
440 if (shellparam.optp) { in getoptscmd()
441 for (ap = shellparam.optp ; *ap ; ap++) in getoptscmd()
443 ckfree(shellparam.optp); in getoptscmd()
444 shellparam.optp = NULL; in getoptscmd()
447 shellparam.optp = ckmalloc((argc - 2) * sizeof *ap); in getoptscmd()
448 memset(shellparam.optp, '\0', (argc - 2) * sizeof *ap); in getoptscmd()
450 shellparam.optp[i] = savestr(argv[i + 3]); in getoptscmd()
453 optbase = argc == 3 ? shellparam.p : shellparam.optp; in getoptscmd()
454 shellparam.optnext = optbase; in getoptscmd()
455 shellparam.optptr = NULL; in getoptscmd()
456 shellparam.reset = 0; in getoptscmd()
458 optbase = shellparam.optp ? shellparam.optp : shellparam.p; in getoptscmd()
460 return getopts(argv[1], argv[2], optbase, &shellparam.optnext, in getoptscmd()
461 &shellparam.optptr); in getoptscmd()