InChI
 
Loading...
Searching...
No Matches
mol_fmt.h File Reference
#include <stdio.h>
#include "ichisize.h"
#include "mode.h"
+ Include dependency graph for mol_fmt.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  A_NUM_LISTS
 NUM_LISTS - Dynamically growing array of numeric lists. More...
 
struct  tagINT_ARRAY
 INT_ARRAY - Dynamically growing array of int. More...
 
struct  A_MOL_FMT_SGROUP
 Data structure for Sgroup data (substance group data). More...
 
struct  A_MOL_FMT_SGROUPS
 MOL_FMT_SGROUPS is a dynamically growing array of pointers to MOL_FMT_SGROUP objects. More...
 
struct  A_MOL_FMT_HEADER_BLOCK
 Data structure for MOL file header block (3 lines). More...
 
struct  A_MOL_FMT_ATOM
 Data structure for atom representation in the MOL format. More...
 
struct  A_MOL_FMT_BOND
 Data structure for bond representation in the MOL format. More...
 
struct  A_MOL_FMT_v3000
 Data structure for V3000 representation in the MOL format. More...
 
struct  A_MOL_FMT_CTAB
 Connection table data structure. More...
 
struct  A_MOL_FMT_DATA
 Data structure for a MOL file. More...
 

Macros

#define SD_FMT_END_OF_DATA   "$$$$"
 
#define MOL_FMT_INPLINELEN   204 /* add cr, lf, double zero termination */
 
#define MOL_FMT_MAXLINELEN   200
 
#define MOL_FMT_PRESENT   1
 
#define MOL_FMT_ABSENT   0
 
#define MOL_FMT_QUERY   MOL_FMT_ABSENT
 
#define MOL_FMT_CPSS   MOL_FMT_ABSENT
 
#define MOL_FMT_REACT   MOL_FMT_ABSENT
 
#define MOL_FMT_STRING_DATA   'S'
 
#define MOL_FMT_CHAR_INT_DATA   'C'
 
#define MOL_FMT_SHORT_INT_DATA   'N'
 
#define MOL_FMT_LONG_INT_DATA   'L'
 
#define MOL_FMT_DOUBLE_DATA   'D'
 
#define MOL_FMT_FLOAT_DATA   'F'
 
#define MOL_FMT_JUMP_TO_RIGHT   'J'
 
#define MOL_FMT_INT_DATA   'I'
 
#define MOL_FMT_MAX_VALUE_LEN   32 /* max length of string containing a numerical value */
 
#define MOL_FMT_M_STY_NON   0
 
#define MOL_FMT_M_STY_SRU   1
 
#define MOL_FMT_M_STY_MON   2
 
#define MOL_FMT_M_STY_COP   3
 
#define MOL_FMT_M_STY_MOD   4
 
#define MOL_FMT_M_STY_CRO   5
 
#define MOL_FMT_M_STY_MER   6
 
#define MOL_FMT_M_SST_NON   0
 
#define MOL_FMT_M_SST_ALT   1
 
#define MOL_FMT_M_SST_RAN   2
 
#define MOL_FMT_M_SST_BLK   3
 
#define MOL_FMT_M_CONN_NON   0
 
#define MOL_FMT_M_CONN_HT   1
 
#define MOL_FMT_M_CONN_HH   2
 
#define MOL_FMT_M_CONN_EU   3
 
#define MOL_FMT_V3000_STENON   -1
 
#define MOL_FMT_V3000_STEABS   1
 
#define MOL_FMT_V3000_STEREL   2
 
#define MOL_FMT_V3000_STERAC   3
 
#define MOL_FMT_V3000_INPLINELEN   32004 /* add cr, lf, double zero termination */
 
#define MOL_FMT_V3000_MAXLINELEN   32000
 
#define MOL_FMT_V3000_MAXFIELDLEN   4096
 
#define ISOTOPIC_SHIFT_FLAG   10000 /* add to isotopic mass if isotopic_mass = */
 
#define INCHI_US_CHAR_DEF
 

Typedefs

typedef signed char S_CHAR
 
typedef unsigned char U_CHAR
 
typedef struct A_NUM_LISTS NUM_LISTS
 NUM_LISTS - Dynamically growing array of numeric lists.
 
typedef struct tagINT_ARRAY INT_ARRAY
 INT_ARRAY - Dynamically growing array of int.
 
typedef struct A_MOL_FMT_SGROUP MOL_FMT_SGROUP
 Data structure for Sgroup data (substance group data).
 
typedef struct A_MOL_FMT_SGROUPS MOL_FMT_SGROUPS
 MOL_FMT_SGROUPS is a dynamically growing array of pointers to MOL_FMT_SGROUP objects.
 
typedef struct A_MOL_FMT_HEADER_BLOCK MOL_FMT_HEADER_BLOCK
 Data structure for MOL file header block (3 lines).
 
typedef struct A_MOL_FMT_ATOM MOL_FMT_ATOM
 Data structure for atom representation in the MOL format.
 
typedef struct A_MOL_FMT_BOND MOL_FMT_BOND
 Data structure for bond representation in the MOL format.
 
typedef struct A_MOL_FMT_v3000 MOL_FMT_v3000
 Data structure for V3000 representation in the MOL format.
 
typedef struct A_MOL_FMT_CTAB MOL_FMT_CTAB
 Connection table data structure.
 
typedef struct A_MOL_FMT_DATA MOL_FMT_DATA
 Data structure for a MOL file.
 

Functions

int NumLists_Alloc (NUM_LISTS *num_lists, int nlists)
 Allocates memory for a specified number of numeric lists.
 
int NumLists_ReAlloc (NUM_LISTS *num_lists)
 Reallocates memory for the numeric lists.
 
int NumLists_Append (NUM_LISTS *num_lists, int *list)
 Push new item to the end of array.
 
void NumLists_Free (NUM_LISTS *num_lists)
 Frees the memory allocated for the numeric list.
 
int IntArray_Alloc (INT_ARRAY *items, int nitems)
 Initializes an INT_ARRAY structure.
 
