InChI
 
Loading...
Searching...
No Matches
ichiprt2.c File Reference
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include "mode.h"
#include "ichimain.h"
#include "ichimake.h"
#include "ichi_io.h"
#include "bcf_s.h"
+ Include dependency graph for ichiprt2.c:

Macros

#define INIT_MIN_NUM_H   (-4)
 
#define INIT_MAX_NUM_H   16
 
#define INIT_LEN_NUM_H   (INIT_MAX_NUM_H - INIT_MIN_NUM_H + 1)
 
#define ALPHA_MINUS   '-'
 
#define ALPHA_ZERO_VAL   '.'
 
#define ALPHA_ONE   'a'
 
#define ALPHA_ZERO   '@'
 
#define __MYTOLOWER(c)   ( ((c) >= 'A') && ((c) <= 'Z') ? ((c) - 'A' + 'a') : (c) )
 
#define DECIMAL_BASE   10
 
#define DECIMAL_MINUS   '-'
 
#define DECIMAL_ZERO_VAL   '0'
 
#define DECIMAL_ONE   '1'
 
#define DECIMAL_ZERO   '0'
 

Functions

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 bHasOrigInfo (ORIG_INFO *OrigInfo, int num_atoms)
 
int EqlOrigInfo (INChI_Aux *a1, INChI_Aux *a2)
 
int bHasEquString (AT_NUMB *LinearCT, int nLenCT)
 Checks if a given array of equivalence numbers (LinearCT) contains any repetitions.
 
int MakeMult (int mult, const char *szTailingDelim, INCHI_IOS_STRING *buf, int nCtMode, int *bOverflow)
 
int MakeDelim (const char *szTailingDelim, INCHI_IOS_STRING *buf, int *bOverflow)
 
int MakeEqStr (const char *szTailingDelim, int mult, INCHI_IOS_STRING *buf, int *bOverflow)
 
int MakeCtStringNew (CANON_GLOBALS *pCG, AT_NUMB *LinearCT, int nLenCT, int bAddDelim, S_CHAR *nNum_H, int num_atoms, INCHI_IOS_STRING *strbuf, int nCtMode, int *bOverflow)
 
int MakeCtStringOld (AT_NUMB *LinearCT, int nLenCT, int bAddDelim, INCHI_IOS_STRING *strbuf, int nCtMode, int *bOverflow)
 
int MakeHString (int bAddDelim, S_CHAR *LinearCT, int nLenCT, INCHI_IOS_STRING *strbuf, int nCtMode, int *bOverflow)
 
int MakeCtString (CANON_GLOBALS *pCG, AT_NUMB *LinearCT, int nLenCT, int bAddDelim, S_CHAR *nNum_H, int num_atoms, INCHI_IOS_STRING *strbuf, int nCtMode, int *bOverflow)
 
int MakeTautString (AT_NUMB *LinearCT, int nLenCT, int bAddDelim, INCHI_IOS_STRING *strbuf, int nCtMode, int *bOverflow)
 
int MakeCRVString (ORIG_INFO *OrigInfo, int nLenCT, int bAddDelim, INCHI_IOS_STRING *strbuf, int nCtMode, int *bOverflow)
 
int MakeEquString (AT_NUMB *LinearCT, int nLenCT, int bAddDelim, INCHI_IOS_STRING *strbuf, int nCtMode, int *bOverflow)
 
int MakeIsoAtomString (INChI_IsotopicAtom *IsotopicAtom, int nNumberOfIsotopicAtoms, INCHI_IOS_STRING *strbuf, int nCtMode, int *bOverflow)
 
int MakeIsoTautString (INChI_IsotopicTGroup *IsotopicTGroup, int nNumberOfIsotopicTGroups, INCHI_IOS_STRING *strbuf, int nCtMode, int *bOverflow)
 
int MakeIsoHString (int num_iso_H[], INCHI_IOS_STRING *strbuf, int nCtMode, int *bOverflow)
 
int MakeStereoString (AT_NUMB *at1, AT_NUMB *at2, S_CHAR *parity, int bAddDelim, int nLenCT, INCHI_IOS_STRING *strbuf, int nCtMode, int *bOverflow)
 
int MakeAbcNumber (char *szString, int nStringLen, const char *szLeadingDelim, int nValue)
 
static long abctol (const char *szString, char **q)
 
long inchi_strtol (const char *str, const char **p, int base)
 Convert string to long integer.
 
double inchi_strtod (const char *str, const char **p)
 Convert string to double.
 
int MakeDecNumber (char *szString, int nStringLen, const char *szLeadingDelim, int nValue)
 
void print_sequence_of_nums_compressing_ranges (int n, int *num, INCHI_IOS_STRING *strbuf)
 

Macro Definition Documentation

◆ __MYTOLOWER

#define __MYTOLOWER (   c)    ( ((c) >= 'A') && ((c) <= 'Z') ? ((c) - 'A' + 'a') : (c) )

◆ ALPHA_MINUS

#define ALPHA_MINUS   '-'

◆ ALPHA_ONE

#define ALPHA_ONE   'a'

◆ ALPHA_ZERO

#define ALPHA_ZERO   '@'

◆ ALPHA_ZERO_VAL

#define ALPHA_ZERO_VAL   '.'

◆ DECIMAL_BASE

#define DECIMAL_BASE   10

◆ DECIMAL_MINUS

#define DECIMAL_MINUS   '-'

◆ DECIMAL_ONE

#define DECIMAL_ONE   '1'

◆ DECIMAL_ZERO

#define DECIMAL_ZERO   '0'

◆ DECIMAL_ZERO_VAL

#define DECIMAL_ZERO_VAL   '0'

◆ INIT_LEN_NUM_H

#define INIT_LEN_NUM_H   (INIT_MAX_NUM_H - INIT_MIN_NUM_H + 1)

◆ INIT_MAX_NUM_H

#define INIT_MAX_NUM_H   16

◆ INIT_MIN_NUM_H

#define INIT_MIN_NUM_H   (-4)

Function Documentation

◆ abctol()

long abctol ( const char *  szString,
char **  q 
)
static
+ 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:

◆ bHasOrigInfo()

int bHasOrigInfo ( ORIG_INFO OrigInfo,
int  num_atoms 
)
+ 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:

◆ EqlOrigInfo()

int EqlOrigInfo ( INChI_Aux a1,
INChI_Aux a2 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inchi_strtod()

double inchi_strtod ( const char *  str,
const char **  p 
)

Convert string to double.

Parameters
strPointer to the input string
pPointer to the position where conversion stopped
Returns
double Converted value
+ Here is the caller graph for this function:

◆ inchi_strtol()

long inchi_strtol ( const char *  str,
const char **  p,
int  base 
)

Convert string to long integer.

Parameters
strPointer to the input string
pPointer to the position where conversion stopped
baseBase for conversion
Returns
long Converted value
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeAbcNumber()

int MakeAbcNumber ( char *  szString,
int  nStringLen,
const char *  szLeadingDelim,
int  nValue 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeCRVString()

int MakeCRVString ( ORIG_INFO OrigInfo,
int  nLenCT,
int  bAddDelim,
INCHI_IOS_STRING strbuf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeCtString()

int MakeCtString ( CANON_GLOBALS pCG,
AT_NUMB LinearCT,
int  nLenCT,
int  bAddDelim,
S_CHAR nNum_H,
int  num_atoms,
INCHI_IOS_STRING strbuf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeCtStringNew()

int MakeCtStringNew ( CANON_GLOBALS pCG,
AT_NUMB LinearCT,
int  nLenCT,
int  bAddDelim,
S_CHAR nNum_H,
int  num_atoms,
INCHI_IOS_STRING strbuf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeCtStringOld()

int MakeCtStringOld ( AT_NUMB LinearCT,
int  nLenCT,
int  bAddDelim,
INCHI_IOS_STRING strbuf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeDecNumber()

int MakeDecNumber ( char *  szString,
int  nStringLen,
const char *  szLeadingDelim,
int  nValue 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeDelim()

int MakeDelim ( const char *  szTailingDelim,
INCHI_IOS_STRING buf,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeEqStr()

int MakeEqStr ( const char *  szTailingDelim,
int  mult,
INCHI_IOS_STRING buf,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeEquString()

int MakeEquString ( AT_NUMB LinearCT,
int  nLenCT,
int  bAddDelim,
INCHI_IOS_STRING strbuf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeHString()

int MakeHString ( int  bAddDelim,
S_CHAR LinearCT,
int  nLenCT,
INCHI_IOS_STRING strbuf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeIsoAtomString()

int MakeIsoAtomString ( INChI_IsotopicAtom IsotopicAtom,
int  nNumberOfIsotopicAtoms,
INCHI_IOS_STRING strbuf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeIsoHString()

int MakeIsoHString ( int  num_iso_H[],
INCHI_IOS_STRING strbuf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeIsoTautString()

int MakeIsoTautString ( INChI_IsotopicTGroup IsotopicTGroup,
int  nNumberOfIsotopicTGroups,
INCHI_IOS_STRING strbuf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeMult()

int MakeMult ( int  mult,
const char *  szTailingDelim,
INCHI_IOS_STRING buf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeStereoString()

int MakeStereoString ( AT_NUMB at1,
AT_NUMB at2,
S_CHAR parity,
int  bAddDelim,
int  nLenCT,
INCHI_IOS_STRING strbuf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeTautString()

int MakeTautString ( AT_NUMB LinearCT,
int  nLenCT,
int  bAddDelim,
INCHI_IOS_STRING strbuf,
int  nCtMode,
int *  bOverflow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_sequence_of_nums_compressing_ranges()

void print_sequence_of_nums_compressing_ranges ( int  n,
int *  num,
INCHI_IOS_STRING strbuf 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function: