
/*
 *	Function
 *	Programmer	N.d'Alterio
 *	Date		
 *
 *  Synopsis:	This function counts the number of messages currently
 *		in the spooldir.
 *
 *  Arguments:	struct FullInfo *		FullInfo on spooldir.
 *
 *  Returns:	int				Number of spooled messages.
 *		0				If error.
 *
 *  Variables:	 spooled			Count of spooled files.
 *		*cur_fi				Temporary FullInfo pointer
 * 
 *  $Id: CountSpool.c 2.1 1995/09/23 17:13:51 daltern Exp $
 *
 */

#include "SpoolWatch.h"

int CountSpool( struct FullInfo *fi )

{

  int spooled = 0;

  struct FullInfo *cur_fi;

  cur_fi = fi;
  
  if ( fi ) {

/*
 *   Trace through the linked list until next entry is NULL.
 */

	  while ( cur_fi ) {

		cur_fi = cur_fi->fi_next;
		spooled++;

  	}   /* end while cur_fi */

  }    /* end if fi */

  return spooled;

}   /* end function CountSpool */

/*========================================================================*
			END FUNCTION CountSpool
 *========================================================================*/