int IntArray_ReAlloc (INT_ARRAY *items)
 Reallocates memory for the INT_ARRAY structure.
 
int IntArray_Append (INT_ARRAY *items, int new_item)
 Appends a new item to the INT_ARRAY structure.
 
int IntArray_AppendIfAbsent (INT_ARRAY *items, int new_item)
 Appends a new item to the INT_ARRAY structure if it is not already present.
 
void IntArray_Reset (INT_ARRAY *items)
 Resets the INT_ARRAY structure to its initial state.
 
void IntArray_Free (INT_ARRAY *items)
 Frees the memory allocated for the INT_ARRAY structure.
 
void IntArray_DebugPrint (INT_ARRAY *items)
 Prints the contents of the INT_ARRAY structure for debugging purposes.
 
int MolFmtSgroup_Create (MOL_FMT_SGROUP **sgroup, int id, int type)
 Allocate new array Sgroup.
 
void MolFmtSgroup_Free (MOL_FMT_SGROUP *sgroup)
 Frees the memory allocated for the Sgroup.
 
int MolFmtSgroups_Alloc (MOL_FMT_SGROUPS *items, int nitems)
 Allocates memory for a specified number of Sgroup objects.
 
int MolFmtSgroups_ReAlloc (MOL_FMT_SGROUPS *items)
 Expand array of Sgroups.
 
int MolFmtSgroups_Append (MOL_FMT_SGROUPS *items, int id, int type)
 Appends a new Sgroup to the array.
 
void MolFmtSgroups_Free (MOL_FMT_SGROUPS *items)
 Frees the memory allocated for the MOL_FMT_SGROUPS list.
 
int MolFmtSgroups_GetIndexBySgroupId (int id, MOL_FMT_SGROUPS *items)
 Gets the index of a Sgroup by its ID.
 
static MOL_FMT_DATAMolfileReadDataLines (INCHI_IOSTREAM *inp_file, MOL_FMT_HEADER_BLOCK *OnlyHeaderBlock, MOL_FMT_CTAB *OnlyCTab, int bGetOrigCoord, int treat_polymers, int *err, char *pStrErr, int bNoWarnings)
 Reads header lines and connection table block from input SD or MOL file, ignore STEXT block, queries, and 3D features.
 
static int MolfileReadHeaderLines (MOL_FMT_HEADER_BLOCK *hdr, INCHI_IOSTREAM *inp_file, char *pStrErr)
 Reads header lines from input MOL file. A MOL file can have 3 header lines: (1) the name of the molecule, (2) details about the software used and (3) a comment line.
 
static int MolfileReadCountsLine (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, char *pStrErr)
 Reads counts line from input MOL file, includes information about the number of atoms, bonds, and atom lists, the chiral flag setting, and the Ctab version.
 
static int MolfileReadAtomsBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 Reads an atom block from input MOL file (V2000).
 
static int MolfileReadBondsBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 Reads a bond block from input MOL file (V2000)
 
MOL_FMT_DATAReadMolfile (INCHI_IOSTREAM *inp_file, MOL_FMT_HEADER_BLOCK *OnlyHeaderBlock, MOL_FMT_CTAB *OnlyCTab, int bGetOrigCoord, int treat_polymers, int pseudos_allowed, char *pname, int lname, unsigned long *Id, const char *pSdfLabel, char *pSdfValue, int *err, char *pStrErr, int bNoWarnings)
 Reads a substance text block.
 
int MolfileStrnread (char *dest, char *source, int len, char **first_space)
 Read a string from a source buffer into a destination buffer.
 
int MolfileReadField (void *data, int field_len, int data_type, char **line_ptr)
 Extract the 'data' in the MOL file field at given text position 'line_ptr'.
 
long MolfileExtractStrucNum (MOL_FMT_HEADER_BLOCK *pHdr)
 Extract the MOL file number from the header name line like "Structure #22".
 
int MolfileHasNoChemStruc (MOL_FMT_DATA *mfdata)
 Check if the MOL file has no chemical structure.
 
int MolfileSaveCopy (INCHI_IOSTREAM *inp_file, long fPtrStart, long fPtrEnd, FILE *outfile, long num)
 Copy MOL-formatted data of SDF record or Molfile to another file.
 
int MolfileGetXYZDimAndNormFactors (MOL_FMT_DATA *mfdata, int find_norm_factors, double *x0, double *y0, double *z0, double *xmin, double *ymin, double *zmin, double *scaler, int *err, char *pStrErr)
 Get xyz dimensionality and normalization factors in the MOL file.
 
MOL_FMT_DATAFreeMolfileData (MOL_FMT_DATA *mfdata)
 Free MOL file data structure.
 
int MolfileV3000Init (MOL_FMT_CTAB *ctab, char *pStrErr)
 Initialize V3000 connection table in MOL file data structure.
 
int MolfileV3000ReadCTABBeginAndCountsLine (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, char *pStrErr)
 Read V3000 head (begin and counts line) of in MOL file data structure from input file stream.
 
int MolfileV3000ReadAtomsBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 Read V3000 atoms block in MOL file data structure from input file stream.
 
int MolfileV3000ReadBondsBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 Read V3000 bonds block in MOL file data structure from input file stream.
 
int MolfileV3000ReadTailOfCTAB (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 Read V3000 tail (haptic bonds, stereo collections, Sgroups, 3D constraints, collections, end line) in to the MOL file data structure from input file stream.
 
int MolfileV3000ReadHapticBond (MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr)
 Read V3000 haptic bond information from the input line.
 
int MolfileV3000ReadStereoCollection (MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr)
 Read V3000 stereo collection information from the input line.
 
int MolfileV3000ReadSGroup (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 Read V3000 Sgroup information from the input file stream into the MOL file data structure.
 
int MolfileV3000Read3DBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 Read V3000 3D constraints block in MOL file data structure from input file stream.
 
int MolfileV3000ReadCollections (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 Read V3000 collections block in MOL file data structure from input file stream.
 
int DeleteMolfileV3000Info (MOL_FMT_v3000 *v3000)
 Free memory allocated for V3000 specific data in the MOL file data structure.
 
char * inchi_fgetsLf_V3000 (char *line, INCHI_IOSTREAM *inp_stream)
 Read a line from the input file stream, handling V3000 line continuations: Extended version of inchi_fgetsLf which is able of reading concatenated lines (ending with '-') of V3000 Molfile. Also removes "M V30 " prefix" and normalizes the rest of string.
 
int get_V3000_input_line_to_strbuf (INCHI_IOS_STRING *buf, INCHI_IOSTREAM *inp_stream)
 Get a V3000 input line and store it in a string buffer.
 
int MolfileV3000ReadField (void *data, int data_type, char **line_ptr)
 Extract the 'data' in specified mol file field at given text position 'line_ptr'.
 
int MolfileV3000ReadKeyword (char *key, char **line_ptr)
 Read keyword from the specified line.
 
int SDFileSkipExtraData (INCHI_IOSTREAM *inp_file, unsigned long *CAS_num, char *comment, int lcomment, char *name, int lname, int prev_err, const char *pSdfLabel, char *pSdfValue, char *pStrErr, int bNoWarnings)
 Skip extra data in SDF file after the MOL file data.
 
int SDFileIdentifyLabel (char *inp_line, const char *pSdfLabel)
 Identify if the given line matches the specified SDF label.
 
unsigned long SDFileExtractCASNo (char *line)
 Extract CAS number from the given line.
 

Macro Definition Documentation

◆ INCHI_US_CHAR_DEF

#define INCHI_US_CHAR_DEF

◆ ISOTOPIC_SHIFT_FLAG

#define ISOTOPIC_SHIFT_FLAG   10000 /* add to isotopic mass if isotopic_mass = */

◆ MOL_FMT_ABSENT

#define MOL_FMT_ABSENT   0

◆ MOL_FMT_CHAR_INT_DATA

#define MOL_FMT_CHAR_INT_DATA   'C'

◆ MOL_FMT_CPSS

#define MOL_FMT_CPSS   MOL_FMT_ABSENT

◆ MOL_FMT_DOUBLE_DATA

#define MOL_FMT_DOUBLE_DATA   'D'

◆ MOL_FMT_FLOAT_DATA

#define MOL_FMT_FLOAT_DATA   'F'

◆ MOL_FMT_INPLINELEN

#define MOL_FMT_INPLINELEN   204 /* add cr, lf, double zero termination */

◆ MOL_FMT_INT_DATA

#define MOL_FMT_INT_DATA   'I'

◆ MOL_FMT_JUMP_TO_RIGHT

#define MOL_FMT_JUMP_TO_RIGHT   'J'

◆ MOL_FMT_LONG_INT_DATA

#define MOL_FMT_LONG_INT_DATA   'L'

◆ MOL_FMT_M_CONN_EU

#define MOL_FMT_M_CONN_EU   3

◆ MOL_FMT_M_CONN_HH

#define MOL_FMT_M_CONN_HH   2

◆ MOL_FMT_M_CONN_HT

#define MOL_FMT_M_CONN_HT   1

◆ MOL_FMT_M_CONN_NON

#define MOL_FMT_M_CONN_NON   0

◆ MOL_FMT_M_SST_ALT

#define MOL_FMT_M_SST_ALT   1

Alternating

◆ MOL_FMT_M_SST_BLK

#define MOL_FMT_M_SST_BLK   3

Block

◆ MOL_FMT_M_SST_NON

#define MOL_FMT_M_SST_NON   0

None

◆ MOL_FMT_M_SST_RAN

#define MOL_FMT_M_SST_RAN   2

Random

◆ MOL_FMT_M_STY_COP

#define MOL_FMT_M_STY_COP   3

Copolymer

◆ MOL_FMT_M_STY_CRO

#define MOL_FMT_M_STY_CRO   5

Crosslink

◆ MOL_FMT_M_STY_MER

#define MOL_FMT_M_STY_MER   6

Mer type

◆ MOL_FMT_M_STY_MOD

#define MOL_FMT_M_STY_MOD   4

Modification

◆ MOL_FMT_M_STY_MON

#define MOL_FMT_M_STY_MON   2

Monomer

◆ MOL_FMT_M_STY_NON

#define MOL_FMT_M_STY_NON   0

None

◆ MOL_FMT_M_STY_SRU

#define MOL_FMT_M_STY_SRU   1

Structure repeating unit

◆ MOL_FMT_MAX_VALUE_LEN

#define MOL_FMT_MAX_VALUE_LEN   32 /* max length of string containing a numerical value */

◆ MOL_FMT_MAXLINELEN

#define MOL_FMT_MAXLINELEN   200

◆ MOL_FMT_PRESENT

#define MOL_FMT_PRESENT   1

◆ MOL_FMT_QUERY

#define MOL_FMT_QUERY   MOL_FMT_ABSENT

◆ MOL_FMT_REACT

#define MOL_FMT_REACT   MOL_FMT_ABSENT

◆ MOL_FMT_SHORT_INT_DATA

#define MOL_FMT_SHORT_INT_DATA   'N'

◆ MOL_FMT_STRING_DATA

#define MOL_FMT_STRING_DATA   'S'

◆ MOL_FMT_V3000_INPLINELEN

#define MOL_FMT_V3000_INPLINELEN   32004 /* add cr, lf, double zero termination */

◆ MOL_FMT_V3000_MAXFIELDLEN

#define MOL_FMT_V3000_MAXFIELDLEN   4096

◆ MOL_FMT_V3000_MAXLINELEN

#define MOL_FMT_V3000_MAXLINELEN   32000

◆ MOL_FMT_V3000_STEABS

#define MOL_FMT_V3000_STEABS   1

◆ MOL_FMT_V3000_STENON

#define MOL_FMT_V3000_STENON   -1

◆ MOL_FMT_V3000_STERAC

#define MOL_FMT_V3000_STERAC   3

◆ MOL_FMT_V3000_STEREL

#define MOL_FMT_V3000_STEREL   2

◆ SD_FMT_END_OF_DATA

#define SD_FMT_END_OF_DATA   "$$$$"

Typedef Documentation

◆ INT_ARRAY

typedef struct tagINT_ARRAY INT_ARRAY

INT_ARRAY - Dynamically growing array of int.

Parameters
itemPointer to the array of integers.
allocatedAmount of memory allocated.
usedAmount of memory used.
incrementAmount to increment when expanding.

◆ MOL_FMT_ATOM

typedef struct A_MOL_FMT_ATOM MOL_FMT_ATOM

Data structure for atom representation in the MOL format.

Parameters
fxx coordinate: F10.5; Generic
fyy coordinate: F10.5; Generic
fzz coordinate: F10.5; Generic
symbolElement symbol (aaa; up to 6 characters)
mass_differenceMass difference (dd; (M_ISO); Generic: -3..+4 otherwise 0 or 127=most abund. isotope )
chargeFormal charge (M CHG)
radicalRadical status (M RAD)
stereo_parityStereochemical parity (M STY)
H_count_plus_1Hydrogen count plus one (hhh; Query; Hn means >= n H; H0 means no H)
stereo_carebbb; Query: 0=ignore; 1=must match
valencevvv: <vvv: 0=no marking; (1..14)=(1..14); 15=zero valence.Number of bonds includes bonds to impl. H's>
H0_designatorHHH: CPSS
reaction_component_typerrr: CPSS: 1=reactant, 2=product, 3=intermediate
reaction_component_numiii: CPSS: 0 to (n-1)
atom_atom_mapping_nummmm: Reaction: 1..255
cInversionRetentionFlagnnn: 1=inverted, 2=retained config.; 0=property not applied
exact_change_flageee
my_n_impHnumber of implicit H calculated for adding H to strings in STDATA
display_tomDo not hide element's name (applies to C 7-25-98 DCh)
atom_aliased_flagDo not remove charge/radical/isotope if it is in the alias. 9-3-99 DCh

◆ MOL_FMT_BOND

typedef struct A_MOL_FMT_BOND MOL_FMT_BOND

Data structure for bond representation in the MOL format.

Parameters
atnum1First atom number.
atnum2Second atom number.
bond_typeType of bond (single, double, triple, etc.).
bond_stereoStereo information for the bond.
bond_topologyTopology information for the bond.
react_center_statusReaction center status information.

◆ MOL_FMT_CTAB

typedef struct A_MOL_FMT_CTAB MOL_FMT_CTAB

Connection table data structure.

Parameters
n_atomsNumber of atoms in the molecule.
n_bondsNumber of bonds in the molecule.
n_atom_listsNumber of atom lists.
chiral_flagChiral flag indicating the presence of chiral centers.
n_stext_entriesNumber of stereo text entries.
n_reaction_components_plus_1Number of reaction components.
n_reactantsNumber of reactants.
n_productsNumber of products.
n_intermediatesNumber of intermediates.
n_property_linesNumber of property lines.
follow_inchi_1_treating_iso_massFlag indicating whether to follow InChI-1 treating isotopic mass.
version_stringVersion string indicating the format version.
atomsPointer to the array of atom block data structure.
bondsPointer to the array of bond block data structure.
coordsPointer to the array of coordinate data structure.
sgroupsGrowable array of pointers to Sgroup objects.
v3000Pointer to the V3000 specific data structure.

◆ MOL_FMT_DATA

typedef struct A_MOL_FMT_DATA MOL_FMT_DATA

Data structure for a MOL file.

Parameters
hdrHeader block data structure.
ctabConnection table data structure.

◆ MOL_FMT_HEADER_BLOCK

Data structure for MOL file header block (3 lines).

Parameters
molnameName of molecule (up to 80 characters)
line2Second line of the header (the whole line2, up to 80 chars)
user_initlsUser initials (2 bytes; char)
prog_nameProgram name (8 bytes; char)
monthMonth (2 bytes; integral)
dayDay (2 bytes; integral)
yearYear (2 bytes; integral)
hourHour (2 bytes; integral)
minuteMinute (2 bytes; integral )
dim_codeDimensional code (2 bytes, dimensional code, char)
scaling_factor1Scaling factor 1 (2 bytes, I2)
scaling_factor2Scaling factor 2 (10 bytes, F10.5 )
energyEnergy (10 bytes, F10.5 )
internal_regnoInternal registration number (6 bytes, integral)
commentComment (Line #3, up to 80 characters)

◆ MOL_FMT_SGROUP

Data structure for Sgroup data (substance group data).

Parameters
idit is what is called 'Sgroup number' in CTFile
typeSgroup type: SUP = superatom, MUL = multiple group, SRU = SRU type, MON = monomer, MER = Mer type, COP = copolymer, CRO = crosslink, MOD = modification, GRA = graft, COM = component, MIX = mixture, FOR = formulation, DAT = data Sgroup, ANY = any polymer, GEN = generic
subtype(SST)
conn(SCN) Connectivity
labelwhat is called 'unique Sgroup identifier' in CTFile (SLB)
xbr1bracket ends coordinates (SDI)
xbr2bracket ends coordinates (SDI)
smtSgroup Subscript (SMT)
alistlist of atom indices (AL)
blistlist of bond indices (BL)

◆ MOL_FMT_SGROUPS

MOL_FMT_SGROUPS is a dynamically growing array of pointers to MOL_FMT_SGROUP objects.

Parameters
groupPointer to the growable array of pointers to MOL_FMT_SGROUPs
allocatedNumber of allocated objects
usedNumber of used objects
incrementArray expansion increment

◆ MOL_FMT_v3000

Data structure for V3000 representation in the MOL format.

Parameters
n_non_star_atomsNumber of non-star atoms.
n_star_atomsNumber of star atoms.
atom_index_origOriginal atom indices as supplied.
atom_index_finFinal atom indices, with -1 for star atoms.
n_sgroupsNumber of S-groups.
n_3d_constraintsNumber of 3D constraints.
n_collectionsNumber of collections.
n_non_haptic_bondsNumber of non-haptic bonds.
n_haptic_bondsNumber of haptic bonds.
haptic_bondsPointer to the list of haptic bonds (int* contains bond type, non-star atom number, nendpts, then endpts themselves).
n_steabsNumber of absolute stereo groups.
steabsPointer to the list of absolute stereo groups (e.g. R and S).
n_sterelNumber of relative stereo groups.
sterelPointer to the list of relative stereo groups (OR - describes the orientation of groups relative to each other, such as in cis- and trans-isomers).
n_steracNumber of racemic stereo groups.
steracPointer to the list of racemic stereo groups (AND - equal 50:50 mixture of two enantiomers of a chiral molecule).

◆ NUM_LISTS

typedef struct A_NUM_LISTS NUM_LISTS

NUM_LISTS - Dynamically growing array of numeric lists.

Parameters
listsPointer to the array of integer lists.
allocatedAmount of memory allocated.
usedAmount of memory used.
incrementAmount to increment when expanding.

◆ S_CHAR

typedef signed char S_CHAR

◆ U_CHAR

typedef unsigned char U_CHAR

Function Documentation

◆ DeleteMolfileV3000Info()

int DeleteMolfileV3000Info ( MOL_FMT_v3000 v3000)

Free memory allocated for V3000 specific data in the MOL file data structure.

Parameters
v3000Pointer to the V3000 specific data structure to free.
Returns
0.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FreeMolfileData()

MOL_FMT_DATA * FreeMolfileData ( MOL_FMT_DATA mfdata)

Free MOL file data structure.

Parameters
mfdataPointer to the MOL file data structure to free.
Returns
NULL pointer.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_V3000_input_line_to_strbuf()

int get_V3000_input_line_to_strbuf ( INCHI_IOS_STRING buf,
INCHI_IOSTREAM inp_stream 
)

Get a V3000 input line and store it in a string buffer.

Parameters
bufPointer to the string buffer to store the line.
inp_streamPointer to the input file stream.
Returns
Length of buffer stored on success, -1 on failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inchi_fgetsLf_V3000()

char * inchi_fgetsLf_V3000 ( char *  line,
INCHI_IOSTREAM inp_stream 
)

Read a line from the input file stream, handling V3000 line continuations: Extended version of inchi_fgetsLf which is able of reading concatenated lines (ending with '-') of V3000 Molfile. Also removes "M V30 " prefix" and normalizes the rest of string.

Parameters
linePointer to the buffer to store the read line.
inp_streamPointer to the input file stream.
Returns
Pointer to the read line, or NULL on end of file or error.
+ Here is the call graph for this function:

◆ IntArray_Alloc()

int IntArray_Alloc ( INT_ARRAY items,
int  nitems 
)

Initializes an INT_ARRAY structure.

Parameters
itemsPointer to the INT_ARRAY structure to initialize.
nitemsInitial number of items to allocate.
Returns
0 on success, -1 on failure.
+ Here is the caller graph for this function:

◆ IntArray_Append()

int IntArray_Append ( INT_ARRAY items,
int  new_item 
)

Appends a new item to the INT_ARRAY structure.

Parameters
itemsPointer to the INT_ARRAY structure to modify.
new_itemThe new item to append.
Returns
0 on success, -1 on failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IntArray_AppendIfAbsent()

int IntArray_AppendIfAbsent ( INT_ARRAY items,
int  new_item 
)

Appends a new item to the INT_ARRAY structure if it is not already present.

Parameters
itemsPointer to the INT_ARRAY structure to modify.
new_itemThe new item to append.
Returns
0 on success, -1 on failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IntArray_DebugPrint()

void IntArray_DebugPrint ( INT_ARRAY items)

Prints the contents of the INT_ARRAY structure for debugging purposes.

Parameters
itemsPointer to the INT_ARRAY structure to print.
+ Here is the caller graph for this function:

◆ IntArray_Free()

void IntArray_Free ( INT_ARRAY items)

Frees the memory allocated for the INT_ARRAY structure.

Parameters
itemsPointer to the INT_ARRAY structure to free.
+ Here is the caller graph for this function:

◆ IntArray_ReAlloc()

int IntArray_ReAlloc ( INT_ARRAY items)

Reallocates memory for the INT_ARRAY structure.

Parameters
itemsPointer to the INT_ARRAY structure to reallocate.
Returns
0 on success, -1 on failure.
+ Here is the caller graph for this function:

◆ IntArray_Reset()

void IntArray_Reset ( INT_ARRAY items)

Resets the INT_ARRAY structure to its initial state.

Parameters
itemsPointer to the INT_ARRAY structure to reset.
+ Here is the caller graph for this function:

◆ MolfileExtractStrucNum()

long MolfileExtractStrucNum ( MOL_FMT_HEADER_BLOCK pHdr)

Extract the MOL file number from the header name line like "Structure #22".

Parameters
pHdrPointer to the header block.
Returns
The structure number.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileGetXYZDimAndNormFactors()

int MolfileGetXYZDimAndNormFactors ( MOL_FMT_DATA mfdata,
int  find_norm_factors,
double *  x0,
double *  y0,
double *  z0,
double *  xmin,
double *  ymin,
double *  zmin,
double *  scaler,
int *  err,
char *  pStrErr 
)

Get xyz dimensionality and normalization factors in the MOL file.

Parameters
mfdataPointer to the MOL file data structure.
find_norm_factorsFlag indicating whether to find normalization/scaling factors.
x0Pointer to the minimum x-coordinate of the molecule.
y0Pointer to the minimum y-coordinate of the molecule.
z0Pointer to the minimum z-coordinate of the molecule.
xminPointer to the x-coordinate (is set to 0).
yminPointer to the y-coordinate (is set to 0).
zminPointer to the z-coordinate (is set to 0).
scalerPointer to the scaling factor.
errPointer to the error code.
pStrErrPointer to the error string buffer.
Returns
number of dimensions: 0, 2, 3
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileHasNoChemStruc()

int MolfileHasNoChemStruc ( MOL_FMT_DATA mfdata)

Check if the MOL file has no chemical structure.

Parameters
mfdataPointer to the MOL file data structure.
Returns
1 if no chemical structure, 0 otherwise.
+ Here is the caller graph for this function:

◆ MolfileReadAtomsBlock()

static int MolfileReadAtomsBlock ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
int  err,
char *  pStrErr 
)
static

Reads an atom block from input MOL file (V2000).

Parameters
ctabConnection table data structure
inp_fileInput file
errError code
pStrErrError string
Returns
int Error code, returns 0 - no error, 4 - error: can't interpret atom block, 5 - error: can't interpret second half of atom block?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadBondsBlock()

static int MolfileReadBondsBlock ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
int  err,
char *  pStrErr 
)
static

Reads a bond block from input MOL file (V2000)

Parameters
ctabConnection table data structure
inp_fileInput file
errError code
pStrErrError string
Returns
int Error code
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadCountsLine()

static int MolfileReadCountsLine ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
char *  pStrErr 
)
static

Reads counts line from input MOL file, includes information about the number of atoms, bonds, and atom lists, the chiral flag setting, and the Ctab version.

Parameters
ctabConnection table data structure
inp_fileInput file
pStrErrError string
Returns
int Error code, returns 0 - no error, 3 - error: can't read counts line, -1 - error: out of RAM
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadDataLines()

static MOL_FMT_DATA * MolfileReadDataLines ( INCHI_IOSTREAM inp_file,
MOL_FMT_HEADER_BLOCK OnlyHeaderBlock,
MOL_FMT_CTAB OnlyCTab,
int  bGetOrigCoord,
int  treat_polymers,
int *  err,
char *  pStrErr,
int  bNoWarnings 
)
static

Reads header lines and connection table block from input SD or MOL file, ignore STEXT block, queries, and 3D features.

Parameters
inp_fileInput file
OnlyHeaderBlockOutput header data structure, return MOL_FMT_DATA will point to it
OnlyCTabOutput connection table data structure, return MOL_FMT_DATA will point to it
bGetOrigCoordFlag to get original coordinates
treat_polymersFlag to treat polymers
errError code
pStrErrError string
bNoWarningsFlag to show warnings
Returns
MOL_FMT_DATA* returns mol file data structure, includes e.g. header block, connection table, ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadField()

int MolfileReadField ( void *  data,
int  field_len,
int  data_type,
char **  line_ptr 
)

Extract the 'data' in the MOL file field at given text position 'line_ptr'.

Parameters
dataPointer to the destination buffer.
field_lenLength of the field to read. For MOL_FMT_STRING_DATA does not include trailing zero, that is actual length of the string pointed by 'data' should be at least field_len+1 bytes. For numerical data 'field_len' is length of input data field For numerical integral data field_len <= 0 means read up to first non-numeric character as strtod() does ("free format")
data_typeType of the data to read. E.g. MOL_FMT_STRING_DATA, MOL_FMT_CHAR_INT_DATA, etc.
line_ptrPointer to a variable that will receive the address of the next line.
Returns
for MOL_FMT_STRING_DATA: number of bytes excluding trailing zero for all others: 1=success; 0 = empty; -1 = error

on exit *line_ptr points to the next byte after the last entered

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadHeaderLines()

static int MolfileReadHeaderLines ( MOL_FMT_HEADER_BLOCK hdr,
INCHI_IOSTREAM inp_file,
char *  pStrErr 
)
static

Reads header lines from input MOL file. A MOL file can have 3 header lines: (1) the name of the molecule, (2) details about the software used and (3) a comment line.

Parameters
hdrOutput header data structure
inp_fileInput file
pStrErrError string
Returns
* int Error code, retuns 0 - no error, 1 - error: can't read header block name, 3 - error: can't read header block 2 line, 7 - error: cant' read header block comment line
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileSaveCopy()

int MolfileSaveCopy ( INCHI_IOSTREAM inp_file,
long  fPtrStart,
long  fPtrEnd,
FILE *  outfile,
long  num 
)

Copy MOL-formatted data of SDF record or Molfile to another file.

Parameters
inp_filePointer to the input file stream.
fPtrStartFile pointer position to start copying from.
fPtrEndFile pointer position to stop copying at.
outfilePointer to the output file stream.
numStructure number to write in the header line.
Returns
last position of the output file stream.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileStrnread()

int MolfileStrnread ( char *  dest,
char *  source,
int  len,
char **  first_space 
)

Read a string from a source buffer into a destination buffer.

Parameters
destPointer to the destination buffer.
sourcePointer to the source buffer.
lenLength of the string to read.
first_spacePointer to a variable that will receive the address of the first space character in the source buffer.
Returns
number of actually processed bytes excluding zero terminator.
+ Here is the caller graph for this function:

◆ MolfileV3000Init()

int MolfileV3000Init ( MOL_FMT_CTAB ctab,
char *  pStrErr 
)

Initialize V3000 connection table in MOL file data structure.

Parameters
ctabPointer to the connection table data structure.
pStrErrPointer to the error string buffer.
Returns
0 on success, -1 on failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000Read3DBlock()

int MolfileV3000Read3DBlock ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
int  err,
char *  pStrErr 
)

