local/toolchest/ksh/sh/name.c
/*
 * Initialize the shell name and alias table
 */
Initialize the shell name and alias table
Initialize the shell name and alias table
void meminit()
{
	register NAMPTR np;
	bltin_nodes = (NAMPTR)malloc((unsigned)(NNODES*sizeof(struct Namnod)));
	namebase = namep = inittree(node_names,bltin_nodes,0);
#ifdef apollo
	(PPIDNOD)->value.namval.cp = (char*)(&ppid);
	(L_ARGNOD)->value.namval.cp = (char*)(&lastarg);
	(TMOUTNOD)->value.namval.cp = (char*)(&timeout);
	(SECONDS)->value.namval.cp = (char*)(&seconds);
	(MCHKNOD)->value.namval.cp = (char*)(&mailchk);
	(RANDNOD)->value.namval.cp = (char*)(&randnum);
#endif	
	namflag(RANDNOD) = N_FREE|INT_GER|BLT_NOD;
	namflag(SECONDS) = N_FREE|INT_GER|BLT_NOD;
	set_second(0L);
	namflag(MCHKNOD) = N_FREE|INT_GER;
	namflag(TMOUTNOD) = INT_GER;
	namflag(PPIDNOD) = (N_FREE|INT_GER|N_RDONLY);
	namflag(L_ARGNOD) = N_FREE|IN_DIR;
	np = (NAMPTR)malloc(NALIAS*sizeof(struct Namnod));
	alias = inittree(alias_names,np,N_EXPORT);
	prnames = gettree(MEMSIZE/4);
}
void meminit ( ) { register NAMPTR np ; bltin_nodes = ( NAMPTR ) malloc ( ( unsigned ) ( NNODES * sizeof ( struct Namnod ) ) ) ; namebase = namep = inittree ( node_names , bltin_nodes , 0 ) ; #ifdef apollo ( PPIDNOD ) -> value . namval . cp = ( char * ) ( & ppid ) ; ( L_ARGNOD ) -> value . namval . cp = ( char * ) ( & lastarg ) ; ( TMOUTNOD ) -> value . namval . cp = ( char * ) ( & timeout ) ; ( SECONDS ) -> value . namval . cp = ( char * ) ( & seconds ) ; ( MCHKNOD ) -> value . namval . cp = ( char * ) ( & mailchk ) ; ( RANDNOD ) -> value . namval . cp = ( char * ) ( & randnum ) ; #endif namflag ( RANDNOD ) = N_FREE | INT_GER | BLT_NOD ; namflag ( SECONDS ) = N_FREE | INT_GER | BLT_NOD ; set_second ( 0L ) ; namflag ( MCHKNOD ) = N_FREE | INT_GER ; namflag ( TMOUTNOD ) = INT_GER ; namflag ( PPIDNOD ) = ( N_FREE | INT_GER | N_RDONLY ) ; namflag ( L_ARGNOD ) = N_FREE | IN_DIR ; np = ( NAMPTR ) malloc ( NALIAS * sizeof ( struct Namnod ) ) ; alias = inittree ( alias_names , np , N_EXPORT ) ; prnames = gettree ( MEMSIZE / 4 ) ; }
Initialize the shell name and alias table
Initialize the shell name and alias table
/* set up random number generator */ /* apollo */ /* set up the seconds clock */