InChI
 
Loading...
Searching...
No Matches
strutil.h File Reference
#include "inpdef.h"
#include "ichi.h"
+ Include dependency graph for strutil.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tagInChICompareResults
 
struct  subgraf_edge
 
struct  subgraf
 
struct  subgraf_pathfinder
 

Macros

#define IDIFF_SB   (IDIF_SB_PARITY | IDIF_SB_EXTRA_UNDF | IDIF_SB_EXTRA | IDIF_SB_MISS_UNDF | IDIF_SB_MISS)
 
#define IDIFF_SC   (IDIF_SC_PARITY | IDIF_SC_EXTRA_UNDF | IDIF_SC_EXTRA | IDIF_SC_MISS_UNDF | IDIF_SC_MISS)
 
#define IDIFF_CONSTIT
 
#define IDIFF_STEREO
 
#define ICR_MAX_ENDP_IN1_ONLY   32
 
#define ICR_MAX_ENDP_IN2_ONLY   32
 
#define ICR_MAX_DIFF_FIXED_H   32
 
#define ICR_MAX_SB_IN1_ONLY   32
 
#define ICR_MAX_SB_IN2_ONLY   32
 
#define ICR_MAX_SC_IN1_ONLY   32
 
#define ICR_MAX_SC_IN2_ONLY   32
 
#define ICR_MAX_SB_UNDF   32
 
#define ICR_MAX_SC_UNDF   32
 
#define EQL_EXISTS   1
 
#define EQL_SP3   2
 
#define EQL_SP3_INV   4
 
#define EQL_SP2   8
 
#define EQL_EQU   0
 
#define EQL_EQU_TG   1
 
#define EQL_EQU_ISO   2
 
#define EQL_NUM   0
 
#define EQL_NUM_INV   1
 
#define EQL_NUM_ISO   2
 
#define FLAG_SORT_PRINT_TRANSPOS_BAS   1 /* transposition in the main InChI layer */
 
#define FLAG_SORT_PRINT_TRANSPOS_REC   2 /* transposition in the reconnected InChI layer */
 
#define FLAG_SORT_PRINT_NO_NFIX_H_BAS   4 /* no fixed H non-isotopic in the main InChI layer */
 
#define FLAG_SORT_PRINT_NO_NFIX_H_REC   8 /* no fixed H non-isotopic in the reconnected InChI layer */
 
#define FLAG_SORT_PRINT_NO_IFIX_H_BAS   16 /* no fixed H isotopic in the main InChI layer */
 
#define FLAG_SORT_PRINT_NO_IFIX_H_REC   32 /* no fixed H isotopic in the the reconnected InChI layer */
 
#define FLAG_SORT_PRINT_ReChI_PREFIX   64 /* Output ReChI instead of InChI */
 
#define SDF_LBL_VAL(L, V)
 

Typedefs

typedef enum tagInchiDiffBits IDIF
 
typedef struct tagInChICompareResults ICR
 
typedef enum tagDiffINChISegments DIF_SEGMENTS
 
typedef enum tagDiffINChILayers DIF_LAYERS
 
typedef enum tagMarkDiff DIF_VALUES
 
typedef enum tagINChISegmAction INCHI_SEGM_ACTION
 
typedef struct subgraf_edge subgraf_edge
 
typedef struct subgraf subgraf
 
typedef struct subgraf_pathfinder subgraf_pathfinder
 

Enumerations

enum  tagInchiDiffBits {
  IDIF_PROBLEM = 0x00000001 , IDIF_NUM_AT = 0x00000001 , IDIF_ATOMS = 0x00000001 , IDIF_NUM_EL = 0x00000001 ,
  IDIF_CON_LEN = 0x00000001 , IDIF_CON_TBL = 0x00000001 , IDIF_POSITION_H = 0x00000002 , IDIF_MORE_FH = 0x00000004 ,
  IDIF_LESS_FH = 0x00000008 , IDIF_MORE_H = 0x00000010 , IDIF_LESS_H = 0x00000020 , IDIF_NO_TAUT = 0x00000040 ,
  IDIF_WRONG_TAUT = 0x00000080 , IDIF_SINGLE_TG = 0x00000100 , IDIF_MULTIPLE_TG = 0x00000200 , IDIF_NUM_TG = 0x00000400 ,
  IDIF_EXTRA_TG_ENDP = 0x00000800 , IDIF_MISS_TG_ENDP = 0x00001000 , IDIF_DIFF_TG_ENDP = 0x00002000 , IDIF_TG = 0x00004000 ,
  IDIF_NUM_ISO_AT = 0x00008000 , IDIF_ISO_AT = 0x00010000 , IDIF_CHARGE = 0x00020000 , IDIF_REM_PROT = 0x00040000 ,
  IDIF_REM_ISO_H = 0x00080000 , IDIF_SC_INV = 0x00100000 , IDIF_SC_PARITY = 0x00200000 , IDIF_SC_EXTRA_UNDF = 0x00400000 ,
  IDIF_SC_EXTRA = 0x00800000 , IDIF_SC_MISS_UNDF = 0x01000000 , IDIF_SC_MISS = 0x02000000 , IDIF_SB_PARITY = 0x04000000 ,
  IDIF_SB_EXTRA_UNDF = 0x08000000 , IDIF_SB_EXTRA = 0x10000000 , IDIF_SB_MISS_UNDF = 0x20000000 , IDIF_SB_MISS = 0x40000000
}
 
