#include <stdio.h>
#include "file2.h"
#include "internal.h"
#include <stdlib.h>

/************************************************************************
 *
 * Function:    _freebuf
 *
 * Description:
 *    discard all buffer information for the indicated file.
 *
 * Input:       stream - a pointer to the file to be released
 *
 * Output:      none.
 */

void _freebuf (FILE *stream)
    {
    if (inuse(stream) && mbuf(stream))
        {
        free(stream->_base);
        stream->_flag &= ~_IOMYBUF;
        stream->_base = stream->_ptr = NULL;
        stream->_cnt = 0;
        }
    }
