InChI
 
Loading...
Searching...
No Matches
strutil.h
Go to the documentation of this file.
1/*
2 * International Chemical Identifier (InChI)
3 * Version 1
4 * Software version 1.07
5 * April 30, 2024
6 *
7 * MIT License
8 *
9 * Copyright (c) 2024 IUPAC and InChI Trust
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included in all
19 * copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 * SOFTWARE.
28*
29* The InChI library and programs are free software developed under the
30 * auspices of the International Union of Pure and Applied Chemistry (IUPAC).
31 * Originally developed at NIST.
32 * Modifications and additions by IUPAC and the InChI Trust.
33 * Some portions of code were developed/changed by external contributors
34 * (either contractor or volunteer) which are listed in the file
35 * 'External-contributors' included in this distribution.
36 *
37 * info@inchi-trust.org
38 *
39*/
40
41
42#ifndef _STRUTIL_H_
43#define _STRUTIL_H_
44
45
46/* Mol structure utlities */
47
48
49#include "inpdef.h"
50#include "ichi.h"
51
52#ifndef COMPILE_ALL_CPP
53#ifdef __cplusplus
54extern "C" {
55#endif
56#endif
57
58/* forward declaration */
60 struct tagCANON_GLOBALS;
61
62 int ExtractConnectedComponent( inp_ATOM *at, int num_at,
63 int component_number,
64 inp_ATOM *component_at );
65 int SetConnectedComponentNumber( inp_ATOM *at, int num_at, int component_number );
66
67 INChI *Alloc_INChI( inp_ATOM *at, int num_at, int *found_num_bonds,
68 int *found_num_isotopic, int nAllocMode );
69 int Free_INChI( INChI **ppINChI );
70 int Free_INChI_Members( INChI *pINChI );
71 int Free_INChI_Stereo( INChI_Stereo *pINChI_Stereo );
72 INChI_Aux *Alloc_INChI_Aux( int num_at, int num_isotopic_atoms,
73 int nAllocMode, int bOrigData );
74 int Free_INChI_Aux( INChI_Aux **ppINChI_Aux );
75
76 int Create_INChI( struct tagCANON_GLOBALS *pCG,
77 struct tagINCHI_CLOCK *ic,
78 INPUT_PARMS *ip,
79 INChI **ppINChI,
80 INChI_Aux **ppINChI_Aux,
81 ORIG_ATOM_DATA *orig_inp_data,
82 inp_ATOM *inp_at,
83 INP_ATOM_DATA *inp_norm_data[2],
84 int num_inp_at,
85 INCHI_MODE nUserMode,
86 INCHI_MODE *pbTautFlags,
87 INCHI_MODE *pbTautFlagsDone,
88 struct tagInchiTime *ulMaxTime,
89 struct tagTautomerGroupsInfo *ti_out,
90 char *pStrErrStruct );
91
93 inp_ATOM *norm_at,
94 INF_ATOM_DATA *inf_norm_at_data,
95 int init_num_at,
96 int num_removed_H,
97 int bAdd_DT_to_num_H,
98 int nNumRemovedProtons,
99 NUM_H *nNumRemovedProtonsIsotopic,
100 int bIsotopic,
101 INChI *pINChI,
102 INChI_Aux *pINChI_Aux,
103 int bAbcNumbers,
104 INCHI_MODE nMode );
105
107 COMP_ATOM_DATA *composite_norm_data,
108 INF_ATOM_DATA *inf_norm_at_data,
109 int bIsotopic,
110 int bTautomeric,
111 PINChI2 *pINChI2,
112 PINChI_Aux2 *pINChI_Aux2,
113 int bAbcNumbers,
114 INCHI_MODE nMode );
115
116#if ( FIX_DALKE_BUGS == 1 )
117 char *AllocateAndFillHillFormula( INChI *pINChI );
118#endif
119
120 typedef enum tagInchiDiffBits
121 {
122 IDIF_PROBLEM = 0x00000001, /* severe: at least one InChI does not exist */
123 IDIF_NUM_AT = 0x00000001, /* severe: different number of atoms in the skeleton */
124 IDIF_ATOMS = 0x00000001, /* severe: diiferent types of skeleton atoms */
125 IDIF_NUM_EL = 0x00000001, /* severe: formulas differ in another element */
126 IDIF_CON_LEN = 0x00000001, /* severe: different connection table lengths */
127 IDIF_CON_TBL = 0x00000001, /* severe: different connection tables */
128 IDIF_POSITION_H = 0x00000002, /* difference in non-taut (Mobile-H) or all H (Fixed-H) location/number */
129 IDIF_MORE_FH = 0x00000004, /* extra fixed H */
130 IDIF_LESS_FH = 0x00000008, /* missing fixed H */
131 IDIF_MORE_H = 0x00000010, /* formulas differ in number of H */
132 IDIF_LESS_H = 0x00000020, /* formulas differ in number of H */
133 /*IDIF_TAUT_LEN = 0x00000008,*/ /* different lengths of tautomer lists */
134 IDIF_NO_TAUT = 0x00000040, /* restored structure has no taut groups while the original InChI has some */
135 IDIF_WRONG_TAUT = 0x00000080, /* restored has tautomerism while the original does not have it */
136 IDIF_SINGLE_TG = 0x00000100, /* restored has 1 taut. group while the original InChI has multiple tg */
137 IDIF_MULTIPLE_TG = 0x00000200, /* restored has multiple tg while the original InChI has only one tg */
138 IDIF_NUM_TG = 0x00000400, /* different number of tautomeric groups */
139 /*IDIF_LESS_TG_ENDP = 0x00000200,*/ /* restores structure has less taut. endpoints */
140 /*IDIF_MORE_TG_ENDP = 0x00000400,*/ /* restores structure has more taut. endpoints */
141 IDIF_EXTRA_TG_ENDP = 0x00000800, /* extra tautomeric endpoint(s) in restored structure */
142 IDIF_MISS_TG_ENDP = 0x00001000, /* one or more tg endpoint is not in the restored structure */
143 IDIF_DIFF_TG_ENDP = 0x00002000, /* lists of tg endpoints are different */
144 IDIF_TG = 0x00004000, /* different tautomeric groups */
145 IDIF_NUM_ISO_AT = 0x00008000, /* ?severe: restored struct. has different number of isotopic atoms */
146 IDIF_ISO_AT = 0x00010000, /* ?severe: restored struct. has different locations/isotopes of isotopic atoms */
147 IDIF_CHARGE = 0x00020000, /* restored structure has different charge */
148 IDIF_REM_PROT = 0x00040000, /* proton(s) removed/added from the restored structure */
149 IDIF_REM_ISO_H = 0x00080000, /* isotopic H removed */
150 IDIF_SC_INV = 0x00100000, /* restores structure has different inversion stereocenter mark */
151 IDIF_SC_PARITY = 0x00200000, /* restored structure has stereoatoms or allenes with different parity */
152 IDIF_SC_EXTRA_UNDF = 0x00400000, /* restored structure has extra undefined stereocenter(s) */
153 IDIF_SC_EXTRA = 0x00800000, /* restored structure has extra stereocenter(s) */
154 IDIF_SC_MISS_UNDF = 0x01000000, /* restored structure has not some undefined stereocenter(s) */
155 IDIF_SC_MISS = 0x02000000, /* restored structure has not some stereocenters that are not undefined */
156 IDIF_SB_PARITY = 0x04000000, /* restored structure has stereobonds or cumulenes with different parity */
157 IDIF_SB_EXTRA_UNDF = 0x08000000, /* restored structure has extra undefined stereobond(s) */
158 IDIF_SB_EXTRA = 0x10000000, /* restored structure has extra stereobond(s) */
159 IDIF_SB_MISS_UNDF = 0x20000000, /* restored structure has not some undefined stereocenters */
160 IDIF_SB_MISS = 0x40000000 /* restored structure has not some stereobonds that are not undefined */
162
163
164#define IDIFF_SB (IDIF_SB_PARITY | IDIF_SB_EXTRA_UNDF | IDIF_SB_EXTRA | IDIF_SB_MISS_UNDF | IDIF_SB_MISS)
165#define IDIFF_SC (IDIF_SC_PARITY | IDIF_SC_EXTRA_UNDF | IDIF_SC_EXTRA | IDIF_SC_MISS_UNDF | IDIF_SC_MISS)
166
167#define IDIFF_CONSTIT (IDIF_POSITION_H | IDIF_MORE_FH | IDIF_LESS_FH | IDIF_MORE_H | IDIF_LESS_H |\
168 IDIF_NO_TAUT | IDIF_WRONG_TAUT | IDIF_SINGLE_TG | IDIF_MULTIPLE_TG | \
169 IDIF_NUM_TG | IDIF_EXTRA_TG_ENDP | IDIF_MISS_TG_ENDP | IDIF_TG | \
170 IDIF_NUM_ISO_AT | IDIF_ISO_AT | IDIF_CHARGE | IDIF_REM_PROT | IDIF_REM_ISO_H |\
171 IDIF_DIFF_TG_ENDP)
172#define IDIFF_STEREO (IDIF_SC_INV | IDIF_SC_PARITY | IDIF_SC_EXTRA_UNDF | IDIF_SC_EXTRA | \
173 IDIF_SC_MISS_UNDF | IDIF_SC_MISS | IDIF_SB_PARITY | IDIF_SB_EXTRA_UNDF |\
174 IDIF_SB_EXTRA | IDIF_SB_MISS_UNDF | IDIF_SB_MISS)
175
176
177/*************************************************************************************/
178#define ICR_MAX_ENDP_IN1_ONLY 32
179#define ICR_MAX_ENDP_IN2_ONLY 32
180#define ICR_MAX_DIFF_FIXED_H 32
181#define ICR_MAX_SB_IN1_ONLY 32
182#define ICR_MAX_SB_IN2_ONLY 32
183#define ICR_MAX_SC_IN1_ONLY 32
184#define ICR_MAX_SC_IN2_ONLY 32
185#define ICR_MAX_SB_UNDF 32
186#define ICR_MAX_SC_UNDF 32
187
189 {
191
198
199 /* 1 => InChI from reversed struct. 2 => input InChI */
200
201 AT_NUMB endp_in1_only[ICR_MAX_ENDP_IN1_ONLY]; /* endpoint canonical number = index+1 */
203
204 AT_NUMB endp_in2_only[ICR_MAX_ENDP_IN2_ONLY]; /* endpoint canonical number = index+1 */
206
210
214
218
223
228
233
238 } ICR; /* tagInChICompareResults */
239
240
241
242 INCHI_MODE CompareReversedINChI2( INChI *i1 /* InChI from reversed struct */,
243 INChI *i2 /* input InChI */,
244 INChI_Aux *a1, INChI_Aux *a2,
245 ICR *picr, int *err );
246 int CompareIcr( ICR *picr1, ICR *picr2, INCHI_MODE *pin1, INCHI_MODE *pin2, INCHI_MODE mask );
247
248 int CompareReversedINChI( INChI *i1, INChI *i2, INChI_Aux *a1, INChI_Aux *a2 );
249 const char *CompareReversedInchiMsg( int code );
250
251#define EQL_EXISTS 1
252#define EQL_SP3 2
253#define EQL_SP3_INV 4
254#define EQL_SP2 8
255
256 int Eql_INChI_Stereo( INChI_Stereo *s1, int eql1, INChI_Stereo *s2, int eql2, int bRelRac );
257 int Eql_INChI_Isotopic( INChI *i1, INChI *i2 );
258
259#define EQL_EQU 0
260#define EQL_EQU_TG 1
261#define EQL_EQU_ISO 2
262
263 int Eql_INChI_Aux_Equ( INChI_Aux *a1, int eql1, INChI_Aux *a2, int eql2 );
264
265#define EQL_NUM 0
266#define EQL_NUM_INV 1
267#define EQL_NUM_ISO 2
268 int Eql_INChI_Aux_Num( INChI_Aux *a1, int eql1, INChI_Aux *a2, int eql2 );
269
270 int bHasEquString( AT_NUMB *LinearCT, int nLenCT );
271
272 int CompINChINonTaut2( const void *p1, const void *p2 );
273 int CompINChITaut2( const void *p1, const void *p2 );
274 int CompINChI2( const INCHI_SORT *p1, const INCHI_SORT *p2, int bTaut, int bCompareIsotopic );
275 int CompINChITautVsNonTaut( const INCHI_SORT *p1, const INCHI_SORT *p2, int bCompareIsotopic );
276
278 { /* r = repetitive, n = non-repetitive */
279 DIFS_f_FORMULA, /* 0 r; fixed-H <-> mobile-H */
280 DIFS_c_CONNECT, /* 1 n; connection table; mobile-H only */
281 DIFS_h_H_ATOMS, /* 2 n; hydrogen atoms: mobile-H and Fixed-H; have different meanings */
282 DIFS_q_CHARGE, /* 3 r; charge; fixed-H <-> mobile-H */
283 DIFS_p_PROTONS, /* 4 n; protons; mobile-H only */
284 DIFS_b_SBONDS, /* 5 r: stereobonds: fixed-H <-> mobile-H * isotopic <-> non-isotopic */
285 DIFS_t_SATOMS, /* 6 r: stereoatoms: fixed-H <-> mobile-H * isotopic <-> non-isotopic */
286 DIFS_m_SP3INV, /* 7 r: stereo-abs-inv: fixed-H <-> mobile-H * isotopic <-> non-isotopic */
287 DIFS_s_STYPE, /* 8 r: stereo-type: fixed-H <-> mobile-H * isotopic <-> non-isotopic */
288 DIFS_i_IATOMS, /* 9 r: isotopic atoms: fixed-H <-> mobile-H * isotopic <-> non-isotopic */
289 DIFS_o_TRANSP, /* 10 n: Fixed-H transposition */
290 DIFS_idf_LENGTH, /* 11 length of the array relevant to the INChI Identifier */
291 /* later elements referring to AuxInfo may be added */
292 DIFS_LENGTH = DIFS_idf_LENGTH /* length of the array */
294
296 {
297 DIFL_M, /* 0 main layer */
298 DIFL_MI, /* 1 main isotopic */
299 DIFL_F, /* 2 fixed-H */
300 DIFL_FI, /* 3 fixed-H isotopic */
301 DIFL_LENGTH /* number of layers */
303
304 /* Value meaning */
305 typedef enum tagMarkDiff
306 {
307 DIFV_BOTH_EMPTY = 0, /* both this and the component in the preceding namesake segment are empty */
308 DIFV_EQL2PRECED = 1, /* equal to the component in the preceding namesake segment */
309 DIFV_NEQ2PRECED = 2, /* different from the component in the preceding namesake segment */
310 DIFV_IS_EMPTY = 4, /* is empty while the preceding namesake segment is not empty */
311 DIFV_FI_EQ_MI = 8, /* FI stereo component is equal to the component in the MI namesake segment */
312 /* while M and F components are empty */
313 /* decision_F = bitmask: bits that should not be present */
314 /* decision_T = bitmask: at least one of the bits should be present */
315 /* decision = true if( !( BITS & decision_F ) && ( BITS & decision_F ) ) */
316 DIFV_OUTPUT_EMPTY_T = ( DIFV_IS_EMPTY ), /* bits present for empty segment output */
318
319 DIFV_OUTPUT_OMIT_F = ( DIFV_NEQ2PRECED | DIFV_IS_EMPTY ), /* bits NOT present for omitting */
320
323
325 {
327 INCHI_SEGM_FILL = 1, /* the value is used in str_LineEnd() */
328 INCHI_SEGM_EMPTY = 2 /* the value is used in str_LineEnd() */
330
331 int CompINChILayers( const INCHI_SORT *p1, const INCHI_SORT *p2,
332 char sDifSegs[][DIFS_LENGTH], int bFixTranspChargeBug );
333 int MarkUnusedAndEmptyLayers( char sDifSegs[][DIFS_LENGTH] );
334 int INChI_SegmentAction( char cDifSegs );
335
336#define FLAG_SORT_PRINT_TRANSPOS_BAS 1 /* transposition in the main InChI layer */
337#define FLAG_SORT_PRINT_TRANSPOS_REC 2 /* transposition in the reconnected InChI layer */
338#define FLAG_SORT_PRINT_NO_NFIX_H_BAS 4 /* no fixed H non-isotopic in the main InChI layer */
339#define FLAG_SORT_PRINT_NO_NFIX_H_REC 8 /* no fixed H non-isotopic in the reconnected InChI layer */
340#define FLAG_SORT_PRINT_NO_IFIX_H_BAS 16 /* no fixed H isotopic in the main InChI layer */
341#define FLAG_SORT_PRINT_NO_IFIX_H_REC 32 /* no fixed H isotopic in the the reconnected InChI layer */
342#define FLAG_SORT_PRINT_ReChI_PREFIX 64 /* Output ReChI instead of InChI */
343
344
345 struct tagCANON_GLOBALS;
346
347 int OutputINChI1( struct tagCANON_GLOBALS *pCG,
348 INCHI_IOS_STRING *strbuf,
349 INCHI_SORT *pINChISortTautAndNonTaut2[][TAUT_NUM],
350 int iINChI,
351 ORIG_ATOM_DATA *orig_inp_data,
352 ORIG_STRUCT *pOrigStruct,
353 INPUT_PARMS *ip,
354 int bDisconnectedCoord,
355 int bOutputType,
356 int bINChIOutputOptions,
357 int num_components2[],
358 int num_non_taut2[],
359 int num_taut2[],
360 INCHI_IOSTREAM *out_file,
361 INCHI_IOSTREAM *log_file,
362 int num_input_struct,
363 int *pSortPrintINChIFlags,
364 unsigned char save_opt_bits );
365
366 int OutputINChI2( struct tagCANON_GLOBALS *pCG,
367 INCHI_IOS_STRING *strbuf,
368 INCHI_SORT *pINChISortTautAndNonTaut2[][TAUT_NUM],
369 int INCHI_basic_or_INCHI_reconnected,
370 ORIG_ATOM_DATA *orig_inp_data,
371 ORIG_STRUCT *pOrigStruct,
372 INPUT_PARMS *ip,
373 int bDisconnectedCoord,
374 int bOutputType,
375 int bINChIOutputOptions,
376 int num_components2[],
377 int num_non_taut2[],
378 int num_taut2[],
379 INCHI_IOSTREAM *out_file,
380 INCHI_IOSTREAM *log_file,
381 int num_input_struct,
382 int *pSortPrintINChIFlags,
383 unsigned char save_opt_bits );
384
386 INCHI_SORT *pINChISort[TAUT_NUM],
387 int *num_components,
388 ORIG_ATOM_DATA *orig_inp_data,
389 ORIG_ATOM_DATA *prep_inp_data,
390 COMP_ATOM_DATA composite_norm_data[TAUT_NUM+1],
391 int bCompareComponents ); /* djb-rwth: matching composite_norm_data bounds */
392
394 char *pErrorText,
395 int bError );
396 int GetInpStructErrorType( INPUT_PARMS *ip, int err, char *pStrErrStruct, int num_inp_atoms );
397 int ProcessStructError( INCHI_IOSTREAM *out_file,
398 INCHI_IOSTREAM *log_file,
399 char *pStrErrStruct,
400 int nErrorType,
401 long num_inp,
402 INPUT_PARMS *ip );
403
404 int bNumHeterAtomHasIsotopicH( inp_ATOM *atom, int num_atoms );
405
406 int WriteToSDfile( const INP_ATOM_DATA *inp_at_data, INCHI_IOSTREAM* fcb, const char* name, const char* comment,
407 const char *szLabel, const char *szValue );
408 int bIsMetalSalt( inp_ATOM *at, int i );
409
410 int bIsSameBond(int a1, int a2, int b1, int b2);
411
412 extern const char gsMissing[];
413 extern const char gsEmpty[];
414 extern const char gsSpace[];
415 extern const char gsEqual[];
416
417#define SDF_LBL_VAL(L,V) ((L)&&(L)[0])?gsSpace:gsEmpty, ((L)&&(L)[0])?L:gsEmpty, ((L)&&(L)[0])? (((V)&&(V)[0])?gsEqual:gsSpace):gsEmpty, ((V)&&(V)[0])?V:((L)&&(L)[0])?gsMissing:gsEmpty
418
419
420 /* Handle integer matrix [mxn] */
421 int imat_new(int m, int n, int ***a);
422 void imat_free(int m, int **a);
423
424
425 /* Light-weight {nodes, connections} subgraph of molecule, subgraf
426 refers to parent structure via orig atom numbers stored internally
427 nodes and edges: are living in 0-based node numbers domain
428 atoms and bonds: are living in 1-based orig atom numbers domain
429 */
430
431 /* subgraf_edge is node connections element */
432 typedef struct subgraf_edge
433 {
434 int nbr; /* node neighbor */
435 int etype; /* edge type echoing corresponding bond type */
436 }
438 /* subgraf is set of nodes and their connections */
439 typedef struct subgraf
440 {
441 int nnodes; /* number of nodes (atoms) */
442 int *nodes; /* nodes[i] is 1-based orig atom number of node #i */
443 /* (i = 0 to nnodes) */
444 int *degrees; /* degrees of nodes */
445 int *orig2node; /* orig2node[k] is 0-based node number for orig #k */
446 subgraf_edge **adj; /* node connections representing adjacency relation */
447 /* adj[i] is vector[0-degree] of edges at node #i */
449 /* helper structure for finding paths in subgraf*/
450 typedef struct subgraf_pathfinder
451 {
452 subgraf *sg; /* base subgraf */
453 int start; /* start node of path, 0-based */
454 int end; /* end node of path */
455 int maxbonds; /* max number of bonds in path */
456 int nbonds; /* actual number of bonds in path */
457 int nseen; /* number of nodes of found path(s) */
458 int *seen; /* nodes of found path(s) */
460
461 subgraf * subgraf_new( ORIG_ATOM_DATA *orig_inp_data,
462 int nnodes,
463 int *nodes );
464 void subgraf_free( subgraf *sg );
465 void subgraf_debug_trace( subgraf *sg );
467 ORIG_ATOM_DATA *orig_inp_data,
468 int start,
469 int end );
472 int nforbidden,
473 int *forbidden_orig,
474 int *nbonds, int **bonds,
475 int *natoms, int *atoms);
477 int nforbidden,
478 int *forbidden,
479 int *atnums);
480
481 void CompAtomData_GetNumMapping( COMP_ATOM_DATA *adata, int *orig_num, int *curr_num );
482
483#ifndef COMPILE_ALL_CPP
484#ifdef __cplusplus
485}
486#endif
487#endif
488
489
490#endif /* _STRUTIL_H_ */
INChI * PINChI2[TAUT_NUM]
Definition ichi.h:259
INChI_Aux * PINChI_Aux2[TAUT_NUM]
Definition ichi.h:302
unsigned short AT_NUMB
Definition ichisize.h:45
signed short NUM_H
Definition ichisize.h:49
unsigned long INCHI_MODE
Definition ichisize.h:60
signed char S_CHAR
Definition inchi_api.h:113
#define TAUT_NUM
Definition mode.h:593
Definition strutil.h:433
int etype
Definition strutil.h:435
int nbr
Definition strutil.h:434
Definition strutil.h:451
int * seen
Definition strutil.h:458
int nseen
Definition strutil.h:457
int end
Definition strutil.h:454
subgraf * sg
Definition strutil.h:452
int start
Definition strutil.h:453
int nbonds
Definition strutil.h:456
int maxbonds
Definition strutil.h:455
Definition strutil.h:440
int * nodes
Definition strutil.h:442
int * degrees
Definition strutil.h:444
int * orig2node
Definition strutil.h:445
subgraf_edge ** adj
Definition strutil.h:446
int nnodes
Definition strutil.h:441
Definition ichicant.h:338
Definition inpdef.h:443
Definition ichitime.h:85
Definition ichi.h:267
Definition ichi.h:122
Definition ichi.h:209
Definition ichi.h:305
Definition strutil.h:189
int num_fixed_H2_more
Definition strutil.h:217
AT_NUMB sc_in2_only[ICR_MAX_SC_IN2_ONLY]
Definition strutil.h:221
int num_sb_in2_only
Definition strutil.h:227
AT_NUMB fixed_H_at1_more[ICR_MAX_DIFF_FIXED_H]
Definition strutil.h:211
int num_sc_in1_only
Definition strutil.h:220
int tot_num_H2
Definition strutil.h:193
AT_NUMB sc_undef_in2_only[ICR_MAX_SB_UNDF]
Definition strutil.h:236
AT_NUMB sb_undef_in1_only[ICR_MAX_SC_UNDF]
Definition strutil.h:229
int num_endp_in2_only
Definition strutil.h:205
int tot_num_H1
Definition strutil.h:192
S_CHAR fixed_H_nH2_more[ICR_MAX_DIFF_FIXED_H]
Definition strutil.h:216
int num_sc_in2_only
Definition strutil.h:222
int num_sb_undef_in2_only
Definition strutil.h:232
INCHI_MODE flags
Definition strutil.h:190
int num_sb_undef_in1_only
Definition strutil.h:230
int num_sb_in1_only
Definition strutil.h:225
AT_NUMB sb_undef_in2_only[ICR_MAX_SC_UNDF]
Definition strutil.h:231
AT_NUMB diff_pos_H_at[ICR_MAX_DIFF_FIXED_H]
Definition strutil.h:207
int num_diff_pos_H
Definition strutil.h:209
AT_NUMB sb_in2_only[ICR_MAX_SB_IN2_ONLY]
Definition strutil.h:226
int num_fixed_H1_more
Definition strutil.h:213
AT_NUMB sc_in1_only[ICR_MAX_SC_IN1_ONLY]
Definition strutil.h:219
int num_sc_undef_in2_only
Definition strutil.h:237
AT_NUMB fixed_H_at2_more[ICR_MAX_DIFF_FIXED_H]
Definition strutil.h:215
AT_NUMB endp_in1_only[ICR_MAX_ENDP_IN1_ONLY]
Definition strutil.h:201
AT_NUMB sb_in1_only[ICR_MAX_SB_IN1_ONLY]
Definition strutil.h:224
int num_taut_M2
Definition strutil.h:197
int num_endp_in1_only
Definition strutil.h:202
int num_taut_M1
Definition strutil.h:196
int num_sc_undef_in1_only
Definition strutil.h:235
AT_NUMB sc_undef_in1_only[ICR_MAX_SB_UNDF]
Definition strutil.h:234
AT_NUMB endp_in2_only[ICR_MAX_ENDP_IN2_ONLY]
Definition strutil.h:204
int num_taut_H1
Definition strutil.h:194
int num_taut_H2
Definition strutil.h:195
S_CHAR fixed_H_nH1_more[ICR_MAX_DIFF_FIXED_H]
Definition strutil.h:212
S_CHAR diff_pos_H_nH[ICR_MAX_DIFF_FIXED_H]
Definition strutil.h:208
Definition ichitime.h:69
Definition inpdef.h:390
Definition inpdef.h:406
Definition inpdef.h:110
Definition ichidrp.h:120
Definition inpdef.h:305
Definition inpdef.h:340
Definition mode.h:1030
Definition mode.h:1016
Definition ichitaut.h:222
int OutputINChI2(struct tagCANON_GLOBALS *pCG, INCHI_IOS_STRING *strbuf, INCHI_SORT *pINChISortTautAndNonTaut2[][TAUT_NUM], int INCHI_basic_or_INCHI_reconnected, ORIG_ATOM_DATA *orig_inp_data, ORIG_STRUCT *pOrigStruct, INPUT_PARMS *ip, int bDisconnectedCoord, int bOutputType, int bINChIOutputOptions, int num_components2[], int num_non_taut2[], int num_taut2[], INCHI_IOSTREAM *out_file, INCHI_IOSTREAM *log_file, int num_input_struct, int *pSortPrintINChIFlags, unsigned char save_opt_bits)
Definition ichiprt1.c:966
#define ICR_MAX_SC_IN2_ONLY
Definition strutil.h:184
int imat_new(int m, int n, int ***a)
Definition strutil.c:4998
struct tagInChICompareResults ICR
int CompINChITaut2(const void *p1, const void *p2)
Definition ichimake.c:2064
int GetInpStructErrorType(INPUT_PARMS *ip, int err, char *pStrErrStruct, int num_inp_atoms)
Definition ichimake.c:2476
const char gsMissing[]
Definition runichi.c:207
enum tagMarkDiff DIF_VALUES
int Free_INChI_Stereo(INChI_Stereo *pINChI_Stereo)
Definition strutil.c:4604
tagDiffINChISegments
Definition strutil.h:278
@ DIFS_t_SATOMS
Definition strutil.h:285
@ DIFS_idf_LENGTH
Definition strutil.h:290
@ DIFS_m_SP3INV
Definition strutil.h:286
@ DIFS_h_H_ATOMS
Definition strutil.h:281
@ DIFS_f_FORMULA
Definition strutil.h:279
@ DIFS_q_CHARGE
Definition strutil.h:282
@ DIFS_p_PROTONS
Definition strutil.h:283
@ DIFS_b_SBONDS
Definition strutil.h:284
@ DIFS_o_TRANSP
Definition strutil.h:289
@ DIFS_i_IATOMS
Definition strutil.h:288
@ DIFS_s_STYPE
Definition strutil.h:287
@ DIFS_LENGTH
Definition strutil.h:292
@ DIFS_c_CONNECT
Definition strutil.h:280
enum tagDiffINChISegments DIF_SEGMENTS
int Free_INChI_Aux(INChI_Aux **ppINChI_Aux)
Definition strutil.c:4836
void imat_free(int m, int **a)
Definition strutil.c:5029
int Eql_INChI_Isotopic(INChI *i1, INChI *i2)
Definition ichiprt2.c:203
int subgraf_pathfinder_collect_all(subgraf_pathfinder *spf, int nforbidden, int *forbidden, int *atnums)
Definition strutil.c:5415
int FillOutInfAtom(struct tagCANON_GLOBALS *pCG, inp_ATOM *norm_at, INF_ATOM_DATA *inf_norm_at_data, int init_num_at, int num_removed_H, int bAdd_DT_to_num_H, int nNumRemovedProtons, NUM_H *nNumRemovedProtonsIsotopic, int bIsotopic, INChI *pINChI, INChI_Aux *pINChI_Aux, int bAbcNumbers, INCHI_MODE nMode)
subgraf * subgraf_new(ORIG_ATOM_DATA *orig_inp_data, int nnodes, int *nodes)
Definition strutil.c:5057
#define ICR_MAX_SC_IN1_ONLY
Definition strutil.h:183
const char * CompareReversedInchiMsg(int code)
int Free_INChI(INChI **ppINChI)
Definition strutil.c:4668
int CompINChI2(const INCHI_SORT *p1, const INCHI_SORT *p2, int bTaut, int bCompareIsotopic)
Definition ichimake.c:1712
enum tagINChISegmAction INCHI_SEGM_ACTION
#define ICR_MAX_SB_UNDF
Definition strutil.h:185
int ProcessStructError(INCHI_IOSTREAM *out_file, INCHI_IOSTREAM *log_file, char *pStrErrStruct, int nErrorType, long num_inp, INPUT_PARMS *ip)
Definition ichimake.c:2507
INCHI_MODE CompareReversedINChI2(INChI *i1, INChI *i2, INChI_Aux *a1, INChI_Aux *a2, ICR *picr, int *err)
Definition ichimake.c:3258
tagMarkDiff
Definition strutil.h:306
@ DIFV_OUTPUT_OMIT_F
Definition strutil.h:319
@ DIFV_OUTPUT_FILL_T
Definition strutil.h:321
@ DIFV_NEQ2PRECED
Definition strutil.h:309
@ DIFV_OUTPUT_EMPTY_T
Definition strutil.h:316
@ DIFV_BOTH_EMPTY
Definition strutil.h:307
@ DIFV_EQL2PRECED
Definition strutil.h:308
@ DIFV_OUTPUT_EMPTY_F
Definition strutil.h:317
@ DIFV_FI_EQ_MI
Definition strutil.h:311
@ DIFV_IS_EMPTY
Definition strutil.h:310
void subgraf_free(subgraf *sg)
Definition strutil.c:5148
#define ICR_MAX_ENDP_IN1_ONLY
Definition strutil.h:178
#define ICR_MAX_SB_IN2_ONLY
Definition strutil.h:182
void subgraf_pathfinder_run(subgraf_pathfinder *spf, int nforbidden, int *forbidden_orig, int *nbonds, int **bonds, int *natoms, int *atoms)
Definition strutil.c:5266
const char gsEmpty[]
Definition runichi.c:208
int bHasEquString(AT_NUMB *LinearCT, int nLenCT)
Definition ichiprt2.c:398
int CompareReversedINChI(INChI *i1, INChI *i2, INChI_Aux *a1, INChI_Aux *a2)
Definition ichimake.c:2932
int INChI_SegmentAction(char cDifSegs)
Definition ichimake.c:1486
int bIsSameBond(int a1, int a2, int b1, int b2)
Definition runichi2.c:1289
int Eql_INChI_Aux_Num(INChI_Aux *a1, int eql1, INChI_Aux *a2, int eql2)
Definition ichiprt2.c:305
int Create_INChI(struct tagCANON_GLOBALS *pCG, struct tagINCHI_CLOCK *ic, INPUT_PARMS *ip, INChI **ppINChI, INChI_Aux **ppINChI_Aux, ORIG_ATOM_DATA *orig_inp_data, inp_ATOM *inp_at, INP_ATOM_DATA *inp_norm_data[2], int num_inp_at, INCHI_MODE nUserMode, INCHI_MODE *pbTautFlags, INCHI_MODE *pbTautFlagsDone, struct tagInchiTime *ulMaxTime, struct tagTautomerGroupsInfo *ti_out, char *pStrErrStruct)
Definition ichimake.c:3703
subgraf_pathfinder * subgraf_pathfinder_new(subgraf *sg, ORIG_ATOM_DATA *orig_inp_data, int start, int end)
Definition strutil.c:5214
void CompAtomData_GetNumMapping(COMP_ATOM_DATA *adata, int *orig_num, int *curr_num)
Definition strutil.c:4979
void subgraf_debug_trace(subgraf *sg)
Definition strutil.c:5185
#define ICR_MAX_DIFF_FIXED_H
Definition strutil.h:180
int CompINChITautVsNonTaut(const INCHI_SORT *p1, const INCHI_SORT *p2, int bCompareIsotopic)
Definition ichimake.c:341
int MarkUnusedAndEmptyLayers(char sDifSegs[][DIFS_LENGTH])
Definition ichimake.c:1525
int bIsMetalSalt(inp_ATOM *at, int i)
Definition strutil.c:2504
int bNumHeterAtomHasIsotopicH(inp_ATOM *atom, int num_atoms)
Definition strutil.c:4126
int CompINChILayers(const INCHI_SORT *p1, const INCHI_SORT *p2, char sDifSegs[][DIFS_LENGTH], int bFixTranspChargeBug)
Definition ichimake.c:645
const char gsEqual[]
Definition runichi.c:210
enum tagInchiDiffBits IDIF
INChI_Aux * Alloc_INChI_Aux(int num_at, int num_isotopic_atoms, int nAllocMode, int bOrigData)
Definition strutil.c:4877
enum tagDiffINChILayers DIF_LAYERS
int ExtractConnectedComponent(inp_ATOM *at, int num_at, int component_number, inp_ATOM *component_at)
Definition strutil.c:4551
int SaveEquComponentsInfoAndSortOrder(int iINChI, INCHI_SORT *pINChISort[TAUT_NUM], int *num_components, ORIG_ATOM_DATA *orig_inp_data, ORIG_ATOM_DATA *prep_inp_data, COMP_ATOM_DATA composite_norm_data[TAUT_NUM+1], int bCompareComponents)
#define ICR_MAX_ENDP_IN2_ONLY
Definition strutil.h:179
tagDiffINChILayers
Definition strutil.h:296
@ DIFL_LENGTH
Definition strutil.h:301
@ DIFL_FI
Definition strutil.h:300
@ DIFL_M
Definition strutil.h:297
@ DIFL_MI
Definition strutil.h:298
@ DIFL_F
Definition strutil.h:299
INChI * Alloc_INChI(inp_ATOM *at, int num_at, int *found_num_bonds, int *found_num_isotopic, int nAllocMode)
Definition strutil.c:4715
tagINChISegmAction
Definition strutil.h:325
@ INCHI_SEGM_OMIT
Definition strutil.h:326
@ INCHI_SEGM_FILL
Definition strutil.h:327
@ INCHI_SEGM_EMPTY
Definition strutil.h:328
int SetConnectedComponentNumber(inp_ATOM *at, int num_at, int component_number)
Definition strutil.c:4591
const char gsSpace[]
Definition runichi.c:209
int CompareIcr(ICR *picr1, ICR *picr2, INCHI_MODE *pin1, INCHI_MODE *pin2, INCHI_MODE mask)
Definition ichimake.c:3185
int Eql_INChI_Aux_Equ(INChI_Aux *a1, int eql1, INChI_Aux *a2, int eql2)
Definition ichiprt2.c:227
int FillOutCompositeCanonInfAtom(struct tagCANON_GLOBALS *pCG, COMP_ATOM_DATA *composite_norm_data, INF_ATOM_DATA *inf_norm_at_data, int bIsotopic, int bTautomeric, PINChI2 *pINChI2, PINChI_Aux2 *pINChI_Aux2, int bAbcNumbers, INCHI_MODE nMode)
#define ICR_MAX_SC_UNDF
Definition strutil.h:186
int OutputINChIPlainError(INCHI_IOSTREAM *out_file, char *pErrorText, int bError)
Definition ichiprt1.c:514
void subgraf_pathfinder_free(subgraf_pathfinder *spf)
Definition strutil.c:5245
tagInchiDiffBits
Definition strutil.h:121
@ IDIF_SC_EXTRA_UNDF
Definition strutil.h:152
@ IDIF_MULTIPLE_TG
Definition strutil.h:137
@ IDIF_CON_TBL
Definition strutil.h:127
@ IDIF_REM_ISO_H
Definition strutil.h:149
@ IDIF_SB_MISS_UNDF
Definition strutil.h:159
@ IDIF_NUM_ISO_AT
Definition strutil.h:145
@ IDIF_REM_PROT
Definition strutil.h:148
@ IDIF_POSITION_H
Definition strutil.h:128
@ IDIF_SB_MISS
Definition strutil.h:160
@ IDIF_MISS_TG_ENDP
Definition strutil.h:142
@ IDIF_TG
Definition strutil.h:144
@ IDIF_SC_INV
Definition strutil.h:150
@ IDIF_SC_PARITY
Definition strutil.h:151
@ IDIF_SINGLE_TG
Definition strutil.h:136
@ IDIF_SB_EXTRA
Definition strutil.h:158
@ IDIF_MORE_FH
Definition strutil.h:129
@ IDIF_NUM_EL
Definition strutil.h:125
@ IDIF_ISO_AT
Definition strutil.h:146
@ IDIF_NUM_AT
Definition strutil.h:123
@ IDIF_CON_LEN
Definition strutil.h:126
@ IDIF_EXTRA_TG_ENDP
Definition strutil.h:141
@ IDIF_SB_EXTRA_UNDF
Definition strutil.h:157
@ IDIF_LESS_H
Definition strutil.h:132
@ IDIF_ATOMS
Definition strutil.h:124
@ IDIF_DIFF_TG_ENDP
Definition strutil.h:143
@ IDIF_SC_MISS
Definition strutil.h:155
@ IDIF_CHARGE
Definition strutil.h:147
@ IDIF_SC_EXTRA
Definition strutil.h:153
@ IDIF_LESS_FH
Definition strutil.h:130
@ IDIF_PROBLEM
Definition strutil.h:122
@ IDIF_NO_TAUT
Definition strutil.h:134
@ IDIF_WRONG_TAUT
Definition strutil.h:135
@ IDIF_SB_PARITY
Definition strutil.h:156
@ IDIF_NUM_TG
Definition strutil.h:138
@ IDIF_MORE_H
Definition strutil.h:131
@ IDIF_SC_MISS_UNDF
Definition strutil.h:154
int WriteToSDfile(const INP_ATOM_DATA *inp_at_data, INCHI_IOSTREAM *fcb, const char *name, const char *comment, const char *szLabel, const char *szValue)
int OutputINChI1(struct tagCANON_GLOBALS *pCG, INCHI_IOS_STRING *strbuf, INCHI_SORT *pINChISortTautAndNonTaut2[][TAUT_NUM], int iINChI, ORIG_ATOM_DATA *orig_inp_data, ORIG_STRUCT *pOrigStruct, INPUT_PARMS *ip, int bDisconnectedCoord, int bOutputType, int bINChIOutputOptions, int num_components2[], int num_non_taut2[], int num_taut2[], INCHI_IOSTREAM *out_file, INCHI_IOSTREAM *log_file, int num_input_struct, int *pSortPrintINChIFlags, unsigned char save_opt_bits)
Definition ichiprt1.c:1043
int CompINChINonTaut2(const void *p1, const void *p2)
Definition ichimake.c:2042
int Free_INChI_Members(INChI *pINChI)
Definition strutil.c:4691
#define ICR_MAX_SB_IN1_ONLY
Definition strutil.h:181
char * AllocateAndFillHillFormula(INChI *pINChI)
Definition ichimak2.c:401
int Eql_INChI_Stereo(INChI_Stereo *s1, int eql1, INChI_Stereo *s2, int eql2, int bRelRac)
Definition ichiprt2.c:54