
/*
	file: util.c
	contains utility routines for area
*/

#include "volume.h"


/*************************************************************/
/* retrieve next atom from input file
*  It read outfile of volume.f fortran file
*/
int read_volume_atom(fp, atom)
ATOM_REC 	*atom;
FILE		*fp;
{
char	line[MAX_LINE_LEN];
int		ret;
char * flag;
	while(flag=fgets(line, MAX_LINE_LEN, fp)){

		ret = sscanf(line, "%*d%*d%*d%*d%s%s%d%*f%*f%*f%*f%*f%f",
			atom->atomName, atom->resName, &atom->resNum, &atom->volume);
		if (ret==4)  break;
	}

	if (flag==NULL){
		return -1;
	}

	return(ret);
}
