rino 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +44 -0
- data/Rakefile +123 -0
- data/ext/extconf.rb +26 -0
- data/ext/ruby_inchi_main.so +0 -0
- data/ext/src/aux2atom.h +2786 -0
- data/ext/src/comdef.h +148 -0
- data/ext/src/e_0dstereo.c +3014 -0
- data/ext/src/e_0dstereo.h +31 -0
- data/ext/src/e_comdef.h +57 -0
- data/ext/src/e_ctl_data.h +147 -0
- data/ext/src/e_ichi_io.c +498 -0
- data/ext/src/e_ichi_io.h +40 -0
- data/ext/src/e_ichi_parms.c +37 -0
- data/ext/src/e_ichi_parms.h +41 -0
- data/ext/src/e_ichicomp.h +50 -0
- data/ext/src/e_ichierr.h +40 -0
- data/ext/src/e_ichimain.c +593 -0
- data/ext/src/e_ichisize.h +43 -0
- data/ext/src/e_inchi_atom.c +75 -0
- data/ext/src/e_inchi_atom.h +33 -0
- data/ext/src/e_inpdef.h +41 -0
- data/ext/src/e_mode.h +706 -0
- data/ext/src/e_mol2atom.c +649 -0
- data/ext/src/e_readinch.c +58 -0
- data/ext/src/e_readmol.c +54 -0
- data/ext/src/e_readmol.h +180 -0
- data/ext/src/e_readstru.c +251 -0
- data/ext/src/e_readstru.h +33 -0
- data/ext/src/e_util.c +284 -0
- data/ext/src/e_util.h +61 -0
- data/ext/src/extr_ct.h +251 -0
- data/ext/src/ichi.h +206 -0
- data/ext/src/ichi_bns.c +7999 -0
- data/ext/src/ichi_bns.h +231 -0
- data/ext/src/ichican2.c +5000 -0
- data/ext/src/ichicano.c +2195 -0
- data/ext/src/ichicano.h +49 -0
- data/ext/src/ichicans.c +1625 -0
- data/ext/src/ichicant.h +379 -0
- data/ext/src/ichicomn.h +260 -0
- data/ext/src/ichicomp.h +50 -0
- data/ext/src/ichidrp.h +119 -0
- data/ext/src/ichierr.h +124 -0
- data/ext/src/ichiisot.c +101 -0
- data/ext/src/ichilnct.c +286 -0
- data/ext/src/ichimain.h +132 -0
- data/ext/src/ichimak2.c +1189 -0
- data/ext/src/ichimake.c +3812 -0
- data/ext/src/ichimake.h +205 -0
- data/ext/src/ichimap1.c +851 -0
- data/ext/src/ichimap2.c +2856 -0
- data/ext/src/ichimap4.c +1609 -0
- data/ext/src/ichinorm.c +741 -0
- data/ext/src/ichinorm.h +67 -0
- data/ext/src/ichiparm.c +45 -0
- data/ext/src/ichiparm.h +1441 -0
- data/ext/src/ichiprt1.c +3612 -0
- data/ext/src/ichiprt2.c +1511 -0
- data/ext/src/ichiprt3.c +3011 -0
- data/ext/src/ichiqueu.c +1003 -0
- data/ext/src/ichiring.c +326 -0
- data/ext/src/ichiring.h +49 -0
- data/ext/src/ichisize.h +35 -0
- data/ext/src/ichisort.c +539 -0
- data/ext/src/ichister.c +3538 -0
- data/ext/src/ichister.h +35 -0
- data/ext/src/ichitaut.c +3843 -0
- data/ext/src/ichitaut.h +387 -0
- data/ext/src/ichitime.h +74 -0
- data/ext/src/inchi_api.h +670 -0
- data/ext/src/inchi_dll.c +1480 -0
- data/ext/src/inchi_dll.h +34 -0
- data/ext/src/inchi_dll_main.c +23 -0
- data/ext/src/inchi_dll_main.h +31 -0
- data/ext/src/inpdef.h +328 -0
- data/ext/src/lreadmol.h +1246 -0
- data/ext/src/mode.h +706 -0
- data/ext/src/ruby_inchi_main.c +558 -0
- data/ext/src/runichi.c +4179 -0
- data/ext/src/strutil.c +3861 -0
- data/ext/src/strutil.h +182 -0
- data/ext/src/util.c +1130 -0
- data/ext/src/util.h +85 -0
- data/lib/clean_tempfile.rb +220 -0
- data/lib/rino.rb +111 -0
- data/test/test.rb +386 -0
- metadata +130 -0
data/ext/src/mode.h
ADDED
@@ -0,0 +1,706 @@
|
|
1
|
+
/*
|
2
|
+
* International Union of Pure and Applied Chemistry (IUPAC)
|
3
|
+
* International Chemical Identifier (InChI)
|
4
|
+
* Version 1
|
5
|
+
* Software version 1.00
|
6
|
+
* April 13, 2005
|
7
|
+
* Developed at NIST
|
8
|
+
*/
|
9
|
+
|
10
|
+
#ifndef __MODE_H__
|
11
|
+
#define __MODE_H__
|
12
|
+
|
13
|
+
/* uncomment to unconditionally force ANSI-89 C, no Win32 specific code */
|
14
|
+
#define INCHI_ANSI_ONLY
|
15
|
+
|
16
|
+
/* uncomment to create a library for using INChI API described in inchi_api.h */
|
17
|
+
#define INCHI_LIBRARY
|
18
|
+
|
19
|
+
/* uncomment to use INChI library as a Win32 DLL or to eliminate stricmp duplication */
|
20
|
+
/* #define INCHI_LINK_AS_DLL */
|
21
|
+
|
22
|
+
/* Uncomment to compile INCHI_MAIN.exe that calls INCHI_DLL.dll */
|
23
|
+
/* #define INCHI_MAIN */
|
24
|
+
|
25
|
+
#if(!defined(_MSC_VER) || defined(INCHI_LIBRARY)) /* non-Microsoft GNU C, BCC, etc. compilers */
|
26
|
+
#ifndef INCHI_ANSI_ONLY
|
27
|
+
#define INCHI_ANSI_ONLY
|
28
|
+
#endif
|
29
|
+
#endif
|
30
|
+
|
31
|
+
/* #define INCHI_ALL_CPP */ /* uncomment to allow C++ compilation/linkage of functions prototyped in .h files */
|
32
|
+
|
33
|
+
#ifdef _MSC_VER
|
34
|
+
/*
|
35
|
+
========== disable MS VC++ 6.0 Level 4 compiler warnings: ==============
|
36
|
+
C4706: assignment within conditional expression
|
37
|
+
C4127: conditional expression is constant
|
38
|
+
C4244: '=' : conversion from 'int ' to '???', possible loss of data
|
39
|
+
C4701: local variable '???' may be used without having been initialized (removed)
|
40
|
+
C4514: unreferenced inline/local function has been removed (C++)
|
41
|
+
C4100: 'identifier' : unreferenced formal parameter
|
42
|
+
C4786: 'identifier' : identifier was truncated to 'number' characters in the debug information
|
43
|
+
========================================================================
|
44
|
+
*/
|
45
|
+
#pragma warning( disable : 4706 4127 4514 4100 4786 )
|
46
|
+
#endif
|
47
|
+
|
48
|
+
/* Release */
|
49
|
+
#define bRELEASE_VERSION 1 /* 1=> release version; comment out to disable */
|
50
|
+
/* Debug */
|
51
|
+
#ifndef bRELEASE_VERSION
|
52
|
+
#define bRELEASE_VERSION 0 /* 0=> debug version */
|
53
|
+
#endif
|
54
|
+
|
55
|
+
#define ACD_LABS_VERSION 0 /* always 0 */
|
56
|
+
|
57
|
+
#ifndef ADD_CMLPP
|
58
|
+
/* this allows ADD_CMLPP be #defined in a makefile */
|
59
|
+
#define ADD_CMLPP 0 /* 1 => add CMLPP input */
|
60
|
+
#endif
|
61
|
+
|
62
|
+
#if ( ADD_CMLPP == 1 )
|
63
|
+
#ifdef USE_CMLPPDLL
|
64
|
+
/* 1200 is VC++ 6.0 version, 1300 is VC++ .NET; USE_CMLPPDLL may be #defined in a makefile*/
|
65
|
+
#if ( defined(_WIN32) && defined(_MSC_VER) && _MSC_VER >= 1200 )
|
66
|
+
#define MSC_DELAY_LOAD_CMLPPDLL
|
67
|
+
#endif
|
68
|
+
#endif
|
69
|
+
#endif
|
70
|
+
|
71
|
+
/* display (non-canonical) c-groups, display orig at numbers */
|
72
|
+
#if( bRELEASE_VERSION == 1 )
|
73
|
+
#define DISPLAY_DEBUG_DATA_C_POINT 0 /* disabled release version for now */
|
74
|
+
#define DISPLAY_ORIG_AT_NUMBERS 1 /* 1 => in an uncanonicalized components display orig. atom numbers (default) */
|
75
|
+
#else
|
76
|
+
#define DISPLAY_DEBUG_DATA_C_POINT 1 /* debug: 1=>display (non-canonically numbered) c-groups, 0=>do not display */
|
77
|
+
#define DISPLAY_ORIG_AT_NUMBERS 1 /* 0 => in an uncanonicalized components display ordering atom numbers (debug) */
|
78
|
+
#endif
|
79
|
+
|
80
|
+
#if ( DISPLAY_DEBUG_DATA_C_POINT > 0 )
|
81
|
+
#define DISPLAY_DEBUG_DATA DISPLAY_DEBUG_DATA_C_POINT
|
82
|
+
#endif
|
83
|
+
|
84
|
+
/**************************/
|
85
|
+
/* Normalization settings */
|
86
|
+
/**************************/
|
87
|
+
|
88
|
+
/* post-2004-04-27 features */
|
89
|
+
#define HAL_ACID_H_XCHG 1 /* allow iso H exchange to HX (X=halogen) and H2Y (Y=halcogen) */
|
90
|
+
#define CANON_FIXH_TRANS 1 /* produce canonical fixed-H transposition */
|
91
|
+
#define STEREO_WEDGE_ONLY 0 /* 1=> only pointed ends stereo bonds define stereo; 0=> both ends */
|
92
|
+
|
93
|
+
/* current new (with respect to v1.12 Beta) preprocessing */
|
94
|
+
#define REMOVE_ION_PAIRS_EARLY 1 /* 1=> new preprocessing: step 1 before disconnecting metals in fix_odd_things() */
|
95
|
+
#define REMOVE_ION_PAIRS_DISC_STRU 1 /* 1=> new post-preprocessing: remove charhes after metal disconnection */
|
96
|
+
#define REMOVE_ION_PAIRS_FIX_BONDS 1 /* 1=> step2: set unchangeable bonds around removed ion pairs */
|
97
|
+
#define S_VI_O_PLUS_METAL_FIX_BOND 1 /* 1=> count double bond M-O(+)=S as O=S in S(VI) ans S(VIII) fixing bonds */
|
98
|
+
#define N_V_STEREOBONDS 1 /* 1=> detect stereobonds incident to N(V); 0 => don't */
|
99
|
+
/* for testing */
|
100
|
+
#define REMOVE_ION_PAIRS_ORIG_STRU 0 /* 0=> normal mode (default)
|
101
|
+
* 1=> testing mode only: remove ion pairs from the original structure
|
102
|
+
* to save the changes in the output Molfile (/OutputSDF) or AuxInfo
|
103
|
+
* NIP=No Ion Pairs
|
104
|
+
*/
|
105
|
+
/* salts treatment */
|
106
|
+
#define DISCONNECT_SALTS 1 /* 1=>disconnect metal atoms from salts, 0=>dont */
|
107
|
+
#define TEST_REMOVE_S_ATOMS 1 /* 1=>default: after merging into one group test &
|
108
|
+
* remove unreachable,
|
109
|
+
* 0=> old version: test only before merging into one t-group */
|
110
|
+
#define CHARGED_SALTS_ONLY 1 /* 1=>(default)do not test far salts tautomerism if
|
111
|
+
* no negative charge(s) present */
|
112
|
+
#define BNS_PROTECT_FROM_TAUT 1 /* 1=> do not allow testing of bonds to acetyl or nitro */
|
113
|
+
#define BNS_MARK_EDGE_2_DISCONNECT 1 /* 1=> mark edge as temp forbidden instead of disconnection */
|
114
|
+
|
115
|
+
#define REPLACE_ALT_WITH_TAUT 1 /* 1 => replace alt bonds with tautomeric bonds in case of standard t-groups */
|
116
|
+
#define MOVE_CHARGES 1 /* 1 => take moveable charges into account */
|
117
|
+
#define NEUTRALIZE_ENDPOINTS 1 /* 1 => before checking whether an H is moveable make 2 endpoints neutral */
|
118
|
+
/* implemented only if CHECK_TG_ALT_PATH = 0, defined in ichi_bns.c */
|
119
|
+
#define FIX_H_CHECKING_TAUT 1 /* 1 => Fix moveable H or (-) before checking if taut. exchange is possible */
|
120
|
+
#define ALWAYS_ADD_TG_ON_THE_FLY 1 /* 1 => disables radical calcellation by taut-charge movement */
|
121
|
+
#define IGNORE_SINGLE_ENDPOINTS 1 /* 1 => see FindAccessibleEndPoints() in INChITaut.c */
|
122
|
+
|
123
|
+
/* recently added -- begin */
|
124
|
+
#define INCL_NON_SALT_CANDIDATATES 1 /* 1=> allow H and (-) migrate between "acidic" O and
|
125
|
+
* other possible endpoints */
|
126
|
+
#define SALT_WITH_PROTONS 1 /* 1=> (new new) include proton migrarion C-SH, =C-OH, NH+ */
|
127
|
+
#define OPPOSITE_CHARGE_IN_CGROUP 1 /* 1=> allow N(-) in (+) c-group, 0=> disallow */
|
128
|
+
#define MOVE_PPLUS_TO_REMOVE_PROTONS 0 /* 0=> default; 1=> (disabled) add P/P+ charge group during
|
129
|
+
* 'hard' proton removal */
|
130
|
+
#define ADD_MOVEABLE_O_PLUS 1 /* 1=> allow charges on O(+) to move */
|
131
|
+
/* recently added -- end */
|
132
|
+
|
133
|
+
#define DISCONNECT_METALS 1 /* make main layer disconnected */
|
134
|
+
#define RECONNECT_METALS 0 /* 1=> by default add reconnected layer in case of coord.
|
135
|
+
* compound disconnection */
|
136
|
+
#define CHECK_METAL_VALENCE 0 /* 1=> disconnect only metals that have abnormal valence */
|
137
|
+
#define bREUSE_INCHI 1 /* 1=> do not recalulate INChI for components in reconnected
|
138
|
+
* structure that are same as in the connected one */
|
139
|
+
#define OUTPUT_CONNECTED_METAL_ONLY 0 /* 0=> default; 1 => (debug) create only reconnected or
|
140
|
+
* initial struct. output */
|
141
|
+
#define EMBED_REC_METALS_INCHI 1 /* 1=> (default) output Reconnected embedded in Disconnected INChI;
|
142
|
+
* 0=> separate output */
|
143
|
+
|
144
|
+
#define bOUTPUT_ONE_STRUCT_TIME 1 /* 1 => output each structure time (non-release only) */
|
145
|
+
|
146
|
+
|
147
|
+
/*#define INCHI_VERSION "0.9Beta" */
|
148
|
+
/*#define INCHI_VERSION "0.91Beta" */ /* 10-10-2002: sent to Jonathan Goodman */
|
149
|
+
/*#define INCHI_VERSION "0.92Beta" */ /* 11-15-2002: added Hill notation; sent to S.Heller & S.Stein */
|
150
|
+
/*#define INCHI_VERSION "0.93Beta" */ /* 12-09-2002: Fixed isotopic canon. bug & chiralanes; sent to S.Heller & A. McNaught */
|
151
|
+
/*#define INCHI_VERSION "0.931Beta" */ /* Non-BNS without salts released to PMR 01-2003 */
|
152
|
+
/*#define INCHI_VERSION "0.932Beta" */ /* Released to CAS 04-01-2003:
|
153
|
+
* - Improved taut. definitions as compared to 01-2003;
|
154
|
+
* - fixed bug: non-isotopic components' stereo missing from isotopic stereo
|
155
|
+
* - fixed bug: couldn't properly read Unix files (EOL = LF instead of CR/LF)
|
156
|
+
* (effective only for MS VC++, Borland and MinGW/GCC compiles that accept "rb" mode of fopen)
|
157
|
+
* DJGPP/GCC does not seem to need this fix.
|
158
|
+
*/
|
159
|
+
/*==== Release version ===*/
|
160
|
+
/*#define INCHI_VERSION "0.94Beta" */ /* 02-27-2003: Balanced network search to find alt paths and non-stereo bonds;
|
161
|
+
Implemented salts disconnection; added (-) to taut groups */
|
162
|
+
/*#define INCHI_VERSION "1.12Beta" */ /* 1.12: 07-06-2004: sort order: No H formula,..; Pointed end stereo ON, Aggressive (de)protonation OFF */
|
163
|
+
/* 1.11: 05-19-2004: annotated plain text output, fixed bugs */
|
164
|
+
/* 1.1: 04-08-2004: variable protonation version */
|
165
|
+
/* 1.01: 12-23-2003 protected bonds, isotopic canonicalization in GetBaseCanonRanking() */
|
166
|
+
/* 1.02: 01-26-2004 fixed new isotopic tgroup canon bug, molfile merge bug */
|
167
|
+
|
168
|
+
/*#define INCHI_VERSION "1.0RC"*/ /* 02-07-2005 v1.0 Release Candidate */
|
169
|
+
#define INCHI_VERSION "1"
|
170
|
+
#define INCHI_NAME "InChI"
|
171
|
+
#define INCHI_NAM_VER_DELIM "="
|
172
|
+
|
173
|
+
/* constants and array sizes */
|
174
|
+
|
175
|
+
#define INCHI_NUM 2 /* = array size; member indexes: */
|
176
|
+
#define INCHI_BAS 0 /* 0 => disconnected or normal */
|
177
|
+
#define INCHI_REC 1 /* 1 => reconnected */
|
178
|
+
|
179
|
+
#define TAUT_NUM 2 /* = array size; member indexes: */
|
180
|
+
#define TAUT_NON 0 /* 0 => normal structure */
|
181
|
+
#define TAUT_YES 1 /* 1 => tautomeric */
|
182
|
+
#define TAUT_INI 2 /* 2 => intermediate tautomeric structure */
|
183
|
+
#define ALT_TAUT(X) ((X)>TAUT_YES? TAUT_YES : 1-(X)) /* was (1-(X)) */
|
184
|
+
|
185
|
+
/* INChI output modes */
|
186
|
+
#define OUT_N1 0 /* non-tautomeric only */
|
187
|
+
#define OUT_T1 1 /* tautomeric if present otherwise non-tautomeric */
|
188
|
+
#define OUT_NT 2 /* only non-taut representations of tautomeric */
|
189
|
+
#define OUT_TN 3 /* tautomeric if present otherwise non-tautomeric;
|
190
|
+
separately output non-taut representations of tautomeric if present */
|
191
|
+
#define OUT_NN 4 /* only non-taut representations: non-taut else tautomeric */
|
192
|
+
|
193
|
+
/* OUT_TN = OUT_T1 + OUT_NT */
|
194
|
+
|
195
|
+
/* torture test */
|
196
|
+
|
197
|
+
#define TEST_RENUMB_ATOMS 0 /* 1 => heavy duty test by multiple renumbering of atoms */
|
198
|
+
#define TEST_RENUMB_NEIGH 1 /* 1 => randomly permutate neighbors */
|
199
|
+
#define TEST_RENUMB_SWITCH 0 /* 1 => output another (different) picture */
|
200
|
+
#define TEST_RENUMB_ATOMS_SAVE_LONGEST 0 /* 1 => save the component with largest processing time into the problem file */
|
201
|
+
|
202
|
+
#if ( defined(_WIN32) && defined(_DEBUG) && defined(_MSC_VER) /*&& !defined(INCHI_ANSI_ONLY)*/ )
|
203
|
+
/* debug: memory leaks tracking */
|
204
|
+
#ifndef INCHI_LIB
|
205
|
+
#define TRACE_MEMORY_LEAKS 1 /* 1=>trace, 0 => do not trace (Debug only) */
|
206
|
+
#else
|
207
|
+
#define TRACE_MEMORY_LEAKS 1 /* 1=>trace, **ALWAYS** =1 for INCHI_LIB */
|
208
|
+
#endif
|
209
|
+
|
210
|
+
#else /* not MSC and not Debug */
|
211
|
+
|
212
|
+
#define TRACE_MEMORY_LEAKS 0 /* 0: do not change */
|
213
|
+
|
214
|
+
#endif
|
215
|
+
|
216
|
+
/* stereo */
|
217
|
+
|
218
|
+
#define NEW_STEREOCENTER_CHECK 1 /* 1 => add new stereocenter categories (see bCanInpAtomBeAStereoCenter(...)) */
|
219
|
+
#define MIN_SB_RING_SIZE 8 /* do not assume stereo bonds in rings containing 3..MIN_SB_RING_SIZE-1 atoms */
|
220
|
+
|
221
|
+
#define REMOVE_KNOWN_NONSTEREO 1 /* 1=> check in advance known stereo to remove parities from non-stereogenic elements */
|
222
|
+
#define REMOVE_CALC_NONSTEREO 1 /* 1=> check new stereo numberings to remove parities from non-stereogenic elements */
|
223
|
+
#define PROPAGATE_ILL_DEF_STEREO 1 /* 1=> if at least one of the pair of constitutionally identical (far) neighbors */
|
224
|
+
/* (of the tested atom) has ill-defined stereo parity and another has any */
|
225
|
+
/* stereo parity then set the parity of the tested atom to ill-defined value. */
|
226
|
+
|
227
|
+
#define ONLY_DOUBLE_BOND_STEREO 0 /* 1=> no alt bond stereo, no taut. bond attachment to stereo bond */
|
228
|
+
/* 0=> allow other definitions (below) to be active */
|
229
|
+
#define ONE_BAD_SB_NEIGHBOR 1 /* 1 => allow 1 "bad" bond type neighbor to a stereobond atom. 2004-06-02 */
|
230
|
+
|
231
|
+
/* more stereo settings */
|
232
|
+
#define BREAK_ONE_MORE_SC_TIE 1 /* break one more tie when comparing possible stereocenter neighbors */
|
233
|
+
#define BREAK_ALSO_NEIGH_TIE 0 /* post 1.12Beta 2004-08-20: if fixed neighbor has equ neighbors, fix the one with smaller canon. rank */
|
234
|
+
#define BREAK_ALSO_NEIGH_TIE_ROTATE 1 /* post 1.12Beta 2004-09-02: break the second in 2nd psition; 1 works, 0 does not (example:MFCD01085607) */
|
235
|
+
|
236
|
+
#define STEREO_CENTER_BONDS_NORM 1 /* set length of the bonds around a stereocenter = 1 before getting the parity */
|
237
|
+
#define STEREO_CENTER_BOND4_NORM 0 /* set length of the added bond around a stereocenter = 1 before getting the parity */
|
238
|
+
#define NORMALIZE_INP_COORD 0 /* 0=>keep unchanged, 1 => make atom coordinates integer values, avg bond len=20 */
|
239
|
+
|
240
|
+
/* recent stereo */
|
241
|
+
#define STEREO_WEDGE_ONLY 0 /* 1=> only pointed ends stereo bonds define stereo; 0=> both ends 1.12Beta */
|
242
|
+
#define CHECK_C2v_S4_SYMM 0 /* post-1.12Beta 1=> check if a stereocenter has C2v or S4 symmetry; 0=>old mode */
|
243
|
+
|
244
|
+
#define EQL_H_NUM_TOGETHER 1 /* 1=> output 1-3,5H2 intead of 1-3H2,5H2 (CT_MODE_EQL_H_TOGETHER) */
|
245
|
+
#define ABC_CT_NUM_CLOSURES 1 /* 1=> in coinnections compressed format output decimal number of closures instead of '-' */
|
246
|
+
|
247
|
+
/* temporary fix */
|
248
|
+
#define SINGLET_IS_TRIPLET 1 /* 'singlet' means two electrons make a lone pair instead of 2 bonds
|
249
|
+
its effect on valence is same as the effect of a triplet */
|
250
|
+
|
251
|
+
/* defug: find structures where canonical partition is different from equitable */
|
252
|
+
#define FIND_CANON_NE_EQUITABLE 0 /* 0=>normal mode */
|
253
|
+
/* 1=> extract (set EXTR_FLAGS = (EXTR_CANON_NE_EQUITABLE)*/
|
254
|
+
/* set cmd line options: /onlynonTAUT /: /UNCHARGEDACIDS:1 /DISCONSALT:0 /MOVEPOS:0 /DISCONMETAL:0 */
|
255
|
+
|
256
|
+
/* Debug: definitions for the extraction of the structures to the problem file */
|
257
|
+
|
258
|
+
/* definition of the flags for structure extraction to the
|
259
|
+
problem file (for debugging and non-standard searching) */
|
260
|
+
#define EXTR_KNOWN_USED_TO_REMOVE_PARITY 0x000001
|
261
|
+
#define EXTR_CALC_USED_TO_REMOVE_PARITY 0x000002
|
262
|
+
#define EXTR_2EQL2CENTER_TO_REMOVE_PARITY 0x000004
|
263
|
+
#define EXTR_HAS_ATOM_WITH_DEFINED_PARITY 0x000008
|
264
|
+
#define EXTR_REMOVE_PARITY_WARNING 0x000010
|
265
|
+
#define EXTR_SALT_WAS_DISCONNECTED 0x000020
|
266
|
+
#define EXTR_SALT_PROTON_MOVED 0x000040
|
267
|
+
#define EXTR_SALT_PROTON_MOVE_ERR_WARN 0x000080
|
268
|
+
#define EXTR_METAL_WAS_DISCONNECTED 0x000100
|
269
|
+
#define EXTR_METAL_WAS_NOT_DISCONNECTED 0x000200
|
270
|
+
#define EXTR_NON_TRIVIAL_STEREO 0x000400 /* (Inv != Abs stereo) && (parities can't be obtained by inverting them) */
|
271
|
+
#define EXTR_UNUSUAL_VALENCES 0x000800
|
272
|
+
#define EXTR_HAS_METAL_ATOM 0x001000
|
273
|
+
#define EXTR_TEST_TAUT3_SALTS_DONE 0x002000 /* non-oxygen t-points used to discover tautomerism of merged t-groups */
|
274
|
+
#define EXTR_CANON_NE_EQUITABLE 0x004000 /* find structures where canonical partition is different from equitable */
|
275
|
+
#define EXTR_HAS_PROTON_PN 0x008000 /* has movable H+ attached to N or P */
|
276
|
+
#define EXTR_HAS_FEATURE 0x010000 /* found a feature */
|
277
|
+
#define EXTR_TAUT_TREATMENT_CHARGES 0x020000 /* tautomeric treatment of charges */
|
278
|
+
#define EXTR_TRANSPOSITION_EXAMPLES 0x040000 /* extract structures that have different mobile-H and fixed-H orders */
|
279
|
+
|
280
|
+
/* define conditions of structure extraction to the problem file */
|
281
|
+
#define EXTR_MASK 0 /*EXTR_TAUT_TREATMENT_CHARGES*/ /*(EXTR_HAS_FEATURE)*/ /*(EXTR_UNUSUAL_VALENCES | EXTR_HAS_METAL_ATOM)*/ /* 0 to disable */
|
282
|
+
#define EXTR_FLAGS 0 /*EXTR_TAUT_TREATMENT_CHARGES*/ /*(EXTR_HAS_FEATURE)*/ /*(EXTR_HAS_PROTON_PN)*/ /*(EXTR_UNUSUAL_VALENCES)*/ /*(EXTR_CANON_NE_EQUITABLE)*/ /*(EXTR_TEST_TAUT3_SALTS_DONE)*/ /*(EXTR_HAS_METAL_ATOM)*/ /* (EXTR_NON_TRIVIAL_STEREO)*/ /*(EXTR_METAL_WAS_DISCONNECTED)*/ /* (EXTR_REMOVE_PARITY_WARNING)*/ /*(EXTR_HAS_ATOM_WITH_DEFINED_PARITY) */
|
283
|
+
|
284
|
+
|
285
|
+
#define ENTITY_REFS_IN_XML_MESSAGES 1 /* 1=> replace ' " < > & in error/warning messages with xml entity references */
|
286
|
+
|
287
|
+
/* added tautomeric structures */
|
288
|
+
|
289
|
+
#define TAUT_TROPOLONE_7 1 /* 1=> tautomeric 7-member rings ON */
|
290
|
+
#define TAUT_TROPOLONE_5 1 /* 1=> taut. similar to tropolone, 5-member ring */
|
291
|
+
#define TAUT_4PYRIDINOL_RINGS 1 /* 1=> OH-C5H4N rings tautomerism */
|
292
|
+
#define TAUT_PYRAZOLE_RINGS 1 /* 1=> tautomerizm in pyrazole rings */
|
293
|
+
/* limitation on tautomerism detection: */
|
294
|
+
#define TAUT_IGNORE_EQL_ENDPOINTS 0 /* 0=> even though 2 endpoints belong to same t-group check
|
295
|
+
them to find more alt bonds (new)
|
296
|
+
1=> ignore and do not check (old mode) */
|
297
|
+
#define TAUT_RINGS_ATTACH_CHAIN 1 /* 1=> allow only chain attachments to tautomeric endpoints */
|
298
|
+
/* (except pyrazole, where is no tautomeric attachment) */
|
299
|
+
/* 0=> allow taut. attachments from same ring system. Default=1 */
|
300
|
+
|
301
|
+
#define FIND_RING_SYSTEMS 1 /* 1 => find and mark ring systems, blocks, cut-vertices */
|
302
|
+
/* Needed for 5- and 6-member ring tautomers and in other places */
|
303
|
+
|
304
|
+
#define FIND_RINS_SYSTEMS_DISTANCES 0 /* 1 => find ring system and atom distance from terminal */
|
305
|
+
#define USE_DISTANCES_FOR_RANKING 0 /* 1 => rank ring systems according to distances from terminal */
|
306
|
+
|
307
|
+
#define DISPLAY_RING_SYSTEMS 0 /* 1 => for debug only; displays: */
|
308
|
+
/* "block no"/"ring system no"/"cut-vertex (num. intersecting blocks-1)" */
|
309
|
+
/* instead of ranks */
|
310
|
+
/* consistency */
|
311
|
+
|
312
|
+
#if( bRELEASE_VERSION==1 && bOUTPUT_ONE_STRUCT_TIME==1)
|
313
|
+
#undef bOUTPUT_ONE_STRUCT_TIME
|
314
|
+
#define bOUTPUT_ONE_STRUCT_TIME 0
|
315
|
+
#endif
|
316
|
+
|
317
|
+
/* consistency: bRELEASE_VERSION==1 needs FIND_RING_SYSTEMS=1 */
|
318
|
+
#if( bRELEASE_VERSION==1 && FIND_RING_SYSTEMS!=1 )
|
319
|
+
#ifdef FIND_RING_SYSTEMS
|
320
|
+
#undef FIND_RING_SYSTEMS
|
321
|
+
#endif
|
322
|
+
#define FIND_RING_SYSTEMS 1
|
323
|
+
#endif
|
324
|
+
|
325
|
+
/* consistency: FIND_RINS_SYSTEMS_DISTANCES needs FIND_RING_SYSTEMS */
|
326
|
+
#if( FIND_RING_SYSTEMS != 1 )
|
327
|
+
|
328
|
+
#if( FIND_RINS_SYSTEMS_DISTANCES == 1 )
|
329
|
+
#undef FIND_RINS_SYSTEMS_DISTANCES
|
330
|
+
#define FIND_RINS_SYSTEMS_DISTANCES 0
|
331
|
+
#endif
|
332
|
+
|
333
|
+
#endif
|
334
|
+
|
335
|
+
/* consistency: USE_DISTANCES_FOR_RANKING and DISPLAY_RING_SYSTEMS need FIND_RINS_SYSTEMS_DISTANCES */
|
336
|
+
#if( FIND_RINS_SYSTEMS_DISTANCES != 1 )
|
337
|
+
|
338
|
+
#if( USE_DISTANCES_FOR_RANKING == 1 )
|
339
|
+
#undef USE_DISTANCES_FOR_RANKING
|
340
|
+
#define USE_DISTANCES_FOR_RANKING 0
|
341
|
+
#endif
|
342
|
+
|
343
|
+
#if( DISPLAY_RING_SYSTEMS == 1 )
|
344
|
+
#undef DISPLAY_RING_SYSTEMS
|
345
|
+
#define DISPLAY_RING_SYSTEMS 0
|
346
|
+
#endif
|
347
|
+
|
348
|
+
#endif
|
349
|
+
|
350
|
+
|
351
|
+
#if( FIND_RING_SYSTEMS==1 && (TAUT_TROPOLONE_7==1 || TAUT_TROPOLONE_5==1 || TAUT_4PYRIDINOL_RINGS==1 || TAUT_PYRAZOLE_RINGS) )
|
352
|
+
#define TAUT_OTHER 1
|
353
|
+
#else
|
354
|
+
#define TAUT_OTHER 0
|
355
|
+
#endif
|
356
|
+
|
357
|
+
#define APPLY_IMPLICIT_H_DOWN_RULE 0 /* 1=> if 3 non-H atoms around stereocenter are in same plane */
|
358
|
+
/* then add "down" hydrogen to obtain sterecenter oparity */
|
359
|
+
/* 0=> Implicit H stereo is unknown if all bonds to 3 non-H atoms */
|
360
|
+
/* are in XY plane */
|
361
|
+
#define ALLOW_TAUT_ATTACHMENTS_TO_STEREO_BONDS 1 /* 1=> consider bond in an alternating circuit stereogenic */
|
362
|
+
/* even though it has adjacent tautomeric atom(s) */
|
363
|
+
|
364
|
+
#define IGNORE_TGROUP_WITHOUT_H 1 /* ignore tautomeric groups containing charges only */
|
365
|
+
|
366
|
+
#if ( DISCONNECT_SALTS == 1 )
|
367
|
+
#define REMOVE_TGROUP_CHARGE 0 /* 0: do not remove charge information from tautomeric groups */
|
368
|
+
#else
|
369
|
+
#define REMOVE_TGROUP_CHARGE 1 /* 1: remove charge information from tautomeric groups */
|
370
|
+
#endif
|
371
|
+
|
372
|
+
#if ( REMOVE_TGROUP_CHARGE == 1 )
|
373
|
+
#define INCHI_T_NUM_MOVABLE 1
|
374
|
+
#else
|
375
|
+
#define INCHI_T_NUM_MOVABLE 2
|
376
|
+
#endif
|
377
|
+
|
378
|
+
/******************************************/
|
379
|
+
/* define canonicalization modes here */
|
380
|
+
/******************************************/
|
381
|
+
|
382
|
+
#define USE_AUX_RANKING 1 /* 1=> get auxiliary ranking to accelerate canonicalization of H layers */
|
383
|
+
#define USE_AUX_RANKING_ALL 1 /* 1=> include all vertices in CellGetMinNode() selection 0=> only vertices with highest ranks */
|
384
|
+
|
385
|
+
#define USE_ISO_SORT_KEY_HFIXED 0 /* 0=> normal mode: merge isotopic taut H to isotopic atom sorting key in
|
386
|
+
taut H-fixed canonicalization;
|
387
|
+
1=> add one more "string" iso_sort_Hfixed to the canonicalization */
|
388
|
+
|
389
|
+
/************************
|
390
|
+
questionable behavior
|
391
|
+
************************/
|
392
|
+
#define REL_RAC_STEREO_IGN_1_SC 0 /* 1=> drop from InChI sp3 stereo in components that have a single stereocenter */
|
393
|
+
/* 0=> old-old mode (all such sp3 stereo is in the Identifier) */
|
394
|
+
/* internal definitions; see also REQ_MODE_BASIC etc in ichi.h */
|
395
|
+
#define CMODE_CT 0x000001
|
396
|
+
#define CMODE_ISO 0x000002
|
397
|
+
#define CMODE_ISO_OUT 0x000004 /* obsolete ? */
|
398
|
+
#define CMODE_STEREO 0x000008
|
399
|
+
#define CMODE_ISO_STEREO 0x000010
|
400
|
+
#define CMODE_TAUT 0x000020
|
401
|
+
#define CMODE_NOEQ_STEREO 0x000040 /* 5-24-2002: do not use stereo equivalence to accelerate */
|
402
|
+
#define CMODE_REDNDNT_STEREO 0x000080 /* 6-11-2002: do not check for redundant stereo elements */
|
403
|
+
#define CMODE_NO_ALT_SBONDS 0x000100 /* 6-14-2002: do not assign stereo to alternating bonds */
|
404
|
+
/* new 10-10-2003 */
|
405
|
+
#define CMODE_RELATIVE_STEREO 0x000200 /* REL All Relative Stereo */
|
406
|
+
#define CMODE_RACEMIC_STEREO 0x000400 /* RAC All Racemic Stereo */
|
407
|
+
#define CMODE_SC_IGN_ALL_UU 0x000800 /* IAUSC Ignore stereocenters if All Undef/Unknown */
|
408
|
+
#define CMODE_SB_IGN_ALL_UU 0x001000 /* IAUSC Ignore stereobonds if All Undef/Unknown */
|
409
|
+
/* end of 10-10-2003 */
|
410
|
+
|
411
|
+
/* external definitions */
|
412
|
+
#define CANON_MODE_CT (CMODE_CT)
|
413
|
+
#define CANON_MODE_TAUT (CMODE_CT|CMODE_TAUT)
|
414
|
+
#define CANON_MODE_ISO (CMODE_CT|CMODE_ISO|CMODE_ISO_OUT)
|
415
|
+
#define CANON_MODE_STEREO (CMODE_CT|CMODE_STEREO)
|
416
|
+
#define CANON_MODE_ISO_STEREO (CMODE_CT|CMODE_ISO|CMODE_ISO_OUT|CMODE_ISO_STEREO)
|
417
|
+
|
418
|
+
#define CANON_MODE_MASK 0x00FF /* used to determine canonicalization mode */
|
419
|
+
|
420
|
+
/*************************************************
|
421
|
+
* from d_norm.c
|
422
|
+
*/
|
423
|
+
|
424
|
+
/* implemented definitions for CT_ATOMID */
|
425
|
+
#define CT_ATOMID_DONTINCLUDE 1
|
426
|
+
#define CT_ATOMID_IS_INITRANK 2
|
427
|
+
#define CT_ATOMID_IS_CURRANK 3
|
428
|
+
|
429
|
+
/***************************************
|
430
|
+
* canonicalization settings I
|
431
|
+
***************************************/
|
432
|
+
|
433
|
+
#define CANON_TAUTOMERS 1 /* 1=> process tautomers */
|
434
|
+
#define HYDROGENS_IN_INIT_RANKS 1 /* 1=> include num_H in initial ranking */
|
435
|
+
|
436
|
+
#define DOUBLE_BOND_NEIGH_LIST 0 /* 1 => include double bond neighbor in NeighList 2 times */
|
437
|
+
#define INCL_NON_6AROM 1 /* 1 => mark all arom. bonds; 0=>mark arom. bonds only in 6-member rings */
|
438
|
+
|
439
|
+
#define CT_SMALLEST /* minimal CT */
|
440
|
+
|
441
|
+
#define CT_NEIGH_SMALLER /* in CT, include neighbors with smaller ranks */
|
442
|
+
|
443
|
+
#define CT_ATOMID CT_ATOMID_IS_CURRANK /*CT_ATOMID_DONTINCLUDE */
|
444
|
+
|
445
|
+
#define CT_NEIGH_INCREASE /* in CT, neighbors ranks increase */
|
446
|
+
|
447
|
+
#define USE_SYMMETRY_TO_ACCELERATE 1 /*1 => for fast CT canonicalization, to avoid full enumeration */
|
448
|
+
|
449
|
+
/* dependent definitions due to settings */
|
450
|
+
|
451
|
+
#ifdef CT_SMALLEST
|
452
|
+
#define CT_GREATER_THAN >
|
453
|
+
#define CT_INITVALUE ~0
|
454
|
+
#define BEST_PARITY 1 /* odd */
|
455
|
+
#define WORSE_PARITY 2
|
456
|
+
#else
|
457
|
+
#define CT_GREATER_THAN <
|
458
|
+
#define CT_INITVALUE 0
|
459
|
+
#define BEST_PARITY 2 /* even */
|
460
|
+
#define WORSE_PARITY 1
|
461
|
+
#endif
|
462
|
+
|
463
|
+
#ifdef CT_NEIGH_SMALLER
|
464
|
+
#define CT_NEIGH_SMALLER_THAN <
|
465
|
+
#else
|
466
|
+
#define CT_NEIGH_SMALLER_THAN >
|
467
|
+
#endif
|
468
|
+
|
469
|
+
/* verify corectness of dependent settings */
|
470
|
+
#if !defined( CT_ATOMID )
|
471
|
+
#error You have to #define CT_ATOMID
|
472
|
+
#else
|
473
|
+
#if( defined( CT_ATOMID ) && CT_ATOMID==CT_ATOMID_DONTINCLUDE )
|
474
|
+
#error CT_DELIMITER should be #defined if CT_ATOMID is not included
|
475
|
+
#endif
|
476
|
+
#endif
|
477
|
+
|
478
|
+
/***************************************
|
479
|
+
* canonicalization settings II
|
480
|
+
***************************************/
|
481
|
+
/* from extr_ct.h */
|
482
|
+
#define ALL_ALT_AS_AROMATIC 1 /* 1 => all altrnate bonds (even in cyclooctateraene) treat as aromatic */
|
483
|
+
/* and set DOUBLE_BOND_NEIGH_LIST = 0 */
|
484
|
+
#define ANY_ATOM_IN_ALT_CYCLE 1 /* 1=> accept any atom in alternating bond circuit, 0=>only some */
|
485
|
+
|
486
|
+
#define EXCL_ALL_AROM_BOND_PARITY 0 /* 1 => any arom atom cannot belong to stereo bond. */
|
487
|
+
/* This has presedence over ADD_6MEMB_AROM_BOND_PARITY=1 */
|
488
|
+
/* 0 => include arom bonds parities according to */
|
489
|
+
/* ADD_6MEMB_AROM_BOND_PARITY definition */
|
490
|
+
|
491
|
+
#if ( EXCL_ALL_AROM_BOND_PARITY == 0 )
|
492
|
+
#define ADD_6MEMB_AROM_BOND_PARITY 1 /* 1 => all arom bonds are stereo bonds */
|
493
|
+
/* 0 => only those arom bonds which do not belong to */
|
494
|
+
/* 6-member arom rings are stereo bonds */
|
495
|
+
#else
|
496
|
+
#define ADD_6MEMB_AROM_BOND_PARITY 0 /* 0 => standard; 1 => meaningless: ignore parities of non-6-member ring alt. bonds */
|
497
|
+
#endif
|
498
|
+
|
499
|
+
#define CML_NUM_AT_IN_ATREF4 4
|
500
|
+
#define MAX_NUM_STEREO_BONDS 3
|
501
|
+
#define MAX_NUM_STEREO_BOND_NEIGH 3
|
502
|
+
#define MIN_NUM_STEREO_BOND_NEIGH 2
|
503
|
+
|
504
|
+
#define MAX_NUM_STEREO_ATOM_NEIGH 4
|
505
|
+
#define STEREO_AT_MARK 8 /* > MAX_NUM_STEREO_BONDS */
|
506
|
+
|
507
|
+
#if( ONLY_DOUBLE_BOND_STEREO == 1 ) /* { */
|
508
|
+
|
509
|
+
#ifdef ALLOW_TAUT_ATTACHMENTS_TO_STEREO_BONDS
|
510
|
+
#undef ALLOW_TAUT_ATTACHMENTS_TO_STEREO_BONDS
|
511
|
+
#define ALLOW_TAUT_ATTACHMENTS_TO_STEREO_BONDS 0
|
512
|
+
#endif
|
513
|
+
|
514
|
+
#ifdef EXCL_ALL_AROM_BOND_PARITY
|
515
|
+
#undef EXCL_ALL_AROM_BOND_PARITY
|
516
|
+
#define EXCL_ALL_AROM_BOND_PARITY 1
|
517
|
+
#endif
|
518
|
+
|
519
|
+
#ifdef ADD_6MEMB_AROM_BOND_PARITY
|
520
|
+
#undef ADD_6MEMB_AROM_BOND_PARITY
|
521
|
+
#define ADD_6MEMB_AROM_BOND_PARITY 0
|
522
|
+
#endif
|
523
|
+
|
524
|
+
#endif /* } ONLY_DOUBLE_BOND_STEREO */
|
525
|
+
|
526
|
+
/* dependent definitions due to settings */
|
527
|
+
#if( ALL_ALT_AS_AROMATIC == 1 && DOUBLE_BOND_NEIGH_LIST != 0 )
|
528
|
+
#undef DOUBLE_BOND_NEIGH_LIST
|
529
|
+
#define DOUBLE_BOND_NEIGH_LIST 0
|
530
|
+
#endif
|
531
|
+
|
532
|
+
|
533
|
+
/*************************************
|
534
|
+
* Drawing
|
535
|
+
*/
|
536
|
+
|
537
|
+
#define DRAW_AROM_TAUT 1 /* 1=> draw distinct aromatic & tautomer bonds, 0=> don't */
|
538
|
+
|
539
|
+
/******************************************************/
|
540
|
+
/* C O M M O N D E F I N I T I O N S */
|
541
|
+
/******************************************************/
|
542
|
+
|
543
|
+
|
544
|
+
/* input bTautFlags flags */
|
545
|
+
#define TG_FLAG_TEST_TAUT__ATOMS 0x00000001 /* find regular tautomerism */
|
546
|
+
#define TG_FLAG_DISCONNECT_SALTS 0x00000002 /* DISCONNECT_SALTS disconnect */
|
547
|
+
#define TG_FLAG_TEST_TAUT__SALTS 0x00000004 /* DISCONNECT_SALTS if possible find long-range H/(-) taut. on =C-OH, >C=O */
|
548
|
+
#define TG_FLAG_MOVE_POS_CHARGES 0x00000008 /* MOVE_CHARGES allow long-range movement of N(+), P(+) charges */
|
549
|
+
#define TG_FLAG_TEST_TAUT2_SALTS 0x00000010 /* TEST_REMOVE_S_ATOMS multi-attachement long-range H/(-) taut. on =C-OH, >C=O */
|
550
|
+
#define TG_FLAG_ALLOW_NO_NEGTV_O 0x00000020 /* CHARGED_SALTS_ONLY=0 (debug) find long-range H-only tautomerism on =C-OH, >C=O */
|
551
|
+
#define TG_FLAG_MERGE_TAUT_SALTS 0x00000040 /* DISCONNECT_SALTS merge all "salt"-t-groups and other =C-OH into one t-group */
|
552
|
+
|
553
|
+
#define TG_FLAG_ALL_TAUTOMERIC (TG_FLAG_TEST_TAUT__ATOMS| \
|
554
|
+
TG_FLAG_TEST_TAUT__SALTS| \
|
555
|
+
TG_FLAG_TEST_TAUT2_SALTS| \
|
556
|
+
TG_FLAG_MERGE_TAUT_SALTS)
|
557
|
+
|
558
|
+
#define TG_FLAG_DISCONNECT_COORD 0x00000080 /* find "coord. centers" and disconnect them */
|
559
|
+
#define TG_FLAG_RECONNECT_COORD 0x00000100 /* reconnect disconnected "coord. centers" */
|
560
|
+
#define TG_FLAG_CHECK_VALENCE_COORD 0x00000200 /* do not disconnect "coord. centers" with usual valence */
|
561
|
+
#define TG_FLAG_MOVE_HPLUS2NEUTR 0x00000400 /* move protons to neutralize */
|
562
|
+
#define TG_FLAG_VARIABLE_PROTONS 0x00000800 /* add/remove protons to neutralize */
|
563
|
+
#define TG_FLAG_HARD_ADD_REM_PROTONS 0x00001000 /* add/remove protons to neutralize in hard way */
|
564
|
+
#define TG_FLAG_POINTED_EDGE_STEREO 0x00002000 /* only pointed edge of stereo bond defines stereo */
|
565
|
+
|
566
|
+
/* output bTautFlags flags */
|
567
|
+
|
568
|
+
#define TG_FLAG_MOVE_HPLUS2NEUTR_DONE 0x00000001 /* protons have been moved to neutralize */
|
569
|
+
#define TG_FLAG_TEST_TAUT__ATOMS_DONE 0x00000002
|
570
|
+
#define TG_FLAG_DISCONNECT_SALTS_DONE 0x00000004
|
571
|
+
#define TG_FLAG_TEST_TAUT__SALTS_DONE 0x00000008 /* multiple H tautomerism */
|
572
|
+
#define TG_FLAG_MOVE_POS_CHARGES_DONE 0x00000010
|
573
|
+
#define TG_FLAG_TEST_TAUT2_SALTS_DONE 0x00000020 /* merged t-groups */
|
574
|
+
#define TG_FLAG_ALLOW_NO_NEGTV_O_DONE 0x00000040
|
575
|
+
#define TG_FLAG_MERGE_TAUT_SALTS_DONE 0x00000080 /* added non-taut O to taut groups */
|
576
|
+
|
577
|
+
#define TG_FLAG_ALL_SALT_DONE (TG_FLAG_TEST_TAUT__SALTS_DONE | \
|
578
|
+
TG_FLAG_TEST_TAUT2_SALTS_DONE | \
|
579
|
+
TG_FLAG_MERGE_TAUT_SALTS_DONE )
|
580
|
+
|
581
|
+
#define TG_FLAG_DISCONNECT_COORD_DONE 0x00000100 /* found and disconnected "coord. centers" */
|
582
|
+
#define TG_FLAG_CHECK_VALENCE_COORD_DONE 0x00000200 /* did not disconnect "coord. centers" with usual valence */
|
583
|
+
#define TG_FLAG_MOVE_CHARGE_COORD_DONE 0x00000400 /* changed charge of a disconnected ligand to fit its valence */
|
584
|
+
#define TG_FLAG_FIX_ODD_THINGS_DONE 0x00000800 /* fixed drawing ambiguities in fix_odd_things */
|
585
|
+
#define TG_FLAG_TEST_TAUT3_SALTS_DONE 0x00001000 /* merged t-groups + non-O taut atoms */
|
586
|
+
#define TG_FLAG_FOUND_SALT_CHARGES_DONE 0x00002000 /* not assigned: preprocessing detected possibility of salt-type tautomerism */
|
587
|
+
#define TG_FLAG_FOUND_ISOTOPIC_H_DONE 0x00004000 /* preprocessing detected isotopic H on "good" heteroatoms or isotopic H(+) */
|
588
|
+
#define TG_FLAG_FOUND_ISOTOPIC_ATOM_DONE 0x00008000 /* preprocessing detected isotopic H on "good" heteroatoms or isotopic H(+) */
|
589
|
+
|
590
|
+
|
591
|
+
#ifdef _WIN32
|
592
|
+
|
593
|
+
#define INCHI_OPTION_PREFX '/'
|
594
|
+
#define INCHI_PATH_DELIM '\\'
|
595
|
+
|
596
|
+
#else
|
597
|
+
|
598
|
+
#define INCHI_OPTION_PREFX '-'
|
599
|
+
#define INCHI_PATH_DELIM '/'
|
600
|
+
|
601
|
+
#endif
|
602
|
+
|
603
|
+
#define INCHI_ALT_OPT_PREFIX '-'
|
604
|
+
#define INCHI_ACD_LABS_PREFIX '-'
|
605
|
+
|
606
|
+
#ifdef INCHI_LIBRARY
|
607
|
+
typedef struct tagOutputString {
|
608
|
+
char *pStr;
|
609
|
+
int nAllocatedLength;
|
610
|
+
int nUsedLength;
|
611
|
+
int nPtr;
|
612
|
+
} INCHI_OUTPUT;
|
613
|
+
#define INCHI_FILE INCHI_OUTPUT
|
614
|
+
#else
|
615
|
+
#define INCHI_FILE FILE
|
616
|
+
#endif
|
617
|
+
|
618
|
+
|
619
|
+
/* memory leaks tracking */
|
620
|
+
|
621
|
+
#if( TRACE_MEMORY_LEAKS == 1 )
|
622
|
+
#ifdef _DEBUG
|
623
|
+
|
624
|
+
#define inchi_malloc(s) _malloc_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
|
625
|
+
#define inchi_calloc(c, s) _calloc_dbg(c, s, _NORMAL_BLOCK, __FILE__, __LINE__)
|
626
|
+
#define inchi_free(p) _free_dbg(p, _NORMAL_BLOCK)
|
627
|
+
|
628
|
+
#ifdef INCHI_MAIN
|
629
|
+
/* INChI_MAIN specific */
|
630
|
+
#define e_inchi_malloc(a) inchi_malloc(a)
|
631
|
+
#define e_inchi_calloc(a,b) inchi_calloc(a,b)
|
632
|
+
#define e_inchi_free(a) inchi_free(a)
|
633
|
+
#endif
|
634
|
+
|
635
|
+
/*#define _CRTDBG_MAP_ALLOC*/
|
636
|
+
|
637
|
+
#include <crtdbg.h>
|
638
|
+
|
639
|
+
#else
|
640
|
+
#undef TRACE_MEMORY_LEAKS
|
641
|
+
#define TRACE_MEMORY_LEAKS 0
|
642
|
+
#endif /* _DEBUG */
|
643
|
+
#endif /* TRACE_MEMORY_LEAKS */
|
644
|
+
|
645
|
+
#ifdef INCHI_MAIN
|
646
|
+
/* INChI_MAIN specific */
|
647
|
+
#ifndef inchi_malloc
|
648
|
+
#define inchi_malloc e_inchi_malloc
|
649
|
+
#endif
|
650
|
+
#ifndef inchi_calloc
|
651
|
+
#define inchi_calloc e_inchi_calloc
|
652
|
+
#endif
|
653
|
+
#ifndef inchi_free
|
654
|
+
#define inchi_free e_inchi_free
|
655
|
+
#endif
|
656
|
+
#endif /* INCHI_MAIN */
|
657
|
+
|
658
|
+
/* allocation/deallocation */
|
659
|
+
#define USE_ALLOCA 0
|
660
|
+
|
661
|
+
#if( USE_ALLOCA == 1 )
|
662
|
+
#define qmalloc(X) _alloca(X)
|
663
|
+
#define qfree(X) do{(X)=NULL;}while(0)
|
664
|
+
#else
|
665
|
+
#define qmalloc(X) inchi_malloc(X)
|
666
|
+
#define qfree(X) do{if(X){inchi_free(X);(X)=NULL;}}while(0)
|
667
|
+
#endif
|
668
|
+
|
669
|
+
#if( defined(_MSC_VER) && _MSC_VER >= 800 )
|
670
|
+
#define fast_alloc(X) _alloca(X)
|
671
|
+
#define fast_free(X)
|
672
|
+
#else
|
673
|
+
#define fast_alloc(X) inchi_malloc(X)
|
674
|
+
#define fast_free(X) inchi_free(X)
|
675
|
+
#endif
|
676
|
+
|
677
|
+
#define qzfree(X) do{if(X){inchi_free(X);(X)=NULL;}}while(0)
|
678
|
+
|
679
|
+
/* rellocation */
|
680
|
+
|
681
|
+
#define MYREALLOC2(PTRTYPE1, PTRTYPE2, PTR1, PTR2, LEN1, LEN2, ERR) \
|
682
|
+
do { \
|
683
|
+
if( (LEN1) <= (LEN2) ) {\
|
684
|
+
PTRTYPE1 * newPTR1 = (PTRTYPE1 *)inchi_calloc( (LEN2)+1, sizeof(PTRTYPE1) );\
|
685
|
+
PTRTYPE2 * newPTR2 = (PTRTYPE2 *)inchi_calloc( (LEN2)+1, sizeof(PTRTYPE2) );\
|
686
|
+
if ( newPTR1 && newPTR2 ) { \
|
687
|
+
if ( (PTR1) && (LEN1) > 0 ) \
|
688
|
+
(memcpy) ( newPTR1, (PTR1), (LEN1) * sizeof(PTRTYPE1) ); \
|
689
|
+
if ( (PTR2) && (LEN1) > 0 ) \
|
690
|
+
(memcpy) ( newPTR2, (PTR2), (LEN1) * sizeof(PTRTYPE2) ); \
|
691
|
+
if ( PTR1 ) \
|
692
|
+
inchi_free(PTR1); \
|
693
|
+
if ( PTR2 ) \
|
694
|
+
inchi_free(PTR2); \
|
695
|
+
(PTR1) = newPTR1; \
|
696
|
+
(PTR2) = newPTR2; \
|
697
|
+
(LEN1) = (LEN2); \
|
698
|
+
(ERR) = 0; \
|
699
|
+
} else { \
|
700
|
+
(ERR) = 1; \
|
701
|
+
} \
|
702
|
+
} else { (ERR) = 0; } \
|
703
|
+
} while(0)
|
704
|
+
|
705
|
+
|
706
|
+
#endif /* __MODE_H__ */
|