Read V3000 3D constraints block in MOL file data structure from input file stream.

Parameters
ctabPointer to the connection table data structure.
inp_filePointer to the input file stream.
errError code.
pStrErrPointer to the error string buffer.
Returns
0: Success (no error encountered, 3D block read correctly) 1: Error (e.g., missing "END 3D" marker, or other parsing errors)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000ReadAtomsBlock()

int MolfileV3000ReadAtomsBlock ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
int  err,
char *  pStrErr 
)

Read V3000 atoms block in MOL file data structure from input file stream.

Parameters
ctabPointer to the connection table data structure.
inp_filePointer to the input file stream.
errError code.
pStrErrPointer to the error string buffer.
Returns
0 on success, -1 on failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000ReadBondsBlock()

int MolfileV3000ReadBondsBlock ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
int  err,
char *  pStrErr 
)

Read V3000 bonds block in MOL file data structure from input file stream.

Parameters
ctabPointer to the connection table data structure.
inp_filePointer to the input file stream.
errError code.
pStrErrPointer to the error string buffer.
Returns
0: Success (no error, bonds block read correctly), 1: Error: No V3000 Bond block start marker ("BEGIN BOND" missing), 2: Error: Cannot read V3000 bond block line (input line missing or unreadable), 4: Error: Cannot interpret V3000 bond block line (parsing failure) Negative values: If the end-of-data marker ($$$$) is encountered, err is set to -abs(err) (e.g., -1, -2, -4) Other values: If the end marker ("END BOND") is missing, err is set to 1
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000ReadCollections()

