ast_comparator/test/student_data/handout/shlab-handout/cases/reference_22_tsh.c
/*
 * Requires:
 *   "jobs" points to an array of MAXJOBS job structures.
 *
 * Effects:
 *   Deletes a job from the jobs list whose PID equals "pid".
 */
"jobs" points to an array of MAXJOBS job structures.

Deletes a job from the jobs list whose PID equals "pid".
" jobs " points to an array of MAXJOBS job structures . Deletes a job from the jobs list whose PID equals " pid " .
static int
deletejob(JobP jobs, pid_t pid) 
{
	int i;
	if (pid < 1)
		return (0);
	for (i = 0; i < MAXJOBS; i++) {
		if (jobs[i].pid == pid) {
			clearjob(&jobs[i]);
			nextjid = maxjid(jobs) + 1;
			return (1);
		}
	}
	return (0);
}
static int deletejob ( JobP jobs , pid_t pid ) { int i ; if ( pid < 1 ) return ( 0 ) ; for ( i = 0 ; i < MAXJOBS ; i ++ ) { if ( jobs [ i ] . pid == pid ) { clearjob ( & jobs [ i ] ) ; nextjid = maxjid ( jobs ) + 1 ; return ( 1 ) ; } } return ( 0 ) ; }
Requires:
   "jobs" points to an array of MAXJOBS job structures.
Requires : " jobs " points to an array of MAXJOBS job structures .