/* ******************************************************************************* * Copyright (c) 1996 Martin Poole * ******************************************************************************* ** ** WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! ** ** Any changes to be made to this file should first be checked with ** mplib1 source control for library integrity. ** ** mplib1 source control can be reached at mplib1@quatermass.co.uk ** * * $Source: /home/cvs/cvsroot/onelan/onelan/src/mplib1/libsrc/fgetline2.c,v $ * $Author: mpoole $ * $Date: 2002/10/07 09:37:39 $ * $Revision: 1.2 $ * ******************************************************************************* * * Change History * * $Log: fgetline2.c,v $ * Revision 1.2 2002/10/07 09:37:39 mpoole * Initial checkin of mplib1-3.1.0 * * Revision 1.1 2002/10/07 09:36:56 mpoole * Initial checkin of mplib1-3.1.0 * * ******************************************************************************* */ #ident "$Header: /home/cvs/cvsroot/onelan/onelan/src/mplib1/libsrc/fgetline2.c,v 1.2 2002/10/07 09:37:39 mpoole Exp $" /* ------------------------------------------------------------------ Include files ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ defines ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ Code starts here ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ Include files ------------------------------------------------------------------ */ #include #include #include /* ------------------------------------------------------------------ Defines ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ Structure definitions ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ Global variables ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ Function prototypes ------------------------------------------------------------------ */ int fgetline2( FILE *fh, char *line_buf, int line_len ) { int rv,do_again; char *cp; do { rv = fgetline( fh, line_buf, line_len ); do_again=0; if (rv==0) { cp = line_buf; /* skip past spaces */ while ( *cp=='\t' || *cp==' ' ) cp++; if (*cp=='\0' || *cp=='#') do_again=1; } }while (do_again); return(rv); } /* -- End of File -- */