third_party/inchi/INCHI_BASE/src/mol_fmt1.c
MOL_FMT_DATA* ReadMolfile( INCHI_IOSTREAM *inp_file,
                           MOL_FMT_HEADER_BLOCK *OnlyHeaderBlock,
                           MOL_FMT_CTAB *OnlyCTab,
                           int bGetOrigCoord,
                           int treat_polymers,
                           int treat_NPZz,
                           char *pname,
                           int lname,
                           unsigned long *Id,
                           const char *pSdfLabel,
                           char *pSdfValue,
                           int *err,
                           char *pStrErr,
                           int bNoWarnings )
{
    MOL_FMT_DATA* mfdata;

    if (pname && lname)
    {
        pname[0] = '\0';
    }
    if (Id)
    {
        *Id = 0LU;  /* ignore for now */
    }

    mfdata = MolfileReadDataLines( inp_file, OnlyHeaderBlock, OnlyCTab,
                                   bGetOrigCoord, treat_polymers,
                                   err, pStrErr, bNoWarnings );

    if (*err < 0)
    {
        /* read OK, and end of data encountered */
        *err = -*err;
    }
    else
    {
        /* unnecessary extra data may have present in SDF; skip them for now */
        int ret_skip_extras = SDFileSkipExtraData( inp_file, Id, NULL, 0,
                                                   pname, lname, *err,
                                                   pSdfLabel, pSdfValue,
                                                   pStrErr, bNoWarnings);


        if (ret_skip_extras)
        {
            /* important to continue to the next good structure */
            *err = ret_skip_extras;
        }
    }

    /*  Treat star/Zz atoms if present.
        This first-line treating affects only Molfile input.
        No direct input in API calls, no InChI strings.
        These will be processed on checking internal data structs.
    */
    if (mfdata)
    {
        int nzz = 0;
        int pseudos_allowed = (treat_NPZz == 1) || (treat_polymers != POLYMERS_NO);		
        nzz = MolfileTreatPseudoElementAtoms( &mfdata->ctab,
                                              pseudos_allowed,
                                              err,
                                              pStrErr );
    }

    return mfdata;
}
/****************************************************************************
 Read MOL-format data from SD or MOL file
****************************************************************************/
Read MOL-format data from SD or MOL file
Read MOL - format data from SD or MOL file
MOL_FMT_DATA* ReadMolfile( INCHI_IOSTREAM *inp_file,
                           MOL_FMT_HEADER_BLOCK *OnlyHeaderBlock,
                           MOL_FMT_CTAB *OnlyCTab,
                           int bGetOrigCoord,
                           int treat_polymers,
                           int treat_NPZz,
                           char *pname,
                           int lname,
                           unsigned long *Id,
                           const char *pSdfLabel,
                           char *pSdfValue,
                           int *err,
                           char *pStrErr,
                           int bNoWarnings )
{
    MOL_FMT_DATA* mfdata;
    if (pname && lname)
    {
        pname[0] = '\0';
    }
    if (Id)
    {
        *Id = 0LU;  
    }
    mfdata = MolfileReadDataLines( inp_file, OnlyHeaderBlock, OnlyCTab,
                                   bGetOrigCoord, treat_polymers,
                                   err, pStrErr, bNoWarnings );
    if (*err < 0)
    {
        *err = -*err;
    }
    else
    {
        int ret_skip_extras = SDFileSkipExtraData( inp_file, Id, NULL, 0,
                                                   pname, lname, *err,
                                                   pSdfLabel, pSdfValue,
                                                   pStrErr, bNoWarnings);
        if (ret_skip_extras)
        {
            *err = ret_skip_extras;
        }
    }
    if (mfdata)
    {
        int nzz = 0;
        int pseudos_allowed = (treat_NPZz == 1) || (treat_polymers != POLYMERS_NO);		
        nzz = MolfileTreatPseudoElementAtoms( &mfdata->ctab,
                                              pseudos_allowed,
                                              err,
                                              pStrErr );
    }
    return mfdata;
}
MOL_FMT_DATA * ReadMolfile ( INCHI_IOSTREAM * inp_file , MOL_FMT_HEADER_BLOCK * OnlyHeaderBlock , MOL_FMT_CTAB * OnlyCTab , int bGetOrigCoord , int treat_polymers , int treat_NPZz , char * pname , int lname , unsigned long * Id , const char * pSdfLabel , char * pSdfValue , int * err , char * pStrErr , int bNoWarnings ) { MOL_FMT_DATA * mfdata ; if ( pname && lname ) { pname [ 0 ] = ' \0 ' ; } if ( Id ) { * Id = 0LU ; } mfdata = MolfileReadDataLines ( inp_file , OnlyHeaderBlock , OnlyCTab , bGetOrigCoord , treat_polymers , err , pStrErr , bNoWarnings ) ; if ( * err < 0 ) { * err = - * err ; } else { int ret_skip_extras = SDFileSkipExtraData ( inp_file , Id , NULL , 0 , pname , lname , * err , pSdfLabel , pSdfValue , pStrErr , bNoWarnings ) ; if ( ret_skip_extras ) { * err = ret_skip_extras ; } } if ( mfdata ) { int nzz = 0 ; int pseudos_allowed = ( treat_NPZz == 1 ) || ( treat_polymers != POLYMERS_NO ) ; nzz = MolfileTreatPseudoElementAtoms ( & mfdata -> ctab , pseudos_allowed , err , pStrErr ) ; } return mfdata ; }
Read MOL-format data from SD or MOL file
Read MOL - format data from SD or MOL file
/* ignore for now */ /* read OK, and end of data encountered */ /* unnecessary extra data may have present in SDF; skip them for now */ /* important to continue to the next good structure */ /*  Treat star/Zz atoms if present.
        This first-line treating affects only Molfile input.
        No direct input in API calls, no InChI strings.
        These will be processed on checking internal data structs.
    */