#include "utility.h" char *gfield(line,field_start,field_length,field) /*============================================================================*/ /* PURPOSE: EXTRACT A FIELD FROM A LINE. A FIELD IS ANY CONTIGUOUS SPAN OF /* CHARACTERS STARTING AT AN ARBITRARY POINT. THE RETURNED FIELD IS /* NULL TERMINATED. /* WRITTEN: M.V.GRIESHABER /* LAST MODIFICATION: 2 JUNE 1993 MVG */ char line[]; /* ORIGINAL LINE CONTAINING FIELD. */ int field_start; /* STARTING CHARACTER POSITION OF FIELD. */ int field_length; /* NUMBER OF CHARACTERS IN FIELD. */ char field[]; /* RETURNED FIELD, NULL TERMINATED. */ { strncpy(field,&line[field_start],field_length); field[field_length]='\0'; return(field); }