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.
 
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)
 Read MOL file data in to data structures.
 
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)
 
int MolfileSaveCopy (INCHI_IOSTREAM *inp_file, long fPtrStart, long fPtrEnd, FILE *outfile, long num)
 
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)
 
MOL_FMT_DATAFreeMolfileData (MOL_FMT_DATA *mfdata)
 
int MolfileV3000Init (MOL_FMT_CTAB *ctab, char *pStrErr)
 
int MolfileV3000ReadCTABBeginAndCountsLine (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, char *pStrErr)
 
int MolfileV3000ReadAtomsBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 
int MolfileV3000ReadBondsBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 
int MolfileV3000ReadTailOfCTAB (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 
int MolfileV3000ReadHapticBond (MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr)
 
int MolfileV3000ReadStereoCollection (MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr)
 
int MolfileV3000ReadSGroup (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 
int MolfileV3000Read3DBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 
int MolfileV3000ReadCollections (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 
int DeleteMolfileV3000Info (MOL_FMT_v3000 *v3000)
 
char * inchi_fgetsLf_V3000 (char *line, INCHI_IOSTREAM *inp_stream)
 
int get_V3000_input_line_to_strbuf (INCHI_IOS_STRING *buf, INCHI_IOSTREAM *inp_stream)
 
int MolfileV3000ReadField (void *data, int data_type, char **line_ptr)
 
int MolfileV3000ReadKeyword (char *key, char **line_ptr)
 
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)
 
int SDFileIdentifyLabel (char *inp_line, const char *pSdfLabel)
 
unsigned long SDFileExtractCASNo (char *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.
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)
+ 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)
+ 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 
)
+ 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 
)
+ 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 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileHasNoChemStruc()

int MolfileHasNoChemStruc ( MOL_FMT_DATA mfdata)
+ 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:

◆ MolfileSaveCopy()

int MolfileSaveCopy ( INCHI_IOSTREAM inp_file,
long  fPtrStart,
long  fPtrEnd,
FILE *  outfile,
long  num 
)
+ 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 
)
+ 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 
)
+ 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 
)
+ 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 
)
+ 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 
)
+ 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 
)
+ 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 
)
+ 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 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileV3000ReadKeyword()

int MolfileV3000ReadKeyword ( char *  key,
char **  line_ptr 
)
+ 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 
)
+ 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 
)
+ 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 
)
+ 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 
)

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)
+ Here is the caller graph for this function:

◆ SDFileIdentifyLabel()

int SDFileIdentifyLabel ( char *  inp_line,
const char *  pSdfLabel 
)
+ 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 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function: