68#define SD_FMT_END_OF_DATA "$$$$"
70#define MOL_FMT_INPLINELEN 204
71#ifndef MOL_FMT_MAXLINELEN
72#define MOL_FMT_MAXLINELEN 200
75#define MOL_FMT_PRESENT 1
76#define MOL_FMT_ABSENT 0
79#define MOL_FMT_QUERY MOL_FMT_ABSENT
80#define MOL_FMT_CPSS MOL_FMT_ABSENT
81#define MOL_FMT_REACT MOL_FMT_ABSENT
83#define MOL_FMT_STRING_DATA 'S'
84#define MOL_FMT_CHAR_INT_DATA 'C'
85#define MOL_FMT_SHORT_INT_DATA 'N'
86#define MOL_FMT_LONG_INT_DATA 'L'
87#define MOL_FMT_DOUBLE_DATA 'D'
88#define MOL_FMT_FLOAT_DATA 'F'
89#define MOL_FMT_JUMP_TO_RIGHT 'J'
90#define MOL_FMT_INT_DATA 'I'
92#define MOL_FMT_MAX_VALUE_LEN 32
94#define MOL_FMT_M_STY_NON 0
95#define MOL_FMT_M_STY_SRU 1
96#define MOL_FMT_M_STY_MON 2
97#define MOL_FMT_M_STY_COP 3
98#define MOL_FMT_M_STY_MOD 4
99#define MOL_FMT_M_STY_CRO 5
100#define MOL_FMT_M_STY_MER 6
102#define MOL_FMT_M_SST_NON 0
103#define MOL_FMT_M_SST_ALT 1
104#define MOL_FMT_M_SST_RAN 2
105#define MOL_FMT_M_SST_BLK 3
107#define MOL_FMT_M_CONN_NON 0
108#define MOL_FMT_M_CONN_HT 1
109#define MOL_FMT_M_CONN_HH 2
110#define MOL_FMT_M_CONN_EU 3
113#define MOL_FMT_V3000_STENON -1
114#define MOL_FMT_V3000_STEABS 1
115#define MOL_FMT_V3000_STEREL 2
116#define MOL_FMT_V3000_STERAC 3
119#define MOL_FMT_V3000_INPLINELEN 32004
120#ifndef MOL_FMT_V3000_MAXLINELEN
121#define MOL_FMT_V3000_MAXLINELEN 32000
123#define MOL_FMT_V3000_MAXFIELDLEN 4096
126#ifndef ISOTOPIC_SHIFT_FLAG
127#define ISOTOPIC_SHIFT_FLAG 10000
135#ifndef INCHI_US_CHAR_DEF
138#define INCHI_US_CHAR_DEF
457#if (MOL_FMT_QUERY == MOL_FMT_PRESENT)
469#if (MOL_FMT_CPSS == MOL_FMT_PRESENT)
471 char reaction_component_type;
475 char reaction_component_num;
477#if (MOL_FMT_REACT == MOL_FMT_PRESENT)
478 short atom_atom_mapping_num;
479 char cInversionRetentionFlag;
483#if (MOL_FMT_REACT == MOL_FMT_PRESENT || MOL_FMT_QUERY == MOL_FMT_PRESENT)
484 char exact_change_flag;
528#if (MOL_FMT_QUERY == MOL_FMT_PRESENT)
533#if (MOL_FMT_REACT == MOL_FMT_PRESENT)
624#if (MOL_FMT_QUERY == MOL_FMT_PRESENT)
630#if (MOL_FMT_CPSS == MOL_FMT_PRESENT)
631 short n_reaction_components_plus_1;
634 short n_intermediates;
690 const char *pSdfLabel,
744 int find_norm_factors,
818 unsigned long *CAS_num,
824 const char *pSdfLabel,
char MOL_COORD[LEN_COORD *NUM_COORD+NUM_COORD - 1]
Definition ichisize.h:64
int MolFmtSgroups_GetIndexBySgroupId(int id, MOL_FMT_SGROUPS *items)
Gets the index of a Sgroup by its ID.
Definition mol_fmt4.c:768
struct A_MOL_FMT_SGROUP MOL_FMT_SGROUP
Data structure for Sgroup data (substance group data).
int MolfileV3000Read3DBlock(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:622
signed char S_CHAR
Definition mol_fmt.h:136
struct A_MOL_FMT_DATA MOL_FMT_DATA
Data structure for a MOL file.
int IntArray_Append(INT_ARRAY *items, int new_item)
Appends a new item to the INT_ARRAY structure.
Definition mol_fmt4.c:550
int MolfileSaveCopy(INCHI_IOSTREAM *inp_file, long fPtrStart, long fPtrEnd, FILE *outfile, long num)
Definition mol_fmt2.c:385
unsigned long SDFileExtractCASNo(char *line)
Definition mol_fmt4.c:407
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)
Definition mol_fmt2.c:474
int NumLists_Append(NUM_LISTS *num_lists, int *list)
Push new item to the end of array.
Definition mol_fmt4.c:471
int NumLists_ReAlloc(NUM_LISTS *num_lists)
Reallocates memory for the numeric lists.
Definition mol_fmt4.c:449
int MolfileV3000ReadAtomsBlock(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:871
int MolfileV3000ReadField(void *data, int data_type, char **line_ptr)
Definition mol_fmt3.c:265
int MolfileHasNoChemStruc(MOL_FMT_DATA *mfdata)
Definition mol_fmt2.c:362
int NumLists_Alloc(NUM_LISTS *num_lists, int nlists)
Allocates memory for a specified number of numeric lists.
Definition mol_fmt4.c:433
void MolFmtSgroup_Free(MOL_FMT_SGROUP *sgroup)
Frees the memory allocated for the Sgroup.
Definition mol_fmt4.c:658
unsigned char U_CHAR
Definition mol_fmt.h:137
int MolfileV3000ReadStereoCollection(MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr)
Definition mol_fmt3.c:1832
int MolFmtSgroup_Create(MOL_FMT_SGROUP **sgroup, int id, int type)
Allocate new array Sgroup.
Definition mol_fmt4.c:634
#define MOL_FMT_MAXLINELEN
Definition mol_fmt.h:72
int MolfileV3000ReadKeyword(char *key, char **line_ptr)
Definition mol_fmt3.c:420
void IntArray_DebugPrint(INT_ARRAY *items)
Prints the contents of the INT_ARRAY structure for debugging purposes.
Definition mol_fmt4.c:582
int SDFileIdentifyLabel(char *inp_line, const char *pSdfLabel)
Definition mol_fmt4.c:346
struct A_MOL_FMT_v3000 MOL_FMT_v3000
Data structure for V3000 representation in the MOL format.
void IntArray_Reset(INT_ARRAY *items)
Resets the INT_ARRAY structure to its initial state.
Definition mol_fmt4.c:603
void MolFmtSgroups_Free(MOL_FMT_SGROUPS *items)
Frees the memory allocated for the MOL_FMT_SGROUPS list.
Definition mol_fmt4.c:750
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.
Definition mol_fmt1.c:161
int MolfileStrnread(char *dest, char *source, int len, char **first_space)
Read a string from a source buffer into a destination buffer.
Definition mol_fmt2.c:65
MOL_FMT_DATA * FreeMolfileData(MOL_FMT_DATA *mfdata)
Definition mol_fmt2.c:664
int IntArray_ReAlloc(INT_ARRAY *items)
Reallocates memory for the INT_ARRAY structure.
Definition mol_fmt4.c:525
struct tagINT_ARRAY INT_ARRAY
INT_ARRAY - Dynamically growing array of int.
int MolfileV3000Init(MOL_FMT_CTAB *ctab, char *pStrErr)
Definition mol_fmt3.c:70
struct A_MOL_FMT_BOND MOL_FMT_BOND
Data structure for bond representation in the MOL format.
int MolFmtSgroups_Append(MOL_FMT_SGROUPS *items, int id, int type)
Appends a new Sgroup to the array.
Definition mol_fmt4.c:715
int MolfileV3000ReadBondsBlock(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:1272
int DeleteMolfileV3000Info(MOL_FMT_v3000 *v3000)
Definition mol_fmt3.c:169
struct A_MOL_FMT_CTAB MOL_FMT_CTAB
Connection table data structure.
long MolfileExtractStrucNum(MOL_FMT_HEADER_BLOCK *pHdr)
Extract the MOL file number from the header name line like "Structure #22".
Definition mol_fmt2.c:333
char * inchi_fgetsLf_V3000(char *line, INCHI_IOSTREAM *inp_stream)
Definition mol_fmt3.c:221
int MolFmtSgroups_Alloc(MOL_FMT_SGROUPS *items, int nitems)
Allocates memory for a specified number of Sgroup objects.
Definition mol_fmt4.c:675
int MolfileV3000ReadCTABBeginAndCountsLine(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, char *pStrErr)
Definition mol_fmt3.c:456
struct A_NUM_LISTS NUM_LISTS
NUM_LISTS - Dynamically growing array of numeric lists.
int get_V3000_input_line_to_strbuf(INCHI_IOS_STRING *buf, INCHI_IOSTREAM *inp_stream)
Definition mol_fmt3.c:1905
int MolFmtSgroups_ReAlloc(MOL_FMT_SGROUPS *items)
Expand array of Sgroups.
Definition mol_fmt4.c:693
int MolfileV3000ReadSGroup(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:574
void IntArray_Free(INT_ARRAY *items)
Frees the memory allocated for the INT_ARRAY structure.
Definition mol_fmt4.c:610
struct A_MOL_FMT_SGROUPS MOL_FMT_SGROUPS
MOL_FMT_SGROUPS is a dynamically growing array of pointers to MOL_FMT_SGROUP objects.
void NumLists_Free(NUM_LISTS *num_lists)
Frees the memory allocated for the numeric list.
Definition mol_fmt4.c:491
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'.
Definition mol_fmt2.c:105
int MolfileV3000ReadHapticBond(MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr)
Definition mol_fmt3.c:1746
struct A_MOL_FMT_HEADER_BLOCK MOL_FMT_HEADER_BLOCK
Data structure for MOL file header block (3 lines).
int IntArray_AppendIfAbsent(INT_ARRAY *items, int new_item)
Appends a new item to the INT_ARRAY structure if it is not already present.
Definition mol_fmt4.c:572
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)
Definition mol_fmt4.c:161
int MolfileV3000ReadTailOfCTAB(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:1614
int MolfileV3000ReadCollections(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:662
struct A_MOL_FMT_ATOM MOL_FMT_ATOM
Data structure for atom representation in the MOL format.
int IntArray_Alloc(INT_ARRAY *items, int nitems)
Initializes an INT_ARRAY structure.
Definition mol_fmt4.c:510
Data structure for atom representation in the MOL format.
Definition mol_fmt.h:443
double fy
Definition mol_fmt.h:445
char radical
Definition mol_fmt.h:455
char atom_aliased_flag
Definition mol_fmt.h:490
char valence
Definition mol_fmt.h:464
S_CHAR mass_difference
Definition mol_fmt.h:449
double fz
Definition mol_fmt.h:446
char stereo_parity
Definition mol_fmt.h:456
S_CHAR charge
Definition mol_fmt.h:452
double fx
Definition mol_fmt.h:444
char symbol[6]
Definition mol_fmt.h:447
char my_n_impH
Definition mol_fmt.h:486
char display_tom
Definition mol_fmt.h:488
Data structure for bond representation in the MOL format.
Definition mol_fmt.h:506
short atnum2
Definition mol_fmt.h:508
short atnum1
Definition mol_fmt.h:507
char bond_stereo
Definition mol_fmt.h:518
char bond_type
Definition mol_fmt.h:509
Connection table data structure.
Definition mol_fmt.h:620
int n_bonds
Definition mol_fmt.h:623
MOL_FMT_SGROUPS sgroups
Definition mol_fmt.h:642
short n_stext_entries
Definition mol_fmt.h:629
short follow_inchi_1_treating_iso_mass
Definition mol_fmt.h:637
short n_property_lines
Definition mol_fmt.h:636
int n_atoms
Definition mol_fmt.h:622
char chiral_flag
Definition mol_fmt.h:628
MOL_FMT_BOND * bonds
Definition mol_fmt.h:640
MOL_COORD * coords
Definition mol_fmt.h:641
MOL_FMT_v3000 * v3000
Definition mol_fmt.h:643
MOL_FMT_ATOM * atoms
Definition mol_fmt.h:639
char version_string[7]
Definition mol_fmt.h:638
Data structure for a MOL file.
Definition mol_fmt.h:653
MOL_FMT_CTAB ctab
Definition mol_fmt.h:655
MOL_FMT_HEADER_BLOCK hdr
Definition mol_fmt.h:654
MOL_FMT_SGROUPS is a dynamically growing array of pointers to MOL_FMT_SGROUP objects.
Definition mol_fmt.h:330
int used
Definition mol_fmt.h:333
int increment
Definition mol_fmt.h:334
MOL_FMT_SGROUP ** group
Definition mol_fmt.h:331
int allocated
Definition mol_fmt.h:332
Data structure for Sgroup data (substance group data).
Definition mol_fmt.h:289
int conn
Definition mol_fmt.h:293
char smt[80]
Definition mol_fmt.h:297
int type
Definition mol_fmt.h:291
double xbr2[4]
Definition mol_fmt.h:296
INT_ARRAY alist
Definition mol_fmt.h:298
int id
Definition mol_fmt.h:290
double xbr1[4]
Definition mol_fmt.h:295
int label
Definition mol_fmt.h:294
INT_ARRAY blist
Definition mol_fmt.h:299
int subtype
Definition mol_fmt.h:292
Data structure for V3000 representation in the MOL format.
Definition mol_fmt.h:570
int n_collections
Definition mol_fmt.h:577
int n_non_haptic_bonds
Definition mol_fmt.h:578
NUM_LISTS * sterac
Definition mol_fmt.h:593
int n_steabs
Definition mol_fmt.h:584
int n_sterac
Definition mol_fmt.h:592
int n_sterel
Definition mol_fmt.h:588
int n_star_atoms
Definition mol_fmt.h:572
int n_haptic_bonds
Definition mol_fmt.h:579
int n_sgroups
Definition mol_fmt.h:575
NUM_LISTS * sterel
Definition mol_fmt.h:589
NUM_LISTS * steabs
Definition mol_fmt.h:585
int * atom_index_fin
Definition mol_fmt.h:574
int n_3d_constraints
Definition mol_fmt.h:576
int n_non_star_atoms
Definition mol_fmt.h:571
NUM_LISTS * haptic_bonds
Definition mol_fmt.h:580
int * atom_index_orig
Definition mol_fmt.h:573
NUM_LISTS - Dynamically growing array of numeric lists.
Definition mol_fmt.h:160
int allocated
Definition mol_fmt.h:162
int ** lists
Definition mol_fmt.h:161
int used
Definition mol_fmt.h:163
int increment
Definition mol_fmt.h:164
INT_ARRAY - Dynamically growing array of int.
Definition mol_fmt.h:207
int * item
Definition mol_fmt.h:208
int increment
Definition mol_fmt.h:211
int used
Definition mol_fmt.h:210
int allocated
Definition mol_fmt.h:209