enum  tagDiffINChISegments {
  DIFS_f_FORMULA , DIFS_c_CONNECT , DIFS_h_H_ATOMS , DIFS_q_CHARGE ,
  DIFS_p_PROTONS , DIFS_b_SBONDS , DIFS_t_SATOMS , DIFS_m_SP3INV ,
  DIFS_s_STYPE , DIFS_i_IATOMS , DIFS_o_TRANSP , DIFS_idf_LENGTH ,
  DIFS_LENGTH = DIFS_idf_LENGTH
}
 
enum  tagDiffINChILayers {
  DIFL_M , DIFL_MI , DIFL_F , DIFL_FI ,
  DIFL_LENGTH
}
 
enum  tagMarkDiff {
  DIFV_BOTH_EMPTY = 0 , DIFV_EQL2PRECED = 1 , DIFV_NEQ2PRECED = 2 , DIFV_IS_EMPTY = 4 ,
  DIFV_FI_EQ_MI = 8 , DIFV_OUTPUT_EMPTY_T = (DIFV_IS_EMPTY) , DIFV_OUTPUT_EMPTY_F = (DIFV_EQL2PRECED | DIFV_NEQ2PRECED | DIFV_FI_EQ_MI) , DIFV_OUTPUT_OMIT_F = (DIFV_NEQ2PRECED | DIFV_IS_EMPTY) ,
  DIFV_OUTPUT_FILL_T = (DIFV_EQL2PRECED | DIFV_NEQ2PRECED | DIFV_FI_EQ_MI)
}
 
enum  tagINChISegmAction { INCHI_SEGM_OMIT = 0 , INCHI_SEGM_FILL = 1 , INCHI_SEGM_EMPTY = 2 }
 

Functions

int ExtractConnectedComponent (inp_ATOM *at, int num_at, int component_number, inp_ATOM *component_at)
 Extract one (connected) component.
 
int SetConnectedComponentNumber (inp_ATOM *at, int num_at, int component_number)
 Set the Connected Component Number object.
 
INChIAlloc_INChI (inp_ATOM *at, int num_at, int *found_num_bonds, int *found_num_isotopic, int nAllocMode)
 Allocate INChI data structure.
 
int Free_INChI (INChI **ppINChI)
 Free INChI data structure.
 
int Free_INChI_Members (INChI *pINChI)
 Free INChI members.
 
int Free_INChI_Stereo (INChI_Stereo *pINChI_Stereo)
 Free INChI_Stereo data structure.
 
INChI_AuxAlloc_INChI_Aux (int num_at, int num_isotopic_atoms, int nAllocMode, int bOrigData)
 Allocate AuxInfo data structure.
 
int Free_INChI_Aux (INChI_Aux **ppINChI_Aux)
 Free INChI_Aux data structure.
 
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)
 Create INChI.
 
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)
 Fill out.
 
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)
 Fill out composite canonical info atom data structure.
 
char * AllocateAndFillHillFormula (INChI *pINChI)
 Allocate and fill hill formula.
 
INCHI_MODE CompareReversedINChI2 (INChI *i1, INChI *i2, INChI_Aux *a1, INChI_Aux *a2, ICR *picr, int *err)
 Compares two InChIs (2)
 
int CompareIcr (ICR *picr1, ICR *picr2, INCHI_MODE *pin1, INCHI_MODE *pin2, INCHI_MODE mask)
 Compares results from InChI comparison.
 
int CompareReversedINChI (INChI *i1, INChI *i2, INChI_Aux *a1, INChI_Aux *a2)
 Compares two InChIs (1)
 
const char * CompareReversedInchiMsg (int code)
 
int Eql_INChI_Stereo (INChI_Stereo *s1, int eql1, INChI_Stereo *s2, int eql2, int bRelRac)
 Compares stereo information of two structures.
 
int Eql_INChI_Isotopic (INChI *i1, INChI *i2)
 Compares isotopic information of two InChIs.
 
int Eql_INChI_Aux_Equ (INChI_Aux *a1, int eql1, INChI_Aux *a2, int eql2)
 Compares two InChI AuxInfo objects.
 
int Eql_INChI_Aux_Num (INChI_Aux *a1, int eql1, INChI_Aux *a2, int eql2)
 Compares two InChI AuxInfo objects in terms of numbering.
 
int bHasEquString (AT_NUMB *LinearCT, int nLenCT)
 Checks if a given array of equivalence numbers (LinearCT) contains any repetitions.
 
int CompINChINonTaut2 (const void *p1, const void *p2)
 Compare function for qsort (normal structure)
 
int CompINChITaut2 (const void *p1, const void *p2)
 Compare function for qsort (tautomeric structures)
 
int CompINChI2 (const INCHI_SORT *p1, const INCHI_SORT *p2, int bTaut, int bCompareIsotopic)
 Compares two INChI data structures (qsort)
 
int CompINChITautVsNonTaut (const INCHI_SORT *p1, const INCHI_SORT *p2, int bCompareIsotopic)
 Compare tautomeric vs non-tautomeric information.
 