int MolfileV3000ReadCollections ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
int  err,
char *  pStrErr 
)

Read V3000 collections block in MOL file data structure from input file stream.

Parameters
ctabPointer to the connection table data structure.
inp_filePointer to the input file stream.
errError code.
pStrErrPointer to the error string buffer.
Returns
0: Success (collections block read and parsed correctly) 7: Error in reading or interpreting V3000 collection lines (parsing failure, unexpected format, missing required fields, etc.)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000ReadCTABBeginAndCountsLine()

int MolfileV3000ReadCTABBeginAndCountsLine ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
char *  pStrErr 
)

Read V3000 head (begin and counts line) of in MOL file data structure from input file stream.

Parameters
ctabPointer to the connection table data structure.
inp_filePointer to the input file stream.
pStrErrPointer to the error string buffer.
Returns
0 on success, -1 on failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000ReadField()

int MolfileV3000ReadField ( void *  data,
int  data_type,
char **  line_ptr 
)

Extract the 'data' in specified mol file field at given text position 'line_ptr'.

Parameters
dataPointer to the destination buffer.
data_typeType of the data to read. E.g. MOL_FMT_STRING_DATA, MOL_FMT_CHAR_INT_DATA, etc.
line_ptrPointer to the line buffer.
Returns
for MOL_FMT_STRING_DATA: number of bytes excluding trailing zero for all others: 1=success; 0 = empty
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000ReadHapticBond()

