rino 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. data/README +44 -0
  2. data/Rakefile +123 -0
  3. data/ext/extconf.rb +26 -0
  4. data/ext/ruby_inchi_main.so +0 -0
  5. data/ext/src/aux2atom.h +2786 -0
  6. data/ext/src/comdef.h +148 -0
  7. data/ext/src/e_0dstereo.c +3014 -0
  8. data/ext/src/e_0dstereo.h +31 -0
  9. data/ext/src/e_comdef.h +57 -0
  10. data/ext/src/e_ctl_data.h +147 -0
  11. data/ext/src/e_ichi_io.c +498 -0
  12. data/ext/src/e_ichi_io.h +40 -0
  13. data/ext/src/e_ichi_parms.c +37 -0
  14. data/ext/src/e_ichi_parms.h +41 -0
  15. data/ext/src/e_ichicomp.h +50 -0
  16. data/ext/src/e_ichierr.h +40 -0
  17. data/ext/src/e_ichimain.c +593 -0
  18. data/ext/src/e_ichisize.h +43 -0
  19. data/ext/src/e_inchi_atom.c +75 -0
  20. data/ext/src/e_inchi_atom.h +33 -0
  21. data/ext/src/e_inpdef.h +41 -0
  22. data/ext/src/e_mode.h +706 -0
  23. data/ext/src/e_mol2atom.c +649 -0
  24. data/ext/src/e_readinch.c +58 -0
  25. data/ext/src/e_readmol.c +54 -0
  26. data/ext/src/e_readmol.h +180 -0
  27. data/ext/src/e_readstru.c +251 -0
  28. data/ext/src/e_readstru.h +33 -0
  29. data/ext/src/e_util.c +284 -0
  30. data/ext/src/e_util.h +61 -0
  31. data/ext/src/extr_ct.h +251 -0
  32. data/ext/src/ichi.h +206 -0
  33. data/ext/src/ichi_bns.c +7999 -0
  34. data/ext/src/ichi_bns.h +231 -0
  35. data/ext/src/ichican2.c +5000 -0
  36. data/ext/src/ichicano.c +2195 -0
  37. data/ext/src/ichicano.h +49 -0
  38. data/ext/src/ichicans.c +1625 -0
  39. data/ext/src/ichicant.h +379 -0
  40. data/ext/src/ichicomn.h +260 -0
  41. data/ext/src/ichicomp.h +50 -0
  42. data/ext/src/ichidrp.h +119 -0
  43. data/ext/src/ichierr.h +124 -0
  44. data/ext/src/ichiisot.c +101 -0
  45. data/ext/src/ichilnct.c +286 -0
  46. data/ext/src/ichimain.h +132 -0
  47. data/ext/src/ichimak2.c +1189 -0
  48. data/ext/src/ichimake.c +3812 -0
  49. data/ext/src/ichimake.h +205 -0
  50. data/ext/src/ichimap1.c +851 -0
  51. data/ext/src/ichimap2.c +2856 -0
  52. data/ext/src/ichimap4.c +1609 -0
  53. data/ext/src/ichinorm.c +741 -0
  54. data/ext/src/ichinorm.h +67 -0
  55. data/ext/src/ichiparm.c +45 -0
  56. data/ext/src/ichiparm.h +1441 -0
  57. data/ext/src/ichiprt1.c +3612 -0
  58. data/ext/src/ichiprt2.c +1511 -0
  59. data/ext/src/ichiprt3.c +3011 -0
  60. data/ext/src/ichiqueu.c +1003 -0
  61. data/ext/src/ichiring.c +326 -0
  62. data/ext/src/ichiring.h +49 -0
  63. data/ext/src/ichisize.h +35 -0
  64. data/ext/src/ichisort.c +539 -0
  65. data/ext/src/ichister.c +3538 -0
  66. data/ext/src/ichister.h +35 -0
  67. data/ext/src/ichitaut.c +3843 -0
  68. data/ext/src/ichitaut.h +387 -0
  69. data/ext/src/ichitime.h +74 -0
  70. data/ext/src/inchi_api.h +670 -0
  71. data/ext/src/inchi_dll.c +1480 -0
  72. data/ext/src/inchi_dll.h +34 -0
  73. data/ext/src/inchi_dll_main.c +23 -0
  74. data/ext/src/inchi_dll_main.h +31 -0
  75. data/ext/src/inpdef.h +328 -0
  76. data/ext/src/lreadmol.h +1246 -0
  77. data/ext/src/mode.h +706 -0
  78. data/ext/src/ruby_inchi_main.c +558 -0
  79. data/ext/src/runichi.c +4179 -0
  80. data/ext/src/strutil.c +3861 -0
  81. data/ext/src/strutil.h +182 -0
  82. data/ext/src/util.c +1130 -0
  83. data/ext/src/util.h +85 -0
  84. data/lib/clean_tempfile.rb +220 -0
  85. data/lib/rino.rb +111 -0
  86. data/test/test.rb +386 -0
  87. metadata +130 -0