int CompINChILayers (const INCHI_SORT *p1, const INCHI_SORT *p2, char sDifSegs[][DIFS_LENGTH], int bFixTranspChargeBug)
 Compare InChI layers.
 
int MarkUnusedAndEmptyLayers (char sDifSegs[][DIFS_LENGTH])
 Mark unused and empty layers.
 
int INChI_SegmentAction (char cDifSegs)
 Action to take per segment (?)
 
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)
 Main actual worker which serializes InChI to string (called from OutputINChI2( ... ) and from itself)
 
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)
 
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)
 Save equivalent components information and sort order (not used ?)
 
int OutputINChIPlainError (INCHI_IOSTREAM *out_file, char *pErrorText, int bError)
 Print error message (plain text)
 
int GetInpStructErrorType (INPUT_PARMS *ip, int err, char *pStrErrStruct, int num_inp_atoms)
 Get the input struct error type.
 
int ProcessStructError (INCHI_IOSTREAM *out_file, INCHI_IOSTREAM *log_file, char *pStrErrStruct, int nErrorType, long num_inp, INPUT_PARMS *ip)
 
int bNumHeterAtomHasIsotopicH (inp_ATOM *atom, int num_atoms)
 Check if hetero atoms has isotopic hydrogens.
 
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 bIsMetalSalt (inp_ATOM *at, int i)
 Check if atom is a metal salt.
 
int bIsSameBond (int a1, int a2, int b1, int b2)
 Check if two bonds are the same.
 
int imat_new (int m, int n, int ***a)
 Allocate integer matrix.
 
void imat_free (int m, int **a)
 Free integer matrix.
 
subgrafsubgraf_new (ORIG_ATOM_DATA *orig_inp_data, int nnodes, int *nodes)
 Create graph from atom data.
 
void subgraf_free (subgraf *sg)
 Free graph data structure.
 
void subgraf_debug_trace (subgraf *sg)
 Debug graph data structure.
 
subgraf_pathfindersubgraf_pathfinder_new (subgraf *sg, ORIG_ATOM_DATA *orig_inp_data, int start, int end)
 Allocate new graph pathfinder data structure.
 
void subgraf_pathfinder_free (subgraf_pathfinder *spf)
 Frees subgraph pathfinder data structure.
 
void subgraf_pathfinder_run (subgraf_pathfinder *spf, int nforbidden, int *forbidden_orig, int *nbonds, int **bonds, int *natoms, int *atoms)
 Find path(s) from subgraf node spf->start to spf->end and fill bonds[nbonds] and atoms[natoms]. Does not traverse through supplied forbidden edges (if not zero/NULL)
 
int subgraf_pathfinder_collect_all (subgraf_pathfinder *spf, int nforbidden, int *forbidden, int *atnums)
 Collects atom numbers along path.
 
void CompAtomData_GetNumMapping (COMP_ATOM_DATA *adata, int *orig_num, int *curr_num)
 

Variables

const char gsMissing []
 
const char gsEmpty []
 
const char gsSpace []
 
const char gsEqual []
 

Macro Definition Documentation

◆ EQL_EQU

#define EQL_EQU   0

◆ EQL_EQU_ISO

#define EQL_EQU_ISO   2

◆ EQL_EQU_TG

#define EQL_EQU_TG   1

◆ EQL_EXISTS

#define EQL_EXISTS   1

◆ EQL_NUM

#define EQL_NUM   0

◆ EQL_NUM_INV

#define EQL_NUM_INV   1

◆ EQL_NUM_ISO

#define EQL_NUM_ISO   2

◆ EQL_SP2

#define EQL_SP2   8

◆ EQL_SP3

#define EQL_SP3   2

◆ EQL_SP3_INV

#define EQL_SP3_INV   4

◆ FLAG_SORT_PRINT_NO_IFIX_H_BAS

#define FLAG_SORT_PRINT_NO_IFIX_H_BAS   16 /* no fixed H isotopic in the main InChI layer */

◆ FLAG_SORT_PRINT_NO_IFIX_H_REC

#define FLAG_SORT_PRINT_NO_IFIX_H_REC   32 /* no fixed H isotopic in the the reconnected InChI layer */

◆ FLAG_SORT_PRINT_NO_NFIX_H_BAS

#define FLAG_SORT_PRINT_NO_NFIX_H_BAS   4 /* no fixed H non-isotopic in the main InChI layer */

◆ FLAG_SORT_PRINT_NO_NFIX_H_REC

#define FLAG_SORT_PRINT_NO_NFIX_H_REC   8 /* no fixed H non-isotopic in the reconnected InChI layer */

◆ FLAG_SORT_PRINT_ReChI_PREFIX

#define FLAG_SORT_PRINT_ReChI_PREFIX   64 /* Output ReChI instead of InChI */

◆ FLAG_SORT_PRINT_TRANSPOS_BAS

#define FLAG_SORT_PRINT_TRANSPOS_BAS   1 /* transposition in the main InChI layer */

◆ FLAG_SORT_PRINT_TRANSPOS_REC

#define FLAG_SORT_PRINT_TRANSPOS_REC   2 /* transposition in the reconnected InChI layer */

