InChI
 
Loading...
Searching...
No Matches
mol_fmt.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: MIT
3 * Copyright (c) 2024 IUPAC and InChI Trust
4 */
5
6#ifndef _MOL_FMT_H_
7#define _MOL_FMT_H_
8
9#include <stdio.h>
10
11#include "ichisize.h"
12#include "mode.h" /* djb-rwth: necessary header file */
13
14/*
15 Data structures and constants
16*/
17
18/*************************** read MOL file V2000.************************/
19/* ref: A.Dalby et al, "Description of Several Chemical Structure
20 * File Formats Used by Computer Programs Developed at Molecular
21 * Design Limited", J. Chem. Inf. Comput. Sci., 1992, 32, 244-255.
22 */
23
24/* ************************** read MOL file V3000.************************ */
25/* http://download.accelrys.com/freeware/ctfile-formats/CTFile-formats.zip
26 * Last accessed 2013-06-11
27 */
28
29/*-----------*/
30/* CONSTANTS */
31/*-----------*/
32
33#define SD_FMT_END_OF_DATA "$$$$"
34
35#define MOL_FMT_INPLINELEN 204 /* add cr, lf, double zero termination */
36#ifndef MOL_FMT_MAXLINELEN
37#define MOL_FMT_MAXLINELEN 200
38#endif
39
40#define MOL_FMT_PRESENT 1
41#define MOL_FMT_ABSENT 0
42
43/* configuration */
44#define MOL_FMT_QUERY MOL_FMT_ABSENT
45#define MOL_FMT_CPSS MOL_FMT_ABSENT
46#define MOL_FMT_REACT MOL_FMT_ABSENT
47
48#define MOL_FMT_STRING_DATA 'S'
49#define MOL_FMT_CHAR_INT_DATA 'C'
50#define MOL_FMT_SHORT_INT_DATA 'N'
51#define MOL_FMT_LONG_INT_DATA 'L'
52#define MOL_FMT_DOUBLE_DATA 'D'
53#define MOL_FMT_FLOAT_DATA 'F'
54#define MOL_FMT_JUMP_TO_RIGHT 'J'
55#define MOL_FMT_INT_DATA 'I'
56
57#define MOL_FMT_MAX_VALUE_LEN 32 /* max length of string containing a numerical value */
58
59#define MOL_FMT_M_STY_NON 0
60#define MOL_FMT_M_STY_SRU 1
61#define MOL_FMT_M_STY_MON 2
62#define MOL_FMT_M_STY_COP 3
63#define MOL_FMT_M_STY_MOD 4
64#define MOL_FMT_M_STY_CRO 5
65#define MOL_FMT_M_STY_MER 6
67#define MOL_FMT_M_SST_NON 0
68#define MOL_FMT_M_SST_ALT 1
69#define MOL_FMT_M_SST_RAN 2
70#define MOL_FMT_M_SST_BLK 3
72#define MOL_FMT_M_CONN_NON 0
73#define MOL_FMT_M_CONN_HT 1
74#define MOL_FMT_M_CONN_HH 2
75#define MOL_FMT_M_CONN_EU 3
76
77/* V3000 specific constants */
78#define MOL_FMT_V3000_STENON -1
79#define MOL_FMT_V3000_STEABS 1
80#define MOL_FMT_V3000_STEREL 2
81#define MOL_FMT_V3000_STERAC 3
82
83/* provisional limits for V3000 */
84#define MOL_FMT_V3000_INPLINELEN 32004 /* add cr, lf, double zero termination */
85#ifndef MOL_FMT_V3000_MAXLINELEN
86#define MOL_FMT_V3000_MAXLINELEN 32000
87#endif
88#define MOL_FMT_V3000_MAXFIELDLEN 4096
89
90/*#ifdef TARGET_EXE_USING_API*/
91#ifndef ISOTOPIC_SHIFT_FLAG
92#define ISOTOPIC_SHIFT_FLAG 10000 /* add to isotopic mass if isotopic_mass = */
93#endif
94/*#endif*/
95
96/*-------------------*/
97/* SIMPLE DATA TYPES */
98/*-------------------*/
99
100#ifndef INCHI_US_CHAR_DEF
101typedef signed char S_CHAR;
102typedef unsigned char U_CHAR;
103#define INCHI_US_CHAR_DEF
104#endif
105
106#ifndef LEN_COORD
107#define LEN_COORD 10
108#endif
109#ifndef NUM_COORD
110#define NUM_COORD 3
111#endif
112
113/*-----------------*/
114/* DATA STRUCTURES */
115/*-----------------*/
123typedef struct A_NUM_LISTS
124{
125 int **lists;
127 int used;
130
138int NumLists_Alloc(NUM_LISTS *num_lists, int nlists);
139
146int NumLists_ReAlloc(NUM_LISTS *num_lists);
147
155int NumLists_Append(NUM_LISTS *num_lists, int *list);
156
161void NumLists_Free(NUM_LISTS *num_lists);
162
170typedef struct tagINT_ARRAY
171{
172 int *item;
174 int used;
177
186int IntArray_Alloc(INT_ARRAY *items, int nitems);
187
195int IntArray_ReAlloc(INT_ARRAY *items);
196
205int IntArray_Append(INT_ARRAY *items, int new_item);
206
215int IntArray_AppendIfAbsent(INT_ARRAY *items, int new_item);
216
222void IntArray_Reset(INT_ARRAY *items);
223
229void IntArray_Free(INT_ARRAY *items);
230
236void IntArray_DebugPrint(INT_ARRAY *items);
237
252typedef struct A_MOL_FMT_SGROUP
253{
254 int id;
255 int type;
257 int conn;
258 int label;
259 double xbr1[4];
260 double xbr2[4];
261 char smt[80];
265
275 int id,
276 int type);
277
284
300
308int MolFmtSgroups_Alloc(MOL_FMT_SGROUPS *items, int nitems);
309
317
326int MolFmtSgroups_Append(MOL_FMT_SGROUPS *items, int id, int type);
327
334
343
381
406typedef struct A_MOL_FMT_ATOM
407{
408 double fx; /* F10.5; Generic */
409 double fy; /* F10.5; Generic */
410 double fz; /* F10.5; Generic */
411 char symbol[6]; /* aaa; Generic */
412
413 S_CHAR mass_difference; /* dd; (M_ISO) */
414 /* Generic: -3..+4 otherwise 0 or */
415 /* 127=most abund. isotope */
416 S_CHAR charge; /* ccc; (M CHG), */
417 /* Generic: 1=+3, 2=+2,3=+1, */
418 /* 4=doublet,5=-1,6=-2,7=-3 */
419 char radical; /* (M RAD) */
420 char stereo_parity; /* sss; Generic */
421#if (MOL_FMT_QUERY == MOL_FMT_PRESENT)
422 char H_count_plus_1; /* hhh; Query; */
423 /* Hn means >= n H; */
424 /* H0 means no H */
425 char stereo_care; /* bbb; Query: 0=ignore; */
426 /* 1=must match */
427#endif
428 char valence; /* vvv: */
429 /* 0=no marking; (1..14)=(1..14); */
430 /* 15=zero valence.Number of bonds*/
431 /* includes bonds to impl. H's */
432
433#if (MOL_FMT_CPSS == MOL_FMT_PRESENT)
434 char H0_designator; /* HHH: CPSS */
435 char reaction_component_type; /* rrr: */
436 /* CPSS: 1=reactant, */
437 /* 2=product, */
438 /* 3=intermediate */
439 char reaction_component_num; /* iii: CPSS: 0 to (n-1) */
440#endif
441#if (MOL_FMT_REACT == MOL_FMT_PRESENT)
442 short atom_atom_mapping_num; /* mmm: Reaction: 1..255 */
443 char cInversionRetentionFlag; /* nnn: */
444 /* 1=inverted, 2=retained config.;*/
445 /* 0=property not applied */
446#endif
447#if (MOL_FMT_REACT == MOL_FMT_PRESENT || MOL_FMT_QUERY == MOL_FMT_PRESENT)
448 char exact_change_flag; /* eee */
449#endif
450 char my_n_impH; /* number of implicit H calculated */
451 /* for adding H to strings in STDATA*/
452 char display_tom; /* Do not hide element's name */
453 /* (applies to C 7-25-98 DCh */
454 char atom_aliased_flag; /* Do not remove */
455 /* charge/radical/isotope if it */
456 /* is in the alias. 9-3-99 DCh */
458
469typedef struct A_MOL_FMT_BOND
470{
471 short atnum1; /* 111: First atom number: Generic */
472 short atnum2; /* 222: Second atom number:Generic */
473 char bond_type; /* ttt: */
474 /* 1,2,3=single, double, triple; */
475 /* 4=aromatic; */
476 /* 5=single or double; */
477 /* 6=single or aromatic; */
478 /* 7=double or aromatic; */
479 /* 8=any. */
480 /* Values 4-8 are for */
481 /* SSS queries only */
482 char bond_stereo; /* sss: */
483 /* Single bonds: */
484 /* 0=not stereo, 1=up, */
485 /* 4=either, 6=down */
486 /* Double bonds: */
487 /* 0=use x,y,z to */
488 /* determine cis/trans, */
489 /* 3=cis or trans (either) */
490 /* xxx: not used */
491
492#if (MOL_FMT_QUERY == MOL_FMT_PRESENT)
493 char bond_topology; /* rrr: */
494 /* 0=either, 1=ring, 2=chain: */
495 /* SSS queries only */
496#endif
497#if (MOL_FMT_REACT == MOL_FMT_PRESENT)
498 char react_center_status; /* ccc: */
499 /* 0 = unmarked, */
500 /* 1 = a center, */
501 /* -1 = not a center; */
502 /* Additional: */
503 /* 2 = no charge, */
504 /* 4 = bond made/broken, */
505 /* 8 = bond order changes */
506 /* 12=4+8; 5=4+1, 9=8+1, 13=12+1 */
507 /* 12=4+8; 5=4+1, 9=8+1, 13=12+1 */
508 /* are also possible */
509#endif
511
532typedef struct A_MOL_FMT_v3000
533{
536 int *atom_index_orig; /* index as supplied for atoms */
537 int *atom_index_fin; /* = index or -1 for star atom */
538 int n_sgroups; /* currently, we do not use this. */
539 int n_3d_constraints; /* currently, we do not use this. */
543 NUM_LISTS *haptic_bonds; /* haptic_bonds[i] is ptr to int* which contains */
544 /* bond_type, non-star atom number, */
545 /* nendpts, then endpts themselves */
546 /* Enhanced stereo */
548 NUM_LISTS *steabs; /* steabs[k][0] - not used */
549 /* steabs[k][1] - number of members in collection */
550 /* steabs[k][2..] - member atom numbers */
552 NUM_LISTS *sterel; /* sterel[k][0] - n from "STERELn" tag */
553 /* sterel[k][1] - number of members in collection */
554 /* sterel[k][2..] - member atom numbers */
556 NUM_LISTS *sterac; /* sterac[k][0] - n from "STERACn" tag */
557 /* sterac[k][1] - number of members in collection */
558 /* sterac[k][2..] - member atom numbers */
560
582typedef struct A_MOL_FMT_CTAB
583{
584 /* Line #1: Counts line */
585 int n_atoms; /* int accounts for possible V3000. Was: aaa; <= 255; Generic */
586 int n_bonds; /* int accounts for possible V3000. Was: bbb; <= 255; Generic */
587#if (MOL_FMT_QUERY == MOL_FMT_PRESENT)
588 short n_atom_lists; /* lll; <= 30; Query */
589#endif
590
591 char chiral_flag; /* ccc; 0 or 1; Generic */
592 short n_stext_entries; /* sss; CPSS */
593#if (MOL_FMT_CPSS == MOL_FMT_PRESENT)
594 short n_reaction_components_plus_1; /* xxx; CPSS */
595 short n_reactants; /* rrr; CPSS */
596 short n_products; /* ppp; CPSS */
597 short n_intermediates; /* iii; CPSS */
598#endif
599 short n_property_lines; /* mmm; Generic */
601 char version_string[7]; /* vvvvvv; Generic; 'V2000' */
602 MOL_FMT_ATOM *atoms; /* The Atom Block */
605 MOL_FMT_SGROUPS sgroups; /* growable array of pointers to Sgroup objects */
608
620
621/*
622 Functions
623*/
624
638 MOL_FMT_HEADER_BLOCK* OnlyHeaderBlock,
639 MOL_FMT_CTAB* OnlyCTab,
640 int bGetOrigCoord,
641 int treat_polymers,
642 int* err, char* pStrErr, int bNoWarnings);
643
652int MolfileReadHeaderLines(MOL_FMT_HEADER_BLOCK* hdr, INCHI_IOSTREAM* inp_file, char* pStrErr);
653
662int MolfileReadCountsLine(MOL_FMT_CTAB* ctab, INCHI_IOSTREAM* inp_file, char* pStrErr);
663
673 int err, char* pStrErr);
674
685 int err, char* pStrErr);
686
717 MOL_FMT_HEADER_BLOCK *OnlyHeaderBlock,
718 MOL_FMT_CTAB *OnlyCTab,
719 int bGetOrigCoord,
720 int treat_polymers,
721 int pseudos_allowed,
722 char *pname,
723 int lname,
724 unsigned long *Id,
725 const char *pSdfLabel,
726 char *pSdfValue,
727 int *err,
728 char *pStrErr,
729 int bNoWarnings);
730
740int MolfileStrnread(char *dest,
741 char *source,
742 int len,
743 char **first_space);
744
761int MolfileReadField(void *data,
762 int field_len,
763 int data_type,
764 char **line_ptr);
765
773
781
792int MolfileSaveCopy(INCHI_IOSTREAM *inp_file,
793 long fPtrStart,
794 long fPtrEnd,
795 FILE *outfile,
796 long num);
797
815 int find_norm_factors,
816 double *x0,
817 double *y0,
818 double *z0,
819 double *xmin,
820 double *ymin,
821 double *zmin,
822 double *scaler,
823 int *err,
824 char *pStrErr);
825
833
834/*
835 V3000 Molfile
836*/
837
846 char *pStrErr);
847
857 INCHI_IOSTREAM *inp_file,
858 char *pStrErr);
859
870 INCHI_IOSTREAM *inp_file,
871 int err,
872 char *pStrErr);
873
889 INCHI_IOSTREAM *inp_file,
890 int err,
891 char *pStrErr);
892
908 INCHI_IOSTREAM *inp_file,
909 int err,
910 char *pStrErr);
911
924 char **line_ptr,
925 int **num_list,
926 char *pStrErr);
927
940 char **line_ptr,
941 int **num_list,
942 char *pStrErr);
943
955 INCHI_IOSTREAM *inp_file,
956 int err,
957 char *pStrErr);
958
970 INCHI_IOSTREAM *inp_file,
971 int err,
972 char *pStrErr);
973
985 INCHI_IOSTREAM *inp_file,
986 int err,
987 char *pStrErr);
988/* Clean V3000 stuff */
989
997
1006char *inchi_fgetsLf_V3000(char *line,
1007 INCHI_IOSTREAM *inp_stream);
1008
1017 INCHI_IOSTREAM *inp_stream);
1018
1028int MolfileV3000ReadField(void *data,
1029 int data_type,
1030 char **line_ptr);
1038int MolfileV3000ReadKeyword(char *key,
1039 char **line_ptr);
1040
1041/*
1042 SDF
1043*/
1044
1066 unsigned long *CAS_num,
1067 char *comment,
1068 int lcomment,
1069 char *name,
1070 int lname,
1071 int prev_err,
1072 const char *pSdfLabel,
1073 char *pSdfValue,
1074 char *pStrErr,
1075 int bNoWarnings);
1076
1088int SDFileIdentifyLabel(char *inp_line, const char *pSdfLabel);
1089
1096unsigned long SDFileExtractCASNo(char *line);
1097
1098#endif /* _MOL_FMT_H_ */
char MOL_COORD[LEN_COORD *NUM_COORD+NUM_COORD - 1]
Definition ichisize.h:29
int MolFmtSgroups_GetIndexBySgroupId(int id, MOL_FMT_SGROUPS *items)
Gets the index of a Sgroup by its ID.
Definition mol_fmt4.c:734
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)
Read V3000 3D constraints block in MOL file data structure from input file stream.
Definition mol_fmt3.c:573
signed char S_CHAR
Definition mol_fmt.h:101
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:515
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.
Definition mol_fmt2.c:350
int MolfileReadBondsBlock(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Reads a bond block from input MOL file (V2000)
Definition mol_fmt1.c:785
unsigned long SDFileExtractCASNo(char *line)
Extract CAS number from the given line.
Definition mol_fmt4.c:372
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.
Definition mol_fmt2.c:439
int NumLists_Append(NUM_LISTS *num_lists, int *list)
Push new item to the end of array.
Definition mol_fmt4.c:436
int NumLists_ReAlloc(NUM_LISTS *num_lists)
Reallocates memory for the numeric lists.
Definition mol_fmt4.c:414
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.
Definition mol_fmt3.c:827
int MolfileV3000ReadField(void *data, int data_type, char **line_ptr)
Extract the 'data' in specified mol file field at given text position 'line_ptr'.
Definition mol_fmt3.c:222
int MolfileHasNoChemStruc(MOL_FMT_DATA *mfdata)
Check if the MOL file has no chemical structure.
Definition mol_fmt2.c:327
int NumLists_Alloc(NUM_LISTS *num_lists, int nlists)
Allocates memory for a specified number of numeric lists.
Definition mol_fmt4.c:398
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,...
Definition mol_fmt1.c:534
void MolFmtSgroup_Free(MOL_FMT_SGROUP *sgroup)
Frees the memory allocated for the Sgroup.
Definition mol_fmt4.c:623
unsigned char U_CHAR
Definition mol_fmt.h:102
int MolfileV3000ReadStereoCollection(MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr)
Read V3000 stereo collection information from the input line.
Definition mol_fmt3.c:1782
int MolFmtSgroup_Create(MOL_FMT_SGROUP **sgroup, int id, int type)
Allocate new array Sgroup.
Definition mol_fmt4.c:599
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)
Reads header lines and connection table block from input SD or MOL file, ignore STEXT block,...
Definition mol_fmt1.c:130
#define MOL_FMT_MAXLINELEN
Definition mol_fmt.h:37
int MolfileV3000ReadKeyword(char *key, char **line_ptr)
Read keyword from the specified line.
Definition mol_fmt3.c:375
void IntArray_DebugPrint(INT_ARRAY *items)
Prints the contents of the INT_ARRAY structure for debugging purposes.
Definition mol_fmt4.c:547
int SDFileIdentifyLabel(char *inp_line, const char *pSdfLabel)
Identify if the given line matches the specified SDF label.
Definition mol_fmt4.c:311
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:568
void MolFmtSgroups_Free(MOL_FMT_SGROUPS *items)
Frees the memory allocated for the MOL_FMT_SGROUPS list.
Definition mol_fmt4.c:716
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.
Definition mol_fmt1.c:57
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:30
MOL_FMT_DATA * FreeMolfileData(MOL_FMT_DATA *mfdata)
Free MOL file data structure.
Definition mol_fmt2.c:629
int IntArray_ReAlloc(INT_ARRAY *items)
Reallocates memory for the INT_ARRAY structure.
Definition mol_fmt4.c:490
struct tagINT_ARRAY INT_ARRAY
INT_ARRAY - Dynamically growing array of int.
int MolfileV3000Init(MOL_FMT_CTAB *ctab, char *pStrErr)
Initialize V3000 connection table in MOL file data structure.
Definition mol_fmt3.c:33
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:680
int MolfileReadAtomsBlock(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Reads an atom block from input MOL file (V2000).
Definition mol_fmt1.c:626
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.
Definition mol_fmt3.c:1227
int DeleteMolfileV3000Info(MOL_FMT_v3000 *v3000)
Free memory allocated for V3000 specific data in the MOL file data structure.
Definition mol_fmt3.c:130
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:298
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_...
Definition mol_fmt3.c:181
int MolFmtSgroups_Alloc(MOL_FMT_SGROUPS *items, int nitems)
Allocates memory for a specified number of Sgroup objects.
Definition mol_fmt4.c:640
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.
Definition mol_fmt3.c:409
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)
Get a V3000 input line and store it in a string buffer.
Definition mol_fmt3.c:1854
int MolFmtSgroups_ReAlloc(MOL_FMT_SGROUPS *items)
Expand array of Sgroups.
Definition mol_fmt4.c:658
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.
Definition mol_fmt3.c:526
void IntArray_Free(INT_ARRAY *items)
Frees the memory allocated for the INT_ARRAY structure.
Definition mol_fmt4.c:575
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:456
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:70
int MolfileV3000ReadHapticBond(MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr)
Read V3000 haptic bond information from the input line.
Definition mol_fmt3.c:1697
struct A_MOL_FMT_HEADER_BLOCK MOL_FMT_HEADER_BLOCK
Data structure for MOL file header block (3 lines).
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 molec...
Definition mol_fmt1.c:416
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:537
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.
Definition mol_fmt4.c:126
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,...
Definition mol_fmt3.c:1567
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.
Definition mol_fmt3.c:612
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:475
Data structure for atom representation in the MOL format.
Definition mol_fmt.h:407
double fy
Definition mol_fmt.h:409
char radical
Definition mol_fmt.h:419
char atom_aliased_flag
Definition mol_fmt.h:454
char valence
Definition mol_fmt.h:428
S_CHAR mass_difference
Definition mol_fmt.h:413
double fz
Definition mol_fmt.h:410
char stereo_parity
Definition mol_fmt.h:420
S_CHAR charge
Definition mol_fmt.h:416
double fx
Definition mol_fmt.h:408
char symbol[6]
Definition mol_fmt.h:411
char my_n_impH
Definition mol_fmt.h:450
char display_tom
Definition mol_fmt.h:452
Data structure for bond representation in the MOL format.
Definition mol_fmt.h:470
short atnum2
Definition mol_fmt.h:472
short atnum1
Definition mol_fmt.h:471
char bond_stereo
Definition mol_fmt.h:482
char bond_type
Definition mol_fmt.h:473
Connection table data structure.
Definition mol_fmt.h:583
int n_bonds
Definition mol_fmt.h:586
MOL_FMT_SGROUPS sgroups
Definition mol_fmt.h:605
short n_stext_entries
Definition mol_fmt.h:592
short follow_inchi_1_treating_iso_mass
Definition mol_fmt.h:600
short n_property_lines
Definition mol_fmt.h:599
int n_atoms
Definition mol_fmt.h:585
char chiral_flag
Definition mol_fmt.h:591
MOL_FMT_BOND * bonds
Definition mol_fmt.h:603
MOL_COORD * coords
Definition mol_fmt.h:604
MOL_FMT_v3000 * v3000
Definition mol_fmt.h:606
MOL_FMT_ATOM * atoms
Definition mol_fmt.h:602
char version_string[7]
Definition mol_fmt.h:601
Data structure for a MOL file.
Definition mol_fmt.h:616
MOL_FMT_CTAB ctab
Definition mol_fmt.h:618
MOL_FMT_HEADER_BLOCK hdr
Definition mol_fmt.h:617
Data structure for MOL file header block (3 lines).
Definition mol_fmt.h:364
char dim_code[3]
Definition mol_fmt.h:374
char minute
Definition mol_fmt.h:373
char year
Definition mol_fmt.h:371
char comment[81]
Definition mol_fmt.h:379
short scaling_factor1
Definition mol_fmt.h:375
char user_initls[3]
Definition mol_fmt.h:367
double scaling_factor2
Definition mol_fmt.h:376
char hour
Definition mol_fmt.h:372
char molname[MOL_FMT_MAXLINELEN+1]
Definition mol_fmt.h:365
long internal_regno
Definition mol_fmt.h:378
char month
Definition mol_fmt.h:369
char line2[MOL_FMT_MAXLINELEN+1]
Definition mol_fmt.h:366
char prog_name[9]
Definition mol_fmt.h:368
char day
Definition mol_fmt.h:370
double energy
Definition mol_fmt.h:377
MOL_FMT_SGROUPS is a dynamically growing array of pointers to MOL_FMT_SGROUP objects.
Definition mol_fmt.h:294
int used
Definition mol_fmt.h:297
int increment
Definition mol_fmt.h:298
MOL_FMT_SGROUP ** group
Definition mol_fmt.h:295
int allocated
Definition mol_fmt.h:296
Data structure for Sgroup data (substance group data).
Definition mol_fmt.h:253
int conn
Definition mol_fmt.h:257
char smt[80]
Definition mol_fmt.h:261
int type
Definition mol_fmt.h:255
double xbr2[4]
Definition mol_fmt.h:260
INT_ARRAY alist
Definition mol_fmt.h:262
int id
Definition mol_fmt.h:254
double xbr1[4]
Definition mol_fmt.h:259
int label
Definition mol_fmt.h:258
INT_ARRAY blist
Definition mol_fmt.h:263
int subtype
Definition mol_fmt.h:256
Data structure for V3000 representation in the MOL format.
Definition mol_fmt.h:533
int n_collections
Definition mol_fmt.h:540
int n_non_haptic_bonds
Definition mol_fmt.h:541
NUM_LISTS * sterac
Definition mol_fmt.h:556
int n_steabs
Definition mol_fmt.h:547
int n_sterac
Definition mol_fmt.h:555
int n_sterel
Definition mol_fmt.h:551
int n_star_atoms
Definition mol_fmt.h:535
int n_haptic_bonds
Definition mol_fmt.h:542
int n_sgroups
Definition mol_fmt.h:538
NUM_LISTS * sterel
Definition mol_fmt.h:552
NUM_LISTS * steabs
Definition mol_fmt.h:548
int * atom_index_fin
Definition mol_fmt.h:537
int n_3d_constraints
Definition mol_fmt.h:539
int n_non_star_atoms
Definition mol_fmt.h:534
NUM_LISTS * haptic_bonds
Definition mol_fmt.h:543
int * atom_index_orig
Definition mol_fmt.h:536
NUM_LISTS - Dynamically growing array of numeric lists.
Definition mol_fmt.h:124
int allocated
Definition mol_fmt.h:126
int ** lists
Definition mol_fmt.h:125
int used
Definition mol_fmt.h:127
int increment
Definition mol_fmt.h:128
INT_ARRAY - Dynamically growing array of int.
Definition mol_fmt.h:171
int * item
Definition mol_fmt.h:172
int increment
Definition mol_fmt.h:175
int used
Definition mol_fmt.h:174
int allocated
Definition mol_fmt.h:173
Definition mode.h:999
Definition mode.h:985