@@ -0,0 +1,75 @@
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
+ #include <stdio.h>
11
+ #include <string.h>
12
+
13
+ #include "e_mode.h"
14
+ #include "inchi_api.h"
15
+ #include "e_inchi_atom.h"
16
+ #include "e_ichisize.h"
17
+ #include "e_util.h"
18
+ /******************************************************************************************************/
19
+ void e_FreeInchi_Atom( inchi_Atom **at )
20
+ {
21
+ if ( at && *at ) {
22
+ e_inchi_free( *at );
23
+ *at = NULL;
24
+ }
25
+ }
26
+ /******************************************************************************************************/
27
+ void e_FreeInchi_Stereo0D( inchi_Stereo0D **stereo0D )
28
+ {
29
+ if ( stereo0D && *stereo0D ) {
30
+ e_inchi_free( *stereo0D );
31
+ *stereo0D = NULL;
32
+ }
33
+ }
34
+ /******************************************************************************************************/
35
+ inchi_Atom *e_CreateInchi_Atom( int num_atoms )
36
+ {
37
+ inchi_Atom *p = (inchi_Atom* ) e_inchi_calloc(num_atoms, sizeof(inchi_Atom) );
38
+ return p;
39
+ }
40
+ /******************************************************************************************************/
41
+ inchi_Stereo0D *e_CreateInchi_Stereo0D( int num_stereo0D )
42
+ {
43
+ return (inchi_Stereo0D* ) e_inchi_calloc(num_stereo0D, sizeof(inchi_Stereo0D) );
44
+ }
45
+ /******************************************************************************************************/
46
+ void e_FreeInchi_Input( inchi_Input *inp_at_data )
47
+ {
48
+ e_FreeInchi_Atom( &inp_at_data->atom );
49
+ e_FreeInchi_Stereo0D( &inp_at_data->stereo0D );
50
+ memset( inp_at_data, 0, sizeof(*inp_at_data) );
51
+ }
52
+ /*********************************************************/
53
+ int e_RemoveRedundantNeighbors( inchi_Input *inp_at_data )
54
+ {
55
+ int i, j, k;
56
+ inchi_Atom *at = inp_at_data->atom;
57
+ int num_atoms = inp_at_data->num_atoms;
58
+ for ( i = 0; i < num_atoms; i ++ ) {
59
+ for ( j = k = 0; j < at[i].num_bonds; j ++ ) {
60
+ if ( at[i].neighbor[j] < i ) {
61
+ at[i].neighbor[k] = at[i].neighbor[j];
62
+ at[i].bond_type[k] = at[i].bond_type[j];
63
+ at[i].bond_stereo[k] = at[i].bond_stereo[j];
64
+ k ++;
65
+ }
66
+ }
67
+ for ( j = k; j < at[i].num_bonds; j ++ ) {
68
+ at[i].neighbor[j] = 0;
69
+ at[i].bond_type[j] = 0;
70
+ at[i].bond_stereo[j] = 0;
71
+ }
72
+ at[i].num_bonds = k;
73
+ }
74
+ return 0;
75
+ }
@@ -0,0 +1,33 @@
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
+ #ifndef __INCHI_ATOM_H__
11
+ #define __INCHI_ATOM_H__
12
+
13
+ #ifndef INCHI_ALL_CPP
14
+ #ifdef __cplusplus
15
+ extern "C" {
16
+ #endif
17
+ #endif
18
+
19
+ void e_FreeInchi_Atom( inchi_Atom **at );
20
+ void e_FreeInchi_Stereo0D( inchi_Stereo0D **stereo0D );
21
+ inchi_Atom *e_CreateInchi_Atom( int num_atoms );
22
+ inchi_Stereo0D *e_CreateInchi_Stereo0D( int num_stereo0D );
23
+ void e_FreeInchi_Input( inchi_Input *inp_at_data );
24
+ int e_RemoveRedundantNeighbors( inchi_Input *inp_at_data );
25
+
26
+ #ifndef INCHI_ALL_CPP
27
+ #ifdef __cplusplus
28
+ }
29
+ #endif
30
+ #endif
31
+
32
+
33
+ #endif /* __INCHI_ATOM_H__ */
@@ -0,0 +1,41 @@
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
+ /* input/output format */
11
+ #ifndef __INPDEF_H__
12
+ #define __INPDEF_H__
13
+
14
+
15
+ /* BILLY 8/6/04 */
16
+ #ifndef INCHI_ALL_CPP
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+ #endif
21
+
22
+ int e_MolfileToInchi_Input( FILE *inp_molfile, inchi_Input *orig_at_data, int bMergeAllInputStructures,
23
+ int bDoNotAddH, int bAllowEmptyStructure,
24
+ const char *pSdfLabel, char *pSdfValue, long *lSdfId,
25
+ long *lMolfileNumber, INCHI_MODE *pInpAtomFlags, int *err, char *pStrErr );
26
+ int e_INChIToInchi_Input( FILE *inp_molfile, inchi_Input *orig_at_data, int bMergeAllInputStructures,
27
+ int bDoNotAddH, INPUT_TYPE nInputType,
28
+ char *pSdfLabel, char *pSdfValue, long *lSdfId, INCHI_MODE *pInpAtomFlags,
29
+ int *err, char *pStrErr );
30
+
31
+ int e_CopyMOLfile(FILE *inp_file, long fPtrStart, long fPtrEnd, FILE *prb_file, long nNumb);
32
+
33
+
34
+ /* BILLY 8/6/04 */
35
+ #ifndef INCHI_ALL_CPP
36
+ #ifdef __cplusplus
37
+ }
38
+ #endif
39
+ #endif
40
+
41
+ #endif /* __INPDEF_H__ */