◆ ICR_MAX_DIFF_FIXED_H

#define ICR_MAX_DIFF_FIXED_H   32

◆ ICR_MAX_ENDP_IN1_ONLY

#define ICR_MAX_ENDP_IN1_ONLY   32

◆ ICR_MAX_ENDP_IN2_ONLY

#define ICR_MAX_ENDP_IN2_ONLY   32

◆ ICR_MAX_SB_IN1_ONLY

#define ICR_MAX_SB_IN1_ONLY   32

◆ ICR_MAX_SB_IN2_ONLY

#define ICR_MAX_SB_IN2_ONLY   32

◆ ICR_MAX_SB_UNDF

#define ICR_MAX_SB_UNDF   32

◆ ICR_MAX_SC_IN1_ONLY

#define ICR_MAX_SC_IN1_ONLY   32

◆ ICR_MAX_SC_IN2_ONLY

#define ICR_MAX_SC_IN2_ONLY   32

◆ ICR_MAX_SC_UNDF

#define ICR_MAX_SC_UNDF   32

◆ IDIFF_CONSTIT

#define IDIFF_CONSTIT
Value:
@ IDIF_MULTIPLE_TG
Definition strutil.h:258
@ IDIF_REM_ISO_H
Definition strutil.h:270
@ IDIF_NUM_ISO_AT
Definition strutil.h:266
@ IDIF_REM_PROT
Definition strutil.h:269
@ IDIF_POSITION_H
Definition strutil.h:249
@ IDIF_MISS_TG_ENDP
Definition strutil.h:263
@ IDIF_TG
Definition strutil.h:265
@ IDIF_SINGLE_TG
Definition strutil.h:257
@ IDIF_MORE_FH
Definition strutil.h:250
@ IDIF_ISO_AT
Definition strutil.h:267
@ IDIF_EXTRA_TG_ENDP
Definition strutil.h:262
@ IDIF_LESS_H
Definition strutil.h:253
@ IDIF_DIFF_TG_ENDP
Definition strutil.h:264
@ IDIF_CHARGE
Definition strutil.h:268
@ IDIF_LESS_FH
Definition strutil.h:251
@ IDIF_NO_TAUT
Definition strutil.h:255
@ IDIF_WRONG_TAUT
Definition strutil.h:256
@ IDIF_NUM_TG
Definition strutil.h:259
@ IDIF_MORE_H
Definition strutil.h:252

◆ IDIFF_SB

◆ IDIFF_SC

◆ IDIFF_STEREO

#define IDIFF_STEREO
Value:
@ IDIF_SC_EXTRA_UNDF
Definition strutil.h:273
@ IDIF_SB_MISS_UNDF
Definition strutil.h:280
@ IDIF_SB_MISS
Definition strutil.h:281
@ IDIF_SC_INV
Definition strutil.h:271
@ IDIF_SC_PARITY
Definition strutil.h:272
@ IDIF_SB_EXTRA
Definition strutil.h:279
@ IDIF_SB_EXTRA_UNDF
Definition strutil.h:278
@ IDIF_SC_MISS
Definition strutil.h:276
@ IDIF_SC_EXTRA
Definition strutil.h:274
@ IDIF_SB_PARITY
Definition strutil.h:277
@ IDIF_SC_MISS_UNDF
Definition strutil.h:275

◆ SDF_LBL_VAL

#define SDF_LBL_VAL (   L,
 
)
Value:
((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 \
const char gsMissing[]
Definition runichi.c:207
const char gsEmpty[]
Definition runichi.c:208
const char gsEqual[]
Definition runichi.c:210
const char gsSpace[]
Definition runichi.c:209

Typedef Documentation

◆ DIF_LAYERS

◆ DIF_SEGMENTS

◆ DIF_VALUES

typedef enum tagMarkDiff DIF_VALUES

◆ ICR

typedef struct tagInChICompareResults ICR

◆ IDIF

typedef enum tagInchiDiffBits IDIF

◆ INCHI_SEGM_ACTION

◆ subgraf

typedef struct subgraf subgraf

◆ subgraf_edge

typedef struct subgraf_edge subgraf_edge

◆ subgraf_pathfinder

Enumeration Type Documentation

◆ tagDiffINChILayers

Enumerator
DIFL_M 
DIFL_MI 
DIFL_F 
DIFL_FI 
DIFL_LENGTH 

◆ tagDiffINChISegments

Enumerator
DIFS_f_FORMULA 
DIFS_c_CONNECT 
DIFS_h_H_ATOMS 
DIFS_q_CHARGE 
DIFS_p_PROTONS 
DIFS_b_SBONDS 
DIFS_t_SATOMS 
DIFS_m_SP3INV 
DIFS_s_STYPE 
DIFS_i_IATOMS 
DIFS_o_TRANSP 
DIFS_idf_LENGTH 
DIFS_LENGTH 

◆ tagInchiDiffBits

Enumerator
IDIF_PROBLEM 
IDIF_NUM_AT 
IDIF_ATOMS 
IDIF_NUM_EL 
IDIF_CON_LEN 
IDIF_CON_TBL 
IDIF_POSITION_H 
IDIF_MORE_FH 
IDIF_LESS_FH 
IDIF_MORE_H 
IDIF_LESS_H 
IDIF_NO_TAUT 
IDIF_WRONG_TAUT 
IDIF_SINGLE_TG 
IDIF_MULTIPLE_TG 
IDIF_NUM_TG 
IDIF_EXTRA_TG_ENDP 
IDIF_MISS_TG_ENDP 
IDIF_DIFF_TG_ENDP 
IDIF_TG 
IDIF_NUM_ISO_AT 
IDIF_ISO_AT 
IDIF_CHARGE 
IDIF_REM_PROT 
IDIF_REM_ISO_H 
IDIF_SC_INV 
IDIF_SC_PARITY 
IDIF_SC_EXTRA_UNDF 
IDIF_SC_EXTRA 
IDIF_SC_MISS_UNDF 
IDIF_SC_MISS 
IDIF_SB_PARITY 
IDIF_SB_EXTRA_UNDF 
IDIF_SB_EXTRA 
IDIF_SB_MISS_UNDF 
IDIF_SB_MISS 

◆ tagINChISegmAction

Enumerator
INCHI_SEGM_OMIT 
INCHI_SEGM_FILL 
INCHI_SEGM_EMPTY 

◆ tagMarkDiff

Enumerator
DIFV_BOTH_EMPTY 
DIFV_EQL2PRECED 
DIFV_NEQ2PRECED 
DIFV_IS_EMPTY 
DIFV_FI_EQ_MI 
DIFV_OUTPUT_EMPTY_T 
DIFV_OUTPUT_EMPTY_F 
DIFV_OUTPUT_OMIT_F 
DIFV_OUTPUT_FILL_T 

Function Documentation

◆ Alloc_INChI()

INChI * Alloc_INChI ( inp_ATOM at,
int  num_at,
int *  found_num_bonds,
int *  found_num_isotopic,
int  nAllocMode 
)

Allocate INChI data structure.

Parameters
atPointer to atom array
num_atNumber of atoms
found_num_bondsPointer to number of bonds
found_num_isotopicPointer to number of isotopic atoms
nAllocModeAllocation mode
Returns
INChI* Pointer to allocated INChI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Alloc_INChI_Aux()

INChI_Aux * Alloc_INChI_Aux ( int  num_at,
int  num_isotopic_atoms,
int  nAllocMode,
int  bOrigData 
)

Allocate AuxInfo data structure.

Parameters
num_atNumber of atoms
num_isotopic_atomsNumber of isotopic atoms
nAllocModeAllocation mode
bOrigDataFlag indicating if the atom data is original
Returns
INChI_Aux* Pointer to allocated INChI_Aux or NULL if failed
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AllocateAndFillHillFormula()

char * AllocateAndFillHillFormula ( INChI pINChI)

Allocate and fill hill formula.

Parameters
pINChIPointer to INChI data structure
Returns
char* Pointer to allocated hill formula
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bHasEquString()

int bHasEquString ( AT_NUMB LinearCT,
int  nLenCT 
)

Checks if a given array of equivalence numbers (LinearCT) contains any repetitions.

Parameters
LinearCTPointer to equivalence numbers
nLenCTLength of the array
Returns
int 1 if the array contains repetitions, 0 otherwise
+ Here is the caller graph for this function:

◆ bIsMetalSalt()

int bIsMetalSalt ( inp_ATOM at,
int  i 
)

Check if atom is a metal salt.

Parameters
atPointer to atom array
iatom index
Returns
int 1 if metal salt, 0 if not
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bIsSameBond()

int bIsSameBond ( int  a1,
int  a2,
int  b1,
int  b2 
)

Check if two bonds are the same.

Parameters
a1Atom a1 index
a2Atom a2 index
b1Atom b1 index
b2Atom b2 index
Returns
int Returns 1 if bonds (a1,a2) and (b1,b2) are the same, -1 if atoms swapped, 0 if not the same
+ Here is the caller graph for this function:

◆ bNumHeterAtomHasIsotopicH()

int bNumHeterAtomHasIsotopicH ( inp_ATOM atom,
int  num_atoms 
)

Check if hetero atoms has isotopic hydrogens.

Parameters
atomPointer to atom array
num_atomsNumber of atoms
Returns
int 2 if isotopic atoms, 1 if isotopic hydrogens, 0 if not
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CompareIcr()

int CompareIcr ( ICR picr1,
ICR picr2,
INCHI_MODE pin1,
INCHI_MODE pin2,
INCHI_MODE  mask 
)

Compares results from InChI comparison.

Parameters
picr1Pointer to first comparison results
picr2Pointer to second comparison results
pin1Pointer to first InChI mode (never used?)
pin2Pointer to second InChI mode (never used?)
maskEither IDIFF_CONSTIT or IDIFF_STEREO
Returns
* int 2 if undefined results, 1 if unequal, 0 if equal, -1 if unequal
+ Here is the caller graph for this function:

◆ CompareReversedINChI()

int CompareReversedINChI ( INChI i1,
INChI i2,
INChI_Aux a1,
INChI_Aux a2 
)

Compares two InChIs (1)

Parameters
i1Pointer to first InChI (InChI from reversed struct)
i2Pointer to second InChI
a1Pointer to first InChI AuxInfo
a2Pointer to second InChI AuxInfo
Returns
int 0 if NULL, 1 if one is NULL, >1 if difference in structure
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CompareReversedINChI2()

INCHI_MODE CompareReversedINChI2 ( INChI i1,
INChI i2,
INChI_Aux a1,
INChI_Aux a2,
ICR picr,
int *  err 
)

Compares two InChIs (2)

Parameters
i1Pointer to first InChI (InChI from reversed struct)
i2Pointer to second InChI
a1Pointer to first InChI AuxInfo
a2Pointer to second InChI AuxInfo
picrPointer to comparison results
errPointer to error code
Returns
INCHI_MODE Returns code from IDIF
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CompareReversedInchiMsg()

const char * CompareReversedInchiMsg ( int  code)

◆ CompAtomData_GetNumMapping()

void CompAtomData_GetNumMapping ( COMP_ATOM_DATA adata,
int *  orig_num,
int *  curr_num 
)
+ Here is the caller graph for this function:

◆ CompINChI2()

int CompINChI2 ( const INCHI_SORT p1,
const INCHI_SORT p2,
int  bTaut,
int  bCompareIsotopic 
)

Compares two INChI data structures (qsort)

Parameters
p1Pointer to the first INCHI_SORT data structure
p2Pointer to the second INCHI_SORT data structure
bTautFlag for tautomeric comparison
bCompareIsotopicFlag for isotopic comparison
Returns
int -1 if *p1 > *p2, return +1 if *p1 < *p2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CompINChILayers()

int CompINChILayers ( const INCHI_SORT p1,
const INCHI_SORT p2,
char  sDifSegs[][DIFS_LENGTH],
int  bFixTranspChargeBug 
)

Compare InChI layers.

Parameters
p1Pointer to InChI component 1
p2Pointer to InChI component 2
sDifSegsArray of different layers
bFixTranspChargeBugFlag to fix charge bug (?)
Returns
int -1 if *p1 > *p2, return +1 if *p1 < *p2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CompINChINonTaut2()

int CompINChINonTaut2 ( const void *  p1,
const void *  p2 
)

Compare function for qsort (normal structure)

Parameters
p1Pointer to first INCHI_SORT structure
p2Pointer to second INCHI_SORT structure
Returns
int -1 if *p1 > *p2, return +1 if *p1 < *p2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CompINChITaut2()

int CompINChITaut2 ( const void *  p1,
const void *  p2 
)

Compare function for qsort (tautomeric structures)

Parameters
p1Pointer to first INCHI_SORT structure
p2Pointer to second INCHI_SORT structure
Returns
int -1 if *p1 > *p2, return +1 if *p1 < *p2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CompINChITautVsNonTaut()

int CompINChITautVsNonTaut ( const INCHI_SORT p1,
const INCHI_SORT p2,
int  bCompareIsotopic 
)

Compare tautomeric vs non-tautomeric information.

Parameters
p1Pointer to the first INCHI_SORT data structure
p2Pointer to the second INCHI_SORT data structure
bCompareIsotopicFlag for comparing isotopic non-tautomeric part
Returns
int -1 if *p1 > *p2, return +1 if *p1 < *p2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Create_INChI()

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 
)

Create INChI.

Parameters
pCGPointer to canonicalization globals data structure
icPointer to InChI clock data structure
ipPointer to input parameters
ppINChIPointer to INChI data structure
ppINChI_AuxPointer to AuxInfo data structure
orig_inp_dataPointer to original atom data
inp_atPointer to atom array
inp_norm_dataPointer to normalized atom data
num_inp_atNumber of atoms
nUserModeUser mode
pbTautFlagsTautomer flags
pbTautFlagsDoneTautomer flags completed
ulMaxTimeMaximum time
ti_outTautomer info
pStrErrStructStore error or warning messages
Returns
int Status code
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Eql_INChI_Aux_Equ()

int Eql_INChI_Aux_Equ ( INChI_Aux a1,
int  eql1,
INChI_Aux a2,
int  eql2 
)

Compares two InChI AuxInfo objects.

Parameters
a1Pointer to first AuxInfo
eql1Flag to compare type 1
a2Pointer to second AuxInfo
eql2Flag to compare type 2
Returns
int 0 if unequal or empty, 1 if equal
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Eql_INChI_Aux_Num()

int Eql_INChI_Aux_Num ( INChI_Aux a1,
int  eql1,
INChI_Aux a2,
int  eql2 
)

Compares two InChI AuxInfo objects in terms of numbering.

Parameters
a1Pointer to first AuxInfo
eql1Flag to compare type 1
a2Pointer to second AuxInfo
eql2Flag to compare type 2
Returns
int 0 if unequal or empty, 1 if numbering matches
+ Here is the caller graph for this function:

◆ Eql_INChI_Isotopic()

int Eql_INChI_Isotopic ( INChI i1,
INChI i2 
)

Compares isotopic information of two InChIs.

Parameters
i1Pointer to first InChI
i2Pointer to second InChI
Returns
int 0 if unequal, 1 if equal
+ Here is the caller graph for this function:

◆ Eql_INChI_Stereo()

int Eql_INChI_Stereo ( INChI_Stereo s1,
int  eql1,
INChI_Stereo s2,
int  eql2,
int  bRelRac 
)

Compares stereo information of two structures.

Parameters
s1Pointer to stereo information of first structure
eql1Flag for stereo information check
s2Pointer to stereo information of second structure
eql2Flag for stereo information check
bRelRacFlag to compare racemic stereo information
Returns
int 0 if unequal, 1 if equal
+ Here is the caller graph for this function:

◆ ExtractConnectedComponent()

int ExtractConnectedComponent ( inp_ATOM at,
int  num_at,
int  component_number,
inp_ATOM component_at 
)

Extract one (connected) component.

Parameters
atPointer to atom array
num_atNumber of atoms
component_numberComponent number
component_atPointer to component atom array
Returns
int Number of extracted atoms

◆ FillOutCompositeCanonInfAtom()

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 
)

