{ printf("\n the number of process No.%d:\n",i);
p=getpch(PCB);
printf("\n enter the name of process:");
scanf("%s",p->name);
printf("\n enter the prior number of process:");
scanf("%d",&p->super);
printf("\n the time of process:");
scanf("%d",&p->ntime); printf("\n");
p->rtime=0;p->state='w'; p->link=NULL; sort(); } }
int space()
{ int l=0; PCB* pr=ready;
while(pr!=NULL)
{ l++; pr=pr->link; } return(l); }
disp(PCB * pr) /*建立进程显示函数,用于显示当前进程*/
{ printf("\n qname \t state \t super \t ndtime \t runtime \n");
printf("|%s\t",pr->name);
printf("|%c\t",pr->state);
printf("|%d\t",pr->super);
printf("|%d\t",pr->ntime);
printf("|%d\t",pr->rtime);
printf("\n"); }
check() /* 建立进程查看函数 */
{ PCB* pr;
printf("\n **** the running process is:%s",p->name); /*显示当前运行进程*/ disp(p); pr=ready;
printf("\n ****the ready queue is:\n"); /*显示就绪队列状态*/
while(pr!=NULL)
{ disp(pr); pr=pr->link; } }
destroy() /*建立进程撤消函数(进程运行结束,撤消进程)*/