1 |
#ifndef __MCL_INTERFACE_H__ |
2 |
#define __MCL_INTERFACE_H__ |
3 |
|
4 |
|
5 |
|
6 |
typedef enum { MOLECULE, ATOM, BOND, BEND, TORSION, COMPONENT, |
7 |
POSITION, ASSIGNMENT, MEMBER, CONSTRAINT, ORIENTATION, |
8 |
START_INDEX, BLOCK_END } event_enum; |
9 |
|
10 |
|
11 |
typedef struct{ |
12 |
double x; |
13 |
double y; |
14 |
double z; |
15 |
} position_event; |
16 |
|
17 |
typedef enum { STRING, INT, DOUBLE } interface_assign_type; |
18 |
|
19 |
typedef struct{ |
20 |
interface_assign_type asmt_type; |
21 |
char lhs[80]; |
22 |
union{ |
23 |
int ival; |
24 |
double dval; |
25 |
char sval[120]; |
26 |
}rhs; |
27 |
} assignment_event; |
28 |
|
29 |
typedef struct{ |
30 |
int a; |
31 |
int b; |
32 |
int c; |
33 |
int d; |
34 |
} member_event; |
35 |
|
36 |
typedef struct{ |
37 |
int* array; |
38 |
int n_elements; |
39 |
} start_index_event; |
40 |
|
41 |
typedef struct{ |
42 |
event_enum event_type; |
43 |
char* err_msg; |
44 |
|
45 |
union{ |
46 |
int blk_index; // block index |
47 |
position_event pos; |
48 |
position_event ornt; // use the same structure for orientation |
49 |
assignment_event asmt; |
50 |
member_event mbr; |
51 |
double cnstr; // the constraint value |
52 |
start_index_event si; |
53 |
} evt; |
54 |
} event; |
55 |
|
56 |
#ifdef __cplusplus |
57 |
extern "C" { |
58 |
#endif |
59 |
|
60 |
int event_handler( event* the_event ); |
61 |
|
62 |
#ifdef __cplusplus |
63 |
} |
64 |
#endif |
65 |
|
66 |
|
67 |
#endif // ifndef __MCL_INTERFACE_H__ |