Fill out composite canonical info atom data structure.

Parameters
pCGPointer to canonicalization globals data structure
composite_norm_dataPointer to composite normalized atom data
inf_norm_at_dataPointer to normalized info atom data structure
bIsotopicFlag indicating if the atom data is isotopic
bTautomericFlag indicating if the atom data is tautomeric
pINChI2Pointer to INChI2 data structure (?)
pINChI_Aux2Pointer to AuxInfo2 data structure (?)
bAbcNumbersFlag indicating whether to use alphanumeric values (?)
nModeStereochemistry mode
Returns
int Returns 1

◆ FillOutInfAtom()

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 
)

Fill out.

Parameters
pCGPointer to InChI clock data structure
norm_atPointer to normalized atoms
inf_norm_at_dataPointer to normalized info atom data structure
init_num_atNumber of atoms
num_removed_HNumber of removed hydrogens
bAdd_DT_to_num_HAdd isotopic hydrogens to the number of hydrogens
nNumRemovedProtonsNumber of removed protons
nNumRemovedProtonsIsotopicPointer to array of removed protons (isotopic)
bIsotopicFlag indicating if the atom data is isotopic
pINChIPointer to INChI data structure
pINChI_AuxPointer to AuxInfo data structure
bAbcNumbersFlag indicating whether to use alphanumeric values (?)
nModeStereochemistry mode
Returns
int Returns 0

