2
* International Chemical Identifier (InChI)
4
* Software version 1.03
7
* Originally developed at NIST
8
* Modifications and additions by IUPAC and the InChI Trust
10
* The InChI library and programs are free software developed under the
11
* auspices of the International Union of Pure and Applied Chemistry (IUPAC);
12
* you can redistribute this software and/or modify it under the terms of
13
* the GNU Lesser General Public License as published by the Free Software
15
* http://www.opensource.org/licenses/lgpl-2.1.php
19
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
Renamed 06/12/07 to avoid occassional conflict with Microsoft's COMDEF.H
22
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
23
/* common definitions -- do not change */
24
#ifndef __INCOMDEF_H__
25
#define __INCOMDEF_H__
31
#define MAX_SDF_HEADER 64 /* max length of the SDFile data header */
32
#define MAX_SDF_VALUE 255 /* max lenght of the SDFile data value */
34
/* size resrictions */
35
#define ATOM_EL_LEN 6 /* length of atom name string including zero termination */
36
#define ATOM_INFO_LEN 36 /* inf_ATOM output string ^123Al^+2H12..(+)/999/999/999/999: 32 chars */
37
#define MAXVAL 20 /* max number of bonds per atom */
38
#define MAX_STEREO_BONDS 3 /* max number of stereogenic bonds per atom */
39
#define NUM_H_ISOTOPES 3 /* number of hydrogen isotopes: protium, deuterium, tritium */
40
#define ATW_H 1 /* hydrogen atomic weight */
42
/* input bond type definition */
43
#define MIN_INPUT_BOND_TYPE 1
44
#define MAX_INPUT_BOND_TYPE 4
46
#define BOND_TYPE_SINGLE 1
47
#define BOND_TYPE_DOUBLE 2
48
#define BOND_TYPE_TRIPLE 3
49
#define BOND_TYPE_ALTERN 4
51
#define STEREO_SNGL_UP 1
52
#define STEREO_SNGL_EITHER 4
53
#define STEREO_SNGL_DOWN 6
54
#define STEREO_DBLE_EITHER 3
58
#define INPUT_STEREO_SNGL_UP 1
59
#define INPUT_STEREO_SNGL_EITHER 4
60
#define INPUT_STEREO_SNGL_DOWN 6
61
#define INPUT_STEREO_DBLE_EITHER 3
64
#define BOND_MARK_ODD 0x10
65
#define BOND_MARK_EVEN 0x20
67
#define BOND_MARK_PARITY 0x30
68
#define BOND_MARK_HIGHLIGHT 0x40 /* highlight equivalent components */
70
#define BOND_MARK_ODD '-'
71
#define BOND_MARK_EVEN '+'
72
#define BOND_MARK_UNDF '?'
73
#define BOND_MARK_UNKN 'u'
74
#define BOND_MARK_ERR '*'
76
#define SALT_DONOR_H 1
77
#define SALT_DONOR_Neg 2
78
#define SALT_ACCEPTOR 4
79
#define SALT_p_DONOR 8 /* >C-SH */
80
#define SALT_p_ACCEPTOR 16 /* >C-S(-) */
81
#define SALT_DONOR_ALL (SALT_DONOR_Neg | SALT_DONOR_H | SALT_p_ACCEPTOR | SALT_p_DONOR)
82
#define SALT_DONOR_Neg2 (SALT_DONOR_Neg | SALT_p_ACCEPTOR)
83
#define SALT_DONOR_H2 (SALT_DONOR_H | SALT_p_DONOR)
84
#define SALT_DONOR (SALT_DONOR_Neg | SALT_DONOR_H)
86
#define SALT_SELECTED 32
88
/* radical definitions */
89
#define RADICAL_SINGLET 1
90
#define RADICAL_DOUBLET 2
91
#define RADICAL_TRIPLET 3
93
/* metal definition */
94
#define METAL 1 /* definition of an element: lowest valence */
95
#define METAL2 3 /* definition of an element: lowest and next to it valence */
96
#define IS_METAL 3 /* metal bitmap */
98
#define ZERO_ATW_DIFF 127 /* mark mass of the most abundant isotope */
102
#define UCINT (int)(unsigned char)
104
#ifndef INCHI_US_CHAR_DEF
105
typedef signed char S_CHAR;
106
typedef unsigned char U_CHAR;
107
#define INCHI_US_CHAR_DEF
110
#ifndef INCHI_US_SHORT_DEF
111
typedef signed short S_SHORT;
112
typedef unsigned short U_SHORT;
113
#define INCHI_US_SHORT_DEF
117
#ifndef INCHI_ALL_CPP
123
#define STR_ERR_LEN 256
124
int AddMOLfileError( char *pStrErr, const char *szMsg );
128
void *inchi_malloc(size_t c);
131
void *inchi_calloc(size_t c, size_t n);
134
void inchi_free(void *p);
140
void inchi_swap ( char *a, char *b, size_t width );
141
int insertions_sort( void *base, size_t num, size_t width, int ( *compare )(const void *e1, const void *e2 ) );
142
int insertions_sort_AT_NUMBERS( AT_NUMB *base, int num, int ( *compare )(const void *e1, const void *e2 ) );
145
#define MOLFILE_ERR_FIN(err, new_err, err_fin, msg) \
146
if ( !(err) && (new_err) ) { (err) = (new_err);} AddMOLfileError(pStrErr, (msg)); goto err_fin
147
#define MOLFILE_ERR_SET(err, new_err, msg) \
148
if ( !(err) && (new_err) ) { (err) = (new_err);} AddMOLfileError(pStrErr, (msg))
152
#ifndef INCHI_ALL_CPP
158
#endif /* __INCOMDEF_H__ */