Example #1
0
void
reset(void) {

      /* from eval.c: */
      {
	      evalskip = 0;
	      loopnest = 0;
	      funcnest = 0;
      }

      /* from input.c: */
      {
	      if (exception != EXSHELLPROC)
		      parselleft = parsenleft = 0;	/* clear input buffer */
	      popallfiles();
      }

      /* from parser.c: */
      {
	      tokpushback = 0;
	      checkkwd = 0;
      }

      /* from redir.c: */
      {
	      while (redirlist)
		      popredir();
      }
}
Example #2
0
void
closescript(void)
{
	popallfiles();
	if (parsefile->fd > 0) {
		close(parsefile->fd);
		parsefile->fd = 0;
	}
}
Example #3
0
void
initshellproc() {

      /* from eval.c: */
      {
	      exitstatus = 0;
      }

      /* from exec.c: */
      {
	      deletefuncs();
      }

      /* from input.c: */
      {
	      popallfiles();
      }

      /* from jobs.c: */
      {
	      backgndpid = -1;
#if JOBS
	      jobctl = 0;
#endif
      }

      /* from options.c: */
      {
	      char *p;

	      for (p = optval ; p < optval + sizeof optval ; p++)
		      *p = 0;
      }

      /* from redir.c: */
      {
	      clearredir();
      }

      /* from trap.c: */
      {
	      char *sm;

	      clear_traps();
	      for (sm = sigmode ; sm < sigmode + MAXSIG ; sm++) {
		      if (*sm == S_IGN)
			      *sm = S_HARD_IGN;
	      }
      }

      /* from var.c: */
      {
	      shprocvar();
      }
}
Example #4
0
void
reset() {

      /* from eval.c: */
      {
	      evalskip = 0;
	      loopnest = 0;
      }

      /* from input.c: */
      {
	      parselleft = parsenleft = 0;	/* clear input buffer */
	      popallfiles();
      }

      /* from parser.c: */
      {
	      tokpushback = 0;
	      checkkwd = 0;
      }

      /* from redir.c: */
      {
	      /*
	       * Discard all saved file descriptors.
	       */
	      for (;;) {
		      nullredirs = 0;
		      if (!redirlist)
			      break;
		      popredir(0);
	      }
      }

      /* from output.c: */
      {
#ifdef notyet
	      out1 = &output;
	      out2 = &errout;
#ifdef USE_GLIBC_STDIO
	      if (memout.stream != NULL)
		      __closememout();
#endif
	      if (memout.buf != NULL) {
		      ckfree(memout.buf);
		      memout.buf = NULL;
	      }
#endif
      }
}
Example #5
0
File: init.c Project: akat1/impala
void
reset(void)
{

      /* from eval.c: */
      {
	      evalskip = 0;
	      loopnest = 0;
	      funcnest = 0;
      }

      /* from input.c: */
      {
	      if (exception != EXSHELLPROC)
		      parselleft = parsenleft = 0;	/* clear input buffer */
	      popallfiles();
      }

      /* from output.c: */
      {
	      out1 = &output;
	      out2 = &errout;
	      if (memout.buf != NULL) {
		      ckfree(memout.buf);
		      memout.buf = NULL;
	      }
      }

      /* from parser.c: */
      {
	      tokpushback = 0;
	      checkkwd = 0;
      }

      /* from redir.c: */
      {
	      while (redirlist)
		      popredir();
      }
}
Example #6
0
void
reset(shinstance *psh) {

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/eval.c: */
      {
	      psh->evalskip = 0;
	      psh->loopnest = 0;
	      psh->funcnest = 0;
      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/input.c: */
      {
	      if (psh->exception != EXSHELLPROC)
		      psh->parselleft = psh->parsenleft = 0;	/* clear input buffer */
	      popallfiles(psh);
      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/output.c: */
      {
	      psh->out1 = &psh->output;
	      psh->out2 = &psh->errout;
	      if (psh->memout.buf != NULL) {
		      ckfree(psh, psh->memout.buf);
		      psh->memout.buf = NULL;
	      }
      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/parser.c: */
      {
	      psh->tokpushback = 0;
	      psh->checkkwd = 0;
      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/redir.c: */
      {
	      while (psh->redirlist)
		      popredir(psh);
      }
}
Example #7
0
File: init.c Project: akat1/impala
void
initshellproc(void)
{

      /* from alias.c: */
      {
	      rmaliases();
      }

      /* from eval.c: */
      {
	      exitstatus = 0;
      }

      /* from exec.c: */
      {
	      deletefuncs();
      }

      /* from input.c: */
      {
	      popallfiles();
      }

      /* from jobs.c: */
      {
	      backgndpid = -1;
#if JOBS
	      jobctl = 0;
#endif
      }

      /* from options.c: */
      {
	      int i;

	      for (i = 0; i < NOPTS; i++)
		      optlist[i].val = 0;
	      optschanged();

      }

      /* from redir.c: */
      {
	      clearredir();
      }

      /* from trap.c: */
      {
	      char *sm;

	      clear_traps();
	      for (sm = sigmode ; sm < sigmode + NSIG ; sm++) {
		      if (*sm == S_IGN)
			      *sm = S_HARD_IGN;
	      }
      }

      /* from var.c: */
      {
	      shprocvar();
      }
}
Example #8
0
void
initshellproc(shinstance *psh) {

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/alias.c: */
      {
	      rmaliases(psh);
      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/eval.c: */
      {
	      psh->exitstatus = 0;
      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/exec.c: */
      {
	      deletefuncs(psh);
      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/input.c: */
      {
	      popallfiles(psh);
      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/jobs.c: */
      {
	      psh->backgndpid = -1;
#if JOBS
	      psh->jobctl = 0;
#endif
      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/options.c: */
      {
	      int i;

	      for (i = 0; psh->optlist[i].name; i++)
		      psh->optlist[i].val = 0;
	      optschanged(psh);

      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/redir.c: */
      {
	      clearredir(psh, 0);
      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/trap.c: */
      {
	      char *sm;

	      clear_traps(psh, 0);
	      for (sm = psh->sigmode ; sm < psh->sigmode + NSIG ; sm++) {
		      if (*sm == S_IGN)
			      *sm = S_HARD_IGN;
	      }
      }

      /* from /Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/var.c: */
      {
	      shprocvar(psh);
      }
}