◆ Free_INChI()

int Free_INChI ( INChI **  ppINChI)

Free INChI data structure.

Parameters
ppINChIPointer to INChI data structure
Returns
int Returns 0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Free_INChI_Aux()

int Free_INChI_Aux ( INChI_Aux **  ppINChI_Aux)

Free INChI_Aux data structure.

Parameters
ppINChI_AuxPointer to INChI_Aux data structure
Returns
int Returns 0
+ Here is the caller graph for this function:

◆ Free_INChI_Members()

int Free_INChI_Members ( INChI pINChI)

Free INChI members.

Parameters
pINChIPointer to INChI data structure
Returns
int Returns 0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Free_INChI_Stereo()

int Free_INChI_Stereo ( INChI_Stereo pINChI_Stereo)

Free INChI_Stereo data structure.

Parameters
pINChI_StereoPointer to INChI_Stereo
Returns
int Returns 0
+ Here is the caller graph for this function:

◆ GetInpStructErrorType()

int GetInpStructErrorType ( INPUT_PARMS ip,
int  err,
char *  pStrErrStruct,
int  num_inp_atoms 
)

Get the input struct error type.

Parameters
ipPointer to input parameters
errError code
pStrErrStructPointer to error string
num_inp_atomsNumber of input atoms
Returns
int Returns type of error
+ Here is the caller graph for this function:

◆ imat_free()

void imat_free ( int  m,
int **  a 
)

Free integer matrix.

Parameters
mSize of matrix
aPointer to matrix
+ Here is the caller graph for this function:

◆ imat_new()

int imat_new ( int  m,
int  n,
int ***  a 
)

Allocate integer matrix.

Parameters
mSize of matrix
nSize of matrix
aPointer to matrix
Returns
int 1 if success, 0 if failure
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ INChI_SegmentAction()

int INChI_SegmentAction ( char  cDifSegs)

Action to take per segment (?)

Parameters
cDifSegsSegment bits
Returns
int Type of segment action (INCHI_SEGM_OMIT, INCHI_SEGM_EMPTY, INCHI_SEGM_FILL)
+ Here is the caller graph for this function:

◆ MarkUnusedAndEmptyLayers()

int MarkUnusedAndEmptyLayers ( char  sDifSegs[][DIFS_LENGTH])

Mark unused and empty layers.

Parameters
sDifSegsArray of different layers
Returns
int returns 0
+ Here is the caller graph for this function:

◆ OutputINChI1()

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 
)

Main actual worker which serializes InChI to string (called from OutputINChI2( ... ) and from itself)

