1 /*****
2 This file is part of the Babel Program
3 Copyright (C) 1992-96 W. Patrick Walters and Matthew T. Stahl
4 
5 For more information please contact :
6 
7 babel@mercury.aichem.arizona.edu
8 --------------------------------------------------------------------------------
9 FILE : bbl_macros.h
10 AUTHOR(S) : Pat Walters
11 DATE : 8-93
12 PURPOSE : Contains macros used by the babel program
13 
14 ******/
15 
16 #ifndef __BABEL_BBLMACS_H__
17 #define __BABEL_BBLMACS_H__
18 
19 #define BABEL_VERSION "1.6 "
20 #define STARS "************************"
21 #define NOKEY "KEYWORDS GO HERE"
22 
23 #ifdef MSDOS
24 #define HUGEPTR huge
25 #else
26 #define HUGEPTR
27 #endif
28 
29 
30 #define NULL_CHAR '\0'
31 #ifndef TRUE
32 #define TRUE 1
33 #endif
34 #ifndef FALSE
35 #define FALSE 0
36 #endif
37 
38 #define BUFF_SIZE 300
39 #define NUM_TYPES 31
40 #define MAX_CONNECTIONS 20
41 #define MAX_ELEMENTS 108
42 #define MIN_ATOM 1
43 
44 #ifndef PI
45 #define PI 3.1415926535897932384626433
46 #endif
47 
48 #define RAD_TO_DEG 180.0/PI
49 #define DEG_TO_RAD PI/180.0
50 
51 #ifndef ULTRIX
52 #define QSORT_PROTO (int(*)(const void *,const void *))
53 #else
54 #define QSORT_PROTO
55 #endif
56 
57 #define MASTERSIZE sizeof(master) / sizeof(babel_rec)
58 
59 /* Color definitions */
60 
61 #define BBL_UNDEF   0
62 #define BBL_BLACK   1
63 #define BBL_GREY    2
64 #define BBL_DKBLU   3
65 #define BBL_BLUE    4
66 #define BBL_LTBLU   5
67 #define BBL_AQUA    6
68 #define BBL_TURQ    7
69 #define BBL_BLUGRN  8
70 #define BBL_DKGRN   9
71 #define BBL_GREEN   10
72 #define BBL_LTGRN   11
73 #define BBL_YELGRN  12
74 #define BBL_YELLOW  13
75 #define BBL_ORANGE  14
76 #define BBL_DKRED   15
77 #define BBL_RED     16
78 #define BBL_PINK    17
79 #define BBL_REDPUR  18
80 #define BBL_PURPLE  19
81 #define BBL_BLUPUR  20
82 #define BBL_WHITE   21
83 
84 /* Macro definitions */
85 #define SQUARE(x) (x) * (x)
86 #define NEW(type) (type *) malloc(sizeof(type))
87 #define EQ(a, b)        (strcmp((a), (b)) == 0)
88 #define NOTEQ(a, b)     (strcmp((a), (b)) != 0)
89 #define EQn(a, b, n)    (strncmp((a), (b), (n)) == 0)
90 #define NOTEQn(a, b, n)    (strncmp((a), (b), (n)) != 0)
91 
92 #ifndef MIN
93 #define MIN(a,b) (((a) < (b) ? (a) : (b)))
94 #endif
95 #ifndef MAX
96 #define MAX(a,b) (((a) > (b) ? (a) : (b)))
97 #endif
98 
99 #define SWAP(a,b) {a ^= b; b ^= a; a ^= b;}
100 
101 /* Macros defining UMS components */
102 #define Type(x)             mol->atoms[x].type
103 #define Valence(x)          mol->atoms[x].valence
104 #define Max_bonds(x)        mol->atoms[x].max_bonds
105 #define Connection(x,y)     mol->atoms[x].connected_atoms[y]
106 #define Atoms               mol->num_atoms
107 #define Point(x)            mol->atoms[x].point
108 #define Start(x)            mol->connections[x].start
109 #define End(x)              mol->connections[x].end
110 #define Bond_order(x)       mol->connections[x].bond_order
111 #define Bonds               mol->num_bonds
112 #define X(a)                mol->atoms[a].point.x
113 #define Y(a)                mol->atoms[a].point.y
114 #define Z(a)                mol->atoms[a].point.z
115 #define BO(x,y)             mol->atoms[x].bond_order[y]
116 #define Redo(x)             mol->atoms[x].redo
117 #define Radius(x)           mol->atoms[x].radius
118 #define Atomic_number(x)    mol->atoms[x].atomic_number
119 #define BORadius(x)         mol->atoms[x].bond_ord_rad
120 #define Energy              mol->energy
121 #define Double(x)           mol->atoms[x].dble
122 #define Next                mol->next
123 #define Title               mol->title
124 #define Charge(x)           mol->atoms[x].charge
125 #define Organic(x)          mol->atoms[x].organic
126 #define IsOrganic(x)        (mol->atoms[x].organic == 1)
127 
128 /*Macros defining the control structure */
129 #define DefaultExtension    mol->control->default_extension
130 
131 #define InfileName          mol->control->infile_name
132 #define InputKeywords       mol->control->input_keywords
133 #define InputInfo           mol->control->input_info
134 #define InfileType          mol->control->input_info.type
135 #define InputTypeName       mol->control->input_info.type_name
136 #define ReaderFunction      mol->control->input_info.func
137 #define InputTrans          mol->control->input_info.translate
138 
139 #define OutfileName         mol->control->outfile_name
140 #define OutputKeywords      mol->control->output_keywords
141 #define OutputInfo          mol->control->output_info
142 #define OutfileType         mol->control->output_info.type
143 #define OutfileTypeName     mol->control->output_info.type_name
144 #define WriterFunction      mol->control->output_info.func
145 #define OutputTrans         mol->control->output_info.translate
146 
147 #define BaseName            mol->control->base_name
148 #define Verbose             mol->control->verbose
149 #define AddHydrogens        mol->control->do_add_hydrogens
150 #define DeleteAtoms         mol->control->do_delete_atoms
151 #define UseMenus            mol->control->use_menus
152 #define Size                mol->control->the_size
153 #define Multi               mol->control->multi
154 #define DeleteStr           mol->control->del_str
155 #define LowerLimit          mol->control->lower_limit
156 #define UpperLimit          mol->control->upper_limit
157 #define Spline              mol->control->spline
158 #define Increment           mol->control->increment
159 #define DoRenum             mol->control->renum
160 #define NewBase             mol->control->new_base
161 #define CenterMol           mol->control->center
162 #define Align               mol->control->align
163 #define StdOrientation      mol->control->orient
164 #define Precipitate         mol->control->precipitate
165 #define PushHydrogens       mol->control->push_hydrogens
166 #define MakeNewFile         mol->control->new_file
167 #define CalcCharges         mol->control->calc_charges
168 #define NoDummy             mol->control->no_dummy
169 
170 #define NA(x) mol->internal[x].na
171 #define NB(x) mol->internal[x].nb
172 #define NC(x) mol->internal[x].nc
173 #define R(x) mol->internal[x].r
174 #define W(x) mol->internal[x].w
175 #define T(x) mol->internal[x].t
176 
177 #define SerialNum(x) mol->residues[x].serial_num
178 #define ChainNum(x) mol->residues[x].chain_num
179 #define ResNum(x) mol->residues[x].res_num
180 #define ResName(x) mol->residues[x].res_type
181 #define AtmId(x) mol->residues[x].atm_type
182 #define HasResidues (mol->residues != NULL)
183 
184 #define single_struct         0
185 #define multi_struct          1
186 #define multi_conf            2
187 #define sequential_name       3
188 #define title_as_name         4
189 
190 #define SP3_MAX      114.0  /*changed from 115.0 PW->5-17-93*/
191 #define MAY_BE_SP2   122.0
192 #define SP_MIN       160.0
193 
194 #define V1_C1_C1_CUTOFF 1.22
195 #define V1_C2_C_CUTOFF  1.41
196 #define V1_C2_N_CUTOFF  1.37
197 
198 #define V1_N1_C1_CUTOFF 1.20
199 #define V1_N3_C_CUTOFF  1.38
200 #define V1_N3_N3_CUTOFF 1.43
201 #define V1_N3_N2_CUTOFF 1.41
202 
203 #define V1_O2_C2_CUTOFF 1.30
204 #define V1_O2_AS_CUTOFF 1.685
205 
206 #define V1_S2_C2_CUTOFF 1.76
207 #define V1_S2_AS_CUTOFF 2.11
208 
209 #define V2_C3_C_CUTOFF  1.53
210 #define V2_C3_N_CUTOFF  1.46
211 #define V2_C3_O_CUTOFF  1.44
212 
213 #define V2_N2_C_CUTOFF  1.38
214 #define V2_N2_N_CUTOFF  1.32
215 
216 #define V2_C2_C_CUTOFF  1.42
217 #define V2_C2_N_CUTOFF  1.41
218 #define GEN_C3_C_CUTOFF 1.45
219 
220 #define RingSize(x)   rings->ring_list[x].length
221 #define NumRings      rings->count
222 #define RingAtom(x,y) rings->ring_list[x].path_atoms[y]
223 
224 #define mX(a) mini->atoms[a].x
225 #define mY(a) mini->atoms[a].y
226 #define mZ(a) mini->atoms[a].z
227 #define mAtoms mini->num_atoms
228 #define mPoint(a) mini->atoms[a]
229 #define mEnergy mini->energy
230 
231 #define ONE_OVER_SQRT3  0.577350269
232 #define SQRT_TWO_THIRDS 0.816496581
233 
234 #define SP3_C_H_DIST 1.115
235 #define SP2_C_H_DIST 1.103
236 #define SP_C_H_DIST 1.090
237 
238 #define SP3_N_H_DIST 1.020
239 #define SP2_N_H_DIST 1.020
240 
241 #define SP3_O_H_DIST 0.950
242 
243 #define IsUnsatType(x)  (EQ(x,"Car") || EQ(x,"C2") || EQ(x,"Sox") || EQ(x,"Sac") || EQ(x,"Pac") || EQ(x,"So2"))
244 
245 #endif  /* !__BABEL_BBLMACS_H__ */
246