ast_comparator/test/student_data/handout/shlab-handout/cases/reference_22_tsh.c
/*
 * Requires:
 *   "jobs" points to an array of MAXJOBS job structures.
 *
 * Effects:
 *   Returns the PID of the current foreground job or 0 if no foreground
 *   job exists.
 */
"jobs" points to an array of MAXJOBS job structures.

Returns the PID of the current foreground job or 0 if no foreground
job exists.
" jobs " points to an array of MAXJOBS job structures . Returns the PID of the current foreground job or 0 if no foreground job exists .
static pid_t
fgpid(JobP jobs)
{
	int i;
	for (i = 0; i < MAXJOBS; i++)
		if (jobs[i].state == FG)
			return (jobs[i].pid);
	return (0);
}
static pid_t fgpid ( JobP jobs ) { int i ; for ( i = 0 ; i < MAXJOBS ; i ++ ) if ( jobs [ i ] . state == FG ) return ( jobs [ i ] . pid ) ; return ( 0 ) ; }
Requires:
   "jobs" points to an array of MAXJOBS job structures.
Requires : " jobs " points to an array of MAXJOBS job structures .