int MolfileV3000ReadHapticBond ( MOL_FMT_CTAB ctab,
char **  line_ptr,
int **  num_list,
char *  pStrErr 
)

Read V3000 haptic bond information from the input line.

Parameters
ctabPointer to the connection table data structure.
line_ptrPointer to the line buffer.
num_listPointer to the list of numbers.
pStrErrPointer to the error string buffer.
Returns
Positive integer (nread > 0): Success; number of bytes/fields read from the haptic bond block. 0: No data read (rare, usually means nothing was parsed). -1: Error; parsing failed at any step (missing '(', invalid count, allocation failure, field read error, missing "ATTACH=ALL", etc.).
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000ReadKeyword()

int MolfileV3000ReadKeyword ( char *  key,
char **  line_ptr 
)

Read keyword from the specified line.

Parameters
keyPointer to the buffer to store the keyword.
line_ptrPointer to the line buffer.
Returns
Length of the keyword on success, -1 on failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000ReadSGroup()

int MolfileV3000ReadSGroup ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
int  err,
char *  pStrErr 
)

Read V3000 Sgroup information from the input file stream into the MOL file data structure.

Parameters
ctabPointer to the connection table data structure.
inp_filePointer to the input file stream.
errError code.
pStrErrPointer to the error string buffer.
Returns
0: Success (no error encountered, SGroup read correctly) 1: Error (e.g., missing "END SGROUP" marker, or other parsing errors)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000ReadStereoCollection()

