third_party/inchi/INCHI_BASE/src/mol_fmt3.c
int MolfileV3000ReadKeyword( char* key,
                             char** line_ptr )
{
    int  nread = 0;
    char field[MOL_FMT_V3000_MAXFIELDLEN];
    const int max_field_len = sizeof( field );


    memset( field, 0, max_field_len );

    nread = read_upto_delim( line_ptr, field, max_field_len, "= \t\n\v\f\r" );

    if (nread)
    {
        mystrncpy( key, field, nread + 1 );
        /* consume '=' sign if present */
        if (*line_ptr)
        {
            if (*line_ptr[0] == '=')
            {
                *line_ptr = *line_ptr + 1;
            }
        }
    }
    else
    {
        key[0] = '\0';
    }

    return nread;
}
/****************************************************************************
    Read V3000 keyword.
    TODO: treat strings with spaces in double quotes
****************************************************************************/
Read V3000 keyword.
TODO: treat strings with spaces in double quotes
Read V3000 keyword . TODO : treat strings with spaces in double quotes
int MolfileV3000ReadKeyword( char* key,
                             char** line_ptr )
{
    int  nread = 0;
    char field[MOL_FMT_V3000_MAXFIELDLEN];
    const int max_field_len = sizeof( field );
    memset( field, 0, max_field_len );
    nread = read_upto_delim( line_ptr, field, max_field_len, "= \t\n\v\f\r" );
    if (nread)
    {
        mystrncpy( key, field, nread + 1 );
        if (*line_ptr)
        {
            if (*line_ptr[0] == '=')
            {
                *line_ptr = *line_ptr + 1;
            }
        }
    }
    else
    {
        key[0] = '\0';
    }
    return nread;
}
int MolfileV3000ReadKeyword ( char * key , char * * line_ptr ) { int nread = 0 ; char field [ MOL_FMT_V3000_MAXFIELDLEN ] ; const int max_field_len = sizeof ( field ) ; memset ( field , 0 , max_field_len ) ; nread = read_upto_delim ( line_ptr , field , max_field_len , " \t \n \v \f \r " ) ; if ( nread ) { mystrncpy ( key , field , nread + 1 ) ; if ( * line_ptr ) { if ( * line_ptr [ 0 ] == ' ' ) { * line_ptr = * line_ptr + 1 ; } } } else { key [ 0 ] = ' \0 ' ; } return nread ; }
Read V3000 keyword.
Read V3000 keyword .
/* consume '=' sign if present */