gff.c
/***************************************************************************
 *  Library:
 *      #include <biolibc/gff.h>
 *      -lbiolibc -lxtend
 *
 *  Description:
 *      Skip over header lines in GFF input stream.  The FILE pointer
 *      gff_stream is advanced to the first character of the first line
 *      after the header.  The header is copied to a temporary file and and
 *      the function returns a FILE pointer to the header stream.
 *
 *  Arguments:
 *      gff_stream  FILE pointer to the open GFF file
 *
 *  Returns:
 *      A FILE pointer to a temporary file containing a copy of the header
 *
 *  See also:
 *      bl_gff_read(3), bl_gff_copy_header(3)
 *
 *  History: 
 *  Date        Name        Modification
 *  2021-04-08  Jason Bacon Begin
 ***************************************************************************/
#include 
-lbiolibc -lxtend

Skip over header lines in GFF input stream.  The FILE pointer
gff_stream is advanced to the first character of the first line
after the header.  The header is copied to a temporary file and and
the function returns a FILE pointer to the header stream.

gff_stream  FILE pointer to the open GFF file

A FILE pointer to a temporary file containing a copy of the header



Date        Name        Modification
2021-04-08  Jason Bacon Begin
#include - lbiolibc - lxtend Skip over header lines in GFF input stream . The FILE pointer gff_stream is advanced to the first character of the first line after the header . The header is copied to a temporary file and and the function returns a FILE pointer to the header stream . gff_stream FILE pointer to the open GFF file A FILE pointer to a temporary file containing a copy of the header Date Name Modification 2021 - 04 - 08 Jason Bacon Begin
FILE    *bl_gff_skip_header(FILE *gff_stream)
{
    int     ch;
    FILE    *header_stream = tmpfile();
    while ( (ch = getc(gff_stream)) == '#' )
    {
	putc(ch, header_stream);
	do
	{
	    ch = getc(gff_stream);
	    putc(ch, header_stream);
	}   while ( (ch != '\n') && (ch != EOF) );
    }
    if ( ch != EOF )
	ungetc(ch, gff_stream);
    rewind(header_stream);
    return header_stream;
}
FILE * bl_gff_skip_header ( FILE * gff_stream ) { int ch ; FILE * header_stream = tmpfile ( ) ; while ( ( ch = getc ( gff_stream ) ) == ' ' ) { putc ( ch , header_stream ) ; do { ch = getc ( gff_stream ) ; putc ( ch , header_stream ) ; } while ( ( ch != ' \n ' ) && ( ch != EOF ) ) ; } if ( ch != EOF ) ungetc ( ch , gff_stream ) ; rewind ( header_stream ) ; return header_stream ; }
Library:
      #include <biolibc/gff.h>
      -lbiolibc -lxtend
Library : #include <biolibc / gff . h > - lbiolibc - lxtend
/*
     *  Copy header to a nameless temp file and return the FILE *.
     *  This can be used by tools like peak-classifier to replicate the
     *  header in output files.
     */ // Rewind to start of first non-header line