int MolfileV3000ReadStereoCollection ( MOL_FMT_CTAB ctab,
char **  line_ptr,
int **  num_list,
char *  pStrErr 
)

Read V3000 stereo collection information from the input line.

Parameters
ctabPointer to the connection table data structure.
line_ptrPointer to the line buffer.
num_listPointer to the list of numbers.
pStrErrPointer to the error string buffer.
Returns
Positive integer (nread > 0): Success; number of bytes/fields read from the stereo collection block. 0: No data read (rare, usually means nothing was parsed). -1: Error; parsing failed at any step (missing '(', invalid count, allocation failure, field read error, missing "ATTACH=ALL", etc.).
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000ReadTailOfCTAB()

int MolfileV3000ReadTailOfCTAB ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
int  err,
char *  pStrErr 
)

Read V3000 tail (haptic bonds, stereo collections, Sgroups, 3D constraints, collections, end line) in to the MOL file data structure from input file stream.

Parameters
ctabPointer to the connection table data structure.
inp_filePointer to the input file stream.
errError code.
pStrErrPointer to the error string buffer.
Returns
0: Success (no error encountered, tail of CTAB read correctly) 1: Error (e.g., missing "END CTAB" marker, or other parsing errors) 7: Error in reading or interpreting V3000 collection lines 71, 77, etc.: Error codes from sub-blocks (e.g., SGroup, 3DBlock, Collection) plus 70, indicating which sub-block failed Other positive values: Error codes from called functions (e.g., MolfileV3000ReadSGroup, MolfileV3000Read3DBlock, MolfileV3000ReadCollections) plus 70 Negative values: If an end-of-data marker ($$$$) is encountered during an error, the error code may be returned as a negative value (e.g., -1, -7, -71, etc.)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolFmtSgroup_Create()

int MolFmtSgroup_Create ( MOL_FMT_SGROUP **  sgroup,
int  id,
int  type 
)

Allocate new array Sgroup.

Parameters
sgroupPointer to the Sgroup structure to allocate.
idSgroup ID.
typeSgroup type.
Returns
0 on success, -1 on failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolFmtSgroup_Free()

void MolFmtSgroup_Free ( MOL_FMT_SGROUP sgroup)

Frees the memory allocated for the Sgroup.

Parameters
sgroupPointer to the Sgroup structure to free.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolFmtSgroups_Alloc()

int MolFmtSgroups_Alloc ( MOL_FMT_SGROUPS items,
int  nitems 
)

Allocates memory for a specified number of Sgroup objects.

Parameters
itemsPointer to the MOL_FMT_SGROUPS structure.
nitemsNumber of Sgroup objects to allocate.
Returns
0 on success, -1 on failure.
+ Here is the caller graph for this function:

◆ MolFmtSgroups_Append()

