third_party/inchi/INCHI_BASE/src/ichi_io.c
int inchi_strbuf_printf_from( INCHI_IOS_STRING *buf,
                              int npos,
                              const char* lpszFormat, ... )
{
    int ret = 0, max_len;
    va_list argList;

    if (!buf)
    {
        return -1;
    }

    my_va_start( argList, lpszFormat );
    max_len = GetMaxPrintfLength( lpszFormat, argList );
    va_end( argList );
    if (max_len < 0)
    {
        return 0;
    }

    max_len += npos;

    inchi_strbuf_update( buf, max_len );

    my_va_start( argList, lpszFormat );
    ret = vsprintf( buf->pStr + npos, lpszFormat, argList );
    va_end( argList );
    if (ret >= 0)
    {
        buf->nUsedLength = npos + ret;
    }

    return ret;
}
/****************************************************************************
    Print to string in INCHI_IOS_STRING object
    from specified position 'npos', expanding buffer if necessary.
    NB: be careful, intentionally no checks on where is 'npos'!
****************************************************************************/
Print to string in INCHI_IOS_STRING object
from specified position 'npos', expanding buffer if necessary.
NB: be careful, intentionally no checks on where is 'npos'!
Print to string in INCHI_IOS_STRING object from specified position ' npos ' expanding buffer if necessary . NB : be careful intentionally no checks on where is ' npos ' !
int inchi_strbuf_printf_from( INCHI_IOS_STRING *buf,
                              int npos,
                              const char* lpszFormat, ... )
{
    int ret = 0, max_len;
    va_list argList;
    if (!buf)
    {
        return -1;
    }
    my_va_start( argList, lpszFormat );
    max_len = GetMaxPrintfLength( lpszFormat, argList );
    va_end( argList );
    if (max_len < 0)
    {
        return 0;
    }
    max_len += npos;
    inchi_strbuf_update( buf, max_len );
    my_va_start( argList, lpszFormat );
    ret = vsprintf( buf->pStr + npos, lpszFormat, argList );
    va_end( argList );
    if (ret >= 0)
    {
        buf->nUsedLength = npos + ret;
    }
    return ret;
}
int inchi_strbuf_printf_from ( INCHI_IOS_STRING * buf , int npos , const char * lpszFormat , ... ) { int ret = 0 , max_len ; va_list argList ; if ( ! buf ) { return -1 ; } my_va_start ( argList , lpszFormat ) ; max_len = GetMaxPrintfLength ( lpszFormat , argList ) ; va_end ( argList ) ; if ( max_len < 0 ) { return 0 ; } max_len += npos ; inchi_strbuf_update ( buf , max_len ) ; my_va_start ( argList , lpszFormat ) ; ret = vsprintf ( buf -> pStr + npos , lpszFormat , argList ) ; va_end ( argList ) ; if ( ret >= 0 ) { buf -> nUsedLength = npos + ret ; } return ret ; }
Print to string in INCHI_IOS_STRING object
from specified position 'npos', expanding buffer if necessary.
Print to string in INCHI_IOS_STRING object from specified position ' npos ' expanding buffer if necessary .