third_party/inchi/INCHI_BASE/src/ichi_io.c
void inchi_ios_flush( INCHI_IOSTREAM* ios )
{

    if (ios->type == INCHI_IOS_TYPE_STRING)
    {
        if (ios->s.pStr)
        {
            if (ios->s.nUsedLength > 0)
            {
                if (ios->f)
                {
                    fprintf( ios->f, "%-s", ios->s.pStr );
                    fflush( ios->f );
                }
                inchi_free( ios->s.pStr );
                ios->s.pStr = NULL;
                ios->s.nUsedLength = ios->s.nAllocatedLength = ios->s.nPtr = 0;
            }
        }
    }

    else if (ios->type == INCHI_IOS_TYPE_FILE)
    {
        /* output to plain file: just flush it. */
        fflush( ios->f );
    }

    return;
}
/****************************************************************************
    If INCHI_IOSTREAM type is INCHI_IOS_TYPE_STRING
    and associated file exists, flush the string buffer
    to that file, then free the buffer.
    If INCHI_IOSTREAM type is INCHI_IOS_TYPE_FILE,
    just flush the file.
****************************************************************************/
If INCHI_IOSTREAM type is INCHI_IOS_TYPE_STRING
and associated file exists, flush the string buffer
to that file, then free the buffer.
If INCHI_IOSTREAM type is INCHI_IOS_TYPE_FILE,
just flush the file.
If INCHI_IOSTREAM type is INCHI_IOS_TYPE_STRING and associated file exists flush the string buffer to that file then free the buffer . If INCHI_IOSTREAM type is INCHI_IOS_TYPE_FILE just flush the file .
void inchi_ios_flush( INCHI_IOSTREAM* ios )
{
    if (ios->type == INCHI_IOS_TYPE_STRING)
    {
        if (ios->s.pStr)
        {
            if (ios->s.nUsedLength > 0)
            {
                if (ios->f)
                {
                    fprintf( ios->f, "%-s", ios->s.pStr );
                    fflush( ios->f );
                }
                inchi_free( ios->s.pStr );
                ios->s.pStr = NULL;
                ios->s.nUsedLength = ios->s.nAllocatedLength = ios->s.nPtr = 0;
            }
        }
    }
    else if (ios->type == INCHI_IOS_TYPE_FILE)
    {
        fflush( ios->f );
    }
    return;
}
void inchi_ios_flush ( INCHI_IOSTREAM * ios ) { if ( ios -> type == INCHI_IOS_TYPE_STRING ) { if ( ios -> s . pStr ) { if ( ios -> s . nUsedLength > 0 ) { if ( ios -> f ) { fprintf ( ios -> f , " " , ios -> s . pStr ) ; fflush ( ios -> f ) ; } inchi_free ( ios -> s . pStr ) ; ios -> s . pStr = NULL ; ios -> s . nUsedLength = ios -> s . nAllocatedLength = ios -> s . nPtr = 0 ; } } } else if ( ios -> type == INCHI_IOS_TYPE_FILE ) { fflush ( ios -> f ) ; } return ; }
If INCHI_IOSTREAM type is INCHI_IOS_TYPE_STRING
and associated file exists, flush the string buffer
to that file, then free the buffer.
If INCHI_IOSTREAM type is INCHI_IOS_TYPE_STRING and associated file exists flush the string buffer to that file then free the buffer .
/* output to plain file: just flush it. */