int MolFmtSgroups_Append ( MOL_FMT_SGROUPS items,
int  id,
int  type 
)

Appends a new Sgroup to the array.

Parameters
itemsPointer to the MOL_FMT_SGROUPS structure.
idSgroup ID.
typeSgroup type.
Returns
0 on success, -1 on failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolFmtSgroups_Free()

void MolFmtSgroups_Free ( MOL_FMT_SGROUPS items)

Frees the memory allocated for the MOL_FMT_SGROUPS list.

Parameters
itemsPointer to the MOL_FMT_SGROUPS structure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolFmtSgroups_GetIndexBySgroupId()

int MolFmtSgroups_GetIndexBySgroupId ( int  id,
MOL_FMT_SGROUPS items 
)

Gets the index of a Sgroup by its ID.

Parameters
idSgroup ID.
itemsPointer to the MOL_FMT_SGROUPS structure.
Returns
Index of the Sgroup on success, -1 on failure.
+ Here is the caller graph for this function:

◆ MolFmtSgroups_ReAlloc()

int MolFmtSgroups_ReAlloc ( MOL_FMT_SGROUPS items)

Expand array of Sgroups.

Parameters
itemsPointer to the MOL_FMT_SGROUPS structure.
Returns
0 on success, -1 on failure.
+ Here is the caller graph for this function:

◆ NumLists_Alloc()

int NumLists_Alloc ( NUM_LISTS num_lists,
int  nlists 
)

Allocates memory for a specified number of numeric lists.

Parameters
num_listsPointer to the NUM_LISTS structure.
nlistsNumber of lists to allocate.
Returns
0 on success, -1 on failure.
+ Here is the caller graph for this function:

◆ NumLists_Append()

int NumLists_Append ( NUM_LISTS num_lists,
int *  list 
)

Push new item to the end of array.

Parameters
num_listsPointer to the NUM_LISTS structure.
listPointer to the list of integers to append.
Returns
0 on success, -1 on failure.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NumLists_Free()

void NumLists_Free ( NUM_LISTS num_lists)

Frees the memory allocated for the numeric list.

Parameters
num_listsPointer to the NUM_LISTS structure.
+ Here is the caller graph for this function:

◆ NumLists_ReAlloc()

int NumLists_ReAlloc ( NUM_LISTS num_lists)

Reallocates memory for the numeric lists.

Parameters
num_listsPointer to the NUM_LISTS structure.
Returns
0 on success, -1 on failure.
+ Here is the caller graph for this function:

◆ ReadMolfile()

MOL_FMT_DATA * ReadMolfile ( INCHI_IOSTREAM inp_file,
MOL_FMT_HEADER_BLOCK OnlyHeaderBlock,
MOL_FMT_CTAB OnlyCTab,
int  bGetOrigCoord,
int  treat_polymers,
int  pseudos_allowed,
char *  pname,
int  lname,
unsigned long *  Id,
const char *  pSdfLabel,
char *  pSdfValue,
int *  err,
char *  pStrErr,
int  bNoWarnings 
)

Reads a substance text block.

Parameters
ctabConnection table data structure
inp_fileInput file
errError code
pStrErrError string
Returns
int Error code

Read MOL file data in to data structures.

Parameters
inp_filePointer to the input file stream.
OnlyHeaderBlockPointer to the header block to read.
OnlyCTabPointer to the connection table to read.
bGetOrigCoordFlag indicating whether to get original coordinates.
treat_polymersFlag indicating whether to treat polymers.
pseudos_allowedFlag indicating whether pseudo atoms are allowed.
pnamePointer to the name buffer.
lnameLength of the name buffer.
IdPointer to the ID buffer.
pSdfLabelPointer to the SDF label buffer.
pSdfValuePointer to the SDF value buffer.
errPointer to the error code.
pStrErrPointer to the error string buffer.
bNoWarningsFlag indicating whether to suppress warnings.
Returns
MOL_FMT_DATA*
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDFileExtractCASNo()

unsigned long SDFileExtractCASNo ( char *  line)

Extract CAS number from the given line.

Parameters
linePointer to the line containing the CAS number.
Returns
The extracted CAS number, or 0 if not found or invalid.
+ Here is the caller graph for this function:

◆ SDFileIdentifyLabel()

int SDFileIdentifyLabel ( char *  inp_line,
const char *  pSdfLabel 
)

Identify if the given line matches the specified SDF label.

Parameters
inp_linePointer to the input line.
pSdfLabelPointer to the SDF label to match.
Returns
SDF_DATA_HEADER_USER: The label matches the user-specified label (pSdfLabel). SDF_DATA_HEADER_NAME: The label is "NAME". SDF_DATA_HEADER_COMMENT: The label is "COMMENT". SDF_DATA_HEADER_CAS: The label is "CAS". SDF_DATA_HEADER: The label does not match any of the above (default case).
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDFileSkipExtraData()

int SDFileSkipExtraData ( INCHI_IOSTREAM inp_file,
unsigned long *  CAS_num,
char *  comment,
int  lcomment,
char *  name,
int  lname,
int  prev_err,
const char *  pSdfLabel,
char *  pSdfValue,
char *  pStrErr,
int  bNoWarnings 
)

Skip extra data in SDF file after the MOL file data.

Parameters
inp_filePointer to the input file stream.
CAS_numPointer to the variable to store the CAS number.
commentPointer to the buffer to store the comment.
lcommentLength of the comment buffer.
namePointer to the buffer to store the name.
lnameLength of the name buffer.
prev_errPrevious error code.
pSdfLabelPointer to the SDF label buffer.
pSdfValuePointer to the SDF value buffer.
pStrErrPointer to the error string buffer.
bNoWarningsFlag indicating whether to suppress warnings.
Returns
0: Success; extra SDF data was skipped without errors. 3: Unexpected SData header line (unexpected contents or format). 5: Only blank lines encountered (all lines empty). 9: Error occurred, but successfully bypassed to the next structure ($$$$ marker found); non-fatal, warning issued. Other values: The function may propagate the value of prev_err if set before entering the loop.
+ Here is the call graph for this function:
+ Here is the caller graph for this function: