rino 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +44 -0
- data/Rakefile +123 -0
- data/ext/extconf.rb +26 -0
- data/ext/ruby_inchi_main.so +0 -0
- data/ext/src/aux2atom.h +2786 -0
- data/ext/src/comdef.h +148 -0
- data/ext/src/e_0dstereo.c +3014 -0
- data/ext/src/e_0dstereo.h +31 -0
- data/ext/src/e_comdef.h +57 -0
- data/ext/src/e_ctl_data.h +147 -0
- data/ext/src/e_ichi_io.c +498 -0
- data/ext/src/e_ichi_io.h +40 -0
- data/ext/src/e_ichi_parms.c +37 -0
- data/ext/src/e_ichi_parms.h +41 -0
- data/ext/src/e_ichicomp.h +50 -0
- data/ext/src/e_ichierr.h +40 -0
- data/ext/src/e_ichimain.c +593 -0
- data/ext/src/e_ichisize.h +43 -0
- data/ext/src/e_inchi_atom.c +75 -0
- data/ext/src/e_inchi_atom.h +33 -0
- data/ext/src/e_inpdef.h +41 -0
- data/ext/src/e_mode.h +706 -0
- data/ext/src/e_mol2atom.c +649 -0
- data/ext/src/e_readinch.c +58 -0
- data/ext/src/e_readmol.c +54 -0
- data/ext/src/e_readmol.h +180 -0
- data/ext/src/e_readstru.c +251 -0
- data/ext/src/e_readstru.h +33 -0
- data/ext/src/e_util.c +284 -0
- data/ext/src/e_util.h +61 -0
- data/ext/src/extr_ct.h +251 -0
- data/ext/src/ichi.h +206 -0
- data/ext/src/ichi_bns.c +7999 -0
- data/ext/src/ichi_bns.h +231 -0
- data/ext/src/ichican2.c +5000 -0
- data/ext/src/ichicano.c +2195 -0
- data/ext/src/ichicano.h +49 -0
- data/ext/src/ichicans.c +1625 -0
- data/ext/src/ichicant.h +379 -0
- data/ext/src/ichicomn.h +260 -0
- data/ext/src/ichicomp.h +50 -0
- data/ext/src/ichidrp.h +119 -0
- data/ext/src/ichierr.h +124 -0
- data/ext/src/ichiisot.c +101 -0
- data/ext/src/ichilnct.c +286 -0
- data/ext/src/ichimain.h +132 -0
- data/ext/src/ichimak2.c +1189 -0
- data/ext/src/ichimake.c +3812 -0
- data/ext/src/ichimake.h +205 -0
- data/ext/src/ichimap1.c +851 -0
- data/ext/src/ichimap2.c +2856 -0
- data/ext/src/ichimap4.c +1609 -0
- data/ext/src/ichinorm.c +741 -0
- data/ext/src/ichinorm.h +67 -0
- data/ext/src/ichiparm.c +45 -0
- data/ext/src/ichiparm.h +1441 -0
- data/ext/src/ichiprt1.c +3612 -0
- data/ext/src/ichiprt2.c +1511 -0
- data/ext/src/ichiprt3.c +3011 -0
- data/ext/src/ichiqueu.c +1003 -0
- data/ext/src/ichiring.c +326 -0
- data/ext/src/ichiring.h +49 -0
- data/ext/src/ichisize.h +35 -0
- data/ext/src/ichisort.c +539 -0
- data/ext/src/ichister.c +3538 -0
- data/ext/src/ichister.h +35 -0
- data/ext/src/ichitaut.c +3843 -0
- data/ext/src/ichitaut.h +387 -0
- data/ext/src/ichitime.h +74 -0
- data/ext/src/inchi_api.h +670 -0
- data/ext/src/inchi_dll.c +1480 -0
- data/ext/src/inchi_dll.h +34 -0
- data/ext/src/inchi_dll_main.c +23 -0
- data/ext/src/inchi_dll_main.h +31 -0
- data/ext/src/inpdef.h +328 -0
- data/ext/src/lreadmol.h +1246 -0
- data/ext/src/mode.h +706 -0
- data/ext/src/ruby_inchi_main.c +558 -0
- data/ext/src/runichi.c +4179 -0
- data/ext/src/strutil.c +3861 -0
- data/ext/src/strutil.h +182 -0
- data/ext/src/util.c +1130 -0
- data/ext/src/util.h +85 -0
- data/lib/clean_tempfile.rb +220 -0
- data/lib/rino.rb +111 -0
- data/test/test.rb +386 -0
- metadata +130 -0
data/ext/src/comdef.h
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
/*
|
2
|
+
* International Union of Pure and Applied Chemistry (IUPAC)
|
3
|
+
* International Chemical Identifier (InChI)
|
4
|
+
* Version 1
|
5
|
+
* Software version 1.00
|
6
|
+
* April 13, 2005
|
7
|
+
* Developed at NIST
|
8
|
+
*/
|
9
|
+
|
10
|
+
/* common definitions -- do not change */
|
11
|
+
#ifndef __COMDEF_H__
|
12
|
+
#define __COMDEF_H__
|
13
|
+
|
14
|
+
#include "ichisize.h"
|
15
|
+
|
16
|
+
|
17
|
+
/* SDF treatment */
|
18
|
+
#define MAX_SDF_HEADER 64 /* max length of the SDFile data header */
|
19
|
+
#define MAX_SDF_VALUE 255 /* max lenght of the SDFile data value */
|
20
|
+
|
21
|
+
/* size resrictions */
|
22
|
+
#define ATOM_EL_LEN 6 /* length of atom name string including zero termination */
|
23
|
+
#define ATOM_INFO_LEN 36 /* inf_ATOM output string ^123Al^+2H12..(+)/999/999/999/999: 32 chars */
|
24
|
+
#define MAXVAL 20 /* max number of bonds per atom */
|
25
|
+
#define MAX_STEREO_BONDS 3 /* max number of stereogenic bonds per atom */
|
26
|
+
#define NUM_H_ISOTOPES 3 /* number of hydrogen isotopes */
|
27
|
+
#define ATW_H 1 /* hydrogen atomic weight */
|
28
|
+
|
29
|
+
/* input bond type definition */
|
30
|
+
#define MIN_INPUT_BOND_TYPE 1
|
31
|
+
#define MAX_INPUT_BOND_TYPE 4
|
32
|
+
|
33
|
+
#define BOND_TYPE_SINGLE 1
|
34
|
+
#define BOND_TYPE_DOUBLE 2
|
35
|
+
#define BOND_TYPE_TRIPLE 3
|
36
|
+
#define BOND_TYPE_ALTERN 4
|
37
|
+
|
38
|
+
#define STEREO_SNGL_UP 1
|
39
|
+
#define STEREO_SNGL_EITHER 4
|
40
|
+
#define STEREO_SNGL_DOWN 6
|
41
|
+
#define STEREO_DBLE_EITHER 3
|
42
|
+
|
43
|
+
|
44
|
+
/* MOlfile */
|
45
|
+
#define INPUT_STEREO_SNGL_UP 1
|
46
|
+
#define INPUT_STEREO_SNGL_EITHER 4
|
47
|
+
#define INPUT_STEREO_SNGL_DOWN 6
|
48
|
+
#define INPUT_STEREO_DBLE_EITHER 3
|
49
|
+
|
50
|
+
/*
|
51
|
+
#define BOND_MARK_ODD 0x10
|
52
|
+
#define BOND_MARK_EVEN 0x20
|
53
|
+
*/
|
54
|
+
#define BOND_MARK_PARITY 0x30
|
55
|
+
#define BOND_MARK_HIGHLIGHT 0x40 /* highlight equivalent components */
|
56
|
+
|
57
|
+
#define BOND_MARK_ODD '-'
|
58
|
+
#define BOND_MARK_EVEN '+'
|
59
|
+
#define BOND_MARK_UNDF '?'
|
60
|
+
#define BOND_MARK_UNKN 'u'
|
61
|
+
#define BOND_MARK_ERR '*'
|
62
|
+
|
63
|
+
#define SALT_DONOR_H 1
|
64
|
+
#define SALT_DONOR_Neg 2
|
65
|
+
#define SALT_ACCEPTOR 4
|
66
|
+
#define SALT_p_DONOR 8 /* >C-SH */
|
67
|
+
#define SALT_p_ACCEPTOR 16 /* >C-S(-) */
|
68
|
+
#define SALT_DONOR_ALL (SALT_DONOR_Neg | SALT_DONOR_H | SALT_p_ACCEPTOR | SALT_p_DONOR)
|
69
|
+
#define SALT_DONOR_Neg2 (SALT_DONOR_Neg | SALT_p_ACCEPTOR)
|
70
|
+
#define SALT_DONOR_H2 (SALT_DONOR_H | SALT_p_DONOR)
|
71
|
+
#define SALT_DONOR (SALT_DONOR_Neg | SALT_DONOR_H)
|
72
|
+
|
73
|
+
#define SALT_SELECTED 32
|
74
|
+
|
75
|
+
/* radical definitions */
|
76
|
+
#define RADICAL_SINGLET 1
|
77
|
+
#define RADICAL_DOUBLET 2
|
78
|
+
#define RADICAL_TRIPLET 3
|
79
|
+
|
80
|
+
/* metal definition */
|
81
|
+
#define METAL 1 /* definition of an element: lowest valence */
|
82
|
+
#define METAL2 3 /* definition of an element: lowest and next to it valence */
|
83
|
+
#define IS_METAL 3 /* metal bitmap */
|
84
|
+
/* isotopic shift */
|
85
|
+
#define ZERO_ATW_DIFF 127 /* mark mass of the most abundant isotope */
|
86
|
+
|
87
|
+
/* other types */
|
88
|
+
|
89
|
+
#define UCINT (int)(unsigned char)
|
90
|
+
|
91
|
+
#ifndef INCHI_US_CHAR_DEF
|
92
|
+
typedef signed char S_CHAR;
|
93
|
+
typedef unsigned char U_CHAR;
|
94
|
+
#define INCHI_US_CHAR_DEF
|
95
|
+
#endif
|
96
|
+
|
97
|
+
#ifndef INCHI_US_SHORT_DEF
|
98
|
+
typedef signed short S_SHORT;
|
99
|
+
typedef unsigned short U_SHORT;
|
100
|
+
#define INCHI_US_SHORT_DEF
|
101
|
+
#endif
|
102
|
+
|
103
|
+
/* BILLY 8/6/04 */
|
104
|
+
#ifndef INCHI_ALL_CPP
|
105
|
+
#ifdef __cplusplus
|
106
|
+
extern "C" {
|
107
|
+
#endif
|
108
|
+
#endif
|
109
|
+
|
110
|
+
#define STR_ERR_LEN 256
|
111
|
+
int AddMOLfileError( char *pStrErr, const char *szMsg );
|
112
|
+
|
113
|
+
/* allocator */
|
114
|
+
#ifndef inchi_malloc
|
115
|
+
void *inchi_malloc(size_t c);
|
116
|
+
#endif
|
117
|
+
#ifndef inchi_calloc
|
118
|
+
void *inchi_calloc(size_t c, size_t n);
|
119
|
+
#endif
|
120
|
+
#ifndef inchi_free
|
121
|
+
void inchi_free(void *p);
|
122
|
+
#endif
|
123
|
+
|
124
|
+
/* output */
|
125
|
+
int my_fprintf( INCHI_FILE* f, const char* lpszFormat, ... );
|
126
|
+
int inchi_print( INCHI_FILE* f, const char* lpszFormat, ... );
|
127
|
+
int inchi_print_nodisplay( INCHI_FILE* f, const char* lpszFormat, ... );
|
128
|
+
/* sorting etc */
|
129
|
+
void swap ( char *a, char *b, size_t width );
|
130
|
+
int insertions_sort( void *base, size_t num, size_t width, int ( *compare )(const void *e1, const void *e2 ) );
|
131
|
+
int insertions_sort_AT_NUMBERS( AT_NUMB *base, int num, int ( *compare )(const void *e1, const void *e2 ) );
|
132
|
+
|
133
|
+
|
134
|
+
#define MOLFILE_ERR_FIN(err, new_err, err_fin, msg) \
|
135
|
+
if ( !(err) && (new_err) ) { (err) = (new_err);} AddMOLfileError(pStrErr, (msg)); goto err_fin
|
136
|
+
#define MOLFILE_ERR_SET(err, new_err, msg) \
|
137
|
+
if ( !(err) && (new_err) ) { (err) = (new_err);} AddMOLfileError(pStrErr, (msg))
|
138
|
+
|
139
|
+
|
140
|
+
/* BILLY 8/6/04 */
|
141
|
+
#ifndef INCHI_ALL_CPP
|
142
|
+
#ifdef __cplusplus
|
143
|
+
}
|
144
|
+
#endif
|
145
|
+
#endif
|
146
|
+
|
147
|
+
#endif /* __COMDEF_H__ */
|
148
|
+
|