Parameters
pCGPointer to canonicalisation parameters
strbufPoint to string buffer
pINChISortTautAndNonTaut2
iINChIInChI basic or InChI reconnect information (?)
orig_inp_dataPointer to original atom data structure
pOrigStructPointer to original stucture
ipPointer to input parameters
bDisconnectedCoordFlag for disconnected coordinates
bOutputTypeFlag for output type
bINChIOutputOptionsFlag for InChI output options
num_components2Pointer to number of components
num_non_taut2Pointer to number of non tautomeric units (?)
num_taut2Pointer to number of tautomeric units
out_filePointer to output file
log_filePointer to log file
num_input_structNumber of input structures
pSortPrintINChIFlagsPointer to sort and print InChI flags (?)
save_opt_bitsFlag to save optional bits (?)
Returns
int 0 if error, 1 otherwise
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OutputINChI2()

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

◆ OutputINChIPlainError()

int OutputINChIPlainError ( INCHI_IOSTREAM out_file,
char *  pErrorText,
int  bError 
)

Print error message (plain text)

Parameters
out_filePointer to output file
pErrorTextPointer to error text
bErrorError type
Returns
int Returns 1
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessStructError()

int ProcessStructError ( INCHI_IOSTREAM out_file,
INCHI_IOSTREAM log_file,
char *  pStrErrStruct,
int  nErrorType,
long  num_inp,
INPUT_PARMS ip 
)
Parameters
out_filePointer to output file
log_filePointer to log file
pStrErrStructPointer to error string
nErrorTypeError type
num_inpNumber of input structure (?)
ipPointer to input parameters
Returns
int Retunrs error type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SaveEquComponentsInfoAndSortOrder()

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 
)

Save equivalent components information and sort order (not used ?)

Parameters
iINChIIndex to component
pINChISortPointer to InChI sort structure
num_componentsPointer to number of components
orig_inp_dataPointer to original atom data
prep_inp_dataPointer to prepared original atom data (?)
composite_norm_dataPointer to composite data (?)
bCompareComponentsType of comparisson: 1 default, 2 non-isotopic, 4 -non-tautomeric
Returns
* int 0 if error, 1 if otherwise
+ Here is the caller graph for this function:

◆ SetConnectedComponentNumber()

int SetConnectedComponentNumber ( inp_ATOM at,
int  num_at,
int  component_number 
)

Set the Connected Component Number object.

Parameters
atPointer to atom array
num_atNumber of atoms
component_numberComponent number
Returns
int Returns 0
+ Here is the caller graph for this function:

◆ subgraf_debug_trace()

void subgraf_debug_trace ( subgraf sg)

Debug graph data structure.

Parameters
sgPointer to graph

◆ subgraf_free()

void subgraf_free ( subgraf sg)

Free graph data structure.

Parameters
sgPointer to graph
Returns
void Returns NULL (?)
+ Here is the caller graph for this function:

◆ subgraf_new()

subgraf * subgraf_new ( ORIG_ATOM_DATA orig_inp_data,
int  nnodes,
int *  nodes 
)

Create graph from atom data.

Parameters
orig_inp_dataPointer to original atom data
nnodesNumber of nodes
nodesPointer to nodes
Returns
subgraf* NULL if error, a new graph otherwise
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subgraf_pathfinder_collect_all()

int subgraf_pathfinder_collect_all ( subgraf_pathfinder spf,
int  nforbidden,
int *  forbidden,
int *  atnums 
)

Collects atom numbers along path.

Parameters
spfPointer to graph pathfinder data structure
nforbiddenNumber of edges forbidden for traversal
forbiddenPointer to forbidden edges
atnumsPointer to atom numbers
Returns
* int
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subgraf_pathfinder_free()

void subgraf_pathfinder_free ( subgraf_pathfinder spf)

Frees subgraph pathfinder data structure.

Parameters
spfPointer to graph pathfinder data structure
Returns
* void
+ Here is the caller graph for this function:

◆ subgraf_pathfinder_new()

subgraf_pathfinder * subgraf_pathfinder_new ( subgraf sg,
ORIG_ATOM_DATA orig_inp_data,
int  start,
int  end 
)

Allocate new graph pathfinder data structure.

Parameters
sgPointer to graph
orig_inp_dataPointer to original atom data
startStarting node
endEnd node
Returns
subgraf_pathfinder* Returns pointer to graph pathfinder data structure
+ Here is the caller graph for this function:

◆ subgraf_pathfinder_run()

void subgraf_pathfinder_run ( subgraf_pathfinder spf,
int  nforbidden,
int *  forbidden_orig,
int *  nbonds,
int **  bonds,
int *  natoms,
int *  atoms 
)

Find path(s) from subgraf node spf->start to spf->end and fill bonds[nbonds] and atoms[natoms]. Does not traverse through supplied forbidden edges (if not zero/NULL)

Parameters
spfPointer to graph pathfinder data structure
nforbiddenNumber of forbidden edges
forbidden_origPointer forbidden edges
nbondsNumber of bonds
bondsPointer to bonds
natomsNumber of atoms
atomsPointer to atoms
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WriteToSDfile()

int WriteToSDfile ( const INP_ATOM_DATA inp_at_data,
INCHI_IOSTREAM fcb,
const char *  name,
const char *  comment,
const char *  szLabel,
const char *  szValue 
)

Variable Documentation

◆ gsEmpty

const char gsEmpty[]
extern

◆ gsEqual

const char gsEqual[]
extern

◆ gsMissing

const char gsMissing[]
extern

◆ gsSpace

const char gsSpace[]
extern