/* */
int getFileLine( FILE* fp, char buffer[ 128 ], int buffermax )
{ int i=0;
char c ='0';
if( fp == NULL )
{ return 1;
}else{
while(
c!= '\n' && !feof(fp) && (i< buffermax ) )
{
c=fgetc(fp);
buffer[i]=c;
i = i + 1;
}
}
/* replace the newline with a string terminator */
if( i>1 && buffer[i-1] == '\n' )
{ buffer[i-1] = '\0'; }
if( feof(fp) )
{ return 1;
}else{
return 0;
}
}/* end function getFileLine */