From aaf979ab6ce936cb5b5e12ea371771a882d7ea37 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Thu, 4 Dec 2025 14:03:33 +0000 Subject: [PATCH 01/41] Decoupled main from ichimain.c --- .../Geometries/data/cis_platin.mol | 26 - .../Geometries/data/mol_alkene.ds_0.mol | 18 - .../Geometries/data/mol_bidentate.ds_7.mol | 135 -- .../Geometries/data/mol_carbonyl.ds_0.mol | 41 - .../demos/mol2inchi/src/CMakeLists.txt | 4 +- .../inchi-1 => INCHI_BASE}/src/dispstru.c | 116 +- .../inchi-1 => INCHI_BASE}/src/dispstru.h | 0 INCHI-1-SRC/INCHI_BASE/src/ichimain.c | 1529 +++++++++++++++++ .../INCHI_EXE/inchi-1/src/CMakeLists.txt | 13 +- .../src/{ichimain.c => backup_ichimain.c} | 0 INCHI-1-SRC/INCHI_EXE/inchi-1/src/main.c | 266 +++ 11 files changed, 1862 insertions(+), 286 deletions(-) delete mode 100644 INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/cis_platin.mol delete mode 100644 INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_alkene.ds_0.mol delete mode 100644 INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_bidentate.ds_7.mol delete mode 100644 INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_carbonyl.ds_0.mol rename INCHI-1-SRC/{INCHI_EXE/inchi-1 => INCHI_BASE}/src/dispstru.c (98%) rename INCHI-1-SRC/{INCHI_EXE/inchi-1 => INCHI_BASE}/src/dispstru.h (100%) create mode 100644 INCHI-1-SRC/INCHI_BASE/src/ichimain.c rename INCHI-1-SRC/INCHI_EXE/inchi-1/src/{ichimain.c => backup_ichimain.c} (100%) create mode 100644 INCHI-1-SRC/INCHI_EXE/inchi-1/src/main.c diff --git a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/cis_platin.mol b/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/cis_platin.mol deleted file mode 100644 index 92a570bd..00000000 --- a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/cis_platin.mol +++ /dev/null @@ -1,26 +0,0 @@ - - ACCLDraw09152511572D - - 11 10 0 0 0 0 0 0 0 0999 V2000 - 13.6841 -9.2760 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 - 13.6841 -10.4428 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 - 13.1007 -9.8594 0.0000 Pt 0 0 0 0 0 0 0 0 0 0 0 0 - 12.7309 -8.4791 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 11.7204 -10.2293 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 11.7204 -9.4896 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 12.7308 -11.2397 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 12.5173 -10.4428 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 - 12.3038 -11.2397 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 12.5173 -9.2760 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 - 11.7204 -9.0625 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 3 1 1 0 0 0 0 - 3 2 1 0 0 0 0 - 3 8 1 0 0 0 0 - 3 10 1 0 0 0 0 - 10 6 1 0 0 0 0 - 10 4 1 0 0 0 0 - 8 5 1 0 0 0 0 - 8 7 1 0 0 0 0 - 8 9 1 0 0 0 0 - 10 11 1 0 0 0 0 -M END diff --git a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_alkene.ds_0.mol b/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_alkene.ds_0.mol deleted file mode 100644 index 58be810f..00000000 --- a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_alkene.ds_0.mol +++ /dev/null @@ -1,18 +0,0 @@ - -Generated by WebMolKit - - 6 6 0 0 1 0 0 0 0 0999 V2000 - 0.0000 0.0000 0.0000 Pt 0 5 0 0 0 0 0 0 0 0 0 0 - 1.5000 0.0000 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 1.5000 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 -1.5000 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 - -1.5990 0.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.5990 -0.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1 2 1 0 0 0 0 - 1 3 1 0 0 0 0 - 1 4 1 0 0 0 0 - 1 5 0 0 0 0 0 - 5 6 2 0 0 0 0 - 6 1 0 0 0 0 0 -M CHG 1 1 -1 -M END \ No newline at end of file diff --git a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_bidentate.ds_7.mol b/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_bidentate.ds_7.mol deleted file mode 100644 index b768f346..00000000 --- a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_bidentate.ds_7.mol +++ /dev/null @@ -1,135 +0,0 @@ - -Generated by WebMolKit - - 55 61 0 0 1 0 0 0 0 0999 V2000 - 0.0000 0.0000 0.0000 Ru 0 0 0 0 0 0 0 0 0 0 0 0 - -1.7532 -0.4698 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - -1.7290 0.9982 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - -3.0281 1.7482 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - -2.1414 -1.9186 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.0807 -2.9793 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 3.3492 0.0125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.5775 1.2989 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 2.6210 -1.2989 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - -2.0000 2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 4.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.0000 2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -2.7500 0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -2.7500 3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -4.2500 0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -5.0000 2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -4.2500 3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.2990 4.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2990 4.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.2990 6.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 7.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2990 6.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.7500 3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.7500 0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 4.2500 3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 5.0000 2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 4.2500 0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 2.0000 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0 - 2.0000 -2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 -4.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -2.0000 -2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.7500 -0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.7500 -3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 4.2500 -0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 5.0000 -2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 4.2500 -3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2990 -4.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.2990 -4.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2990 -6.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 -7.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.2990 -6.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -2.7500 -3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -2.7500 -0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -4.2500 -3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -5.0000 -2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -4.2500 -0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 -2.0000 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0 - -3.2020 -3.7558 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - -3.9786 -0.8580 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - -5.0391 -2.6952 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - -3.5903 -2.3069 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 4.8240 1.5373 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - 4.8740 -1.4623 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - 6.3488 0.0625 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - 4.8490 0.0375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1 2 1 0 0 0 0 - 1 3 0 0 0 0 0 - 3 4 2 0 0 0 0 - 2 5 1 0 0 0 0 - 5 6 2 0 0 0 0 - 7 8 2 0 0 0 0 - 7 9 1 0 0 0 0 - 9 1 1 0 0 0 0 - 8 1 0 0 0 0 0 - 28 10 1 0 0 0 0 - 28 11 1 0 0 0 0 - 28 12 1 0 0 0 0 - 10 13 1 0 0 0 0 - 10 14 2 0 0 0 0 - 13 15 2 0 0 0 0 - 15 16 1 0 0 0 0 - 16 17 2 0 0 0 0 - 17 14 1 0 0 0 0 - 11 18 1 0 0 0 0 - 11 19 2 0 0 0 0 - 18 20 2 0 0 0 0 - 20 21 1 0 0 0 0 - 21 22 2 0 0 0 0 - 22 19 1 0 0 0 0 - 12 23 1 0 0 0 0 - 12 24 2 0 0 0 0 - 23 25 2 0 0 0 0 - 25 26 1 0 0 0 0 - 26 27 2 0 0 0 0 - 27 24 1 0 0 0 0 - 1 28 0 0 0 0 0 - 47 29 1 0 0 0 0 - 47 30 1 0 0 0 0 - 47 31 1 0 0 0 0 - 29 32 1 0 0 0 0 - 29 33 2 0 0 0 0 - 32 34 2 0 0 0 0 - 34 35 1 0 0 0 0 - 35 36 2 0 0 0 0 - 36 33 1 0 0 0 0 - 30 37 1 0 0 0 0 - 30 38 2 0 0 0 0 - 37 39 2 0 0 0 0 - 39 40 1 0 0 0 0 - 40 41 2 0 0 0 0 - 41 38 1 0 0 0 0 - 31 42 1 0 0 0 0 - 31 43 2 0 0 0 0 - 42 44 2 0 0 0 0 - 44 45 1 0 0 0 0 - 45 46 2 0 0 0 0 - 46 43 1 0 0 0 0 - 1 47 0 0 0 0 0 - 51 48 1 0 0 0 0 - 51 49 1 0 0 0 0 - 51 50 1 0 0 0 0 - 5 51 1 0 0 0 0 - 55 52 1 0 0 0 0 - 55 53 1 0 0 0 0 - 55 54 1 0 0 0 0 - 7 55 1 0 0 0 0 -M STY 1 1 SUP -M SAL 1 15 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 -M SAL 1 4 25 26 27 28 -M SMT 1 P|Ph{3} -M STY 1 2 SUP -M SAL 2 15 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 -M SAL 2 4 44 45 46 47 -M SMT 2 P|Ph{3} -M STY 1 3 SUP -M SAL 3 4 48 49 50 51 -M SMT 3 C|F{3} -M STY 1 4 SUP -M SAL 4 4 52 53 54 55 -M SMT 4 C|F{3} -M END \ No newline at end of file diff --git a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_carbonyl.ds_0.mol b/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_carbonyl.ds_0.mol deleted file mode 100644 index 2d2ca465..00000000 --- a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_carbonyl.ds_0.mol +++ /dev/null @@ -1,41 +0,0 @@ - -Generated by WebMolKit - - 11 10 0 0 1 0 0 0 0 0999 V2000 - 0.0000 0.0000 0.0000 Fe 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 1.5000 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - 0.0000 3.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 -1.5000 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - 0.0000 -3.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2991 -0.7500 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - 2.5981 -1.5000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2990 0.7500 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - 2.5980 1.5001 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - -1.5000 0.0000 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - -3.0000 0.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 1 2 0 0 0 0 0 - 2 3 2 0 0 0 0 - 1 4 0 0 0 0 0 - 4 5 2 0 0 0 0 - 1 6 0 0 0 0 0 - 6 7 2 0 0 0 0 - 1 8 0 0 0 0 0 - 8 9 2 0 0 0 0 - 1 10 0 0 0 0 0 - 10 11 2 0 0 0 0 -M STY 1 1 SUP -M SAL 1 2 2 3 -M SMT 1 C|O -M STY 1 2 SUP -M SAL 2 2 4 5 -M SMT 2 C|O -M STY 1 3 SUP -M SAL 3 2 6 7 -M SMT 3 C|O -M STY 1 4 SUP -M SAL 4 2 8 9 -M SMT 4 C|O -M STY 1 5 SUP -M SAL 5 2 10 11 -M SMT 5 C|O -M END \ No newline at end of file diff --git a/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt b/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt index 8654f50e..1f89d99a 100644 --- a/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt +++ b/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt @@ -51,7 +51,7 @@ if(MATH_LIBRARY) target_link_libraries(mol2inchi PUBLIC ${MATH_LIBRARY}) endif() -target_compile_definitions(mol2inchi PRIVATE +target_compile_definitions(mol2inchi PRIVATE BUILD_LINK_AS_DLL TARGET_EXE_USING_API ) @@ -70,7 +70,7 @@ else() set(CMAKE_THREAD_PREFER_PTHREAD TRUE) set(THREADS_PREFER_PTHREAD_FLAG TRUE) find_package(Threads REQUIRED) - target_link_libraries(mol2inchi Threads::Threads) + target_link_libraries(mol2inchi PRIVATE Threads::Threads) add_custom_command(TARGET mol2inchi POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ $ COMMAND_EXPAND_LISTS diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/dispstru.c b/INCHI-1-SRC/INCHI_BASE/src/dispstru.c similarity index 98% rename from INCHI-1-SRC/INCHI_EXE/inchi-1/src/dispstru.c rename to INCHI-1-SRC/INCHI_BASE/src/dispstru.c index c70ce860..f5bff79f 100644 --- a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/dispstru.c +++ b/INCHI-1-SRC/INCHI_BASE/src/dispstru.c @@ -40,7 +40,7 @@ /* Draw input atom -- Win32 specific */ -#include "../../../INCHI_BASE/src/mode.h" +#include "mode.h" #ifndef COMPILE_ANSI_ONLY @@ -347,13 +347,13 @@ BOOL TextOutVert( HDC pDC, /* handle to DC */ GetTextMetrics( pDC, &TextMetric ); dy = TextMetric.tmHeight; - + for (i = 0, ret = 1; ret && i < cbString; nYStart += dy, i++) { char_width = GetOneCharInStringWidth( pDC, lpString + i ); ret = TextOut( pDC, nXStart + ( cell_width - char_width ) / 2, nYStart, lpString + i, 1 ); } - + return ret; } @@ -366,8 +366,8 @@ BOOL TextOutHoriz( HDC pDC, /* handle to DC */ int cbString, /* number of characters */ int cell_width ) { - int dX = ( cell_width && cbString == 1 ) - ? ( cell_width - GetOneCharInStringWidth( pDC, lpString ) ) / 2 + int dX = ( cell_width && cbString == 1 ) + ? ( cell_width - GetOneCharInStringWidth( pDC, lpString ) ) / 2 : 0; return TextOut( pDC, nXStart + dX, nYStart, lpString, cbString ); @@ -663,7 +663,7 @@ int DrawBond( HDC pDC, { DrawBondParity( pDC, x1, y1, x2, y2, b_parity ); } - + if (xCRU) { DrawBondCrossingCRU(pDC, x1, y1, x2, y2); @@ -726,7 +726,7 @@ void DrawPenColorFilledPolygon( HDC pDC, const POINT *pnt, int num ) ret = GetObject( penOld, sizeof( LogPen ), &LogPen ); SelectObject( pDC, penOld ); - + /* do not need to delete stock object penNew */ if (ret) { @@ -829,7 +829,7 @@ int DrawBondStereo( HDC pDC, POINT pnt[4]; - + if (b_highlight) { hHighlightPen = CreatePen( PS_SOLID, nPenWidth, clrHighlight ); @@ -1012,27 +1012,27 @@ int DrawBondParity( HDC pDC, parity_mark = parity_mark0; } - if (parity_mark == BOND_MARK_ODD) + if (parity_mark == BOND_MARK_ODD) { - p = "(-)"; + p = "(-)"; } - else if (parity_mark == BOND_MARK_EVEN) + else if (parity_mark == BOND_MARK_EVEN) { p = "(+)"; /*" |"; */ } - else if (parity_mark == BOND_MARK_UNDF) + else if (parity_mark == BOND_MARK_UNDF) { - p = "(?)"; + p = "(?)"; } - else if (parity_mark == BOND_MARK_UNKN) + else if (parity_mark == BOND_MARK_UNKN) { - p = "(u)"; + p = "(u)"; } - else if (parity_mark == BOND_MARK_ERR) + else if (parity_mark == BOND_MARK_ERR) { - p = "(!)"; + p = "(!)"; } - else + else { return 0; } @@ -1084,7 +1084,7 @@ int DrawBondCrossingCRU(HDC pDC, int x1, int y1, int x2, int y2) char *p; p = " //"; /*"(+)"; */ - + if (abs(x2 - x1) > 10 * abs(y2 - y1)) { /* almost horizontal bond; draw parity closer (1:2) to the right end */ @@ -1137,7 +1137,7 @@ int DrawBondNoStereo( HDC pDC, COLORREF clr = clrPen; switch (b_type) - { + { /* c=center, l=left, r=right */ case 0: c = 'D'; @@ -1240,8 +1240,8 @@ int DrawBondNoStereo( HDC pDC, DrawLine( pDC, x1, y1, x2, y2 ); hLongDashedPen = (HPEN) SelectObject( pDC, hSolidPen ); } - - + + /* draw lines parallel to line between bonds */ if (l || r) @@ -1252,14 +1252,14 @@ int DrawBondNoStereo( HDC pDC, bond_sep = hfont / 12.0; if (( x1 == x2 ) || ( y1 == y2 )) { - if (bond_sep < 1.0) + if (bond_sep < 1.0) { bond_sep = 1.0; } } else { - if (bond_sep < 2.0) + if (bond_sep < 2.0) { bond_sep = 2.0; } @@ -1270,14 +1270,14 @@ int DrawBondNoStereo( HDC pDC, bond_sep = hfont / 6.0; if (( x1 == x2 ) || ( y1 == y2 )) { - if (bond_sep < 2.0) + if (bond_sep < 2.0) { bond_sep = 2.0; } } else { - if (bond_sep < 4.0) + if (bond_sep < 4.0) { bond_sep = 4.0; } @@ -1397,9 +1397,9 @@ int MyTextOutABC( const char *p, int iFst, int iLst, HDC pDC ) { return 0; } - + GetCurrentPositionEx( pDC, &pt ); - + if (GetCharABCWidths( pDC, /* handle to DC */ (int) p[iFst], /* first character in range */ (int) p[iFst], /* last character in range */ @@ -1411,7 +1411,7 @@ int MyTextOutABC( const char *p, int iFst, int iLst, HDC pDC ) } TextOut( pDC, pt.x, pt.y, p + iFst, iLst - iFst + 1 ); - + if (GetCharABCWidths( pDC, /* handle to DC */ (int) p[iLst], /* first character in range */ (int) p[iLst], /* last character in range */ @@ -1422,7 +1422,7 @@ int MyTextOutABC( const char *p, int iFst, int iLst, HDC pDC ) pt.x -= abc.abcC; MoveToEx( pDC, pt.x, pt.y, NULL ); } - + return 1; } @@ -1438,15 +1438,15 @@ int DrawColorString( HDC pDC,const char *st, int xs, int ys, int bHighlightTheAt COLORREF NewBkColor=0; int bWritingAtomStringColored = 0; - /* - Draw the string character by character. - For each character within the first part of the string - make a decision if it is a subscript or a superscript - The first part ends with '/'=start of the canonical number or '(' = start of the parity mark - The superscript first character is ^ or + or - or . (. initiates double shift) - The the superscript ends with not the first character and not a digit or the end of the first part - The first character of a subscript (if it is not in the superscript) is a digit - The subscript ends a non-digit + /* + Draw the string character by character. + For each character within the first part of the string + make a decision if it is a subscript or a superscript + The first part ends with '/'=start of the canonical number or '(' = start of the parity mark + The superscript first character is ^ or + or - or . (. initiates double shift) + The the superscript ends with not the first character and not a digit or the end of the first part + The first character of a subscript (if it is not in the superscript) is a digit + The subscript ends a non-digit */ const char *p = st; UINT uPrevTextAlign = SetTextAlign( pDC, TA_UPDATECP ); @@ -1672,11 +1672,11 @@ int DrawColorString( HDC pDC,const char *st, int xs, int ys, int bHighlightTheAt /****************************************************************************/ -int DrawPreparedString( HDC pDC, - char *st1, - int shift, - int x, - int y, +int DrawPreparedString( HDC pDC, + char *st1, + int shift, + int x, + int y, int bHighlightTheAtom ) { DrawColorString( pDC, st1, x + shift, y - GetFontAscent( pDC ) / 2, bHighlightTheAtom ); @@ -1705,7 +1705,7 @@ int DrawString( HDC pDC, char *st1, int shift, int x, int y ) ys = y - afont / 2; /* Single element */ - if (strlen( st ) == 1) + if (strlen( st ) == 1) { goto draw; } @@ -1719,7 +1719,7 @@ int DrawString( HDC pDC, char *st1, int shift, int x, int y ) start = MoveHydrogenAtomToTheLeft(st, start, 'D'); start = MoveHydrogenAtomToTheLeft(st, start, 'H'); /* determine the position */ - if (( strlen( st ) == 2 ) && islower( st[1] )) + if (( strlen( st ) == 2 ) && islower( st[1] )) { goto draw; } @@ -1918,7 +1918,7 @@ void CalcTblParms( HDC hMemoryDC, tp->tblRows = inchi_max( tp->tblRows, n ); } if (tdp->nOrientation) - { + { /* here are tp->tblCols columns and tp->tblRows rows. */ tp->tblHeight = tp->thdrHeight + ( 2 * tp->tblRows + 2 )*tp->tcellHeight; /* empty lines above the header and around each cell */ tp->thdrWidth = tp->tcellWidth = inchi_max( tp->tcellWidth, tp->thdrWidth ); @@ -1930,7 +1930,7 @@ void CalcTblParms( HDC hMemoryDC, tp->ytblOffs = yoffs1; } else - { + { /* Do not believe your eyes: here are tp->tblCols rows and tp->tblRows columns. */ tp->thdrHeight = tp->tcellHeight = inchi_max( tp->thdrHeight, tp->tcellHeight ); tp->tblWidth = tp->thdrWidth + ( 2 * tp->tblRows + 2 )*tp->tcellWidth; @@ -1956,7 +1956,7 @@ int DrawTheTable( HDC hDC, int dx = tp->tcellWidth / 2; int dy = tp->tcellHeight / 2; int x1, y1, x2, y2; - + /* draw frame around the table */ ret = Rectangle( hDC, tp->xtblOffs + dx + x_offs, tp->ytblOffs + dy + y_offs, tp->xtblOffs + tp->tblWidth - dx + x_offs, tp->ytblOffs + tp->tblHeight - dy + y_offs ); /* djb-rwth: removing redundant variable *//* djb-rwth: ignoring LLVM warning: variable used to store function return value */ @@ -1979,7 +1979,7 @@ int DrawTheTable( HDC hDC, } DrawLine( hDC, x1 + x_offs, y1 + y_offs, x2 + x_offs, y2 + y_offs ); } - + /* draw lines between requested/Shown/Found types */ for (i = 0; i < tp->tblRows; i++) { @@ -2604,7 +2604,7 @@ int CreateInputStructPicture( HDC hDC, /* Calculate requested/Shown/Found table sizes */ /***********************************************/ memset(&tp, 0, sizeof(tp)); /* djb-rwth: memset_s C11/Annex K variant? */ - + #ifdef TARGET_LIB_FOR_WINCHI bDrawTbl = 0; #else @@ -2760,15 +2760,15 @@ int CreateInputStructPicture( HDC hDC, { strcat(str, ":"); } - if (bTaut) + if (bTaut) { strcat(str, " Mobile H"); } - if (bIso) + if (bIso) { strcat(str, " Isotopic"); } - if (bSter) + if (bSter) { strcat(str, " Stereo"); } @@ -2776,7 +2776,7 @@ int CreateInputStructPicture( HDC hDC, } if (pWinData->inf_at_data.szRemovedProtons[0]) { - if (str[0]) + if (str[0]) strcat( str, "; " ); /* djb-rwth: function replaced with its safe C11 variant */ strcat(str, pWinData->inf_at_data.szRemovedProtons); } @@ -3297,7 +3297,7 @@ int DisplayInputStructure( char *szOutputString, UnregisterClass( szWindowClassName, /* address of class name string */ hInstance /* handle of application instance */ ); - + /* Save window size and position */ if (WinData.rc.bottom > WinData.rc.top && WinData.rc.right > WinData.rc.left) { @@ -3306,12 +3306,12 @@ int DisplayInputStructure( char *szOutputString, dp->pdp->rcPict[2] = WinData.rc.right - WinData.rc.left; dp->pdp->rcPict[3] = WinData.rc.bottom - WinData.rc.top; } - + if (WinData.bEsc) { dp->rdp.bEsc = 1; } - + return WinData.bEsc ? 27 : 1; } #endif diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/dispstru.h b/INCHI-1-SRC/INCHI_BASE/src/dispstru.h similarity index 100% rename from INCHI-1-SRC/INCHI_EXE/inchi-1/src/dispstru.h rename to INCHI-1-SRC/INCHI_BASE/src/dispstru.h diff --git a/INCHI-1-SRC/INCHI_BASE/src/ichimain.c b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c new file mode 100644 index 00000000..a575437b --- /dev/null +++ b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c @@ -0,0 +1,1529 @@ +/* + * International Chemical Identifier (InChI) + * Version 1 + * Software version 1.07 + * April 30, 2024 + * + * MIT License + * + * Copyright (c) 2024 IUPAC and InChI Trust + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +* +* The InChI library and programs are free software developed under the + * auspices of the International Union of Pure and Applied Chemistry (IUPAC). + * Originally developed at NIST. + * Modifications and additions by IUPAC and the InChI Trust. + * Some portions of code were developed/changed by external contributors + * (either contractor or volunteer) which are listed in the file + * 'External-contributors' included in this distribution. + * + * info@inchi-trust.org + * +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef COMPILE_ANSI_ONLY +// #include +#ifndef TARGET_LIB_FOR_WINCHI +// #include +#endif +#endif + +#include "mode.h" + +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) +#include +#include +#endif + + +#ifdef _WIN32 +#include +#endif +#include "ichitime.h" +#include "incomdef.h" +#include "ichidrp.h" +#include "inpdef.h" +#include "ichi.h" +#include "strutil.h" +#include "util.h" +#include "ichierr.h" +#include "ichimain.h" +#include "ichicomp.h" +#include "ichi_io.h" +#ifdef TARGET_EXE_STANDALONE +#include "inchi_api.h" +#endif + +#include "bcf_s.h" +#include "permutation_util.h" + + /* Console-specific */ + + + +#ifndef TARGET_LIB_FOR_WINCHI +/* COVERS THE CODE FROM HERE TO THE END OF FILE */ + + +/* Enable/disable internal tests */ + +/* Uncomment for INCHI_LIB testing only */ +/*#define TEST_FPTRS*/ + +/* Windows-console-mode specific */ + +// int bInterrupted = 0; + + +/****************************************************************************/ +int ProcessMultipleInputFiles(int argc, char* argv[]) +{ + int i, ret = 0, nfn_ins = 0, + AMIOutStd = 0, AMILogStd = 0, AMIPrbNone = 0; + char* fn_out, * fn_log, * fn_prb; + char pNUL[] = "NUL"; + char** fn_ins = NULL, ** targv = NULL; + int ret_val; /* djb-rwth: adding return value */ /* djb-rwth: ignoring LLVM warning */ + +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) +#ifdef _WIN64 + typedef __int64 intptr_t; /* x64 */ +#else + typedef long int intptr_t; /* VC 6.0 has no intptr_t and no x64 */ +#endif + struct _finddata_t file_info; + intptr_t hFile = -1; + int retFile, lenPath; + char* pName, * pOutPath = NULL; /* djb-rwth: ignoring LLVM warning */ + char pathname[_MAX_PATH]; + char szBlank[] = ""; /* djb-rwth: ignoring LLVM warning */ + int numFiles = 0; /* counts processed files */ +#else + int p; +#endif + + fn_ins = (char**)inchi_calloc(argc, sizeof(char*)); + if (!fn_ins) + { + fprintf(stderr, "Not enough memory.\n"); + goto exit_ami; + } + + /* Check for other options and collect inputs. */ + for (i = 1; i < argc; i++) + { + if (argv[i][0] == INCHI_OPTION_PREFX) + { + if (!inchi_stricmp(argv[i] + 1, "STDIO")) + { + fprintf(stderr, "Options AMI and STDIO are not compatible.\n"); + goto exit_ami; + } + else if (!inchi_stricmp(argv[i] + 1, "AMIOutStd")) + { + AMIOutStd = 1; + } + else if (!inchi_stricmp(argv[i] + 1, "AMILogStd")) + { + AMILogStd = 1; + } + else if (!inchi_stricmp(argv[i] + 1, "AMIPrbNone")) + { + AMIPrbNone = 1; + } +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) + else if (!inchi_memicmp(argv[i] + 1, "OP:", 3)) + { + pOutPath = argv[i] + 4; /* output path */ + } +#endif + } + else + { + fn_ins[nfn_ins] = argv[i]; + nfn_ins++; + } + } + + if (!nfn_ins) + { + fprintf(stderr, "At least one input file is expected in AMI mode.\n"); + goto exit_ami; + } + + targv = (char**)inchi_calloc((long long)argc + 3, sizeof(char*)); /* djb-rwth: cast operator added */ + + if (!targv) + { + fprintf(stderr, "Not enough memory.\n"); + goto exit_ami; + } + +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) + if ((pName = strrchr(fn_ins[0], INCHI_PATH_DELIM))) /* djb-rwth: addressing LLVM warning */ + { + pName++; + lenPath = pName - fn_ins[0]; + } + else + { + pName = fn_ins[0]; + lenPath = 0; + } + for (hFile = _findfirst(fn_ins[0], &file_info), retFile = 0; + !retFile && -1 != hFile; + retFile = _findnext(hFile, &file_info), numFiles++) +#else + for (p = 0; p < nfn_ins; p++) +#endif + { + int targc; +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) + const char* fn_in; + int inlen = lenPath + strlen(file_info.name); + if (!file_info.size || (file_info.attrib & _A_SUBDIR) || inlen >= _MAX_PATH) + { + continue; + } + memcpy(pathname, fn_ins[0], lenPath); + strcpy(pathname + lenPath, file_info.name); + fn_in = pathname; + if (0 == numFiles % 5000) + { + ret_val = _heapmin(); /* reduce heap fragmentation */ /* djb-rwth: return value variable added */ + } +#else + const char* fn_in = fn_ins[p]; + int inlen = strlen(fn_in); +#endif + fn_out = fn_log = fn_prb = NULL; + + targv[0] = argv[0]; + targv[1] = (char*)fn_in; + targc = 1; + + if (AMIOutStd) + { + targv[++targc] = pNUL; + } +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) + else if (pOutPath) + { + targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ + } +#endif + else + { + /* make output name as input name plus ext. */ + fn_out = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ + if (fn_out) + { + strcpy(fn_out, fn_in); + strcat(fn_out, ".txt"); + } + targv[++targc] = fn_out; + } + + if (AMILogStd) + { + targv[++targc] = pNUL; + } +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) + else if (pOutPath) + { + targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ + } +#endif + else + { + /* Make log name as input name plus ext. */ + fn_log = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ + if (fn_log) + { + strcpy(fn_log, fn_in); + strcat(fn_log, ".log"); + } + targv[++targc] = fn_log; + } + if (AMIPrbNone) + { + targv[++targc] = pNUL; + } +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) + else if (pOutPath) + { + targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ + } +#endif + else + { + /* Make problem file name as input file name plus ext. */ + fn_prb = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ + if (fn_prb) + { + strcpy(fn_prb, fn_in); + strcat(fn_prb, ".prb"); + } + targv[++targc] = fn_prb; + } + + for (i = 1; i < argc; i++) + { + if (argv[i][0] == INCHI_OPTION_PREFX) + { + /* avoid strnicmp/strncasecmp */ + if ((strlen(argv[i]) > 3) && + (toupper(argv[i][1]) == 'A') && (toupper(argv[i][2]) == 'M') && (toupper(argv[i][3]) == 'I')) + { + continue; + } + targv[++targc] = argv[i]; + } + } + /* djb-rwth: fixing undefined index value / buffer overflow */ + ++targc; + if (targc < argc + 3) + { + targv[targc] = NULL; + } + + ret = ProcessSingleInputFile(targc, targv); /* ProcessSingleInputFile() is a former main() */ + + if (fn_out) + { + inchi_free(fn_out); + } + if (fn_log) + { + inchi_free(fn_log); + } + if (fn_prb) + { + inchi_free(fn_prb); + } + +#if ( defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) + if (ret == CTRL_STOP_EVENT) + { + goto exit_ami; + } +#endif + } + + +exit_ami: +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) + if (hFile != -1) + { + _findclose(hFile); + } +#endif + if (targv) + { + inchi_free(targv); + } + if (fn_ins) + { + inchi_free(fn_ins); + } + + return 0; +} + + + +/****************************************************************************/ +int ProcessSingleInputFile(int argc, char* argv[]) +{ + /**************************************/ +#endif /* #if ( BUILD_WITH_AMI == 1 ) */ +/**************************************/ + +/**** IF NOT IN AMI MODE, main() STARTS HERE ****/ + + int bReleaseVersion = bRELEASE_VERSION; + const int nStrLen = INCHI_SEGM_BUFLEN; + int nRet = 0; + int i; + long num_err, num_output, num_inp; + /* long rcPict[4] = {0,0,0,0}; */ + unsigned long ulDisplTime = 0; /* infinite, milliseconds */ + unsigned long ulTotalProcessingTime = 0; + + CANON_GLOBALS CG; + INCHI_CLOCK ic; + + char szTitle[MAX_SDF_HEADER + MAX_SDF_VALUE + 256]; + char szSdfDataValue[MAX_SDF_VALUE + 1]; + + INPUT_PARMS inp_parms; + INPUT_PARMS* ip = &inp_parms; + + STRUCT_DATA struct_data; + STRUCT_DATA* sd = &struct_data; + + ORIG_ATOM_DATA OrigAtData; /* 0=> disconnected, 1=> original */ + ORIG_ATOM_DATA* orig_inp_data = &OrigAtData; + ORIG_ATOM_DATA PrepAtData[2]; /* 0=> disconnected, 1=> original */ + ORIG_ATOM_DATA* prep_inp_data = PrepAtData; + + PINChI2* pINChI[INCHI_NUM]; + PINChI_Aux2* pINChI_Aux[INCHI_NUM]; + + char* pLF, * pTAB; + INCHI_IOS_STRING temp_string_container; + INCHI_IOS_STRING* strbuf = &temp_string_container; + INCHI_IOSTREAM outputstr, logstr, prbstr, instr; + INCHI_IOSTREAM* pout = &outputstr, * plog = &logstr, * pprb = &prbstr, * inp_file = &instr; + +#ifdef TARGET_EXE_STANDALONE + int inchi_ios_type = INCHI_IOS_TYPE_STRING; +#else + int inchi_ios_type = INCHI_IOS_TYPE_FILE; +#endif +#if ( READ_INCHI_STRING == 1 ) + const int may_get_inchi_string_input = 1; +#else + const int may_get_inchi_string_input = 0; +#endif + int bInChI2Structure = 0; + int output_error_inchi = 0; + + + /* internal tests --- */ +#ifndef TEST_FPTRS + STRUCT_FPTRS* pStructPtrs = NULL; +#else + STRUCT_FPTRS struct_fptrs, * pStructPtrs = &struct_fptrs; /* INCHI_LIB debug only */ +#endif + +#if ( defined(_WIN32) && defined(_MSC_VER) ) +#if WINVER >= 0x0501 /* XP or newer */ /* 0x0600 Vista or newer */ + DWORD tick_inchi_start, tick_inchi_stop; + tick_inchi_start = GetTickCount64(); /* djb-rwth: GetTickCount64() should be used */ +#endif +#endif + +#ifdef _WIN32 +#if ( TRACE_MEMORY_LEAKS == 1 ) + _CrtSetDbgFlag(_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF); + /* for execution outside the VC++ debugger uncomment one of the following two */ + /*#define MY_REPORT_FILE _CRTDBG_FILE_STDERR */ + /*#define MY_REPORT_FILE _CRTDBG_FILE_STDOUT */ +#ifdef MY_REPORT_FILE + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_WARN, MY_REPORT_FILE); + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ERROR, MY_REPORT_FILE); + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ASSERT, MY_REPORT_FILE); +#else + _CrtSetReportMode(_CRT_WARN | _CRT_ERROR, _CRTDBG_MODE_DEBUG); +#endif + /* turn on floating point exceptions */ + { + /* Get the default control word. */ + int cw = _controlfp(0, 0); + + /* Set the exception masks OFF, turn exceptions on. */ + /*cw &=~(EM_OVERFLOW|EM_UNDERFLOW|EM_INEXACT|EM_ZERODIVIDE|EM_DENORMAL);*/ + cw &= ~(EM_OVERFLOW | EM_UNDERFLOW | EM_ZERODIVIDE | EM_DENORMAL); + + /* Set the control word. */ + _controlfp(cw, MCW_EM); +} +#endif +#endif + + sd->bUserQuit = 0; + /* djb-rwth: fixing coverity CID #499552 */ + sd->num_components[0] = 0; + sd->num_components[1] = 0; +#if ( defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) + if (SetConsoleCtrlHandler(MyHandlerRoutine, 1)) + { + ConsoleQuit = WasInterrupted; + } +#endif + + num_inp = 0; + num_err = 0; + num_output = 0; + + inchi_ios_init(inp_file, INCHI_IOS_TYPE_FILE, NULL); + inchi_ios_init(pout, inchi_ios_type, NULL); + inchi_ios_init(plog, inchi_ios_type, stdout); + inchi_ios_init(pprb, inchi_ios_type, NULL); + memset(strbuf, 0, sizeof(*strbuf)); /* djb-rwth: memset_s C11/Annex K variant?; dereferencing strbuf */ + + if (argc == 1 || (argc == 2 && (argv[1][0] == INCHI_OPTION_PREFX) && + ((!strcmp(argv[1] + 1, "?") || !inchi_stricmp(argv[1] + 1, "help"))))) /* djb-rwth: addressing LLVM warning */ + { + HelpCommandLineParms(plog); + inchi_ios_flush(plog); + return 0; + } + + /* djb-rwth: printing out InChI version */ + if (argc == 2 && ((argv[1][0] == INCHI_OPTION_PREFX)) && (!strcmp(argv[1] + 1, "v") || !strcmp(argv[1] + 1, "V"))) + { + printf("%s\n", APP_DESCRIPTION); + return 0; + } + + /* djb-rwth: disallowing endless execution if no file(s) is given as the first argument */ + if (argc >= 2 && ((argv[1][0] == INCHI_OPTION_PREFX)) && (strcmp(argv[1] + 1, "v") || strcmp(argv[1] + 1, "V") || strcmp(argv[1] + 1, "?") || inchi_stricmp(argv[1] + 1, "help"))) + { + HelpCommandLineParms(plog); + inchi_ios_flush(plog); + return 0; + } + + /* original input structure */ + memset(orig_inp_data, 0, sizeof(*orig_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ + memset(prep_inp_data, 0, 2 * sizeof(*prep_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ + memset(pINChI, 0, sizeof(pINChI)); /* djb-rwth: memset_s C11/Annex K variant? */ + memset(pINChI_Aux, 0, sizeof(pINChI_Aux)); /* djb-rwth: memset_s C11/Annex K variant? */ + memset(szSdfDataValue, 0, sizeof(szSdfDataValue)); /* djb-rwth: memset_s C11/Annex K variant? */ + + memset(&CG, 0, sizeof(CG)); /* djb-rwth: memset_s C11/Annex K variant? */ + memset(&ic, 0, sizeof(ic)); /* djb-rwth: memset_s C11/Annex K variant? */ + + plog->f = stderr; + + if (0 > ReadCommandLineParms(argc, (const char**)argv, ip, + szSdfDataValue, &ulDisplTime, + bReleaseVersion, plog)) + { + goto exit_function; + } + + if (!OpenFiles(&(inp_file->f), &(pout->f), &(plog->f), &(pprb->f), ip)) + { + goto exit_function; + } + + + if (ip->bNoStructLabels) + { + ip->pSdfLabel = NULL; + ip->pSdfValue = NULL; + } + else if (ip->nInputType == INPUT_INCHI_PLAIN || + ip->nInputType == INPUT_INCHI) + { + /* the input may contain both the header and the label of the structure */ + if (!ip->pSdfLabel) + { + ip->pSdfLabel = ip->szSdfDataHeader; + } + if (!ip->pSdfValue) + { + ip->pSdfValue = szSdfDataValue; + } + } + + set_line_separators(ip->bINChIOutputOptions, &pLF, &pTAB); + + save_command_line(argc, argv, plog); + + PrintInputParms(plog, ip); + + inchi_ios_flush2(plog, stderr); + + if (0 >= inchi_strbuf_init(strbuf, INCHI_STRBUF_INITIAL_SIZE, INCHI_STRBUF_SIZE_INCREMENT)) + { + inchi_ios_eprint(plog, "Cannot allocate internal string buffer. Terminating\n"); + inchi_ios_flush2(plog, stderr); + goto exit_function; + } + + + /* Process InChI string as input; output may be */ + /* a) InChI string or b) structure */ + /*#if ( READ_INCHI_STRING == 1 )*/ + if (may_get_inchi_string_input && ip->nInputType == INPUT_INCHI) + { + bInChI2Structure = 0 != (ip->bReadInChIOptions & READ_INCHI_TO_STRUCTURE); + memset(sd, 0, sizeof(*sd)); /* djb-rwth: memset_s C11/Annex K variant? */ + if (bInChI2Structure) + { + /* loop through file lines here */ + INCHI_IOSTREAM tmpinpustream; + INCHI_IOS_STRING* pTmpIn = &tmpinpustream.s; + int crlf2lf = 0, preserve_lf = 1, read_result = 0; + inchi_ios_init(&tmpinpustream, INCHI_IOS_TYPE_STRING, NULL); + while (1) + { + char* p, * pi; + + read_result = inchi_strbuf_getline(pTmpIn, inp_file->f, crlf2lf, preserve_lf); + + if (read_result == -1) +#if (FIX_ONE_LINE_INCHI_INPUT_CONVERSION_ISSUE==1) + { + if (!pTmpIn->pStr) + { + break; + } + if (strlen(pTmpIn->pStr) < 8) /* 7 = strlen("InChI=1") */ + { + break; + } + } +#else + break; /* EOF or read error */ +#endif + + p = pTmpIn->pStr; + if (!p) + { + continue; + } + pi = strstr(p, "InChI=1"); + if (pi != p) + { + continue; + } + + num_inp++; + ip->lMolfileNumber = num_inp; + + ReadWriteInChI(&ic, &CG, &tmpinpustream, pout, plog, ip, sd, NULL, 0, 0, NULL, NULL, NULL, 0, NULL); + + /*fprintf( stderr, "%ld", num_inp );*/ + inchi_strbuf_reset(pTmpIn); + inchi_ios_flush2(plog, stderr); + } + fprintf(stderr, "\r"); + inchi_strbuf_close(pTmpIn); + } + else + { + /* loop through file lines within ReadWriteInChI */ + ReadWriteInChI(&ic, &CG, inp_file, pout, plog, ip, sd, NULL, 0, 0, NULL, NULL, NULL, 0, NULL); + + num_inp = sd->fPtrStart; + num_err = sd->fPtrEnd; + } + + inchi_ios_flush2(plog, stderr); + ulTotalProcessingTime = sd->ulStructTime; + /*num_inp = sd->fPtrStart; + num_err = sd->fPtrEnd; + */ + goto exit_function; + } + + + ulTotalProcessingTime = 0; + if (pStructPtrs) + { + memset(pStructPtrs, 0, sizeof(pStructPtrs[0])); /* djb-rwth: memset_s C11/Annex K variant? */ + } + output_error_inchi = ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR; + + + /*************************************************************/ + /* Main cycle : read input structures and create their INChI */ + /*************************************************************/ + + + while (!sd->bUserQuit ) //&& !bInterrupted + { + int do_renumbering = 0; + int next_action; + int have_err_in_GetOneStructure = 0; + int dup_fail = 0; + ORIG_ATOM_DATA SavedOrigAtData; /* 0=> disconnected, 1=> original */ + ORIG_ATOM_DATA* saved_orig_inp_data = &SavedOrigAtData; + char ikey0[28]; + ikey0[0] = '\0'; + + + next_action = GetTheNextRecordOfInputFile(&ic, sd, ip, szTitle, + inp_file, plog, pout, pprb, + orig_inp_data, &num_inp, pStructPtrs, + &nRet, &have_err_in_GetOneStructure, + &num_err, output_error_inchi); + if (next_action == DO_EXIT_FUNCTION) + { + goto exit_function; + } + else if (next_action == DO_BREAK_MAIN_LOOP) + { + break; + } + else if (next_action == DO_CONTINUE_MAIN_LOOP) + { + if (nRet == _IS_ERROR) /* may also be _IS_SKIP ... */ + { + if (output_error_inchi) + { + Output_RecordInfo(pout, num_inp, ip->bNoStructLabels, ip->pSdfLabel, ip->pSdfValue, ip->lSdfId, + pLF, pTAB); + emit_empty_inchi(ip, num_inp, pLF, pTAB, pout); + } + } + continue; + } + + + /* Create INChI for each connected component of the structure; + optionally display them; + output INChI for the whole structure */ + +#if (RENUMBER_ATOMS_AND_RECALC_V106 == 1 ) + if (ip->bRenumber == 1) + { + do_renumbering = 1; + } +#endif + if (do_renumbering == 0) + { + /* Normal calculations */ + next_action = CalcAndPrintINCHIAndINCHIKEY(&ic, &CG, sd, ip, szTitle, + pINChI, pINChI_Aux, + inp_file, plog, pout, pprb, + orig_inp_data, prep_inp_data, &num_inp, pStructPtrs, + &nRet, have_err_in_GetOneStructure, + &num_err, output_error_inchi, + strbuf, &ulTotalProcessingTime, + pLF, pTAB, ikey0, + 0 /* not silent */); + + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + FreeOrigAtData(orig_inp_data); + FreeOrigAtData(prep_inp_data); + FreeOrigAtData(prep_inp_data + 1); + } + else + { + /* Internal test mode: renumber atoms and recalculate repeatedly */ + long int nrepeat = 1; + /* 2! = 2 3! = 6 4! = 24 5! = 120 6! = 520 7! = 5040 8! = 40320 */ + if (orig_inp_data->num_inp_atoms == 1) + { + nrepeat = 1; + } + else if (orig_inp_data->num_inp_atoms == 2) + { + nrepeat = 2; + } + else if (orig_inp_data->num_inp_atoms == 3) + { + nrepeat = 6; + } + else + { + nrepeat = 1000; /* 100000;*/ /*16;*/ + } + /* correct (decrease repeat number) for relatively large molecules */ + if (orig_inp_data->num_inp_atoms > 128) + { + nrepeat = 100; /* 100000;*/ /*16;*/ + } + if (orig_inp_data->num_inp_atoms > 256) + { + nrepeat = 50; /* 100000;*/ /*16;*/ + } + if (orig_inp_data->num_inp_atoms > 512) + { + nrepeat = 25; /* 100000;*/ /*16;*/ + } + if (orig_inp_data->num_inp_atoms > 1024) + { + nrepeat = 10; /* 100000;*/ /*16;*/ + } + + /*inchi_ios_eprint(plog, "Number of random atom renumberings up to: %-ld\n", nrepeat); + inchi_ios_flush2(plog, stderr);*/ + +#if 0 + else if (orig_inp_data->num_inp_atoms == 4) + { + nrepeat = 24; + } + else + { + nrepeat = 10; + } + + else if (orig_inp_data->num_inp_atoms == 4) + { + nrepeat = 24; + } + else if (orig_inp_data->num_inp_atoms == 5) + { + nrepeat = 120; + } + else if (orig_inp_data->num_inp_atoms == 6) + { + nrepeat = 520; + } + else if (orig_inp_data->num_inp_atoms == 7) + { + nrepeat = 1000; + } + else + { + nrepeat = 10000; + } +#endif + + next_action = RepeatedlyRenumberAtomsAndRecalcINCHI(&ic, &CG, sd, ip, szTitle, + pINChI, pINChI_Aux, + inp_file, plog, pout, pprb, + orig_inp_data, prep_inp_data, &num_inp, pStructPtrs, + &nRet, have_err_in_GetOneStructure, + &num_err, output_error_inchi, + strbuf, &ulTotalProcessingTime, + pLF, pTAB, nrepeat); + } /* if (ip->bRenumber == 1) */ + + if (next_action == DO_EXIT_FUNCTION) + { + goto exit_function; + } + else if (next_action == DO_BREAK_MAIN_LOOP) + { + break; + } + else if (next_action == DO_CONTINUE_MAIN_LOOP) + { + continue; + } + } /* end of main cycle - while ( !sd->bUserQuit && !bInterrupted ) */ + + +exit_function: + /* Avoid memory leaks in case of fatal error */ + if (pStructPtrs && pStructPtrs->fptr) + { + inchi_free(pStructPtrs->fptr); + } + /* Free INChI memory */ + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + /* Free structure data */ + FreeOrigAtData(orig_inp_data); + FreeOrigAtData(prep_inp_data); + FreeOrigAtData(prep_inp_data + 1); + /* Close files */ + inchi_ios_close(inp_file); + inchi_ios_close(pout); + inchi_ios_close(pprb); + { + int hours, minutes, seconds, mseconds; + + SplitTime(ulTotalProcessingTime, &hours, &minutes, &seconds, &mseconds); + + inchi_ios_eprint(plog, "Finished processing %ld structure%s: %ld error%s, processing time %d:%02d:%02d.%02d\n", + num_inp, num_inp == 1 ? "" : "s", + num_err, num_err == 1 ? "" : "s", + hours, minutes, seconds, mseconds / 10); + inchi_ios_flush2(plog, stderr); + } +#if ( defined(_WIN32) && defined(_MSC_VER) ) +#if WINVER >= 0x0501 /* XP or newer */ /* 0x0600 Vista or newer */ + tick_inchi_stop = GetTickCount64(); /* djb-rwth: GetTickCount64() should be used */ + inchi_ios_eprint(plog, "\nElapsed walltime: %d msec.\n", tick_inchi_stop - tick_inchi_start); + inchi_ios_flush2(plog, stderr); +#endif +#endif + /* Final cleanup */ + inchi_ios_close(plog); + inchi_strbuf_close(strbuf); + for (i = 0; i < MAX_NUM_PATHS; i++) + { + if (ip->path[i]) + { + inchi_free((void*)ip->path[i]); /* cast deliberately discards 'const' qualifier */ + ip->path[i] = NULL; + } + } + SetBitFree(&CG); +#if ( ( BUILD_WITH_AMI==1 ) && defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) + if (bInterrupted) + { + return CTRL_STOP_EVENT; + } +#endif + + return 0; +} + + +/****************************************************************************/ +void save_command_line(int argc, char* argv[], INCHI_IOSTREAM* plog) +{ + int k; + + inchi_ios_eprint(plog, "The command line used:\n\""); + for (k = 0; k < argc - 1; k++) + { +#if( ALLOW_EMPTY_PATHS == 1 ) + inchi_ios_eprint(plog, "%-s ", argv[k][0] ? argv[k] : "\"\""); +#else + inchi_ios_eprint(plog, "%-s ", argv[k]); +#endif + } + + inchi_ios_eprint(plog, "%-s\"\n", argv[argc - 1]); + + return; +} + + +/*****************************************************************************/ +void emit_empty_inchi(INPUT_PARMS* ip, + long num_inp, + char* pLF, + char* pTAB, + INCHI_IOSTREAM* pout) +{ + if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) + { + inchi_ios_eprint(pout, "InChI=1S//\n"); /* emit empty Std InChI */ + } + else + { + inchi_ios_eprint(pout, "InChI=1//\n"); /* emit empty InChI */ + } + inchi_ios_flush(pout); +} + + + +/*****************************************************************************/ +int GetTheNextRecordOfInputFile(struct tagINCHI_CLOCK* ic, + STRUCT_DATA* sd, INPUT_PARMS* ip, + char* szTitle, + INCHI_IOSTREAM* inp_file, + INCHI_IOSTREAM* plog, + INCHI_IOSTREAM* pout, + INCHI_IOSTREAM* pprb, + ORIG_ATOM_DATA* orig_inp_data, + long* num_inp, + STRUCT_FPTRS* pStructPtrs, + int* nRet, + int* have_err_in_GetOneStructure, + long* num_err, + int output_error_inchi) +{ + if (ip->last_struct_number && *num_inp >= ip->last_struct_number) + { + *nRet = _IS_EOF; /* simulate end of file */ + return DO_EXIT_FUNCTION; + } + + + *nRet = GetOneStructure(ic, sd, ip, szTitle, inp_file, + plog, pout, pprb, orig_inp_data, + num_inp, pStructPtrs); + + inchi_ios_flush2(plog, stderr); + + if (pStructPtrs) + pStructPtrs->cur_fptr++; + + if (sd->bUserQuit) + { + { + return DO_BREAK_MAIN_LOOP; + } + } + + *have_err_in_GetOneStructure = 0; + switch (*nRet) + { + case _IS_FATAL: + (*num_err)++; + if (output_error_inchi == 0) + { + return DO_EXIT_FUNCTION; + } + else + sd->pStrErrStruct[0] = '\0'; /* depress re-appearance of error as warning in ProcessOneStr */ + break; + case _IS_EOF: + return DO_EXIT_FUNCTION; + case _IS_ERROR: + (*num_err)++; + *have_err_in_GetOneStructure = 1; + if (output_error_inchi == 0) + { + return DO_CONTINUE_MAIN_LOOP; + } + else + sd->pStrErrStruct[0] = '\0'; /* depress re-appearance of error as warning in ProcessOneStr */ + break; + case _IS_SKIP: + return DO_CONTINUE_MAIN_LOOP; + default: + sd->pStrErrStruct[0] = '\0'; + } + + return DO_NEXT_STEP; +} + + +/****************************************************************************/ +int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, + CANON_GLOBALS* CG, + STRUCT_DATA* sd, + INPUT_PARMS* ip, + char* szTitle, + PINChI2* pINChI[INCHI_NUM], + PINChI_Aux2* pINChI_Aux[INCHI_NUM], + INCHI_IOSTREAM* inp_file, + INCHI_IOSTREAM* plog, + INCHI_IOSTREAM* pout, + INCHI_IOSTREAM* pprb, + ORIG_ATOM_DATA* orig_inp_data, + ORIG_ATOM_DATA* prep_inp_data, + long* num_inp, + STRUCT_FPTRS* pStructPtrs, + int* nRet, + int have_err_in_GetOneStructure, + long* num_err, + int output_error_inchi, + INCHI_IOS_STRING* strbuf, + unsigned long* pulTotalProcessingTime, + char* pLF, + char* pTAB, + char* ikey, + int silent) +{ + int nRet1; + int next_act = DO_NEXT_STEP; + /* related to hash of InChI */ + char ik_string[256]; /*^^^ Resulting InChIKey string */ + int ik_ret = 0; /*^^^ InChIKey-calc result code */ + int xhash1, xhash2; + char szXtra1[65], szXtra2[65]; + /* related to printing structure header */ + int print_record_info = 0; + INCHI_IOSTREAM temp_out; + INCHI_IOSTREAM* pout0 = &temp_out; + inchi_ios_init(pout0, INCHI_IOS_TYPE_STRING, NULL); + + + /* Calculate InChI */ + + nRet1 = ProcessOneStructureEx(ic, + CG, + sd, + ip, + szTitle, + pINChI, + pINChI_Aux, + inp_file, + plog, + pout0, /* note this */ + pprb, + orig_inp_data, + prep_inp_data, + *num_inp, strbuf, + 0 /* save_opt_bits */); + + inchi_ios_flush2(plog, stderr); + + + /* Output InChI */ + + /* print header for structure if applicable (no error arose, or have a request for empty InChI at error) */ + print_record_info = ((nRet1 == _IS_OKAY) || + (nRet1 == _IS_WARNING) || + ((nRet1 == _IS_ERROR || nRet1 == _IS_FATAL) && output_error_inchi)); + if (print_record_info) + { + Output_RecordInfo(pout, *num_inp, ip->bNoStructLabels, + ip->pSdfLabel, ip->pSdfValue, ip->lSdfId, pLF, pTAB); + } + if (pout0->s.pStr) + { + /* post-process output to correctly treat 'tabbed with InChIKey' mode */ + if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) + { + if (ip->bCalcInChIHash != INCHIHASH_NONE) + { + if (pout0->s.pStr) + { + if (pout0->s.nUsedLength > 0) + { + if (pout0->s.pStr[pout0->s.nUsedLength - 1] == '\n') + { + pout0->s.pStr[pout0->s.nUsedLength - 1] = '\t'; + } + } + } + } + } + /* print InChI string (may be string for empty InChI) */ + if (!ip->bHideInChI) + { + inchi_ios_print(pout, "%-s", pout0->s.pStr); + } + } + /*inchi_ios_close(pout0);*/ /* free temporary out */ + + + *pulTotalProcessingTime += sd->ulStructTime; + + if (nRet1 == _IS_SKIP) + { + next_act = DO_CONTINUE_MAIN_LOOP; + goto exit_function; + } + + *nRet = inchi_max(*nRet, nRet1); + switch (*nRet) + { + case _IS_FATAL: + if (!have_err_in_GetOneStructure) + { + /* increment error counter only if error did not appear earlier */ + (*num_err)++; + } + if (!(ip->bINChIOutputOptions & INCHI_OUT_NO_AUX_INFO) && + (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT)) + { + inchi_ios_print(pout, "\t"); + } + if (ip->bCalcInChIHash != INCHIHASH_NONE) + { + if (ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR) + { + if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) + { + inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYSA-N"); + } + else + { + inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYNA-N"); + } + } + } + inchi_ios_flush(pout); + next_act = DO_EXIT_FUNCTION; + goto exit_function; + + case _IS_ERROR: + if (!have_err_in_GetOneStructure) + { + /* increment error counter only if error did not appear earlier */ + (*num_err)++; + } + if (!(ip->bINChIOutputOptions & INCHI_OUT_NO_AUX_INFO) && + (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT)) + { + inchi_ios_print(pout, "\t"); + } + if (ip->bCalcInChIHash != INCHIHASH_NONE) + { + if (ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR) + { + if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) + { + inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYSA-N"); + } + else + { + inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYNA-N"); + } + } + } + inchi_ios_flush(pout); + next_act = DO_CONTINUE_MAIN_LOOP; + goto exit_function; + + case _IS_SKIP: + next_act = DO_CONTINUE_MAIN_LOOP; + goto exit_function; + } + + + /* Calculate hash[es] of InChI */ + + if (ip->bCalcInChIHash != INCHIHASH_NONE) + { + char* buf = NULL; + size_t slen = pout0->s.nUsedLength; + + extract_inchi_substring(&buf, pout0->s.pStr, slen); + + if (NULL == buf) + { + ik_ret = INCHIKEY_INVALID_INCHI; + } + else + { + xhash1 = xhash2 = 0; + if ((ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1) || + (ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1_XTRA2)) + { + xhash1 = 1; + } + if ((ip->bCalcInChIHash == INCHIHASH_KEY_XTRA2) || + (ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1_XTRA2)) + { + xhash2 = 1; + } + ik_ret = GetINCHIKeyFromINCHI(buf, xhash1, xhash2, ik_string, szXtra1, szXtra2); + inchi_free(buf); + } + + + /* Print hash[es] */ + + if (ik_ret == INCHIKEY_OK) + { + /* NB: correctly treat tabbed output with InChIKey & hash extensions */ + char csep = '\n'; + + if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) + { + csep = '\t'; + } + if (!ip->bMergeHash) + { + inchi_ios_print(pout, "InChIKey=%-s", ik_string); + } + else + { + inchi_ios_print(pout, "InChIHash=%-s", ik_string); + } + strcpy(ikey, ik_string); + + if (szXtra1[0] && ip->bMergeHash) + { + inchi_ios_print(pout, "-%-s", szXtra1); + } + else if (szXtra1[0] && !ip->bMergeHash) + { + inchi_ios_print(pout, "%cXHash1=%-s", csep, szXtra1); + } + else if (!szXtra1[0] && ip->bMergeHash) + { + inchi_ios_print(pout, "-"); + } + + if (szXtra2[0] && ip->bMergeHash) + { + inchi_ios_print(pout, "-%-s", szXtra2); + } + else if (szXtra2[0] && !ip->bMergeHash) + { + inchi_ios_print(pout, "%cXHash2=%-s", csep, szXtra2); + } + else if (!szXtra2[0] && ip->bMergeHash) + { + inchi_ios_print(pout, "-"); + } + + inchi_ios_print(pout, "\n"); + } + else + { + inchi_ios_print(plog, "Warning (Could not compute InChIKey: ", num_inp); + switch (ik_ret) + { + case INCHIKEY_UNKNOWN_ERROR: + inchi_ios_print(plog, "unresolved error)"); + break; + case INCHIKEY_EMPTY_INPUT: + inchi_ios_print(plog, "got an empty string)"); + break; + case INCHIKEY_INVALID_INCHI_PREFIX: + case INCHIKEY_INVALID_INCHI: + case INCHIKEY_INVALID_STD_INCHI: + inchi_ios_print(plog, "no valid InChI string found)"); + break; + case INCHIKEY_NOT_ENOUGH_MEMORY: + inchi_ios_print(plog, "not enough memory to treat the string)"); + break; + default: inchi_ios_print(plog, "internal program error)"); + break; + } + inchi_ios_print(plog, " structure #%-lu.\n", *num_inp); + if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) + { + inchi_ios_print(pout, "\n"); + } + } + + if (!silent) + { + inchi_ios_flush(pout); + inchi_ios_flush2(plog, stderr); + } + else + { + inchi_ios_free_str(pout); + inchi_ios_free_str(plog); + } + } + else + { + inchi_ios_flush(pout); + } + +exit_function: + inchi_ios_close(pout0); /* free temporary out */ + + return next_act; +} + + +#ifdef RENUMBER_ATOMS_AND_RECALC_V106 + +/*****************************************************************************/ + +int numbers_rrar[PERMAXATOMS]; /* djb-rwth: placed as a global variable to avoid function buffer issues */ +int RepeatedlyRenumberAtomsAndRecalcINCHI(struct tagINCHI_CLOCK* ic, + CANON_GLOBALS* CG, + STRUCT_DATA* sd, + INPUT_PARMS* ip, + char* szTitle, + PINChI2* pINChI[INCHI_NUM], + PINChI_Aux2* pINChI_Aux[INCHI_NUM], + INCHI_IOSTREAM* inp_file, + INCHI_IOSTREAM* plog, + INCHI_IOSTREAM* pout, + INCHI_IOSTREAM* pprb, + ORIG_ATOM_DATA* orig_inp_data, + ORIG_ATOM_DATA* prep_inp_data, + long* num_inp, + STRUCT_FPTRS* pStructPtrs, + int* nRet, + int have_err_in_GetOneStructure, + long* num_err, + int output_error_inchi, + INCHI_IOS_STRING* strbuf, + unsigned long* pulTotalProcessingTime, + char* pLF, + char* pTAB, + long int nrepeat) +{ + int next_action = DO_NEXT_STEP; + int dup_fail = 0; + ORIG_ATOM_DATA SavedOrigAtData; /* 0=> disconnected, 1=> original */ + ORIG_ATOM_DATA* saved_orig_inp_data = &SavedOrigAtData; + char ikey0[28]; + + const int very_silent = 2; /* 3 0;*/ + + /* Internal test mode: renumber atoms and recalculate repeatedly */ + + /* do not forget to use /key and to not use /auxnone */ + + + ikey0[0] = '\0'; + { + int k; + for (k = 0; k < orig_inp_data->num_inp_atoms; k++) + { + numbers_rrar[k] = k; + } + for (k = orig_inp_data->num_inp_atoms; k < PERMAXATOMS; k++) + { + numbers_rrar[k] = -1; + } + } + + + + +#if BIG_POLY_DEBUG + { int k; ITRACE_("\nAtoms = {"); for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) ITRACE_(" %-03d,", numbers_rrar[k]); ITRACE_(" %-03d }", numbers_rrar[orig_inp_data->num_inp_atoms - 1]); } + OrigAtData_DebugTrace(orig_inp_data); + OrigAtDataPolymer_DebugTrace(orig_inp_data->polymer); +#endif + + memset(saved_orig_inp_data, 0, sizeof(*saved_orig_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ + dup_fail = OrigAtData_Duplicate(saved_orig_inp_data, orig_inp_data); + + next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, + pINChI, pINChI_Aux, + inp_file, plog, pout, pprb, + orig_inp_data, prep_inp_data, num_inp, pStructPtrs, + nRet, have_err_in_GetOneStructure, + num_err, output_error_inchi, + strbuf, pulTotalProcessingTime, + pLF, pTAB, ikey0, very_silent); + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + FreeOrigAtData(orig_inp_data); + FreeOrigAtData(prep_inp_data); + FreeOrigAtData(prep_inp_data + 1); + + + if (ikey0[0]) + { + if (very_silent < 2) + { + inchi_ios_eprint(plog, "#%-ld-%08ld\t...\t%-s\t%s%s%s%s\n", *num_inp, 1, ikey0, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue)); + } + } + + + if (!dup_fail) + { + int irepeat = 0; + int ndiff = 0; + int n_written_problems = 0; + char ikey[28]; + ikey[0] = '\0'; + for (irepeat = 0; irepeat < nrepeat - 1; irepeat++) + { + dup_fail = OrigAtData_Duplicate(orig_inp_data, saved_orig_inp_data); + if (!dup_fail) + { + shuffle((void*)numbers_rrar, orig_inp_data->num_inp_atoms, sizeof(int)); + OrigAtData_Permute(orig_inp_data, saved_orig_inp_data, numbers_rrar); +#if BIG_POLY_DEBUG + { int k; ITRACE_("\nAtoms = {"); for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) ITRACE_(" %-03d,", numbers_rrar[k]); ITRACE_(" %-03d }", numbers_rrar[orig_inp_data->num_inp_atoms - 1]); } + OrigAtData_DebugTrace(saved_orig_inp_data); + OrigAtData_DebugTrace(orig_inp_data); + OrigAtDataPolymer_DebugTrace(saved_orig_inp_data->polymer); + OrigAtDataPolymer_DebugTrace(orig_inp_data->polymer); +#endif + next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, + pINChI, pINChI_Aux, + inp_file, plog, pout, pprb, + orig_inp_data, + prep_inp_data, num_inp, pStructPtrs, + nRet, have_err_in_GetOneStructure, + num_err, output_error_inchi, + strbuf, pulTotalProcessingTime, + pLF, pTAB, ikey, + 0 /* 1 be silent */); + + + if (ikey0[0] && ikey[0]) + { + if (strcmp(ikey, ikey0)) + { + int result, bINChIOutputOptions = ip->bINChIOutputOptions; /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + ndiff++; + /*inchi_ios_eprint( plog, "!!! #%-ld-%05ld %s%s%s%s\tcurr %-s != %-s orig\n", *num_inp, irepeat + 2, SDF_LBL_VAL( ip->pSdfLabel, ip->pSdfValue ), ikey, ikey0 );*/ + /*inchi_ios_eprint( plog, "!!! %s%s%s%s renum#%05ld\t%-s != %-s\n", SDF_LBL_VAL( ip->pSdfLabel, ip->pSdfValue ), irepeat + 2, ikey, ikey0 );*/ + inchi_ios_eprint(plog, "!!! #%-ld %s%s%s%s\t%-s --> %-s @ renum#%06d/%06ld\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue), ikey0, ikey, irepeat + 2, nrepeat); + if (!very_silent) + { + int k; + inchi_ios_eprint(plog, "Atoms = {"); + for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) + { + inchi_ios_eprint(plog, " %-d,", numbers_rrar[k] + 1); + } + inchi_ios_eprint(plog, " %-d }\n\n", numbers_rrar[orig_inp_data->num_inp_atoms - 1] + 1); + } + ip->bINChIOutputOptions |= INCHI_OUT_SDFILE_ONLY; + result = OrigAtData_SaveMolfile(orig_inp_data, sd, ip, *num_inp, pprb); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + inchi_ios_flush(pprb); + ip->bINChIOutputOptions = bINChIOutputOptions; + if (result == 0) + { + n_written_problems++; + } +#if 0 + /* second pass, non-silent one */ + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + FreeOrigAtData(orig_inp_data); + FreeOrigAtData(prep_inp_data); + FreeOrigAtData(prep_inp_data + 1); + dup_fail = OrigAtData_Duplicate(orig_inp_data, saved_orig_inp_data); + if (!dup_fail) + { + OrigAtData_Permute(orig_inp_data, saved_orig_inp_data, numbers_rrar); + next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, + pINChI, pINChI_Aux, + inp_file, plog, pout, pprb, + orig_inp_data, + prep_inp_data, num_inp, pStructPtrs, + nRet, have_err_in_GetOneStructure, + num_err, output_error_inchi, + strbuf, pulTotalProcessingTime, + pLF, pTAB, ikey, 0); + } +#endif + } + + if (irepeat == nrepeat - 2) + { + if (very_silent < 2) + { + inchi_ios_eprint(plog, "...........\n#%-ld-%08ld\t...\t%-s\t%s%s%s%s\n", *num_inp, irepeat + 2, ikey0, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue)); + } + } + + } + } + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + FreeOrigAtData(orig_inp_data); + FreeOrigAtData(prep_inp_data); + FreeOrigAtData(prep_inp_data + 1); + +#ifdef STOP_AFTER_FIRST_CHANGE_ON_RENUMBERING + if (ndiff == 1) + { + next_action = DO_CONTINUE_MAIN_LOOP; + break; + } +#endif + } + if (ndiff == 0) + { + if (very_silent < 3) + { + /*inchi_ios_eprint( plog, "#%-ld-%05ld\t...\tOK ALL\n", *num_inp, nrepeat );*/ + /*inchi_ios_eprint( plog, "OK #%-ld %s%s%s%s\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue));*/ + /*inchi_ios_eprint(plog, "#%-ld\n", *num_inp);*/ + inchi_ios_eprint(plog, "OK #%-ld %s%s%s%s\t%-s\t Same for %-d/%-d renums\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue), ikey0, nrepeat, nrepeat); + } + } + else + { +#ifdef STOP_AFTER_FIRST_CHANGE_ON_RENUMBERING + /*inchi_ios_eprint( plog, "#%-ld-%05ld\t...\tDIFF %-d\n", num_inp, nrepeat, ndiff );*/ +#else + inchi_ios_eprint(plog, "#%-ld-%05ld\t...\tDIFF %-d\n", num_inp, nrepeat, ndiff); +#endif + } + + FreeOrigAtData(saved_orig_inp_data); + } + + return next_action; +} + + +#endif diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt index ead78dec..8b83d19d 100644 --- a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt +++ b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt @@ -25,9 +25,10 @@ include_directories(${P_BASE} ${P_CURRENT}) add_executable(inchi-1) target_sources(inchi-1 PRIVATE - dispstru.c - dispstru.h - ichimain.c + main.c + ${P_BASE}/ichimain.c + ${P_BASE}/dispstru.c + ${P_BASE}/dispstru.h ${P_BASE}/bcf_s.h ${P_BASE}/bcf_s.c ${P_BASE}/extr_ct.h @@ -132,8 +133,8 @@ if(MATH_LIBRARY) target_link_libraries(inchi-1 PUBLIC ${MATH_LIBRARY}) endif() -target_compile_definitions(inchi-1 PRIVATE - COMPILE_ANSI_ONLY +target_compile_definitions(inchi-1 PRIVATE + COMPILE_ANSI_ONLY TARGET_EXE_STANDALONE ADD_AMI_MODE ) @@ -141,4 +142,4 @@ target_compile_definitions(inchi-1 PRIVATE target_include_directories(inchi-1 PUBLIC "${PROJECT_BINARY_DIR}") string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") -string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") \ No newline at end of file +string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/ichimain.c b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c similarity index 100% rename from INCHI-1-SRC/INCHI_EXE/inchi-1/src/ichimain.c rename to INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/main.c b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/main.c new file mode 100644 index 00000000..5e1f3f46 --- /dev/null +++ b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/main.c @@ -0,0 +1,266 @@ +/* + * International Chemical Identifier (InChI) + * Version 1 + * Software version 1.07 + * April 30, 2024 + * + * MIT License + * + * Copyright (c) 2024 IUPAC and InChI Trust + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +* +* The InChI library and programs are free software developed under the + * auspices of the International Union of Pure and Applied Chemistry (IUPAC). + * Originally developed at NIST. + * Modifications and additions by IUPAC and the InChI Trust. + * Some portions of code were developed/changed by external contributors + * (either contractor or volunteer) which are listed in the file + * 'External-contributors' included in this distribution. + * + * info@inchi-trust.org + * +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef COMPILE_ANSI_ONLY +#include +#ifndef TARGET_LIB_FOR_WINCHI +#include +#endif +#endif + +#include "../../../INCHI_BASE/src/mode.h" + +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) +#include +#include +#endif + + +#ifdef _WIN32 +#include +#endif +#include "../../../INCHI_BASE/src/ichitime.h" +#include "../../../INCHI_BASE/src/incomdef.h" +#include "../../../INCHI_BASE/src/ichidrp.h" +#include "../../../INCHI_BASE/src/inpdef.h" +#include "../../../INCHI_BASE/src/ichi.h" +#include "../../../INCHI_BASE/src/strutil.h" +#include "../../../INCHI_BASE/src/util.h" +#include "../../../INCHI_BASE/src/ichierr.h" +#include "../../../INCHI_BASE/src/ichimain.h" +#include "../../../INCHI_BASE/src/ichicomp.h" +#include "../../../INCHI_BASE/src/ichi_io.h" +#ifdef TARGET_EXE_STANDALONE +#include "../../../INCHI_BASE/src/inchi_api.h" +#endif + +#include "../../../INCHI_BASE/src/bcf_s.h" +#include "../../../INCHI_BASE/src/permutation_util.h" + + /* Console-specific */ + +#if !defined(TARGET_API_LIB) && !defined(COMPILE_ANSI_ONLY) + +/* Use Windows additional features */ + + +/****************************************************************************/ +int user_quit(struct tagINCHI_CLOCK* ic, + const char* msg, + unsigned long ulMaxTime) +{ +#if defined(TARGET_LIB_FOR_WINCHI) + return 0; +#endif + +#if ( !defined(TARGET_LIB_FOR_WINCHI) && defined(_WIN32) ) + + int quit, enter, ret; + printf("%s", msg); /* djb-rwth: format string added for security */ + if (ulMaxTime) + { + inchiTime ulEndTime; + InchiTimeGet(&ulEndTime); + InchiTimeAddMsec(ic, &ulEndTime, ulMaxTime); + while (!_kbhit()) + { + if (bInchiTimeIsOver(ic, &ulEndTime)) + { + printf("\n"); + return 0; + } + MySleep(100); + } + } + while (1) + { + quit = ('q' == (ret = _getch()) || 'Q' == ret || /*Esc*/ 27 == ret); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + enter = ('\r' == ret); + if (ret == 0xE0) + { + ret = _getch(); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + } + else + { + _putch(ret); /* echo */ + } + if (quit || enter) + { + break; + } + printf("\r"); + printf("%s", msg); /* djb-rwth: format string added for security */ + } + _putch('\n'); + + return quit; +#else + return 0; + +#endif /* #if ( defined(_WIN32) && !defined(TARGET_LIB_FOR_WINCHI) ) */ +} + + +/****************************************************************************/ +void eat_keyboard_input(void) +{ + int ret_val; /* djb-rwth: adding return value */ /* djb-rwth: ignoring LLVM warning */ +#ifndef TARGET_LIB_FOR_WINCHI + + while (_kbhit()) + { + if (0xE0 == _getch()) + { + ret_val = _getch(); /* djb-rwth: return value variable added */ + } + } + +#endif +} + +#endif /* end of !COMPILE_ANSI_ONLY */ + + +// #ifndef TARGET_LIB_FOR_WINCHI +/* COVERS THE CODE FROM HERE TO THE END OF FILE */ + + +/* Enable/disable internal tests */ + +/* Uncomment for INCHI_LIB testing only */ +/*#define TEST_FPTRS*/ + +/* Windows-console-mode specific */ + +int bInterrupted = 0; + +#if ( defined( _WIN32 ) && defined( _CONSOLE ) ) +#ifndef COMPILE_ANSI_ONLY + + +/****************************************************************************/ +BOOL WINAPI MyHandlerRoutine(DWORD dwCtrlType /* control signal type */) +{ + if (dwCtrlType == CTRL_C_EVENT || + dwCtrlType == CTRL_BREAK_EVENT || + dwCtrlType == CTRL_CLOSE_EVENT || + dwCtrlType == CTRL_LOGOFF_EVENT) + { + bInterrupted = 1; + return TRUE; + } + return FALSE; +} + + +/****************************************************************************/ +int WasInterrupted(void) +{ +#ifdef _DEBUG + if (bInterrupted) + { + int stop = 1; /* for debug only */ + } +#endif + return bInterrupted; +} +#if ( BUILD_WITH_AMI == 1 ) +#define CTRL_STOP_EVENT 101 +#endif +#endif /* ifndef COMPILE_ANSI_ONLY */ +#endif /* if( defined( _WIN32 ) && defined( _CONSOLE ) ) */ + + + +/****************************************************************************/ +int main(int argc, char* argv[]) +{ +#ifdef GHI100_FIX +#if ((SPRINTF_FLAG != 1) && (SPRINTF_FLAG != 2)) + setlocale(LC_ALL, "en-US"); /* djb-rwth: setting all locales to "en-US" */ +#endif +#endif + +/*************************/ +// #if ( BUILD_WITH_AMI == 1 ) +/*************************/ + +/**** IF IN AMI MODE, main() STARTS HERE ****/ + int i, ret = 0, ami = 0; /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + + /* Check if multiple inputs expected */ + for (i = 1; i < argc; i++) + { + if (argv[i][0] == INCHI_OPTION_PREFX) + { + if (!inchi_stricmp(argv[i] + 1, "AMI")) + { + ami = 1; + break; + } + } + } + + if (ami) + { + ret = ProcessMultipleInputFiles(argc, argv); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + } + else + { + ret = ProcessSingleInputFile(argc, argv); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + } + + return 0; +} + + +// #endif /* ifndef TARGET_LIB_FOR_WINCHI */ + From b76a4cb5cb33ab406a66d7a5cb334e9e217f262a Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 8 Dec 2025 08:43:05 +0000 Subject: [PATCH 02/41] formatting --- INCHI-1-SRC/INCHI_BASE/src/ichimain.c | 3 +- .../INCHI_EXE/inchi-1/src/backup_ichimain.c | 1688 ----------------- 2 files changed, 2 insertions(+), 1689 deletions(-) delete mode 100644 INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c diff --git a/INCHI-1-SRC/INCHI_BASE/src/ichimain.c b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c index a575437b..ccdc9aeb 100644 --- a/INCHI-1-SRC/INCHI_BASE/src/ichimain.c +++ b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c @@ -363,7 +363,8 @@ int ProcessMultipleInputFiles(int argc, char* argv[]) /****************************************************************************/ int ProcessSingleInputFile(int argc, char* argv[]) { - /**************************************/ + +/**************************************/ #endif /* #if ( BUILD_WITH_AMI == 1 ) */ /**************************************/ diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c deleted file mode 100644 index cc422b04..00000000 --- a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c +++ /dev/null @@ -1,1688 +0,0 @@ -/* - * International Chemical Identifier (InChI) - * Version 1 - * Software version 1.07 - * April 30, 2024 - * - * MIT License - * - * Copyright (c) 2024 IUPAC and InChI Trust - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. -* -* The InChI library and programs are free software developed under the - * auspices of the International Union of Pure and Applied Chemistry (IUPAC). - * Originally developed at NIST. - * Modifications and additions by IUPAC and the InChI Trust. - * Some portions of code were developed/changed by external contributors - * (either contractor or volunteer) which are listed in the file - * 'External-contributors' included in this distribution. - * - * info@inchi-trust.org - * -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef COMPILE_ANSI_ONLY -#include -#ifndef TARGET_LIB_FOR_WINCHI -#include -#endif -#endif - -#include "../../../INCHI_BASE/src/mode.h" - -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) -#include -#include -#endif - - -#ifdef _WIN32 -#include -#endif -#include "../../../INCHI_BASE/src/ichitime.h" -#include "../../../INCHI_BASE/src/incomdef.h" -#include "../../../INCHI_BASE/src/ichidrp.h" -#include "../../../INCHI_BASE/src/inpdef.h" -#include "../../../INCHI_BASE/src/ichi.h" -#include "../../../INCHI_BASE/src/strutil.h" -#include "../../../INCHI_BASE/src/util.h" -#include "../../../INCHI_BASE/src/ichierr.h" -#include "../../../INCHI_BASE/src/ichimain.h" -#include "../../../INCHI_BASE/src/ichicomp.h" -#include "../../../INCHI_BASE/src/ichi_io.h" -#ifdef TARGET_EXE_STANDALONE -#include "../../../INCHI_BASE/src/inchi_api.h" -#endif - -#include "../../../INCHI_BASE/src/bcf_s.h" -#include "../../../INCHI_BASE/src/permutation_util.h" - - /* Console-specific */ - -#if !defined(TARGET_API_LIB) && !defined(COMPILE_ANSI_ONLY) - -/* Use Windows additional features */ - - -/****************************************************************************/ -int user_quit(struct tagINCHI_CLOCK* ic, - const char* msg, - unsigned long ulMaxTime) -{ -#if defined(TARGET_LIB_FOR_WINCHI) - return 0; -#endif - -#if ( !defined(TARGET_LIB_FOR_WINCHI) && defined(_WIN32) ) - - int quit, enter, ret; - printf("%s", msg); /* djb-rwth: format string added for security */ - if (ulMaxTime) - { - inchiTime ulEndTime; - InchiTimeGet(&ulEndTime); - InchiTimeAddMsec(ic, &ulEndTime, ulMaxTime); - while (!_kbhit()) - { - if (bInchiTimeIsOver(ic, &ulEndTime)) - { - printf("\n"); - return 0; - } - MySleep(100); - } - } - while (1) - { - quit = ('q' == (ret = _getch()) || 'Q' == ret || /*Esc*/ 27 == ret); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - enter = ('\r' == ret); - if (ret == 0xE0) - { - ret = _getch(); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - } - else - { - _putch(ret); /* echo */ - } - if (quit || enter) - { - break; - } - printf("\r"); - printf("%s", msg); /* djb-rwth: format string added for security */ - } - _putch('\n'); - - return quit; -#else - return 0; - -#endif /* #if ( defined(_WIN32) && !defined(TARGET_LIB_FOR_WINCHI) ) */ -} - - -/****************************************************************************/ -void eat_keyboard_input(void) -{ - int ret_val; /* djb-rwth: adding return value */ /* djb-rwth: ignoring LLVM warning */ -#ifndef TARGET_LIB_FOR_WINCHI - - while (_kbhit()) - { - if (0xE0 == _getch()) - { - ret_val = _getch(); /* djb-rwth: return value variable added */ - } - } - -#endif -} - -#endif /* end of !COMPILE_ANSI_ONLY */ - - -#ifndef TARGET_LIB_FOR_WINCHI -/* COVERS THE CODE FROM HERE TO THE END OF FILE */ - - -/* Enable/disable internal tests */ - -/* Uncomment for INCHI_LIB testing only */ -/*#define TEST_FPTRS*/ - -/* Windows-console-mode specific */ - -int bInterrupted = 0; - -#if ( defined( _WIN32 ) && defined( _CONSOLE ) ) -#ifndef COMPILE_ANSI_ONLY - - -/****************************************************************************/ -BOOL WINAPI MyHandlerRoutine(DWORD dwCtrlType /* control signal type */) -{ - if (dwCtrlType == CTRL_C_EVENT || - dwCtrlType == CTRL_BREAK_EVENT || - dwCtrlType == CTRL_CLOSE_EVENT || - dwCtrlType == CTRL_LOGOFF_EVENT) - { - bInterrupted = 1; - return TRUE; - } - return FALSE; -} - - -/****************************************************************************/ -int WasInterrupted(void) -{ -#ifdef _DEBUG - if (bInterrupted) - { - int stop = 1; /* for debug only */ - } -#endif - return bInterrupted; -} -#if ( BUILD_WITH_AMI == 1 ) -#define CTRL_STOP_EVENT 101 -#endif -#endif /* ifndef COMPILE_ANSI_ONLY */ -#endif /* if( defined( _WIN32 ) && defined( _CONSOLE ) ) */ - - - -/****************************************************************************/ -int main(int argc, char* argv[]) -{ -#ifdef GHI100_FIX -#if ((SPRINTF_FLAG != 1) && (SPRINTF_FLAG != 2)) - setlocale(LC_ALL, "en-US"); /* djb-rwth: setting all locales to "en-US" */ -#endif -#endif - - /*************************/ -#if ( BUILD_WITH_AMI == 1 ) -/*************************/ - -/**** IF IN AMI MODE, main() STARTS HERE ****/ - int i, ret = 0, ami = 0; /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - - /* Check if multiple inputs expected */ - for (i = 1; i < argc; i++) - { - if (argv[i][0] == INCHI_OPTION_PREFX) - { - if (!inchi_stricmp(argv[i] + 1, "AMI")) - { - ami = 1; - break; - } - } - } - - if (ami) - { - ret = ProcessMultipleInputFiles(argc, argv); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - } - else - { - ret = ProcessSingleInputFile(argc, argv); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - } - - return 0; -} - - -/****************************************************************************/ -int ProcessMultipleInputFiles(int argc, char* argv[]) -{ - int i, ret = 0, nfn_ins = 0, - AMIOutStd = 0, AMILogStd = 0, AMIPrbNone = 0; - char* fn_out, * fn_log, * fn_prb; - char pNUL[] = "NUL"; - char** fn_ins = NULL, ** targv = NULL; - int ret_val; /* djb-rwth: adding return value */ /* djb-rwth: ignoring LLVM warning */ - -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) -#ifdef _WIN64 - typedef __int64 intptr_t; /* x64 */ -#else - typedef long int intptr_t; /* VC 6.0 has no intptr_t and no x64 */ -#endif - struct _finddata_t file_info; - intptr_t hFile = -1; - int retFile, lenPath; - char* pName, * pOutPath = NULL; /* djb-rwth: ignoring LLVM warning */ - char pathname[_MAX_PATH]; - char szBlank[] = ""; /* djb-rwth: ignoring LLVM warning */ - int numFiles = 0; /* counts processed files */ -#else - int p; -#endif - - fn_ins = (char**)inchi_calloc(argc, sizeof(char*)); - if (!fn_ins) - { - fprintf(stderr, "Not enough memory.\n"); - goto exit_ami; - } - - /* Check for other options and collect inputs. */ - for (i = 1; i < argc; i++) - { - if (argv[i][0] == INCHI_OPTION_PREFX) - { - if (!inchi_stricmp(argv[i] + 1, "STDIO")) - { - fprintf(stderr, "Options AMI and STDIO are not compatible.\n"); - goto exit_ami; - } - else if (!inchi_stricmp(argv[i] + 1, "AMIOutStd")) - { - AMIOutStd = 1; - } - else if (!inchi_stricmp(argv[i] + 1, "AMILogStd")) - { - AMILogStd = 1; - } - else if (!inchi_stricmp(argv[i] + 1, "AMIPrbNone")) - { - AMIPrbNone = 1; - } -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) - else if (!inchi_memicmp(argv[i] + 1, "OP:", 3)) - { - pOutPath = argv[i] + 4; /* output path */ - } -#endif - } - else - { - fn_ins[nfn_ins] = argv[i]; - nfn_ins++; - } - } - - if (!nfn_ins) - { - fprintf(stderr, "At least one input file is expected in AMI mode.\n"); - goto exit_ami; - } - - targv = (char**)inchi_calloc((long long)argc + 3, sizeof(char*)); /* djb-rwth: cast operator added */ - - if (!targv) - { - fprintf(stderr, "Not enough memory.\n"); - goto exit_ami; - } - -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) - if ((pName = strrchr(fn_ins[0], INCHI_PATH_DELIM))) /* djb-rwth: addressing LLVM warning */ - { - pName++; - lenPath = pName - fn_ins[0]; - } - else - { - pName = fn_ins[0]; - lenPath = 0; - } - for (hFile = _findfirst(fn_ins[0], &file_info), retFile = 0; - !retFile && -1 != hFile; - retFile = _findnext(hFile, &file_info), numFiles++) -#else - for (p = 0; p < nfn_ins; p++) -#endif - { - int targc; -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) - const char* fn_in; - int inlen = lenPath + strlen(file_info.name); - if (!file_info.size || (file_info.attrib & _A_SUBDIR) || inlen >= _MAX_PATH) - { - continue; - } - memcpy(pathname, fn_ins[0], lenPath); - strcpy(pathname + lenPath, file_info.name); - fn_in = pathname; - if (0 == numFiles % 5000) - { - ret_val = _heapmin(); /* reduce heap fragmentation */ /* djb-rwth: return value variable added */ - } -#else - const char* fn_in = fn_ins[p]; - int inlen = strlen(fn_in); -#endif - fn_out = fn_log = fn_prb = NULL; - - targv[0] = argv[0]; - targv[1] = (char*)fn_in; - targc = 1; - - if (AMIOutStd) - { - targv[++targc] = pNUL; - } -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) - else if (pOutPath) - { - targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ - } -#endif - else - { - /* make output name as input name plus ext. */ - fn_out = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ - if (fn_out) - { - strcpy(fn_out, fn_in); - strcat(fn_out, ".txt"); - } - targv[++targc] = fn_out; - } - - if (AMILogStd) - { - targv[++targc] = pNUL; - } -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) - else if (pOutPath) - { - targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ - } -#endif - else - { - /* Make log name as input name plus ext. */ - fn_log = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ - if (fn_log) - { - strcpy(fn_log, fn_in); - strcat(fn_log, ".log"); - } - targv[++targc] = fn_log; - } - if (AMIPrbNone) - { - targv[++targc] = pNUL; - } -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) - else if (pOutPath) - { - targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ - } -#endif - else - { - /* Make problem file name as input file name plus ext. */ - fn_prb = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ - if (fn_prb) - { - strcpy(fn_prb, fn_in); - strcat(fn_prb, ".prb"); - } - targv[++targc] = fn_prb; - } - - for (i = 1; i < argc; i++) - { - if (argv[i][0] == INCHI_OPTION_PREFX) - { - /* avoid strnicmp/strncasecmp */ - if ((strlen(argv[i]) > 3) && - (toupper(argv[i][1]) == 'A') && (toupper(argv[i][2]) == 'M') && (toupper(argv[i][3]) == 'I')) - { - continue; - } - targv[++targc] = argv[i]; - } - } - /* djb-rwth: fixing undefined index value / buffer overflow */ - ++targc; - if (targc < argc + 3) - { - targv[targc] = NULL; - } - - ret = ProcessSingleInputFile(targc, targv); /* ProcessSingleInputFile() is a former main() */ - - if (fn_out) - { - inchi_free(fn_out); - } - if (fn_log) - { - inchi_free(fn_log); - } - if (fn_prb) - { - inchi_free(fn_prb); - } - -#if ( defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) - if (ret == CTRL_STOP_EVENT) - { - goto exit_ami; - } -#endif - } - - -exit_ami: -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) - if (hFile != -1) - { - _findclose(hFile); - } -#endif - if (targv) - { - inchi_free(targv); - } - if (fn_ins) - { - inchi_free(fn_ins); - } - - return 0; -} - - - -/****************************************************************************/ -int ProcessSingleInputFile(int argc, char* argv[]) -{ - /**************************************/ -#endif /* #if ( BUILD_WITH_AMI == 1 ) */ -/**************************************/ - -/**** IF NOT IN AMI MODE, main() STARTS HERE ****/ - - int bReleaseVersion = bRELEASE_VERSION; - const int nStrLen = INCHI_SEGM_BUFLEN; - int nRet = 0; - int i; - long num_err, num_output, num_inp; - /* long rcPict[4] = {0,0,0,0}; */ - unsigned long ulDisplTime = 0; /* infinite, milliseconds */ - unsigned long ulTotalProcessingTime = 0; - - CANON_GLOBALS CG; - INCHI_CLOCK ic; - - char szTitle[MAX_SDF_HEADER + MAX_SDF_VALUE + 256]; - char szSdfDataValue[MAX_SDF_VALUE + 1]; - - INPUT_PARMS inp_parms; - INPUT_PARMS* ip = &inp_parms; - - STRUCT_DATA struct_data; - STRUCT_DATA* sd = &struct_data; - - ORIG_ATOM_DATA OrigAtData; /* 0=> disconnected, 1=> original */ - ORIG_ATOM_DATA* orig_inp_data = &OrigAtData; - ORIG_ATOM_DATA PrepAtData[2]; /* 0=> disconnected, 1=> original */ - ORIG_ATOM_DATA* prep_inp_data = PrepAtData; - - PINChI2* pINChI[INCHI_NUM]; - PINChI_Aux2* pINChI_Aux[INCHI_NUM]; - - char* pLF, * pTAB; - INCHI_IOS_STRING temp_string_container; - INCHI_IOS_STRING* strbuf = &temp_string_container; - INCHI_IOSTREAM outputstr, logstr, prbstr, instr; - INCHI_IOSTREAM* pout = &outputstr, * plog = &logstr, * pprb = &prbstr, * inp_file = &instr; - -#ifdef TARGET_EXE_STANDALONE - int inchi_ios_type = INCHI_IOS_TYPE_STRING; -#else - int inchi_ios_type = INCHI_IOS_TYPE_FILE; -#endif -#if ( READ_INCHI_STRING == 1 ) - const int may_get_inchi_string_input = 1; -#else - const int may_get_inchi_string_input = 0; -#endif - int bInChI2Structure = 0; - int output_error_inchi = 0; - - - /* internal tests --- */ -#ifndef TEST_FPTRS - STRUCT_FPTRS* pStructPtrs = NULL; -#else - STRUCT_FPTRS struct_fptrs, * pStructPtrs = &struct_fptrs; /* INCHI_LIB debug only */ -#endif - -#if ( defined(_WIN32) && defined(_MSC_VER) ) -#if WINVER >= 0x0501 /* XP or newer */ /* 0x0600 Vista or newer */ - DWORD tick_inchi_start, tick_inchi_stop; - tick_inchi_start = GetTickCount64(); /* djb-rwth: GetTickCount64() should be used */ -#endif -#endif - -#ifdef _WIN32 -#if ( TRACE_MEMORY_LEAKS == 1 ) - _CrtSetDbgFlag(_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF); - /* for execution outside the VC++ debugger uncomment one of the following two */ - /*#define MY_REPORT_FILE _CRTDBG_FILE_STDERR */ - /*#define MY_REPORT_FILE _CRTDBG_FILE_STDOUT */ -#ifdef MY_REPORT_FILE - _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_WARN, MY_REPORT_FILE); - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ERROR, MY_REPORT_FILE); - _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ASSERT, MY_REPORT_FILE); -#else - _CrtSetReportMode(_CRT_WARN | _CRT_ERROR, _CRTDBG_MODE_DEBUG); -#endif - /* turn on floating point exceptions */ - { - /* Get the default control word. */ - int cw = _controlfp(0, 0); - - /* Set the exception masks OFF, turn exceptions on. */ - /*cw &=~(EM_OVERFLOW|EM_UNDERFLOW|EM_INEXACT|EM_ZERODIVIDE|EM_DENORMAL);*/ - cw &= ~(EM_OVERFLOW | EM_UNDERFLOW | EM_ZERODIVIDE | EM_DENORMAL); - - /* Set the control word. */ - _controlfp(cw, MCW_EM); -} -#endif -#endif - - sd->bUserQuit = 0; - /* djb-rwth: fixing coverity CID #499552 */ - sd->num_components[0] = 0; - sd->num_components[1] = 0; -#if ( defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) - if (SetConsoleCtrlHandler(MyHandlerRoutine, 1)) - { - ConsoleQuit = WasInterrupted; - } -#endif - - num_inp = 0; - num_err = 0; - num_output = 0; - - inchi_ios_init(inp_file, INCHI_IOS_TYPE_FILE, NULL); - inchi_ios_init(pout, inchi_ios_type, NULL); - inchi_ios_init(plog, inchi_ios_type, stdout); - inchi_ios_init(pprb, inchi_ios_type, NULL); - memset(strbuf, 0, sizeof(*strbuf)); /* djb-rwth: memset_s C11/Annex K variant?; dereferencing strbuf */ - - if (argc == 1 || (argc == 2 && (argv[1][0] == INCHI_OPTION_PREFX) && - ((!strcmp(argv[1] + 1, "?") || !inchi_stricmp(argv[1] + 1, "help"))))) /* djb-rwth: addressing LLVM warning */ - { - HelpCommandLineParms(plog); - inchi_ios_flush(plog); - return 0; - } - - /* djb-rwth: printing out InChI version */ - if (argc == 2 && ((argv[1][0] == INCHI_OPTION_PREFX)) && (!strcmp(argv[1] + 1, "v") || !strcmp(argv[1] + 1, "V"))) - { - printf("%s\n", APP_DESCRIPTION); - return 0; - } - - /* djb-rwth: disallowing endless execution if no file(s) is given as the first argument */ - if (argc >= 2 && ((argv[1][0] == INCHI_OPTION_PREFX)) && (strcmp(argv[1] + 1, "v") || strcmp(argv[1] + 1, "V") || strcmp(argv[1] + 1, "?") || inchi_stricmp(argv[1] + 1, "help"))) - { - HelpCommandLineParms(plog); - inchi_ios_flush(plog); - return 0; - } - - /* original input structure */ - memset(orig_inp_data, 0, sizeof(*orig_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ - memset(prep_inp_data, 0, 2 * sizeof(*prep_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ - memset(pINChI, 0, sizeof(pINChI)); /* djb-rwth: memset_s C11/Annex K variant? */ - memset(pINChI_Aux, 0, sizeof(pINChI_Aux)); /* djb-rwth: memset_s C11/Annex K variant? */ - memset(szSdfDataValue, 0, sizeof(szSdfDataValue)); /* djb-rwth: memset_s C11/Annex K variant? */ - - memset(&CG, 0, sizeof(CG)); /* djb-rwth: memset_s C11/Annex K variant? */ - memset(&ic, 0, sizeof(ic)); /* djb-rwth: memset_s C11/Annex K variant? */ - - plog->f = stderr; - - if (0 > ReadCommandLineParms(argc, (const char**)argv, ip, - szSdfDataValue, &ulDisplTime, - bReleaseVersion, plog)) - { - goto exit_function; - } - - if (!OpenFiles(&(inp_file->f), &(pout->f), &(plog->f), &(pprb->f), ip)) - { - goto exit_function; - } - - - if (ip->bNoStructLabels) - { - ip->pSdfLabel = NULL; - ip->pSdfValue = NULL; - } - else if (ip->nInputType == INPUT_INCHI_PLAIN || - ip->nInputType == INPUT_INCHI) - { - /* the input may contain both the header and the label of the structure */ - if (!ip->pSdfLabel) - { - ip->pSdfLabel = ip->szSdfDataHeader; - } - if (!ip->pSdfValue) - { - ip->pSdfValue = szSdfDataValue; - } - } - - set_line_separators(ip->bINChIOutputOptions, &pLF, &pTAB); - - save_command_line(argc, argv, plog); - - PrintInputParms(plog, ip); - - inchi_ios_flush2(plog, stderr); - - if (0 >= inchi_strbuf_init(strbuf, INCHI_STRBUF_INITIAL_SIZE, INCHI_STRBUF_SIZE_INCREMENT)) - { - inchi_ios_eprint(plog, "Cannot allocate internal string buffer. Terminating\n"); - inchi_ios_flush2(plog, stderr); - goto exit_function; - } - - - /* Process InChI string as input; output may be */ - /* a) InChI string or b) structure */ - /*#if ( READ_INCHI_STRING == 1 )*/ - if (may_get_inchi_string_input && ip->nInputType == INPUT_INCHI) - { - bInChI2Structure = 0 != (ip->bReadInChIOptions & READ_INCHI_TO_STRUCTURE); - memset(sd, 0, sizeof(*sd)); /* djb-rwth: memset_s C11/Annex K variant? */ - if (bInChI2Structure) - { - /* loop through file lines here */ - INCHI_IOSTREAM tmpinpustream; - INCHI_IOS_STRING* pTmpIn = &tmpinpustream.s; - int crlf2lf = 0, preserve_lf = 1, read_result = 0; - inchi_ios_init(&tmpinpustream, INCHI_IOS_TYPE_STRING, NULL); - while (1) - { - char* p, * pi; - - read_result = inchi_strbuf_getline(pTmpIn, inp_file->f, crlf2lf, preserve_lf); - - if (read_result == -1) -#if (FIX_ONE_LINE_INCHI_INPUT_CONVERSION_ISSUE==1) - { - if (!pTmpIn->pStr) - { - break; - } - if (strlen(pTmpIn->pStr) < 8) /* 7 = strlen("InChI=1") */ - { - break; - } - } -#else - break; /* EOF or read error */ -#endif - - p = pTmpIn->pStr; - if (!p) - { - continue; - } - pi = strstr(p, "InChI=1"); - if (pi != p) - { - continue; - } - - num_inp++; - ip->lMolfileNumber = num_inp; - - ReadWriteInChI(&ic, &CG, &tmpinpustream, pout, plog, ip, sd, NULL, 0, 0, NULL, NULL, NULL, 0, NULL); - - /*fprintf( stderr, "%ld", num_inp );*/ - inchi_strbuf_reset(pTmpIn); - inchi_ios_flush2(plog, stderr); - } - fprintf(stderr, "\r"); - inchi_strbuf_close(pTmpIn); - } - else - { - /* loop through file lines within ReadWriteInChI */ - ReadWriteInChI(&ic, &CG, inp_file, pout, plog, ip, sd, NULL, 0, 0, NULL, NULL, NULL, 0, NULL); - - num_inp = sd->fPtrStart; - num_err = sd->fPtrEnd; - } - - inchi_ios_flush2(plog, stderr); - ulTotalProcessingTime = sd->ulStructTime; - /*num_inp = sd->fPtrStart; - num_err = sd->fPtrEnd; - */ - goto exit_function; - } - - - ulTotalProcessingTime = 0; - if (pStructPtrs) - { - memset(pStructPtrs, 0, sizeof(pStructPtrs[0])); /* djb-rwth: memset_s C11/Annex K variant? */ - } - output_error_inchi = ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR; - - - /*************************************************************/ - /* Main cycle : read input structures and create their INChI */ - /*************************************************************/ - - - while (!sd->bUserQuit && !bInterrupted) - { - int do_renumbering = 0; - int next_action; - int have_err_in_GetOneStructure = 0; - int dup_fail = 0; - ORIG_ATOM_DATA SavedOrigAtData; /* 0=> disconnected, 1=> original */ - ORIG_ATOM_DATA* saved_orig_inp_data = &SavedOrigAtData; - char ikey0[28]; - ikey0[0] = '\0'; - - - next_action = GetTheNextRecordOfInputFile(&ic, sd, ip, szTitle, - inp_file, plog, pout, pprb, - orig_inp_data, &num_inp, pStructPtrs, - &nRet, &have_err_in_GetOneStructure, - &num_err, output_error_inchi); - if (next_action == DO_EXIT_FUNCTION) - { - goto exit_function; - } - else if (next_action == DO_BREAK_MAIN_LOOP) - { - break; - } - else if (next_action == DO_CONTINUE_MAIN_LOOP) - { - if (nRet == _IS_ERROR) /* may also be _IS_SKIP ... */ - { - if (output_error_inchi) - { - Output_RecordInfo(pout, num_inp, ip->bNoStructLabels, ip->pSdfLabel, ip->pSdfValue, ip->lSdfId, - pLF, pTAB); - emit_empty_inchi(ip, num_inp, pLF, pTAB, pout); - } - } - continue; - } - - - /* Create INChI for each connected component of the structure; - optionally display them; - output INChI for the whole structure */ - -#if (RENUMBER_ATOMS_AND_RECALC_V106 == 1 ) - if (ip->bRenumber == 1) - { - do_renumbering = 1; - } -#endif - if (do_renumbering == 0) - { - /* Normal calculations */ - next_action = CalcAndPrintINCHIAndINCHIKEY(&ic, &CG, sd, ip, szTitle, - pINChI, pINChI_Aux, - inp_file, plog, pout, pprb, - orig_inp_data, prep_inp_data, &num_inp, pStructPtrs, - &nRet, have_err_in_GetOneStructure, - &num_err, output_error_inchi, - strbuf, &ulTotalProcessingTime, - pLF, pTAB, ikey0, - 0 /* not silent */); - - FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); - FreeOrigAtData(orig_inp_data); - FreeOrigAtData(prep_inp_data); - FreeOrigAtData(prep_inp_data + 1); - } - else - { - /* Internal test mode: renumber atoms and recalculate repeatedly */ - long int nrepeat = 1; - /* 2! = 2 3! = 6 4! = 24 5! = 120 6! = 520 7! = 5040 8! = 40320 */ - if (orig_inp_data->num_inp_atoms == 1) - { - nrepeat = 1; - } - else if (orig_inp_data->num_inp_atoms == 2) - { - nrepeat = 2; - } - else if (orig_inp_data->num_inp_atoms == 3) - { - nrepeat = 6; - } - else - { - nrepeat = 1000; /* 100000;*/ /*16;*/ - } - /* correct (decrease repeat number) for relatively large molecules */ - if (orig_inp_data->num_inp_atoms > 128) - { - nrepeat = 100; /* 100000;*/ /*16;*/ - } - if (orig_inp_data->num_inp_atoms > 256) - { - nrepeat = 50; /* 100000;*/ /*16;*/ - } - if (orig_inp_data->num_inp_atoms > 512) - { - nrepeat = 25; /* 100000;*/ /*16;*/ - } - if (orig_inp_data->num_inp_atoms > 1024) - { - nrepeat = 10; /* 100000;*/ /*16;*/ - } - - /*inchi_ios_eprint(plog, "Number of random atom renumberings up to: %-ld\n", nrepeat); - inchi_ios_flush2(plog, stderr);*/ - -#if 0 - else if (orig_inp_data->num_inp_atoms == 4) - { - nrepeat = 24; - } - else - { - nrepeat = 10; - } - - else if (orig_inp_data->num_inp_atoms == 4) - { - nrepeat = 24; - } - else if (orig_inp_data->num_inp_atoms == 5) - { - nrepeat = 120; - } - else if (orig_inp_data->num_inp_atoms == 6) - { - nrepeat = 520; - } - else if (orig_inp_data->num_inp_atoms == 7) - { - nrepeat = 1000; - } - else - { - nrepeat = 10000; - } -#endif - - next_action = RepeatedlyRenumberAtomsAndRecalcINCHI(&ic, &CG, sd, ip, szTitle, - pINChI, pINChI_Aux, - inp_file, plog, pout, pprb, - orig_inp_data, prep_inp_data, &num_inp, pStructPtrs, - &nRet, have_err_in_GetOneStructure, - &num_err, output_error_inchi, - strbuf, &ulTotalProcessingTime, - pLF, pTAB, nrepeat); - } /* if (ip->bRenumber == 1) */ - - if (next_action == DO_EXIT_FUNCTION) - { - goto exit_function; - } - else if (next_action == DO_BREAK_MAIN_LOOP) - { - break; - } - else if (next_action == DO_CONTINUE_MAIN_LOOP) - { - continue; - } - } /* end of main cycle - while ( !sd->bUserQuit && !bInterrupted ) */ - - -exit_function: - /* Avoid memory leaks in case of fatal error */ - if (pStructPtrs && pStructPtrs->fptr) - { - inchi_free(pStructPtrs->fptr); - } - /* Free INChI memory */ - FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); - /* Free structure data */ - FreeOrigAtData(orig_inp_data); - FreeOrigAtData(prep_inp_data); - FreeOrigAtData(prep_inp_data + 1); - /* Close files */ - inchi_ios_close(inp_file); - inchi_ios_close(pout); - inchi_ios_close(pprb); - { - int hours, minutes, seconds, mseconds; - - SplitTime(ulTotalProcessingTime, &hours, &minutes, &seconds, &mseconds); - - inchi_ios_eprint(plog, "Finished processing %ld structure%s: %ld error%s, processing time %d:%02d:%02d.%02d\n", - num_inp, num_inp == 1 ? "" : "s", - num_err, num_err == 1 ? "" : "s", - hours, minutes, seconds, mseconds / 10); - inchi_ios_flush2(plog, stderr); - } -#if ( defined(_WIN32) && defined(_MSC_VER) ) -#if WINVER >= 0x0501 /* XP or newer */ /* 0x0600 Vista or newer */ - tick_inchi_stop = GetTickCount64(); /* djb-rwth: GetTickCount64() should be used */ - inchi_ios_eprint(plog, "\nElapsed walltime: %d msec.\n", tick_inchi_stop - tick_inchi_start); - inchi_ios_flush2(plog, stderr); -#endif -#endif - /* Final cleanup */ - inchi_ios_close(plog); - inchi_strbuf_close(strbuf); - for (i = 0; i < MAX_NUM_PATHS; i++) - { - if (ip->path[i]) - { - inchi_free((void*)ip->path[i]); /* cast deliberately discards 'const' qualifier */ - ip->path[i] = NULL; - } - } - SetBitFree(&CG); -#if ( ( BUILD_WITH_AMI==1 ) && defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) - if (bInterrupted) - { - return CTRL_STOP_EVENT; - } -#endif - - return 0; -} - - -/****************************************************************************/ -void save_command_line(int argc, char* argv[], INCHI_IOSTREAM* plog) -{ - int k; - - inchi_ios_eprint(plog, "The command line used:\n\""); - for (k = 0; k < argc - 1; k++) - { -#if( ALLOW_EMPTY_PATHS == 1 ) - inchi_ios_eprint(plog, "%-s ", argv[k][0] ? argv[k] : "\"\""); -#else - inchi_ios_eprint(plog, "%-s ", argv[k]); -#endif - } - - inchi_ios_eprint(plog, "%-s\"\n", argv[argc - 1]); - - return; -} - - -/*****************************************************************************/ -void emit_empty_inchi(INPUT_PARMS* ip, - long num_inp, - char* pLF, - char* pTAB, - INCHI_IOSTREAM* pout) -{ - if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) - { - inchi_ios_eprint(pout, "InChI=1S//\n"); /* emit empty Std InChI */ - } - else - { - inchi_ios_eprint(pout, "InChI=1//\n"); /* emit empty InChI */ - } - inchi_ios_flush(pout); -} -#endif /* ifndef TARGET_LIB_FOR_WINCHI */ - - -/*****************************************************************************/ -int GetTheNextRecordOfInputFile(struct tagINCHI_CLOCK* ic, - STRUCT_DATA* sd, INPUT_PARMS* ip, - char* szTitle, - INCHI_IOSTREAM* inp_file, - INCHI_IOSTREAM* plog, - INCHI_IOSTREAM* pout, - INCHI_IOSTREAM* pprb, - ORIG_ATOM_DATA* orig_inp_data, - long* num_inp, - STRUCT_FPTRS* pStructPtrs, - int* nRet, - int* have_err_in_GetOneStructure, - long* num_err, - int output_error_inchi) -{ - if (ip->last_struct_number && *num_inp >= ip->last_struct_number) - { - *nRet = _IS_EOF; /* simulate end of file */ - return DO_EXIT_FUNCTION; - } - - - *nRet = GetOneStructure(ic, sd, ip, szTitle, inp_file, - plog, pout, pprb, orig_inp_data, - num_inp, pStructPtrs); - - inchi_ios_flush2(plog, stderr); - - if (pStructPtrs) - pStructPtrs->cur_fptr++; - - if (sd->bUserQuit) - { - { - return DO_BREAK_MAIN_LOOP; - } - } - - *have_err_in_GetOneStructure = 0; - switch (*nRet) - { - case _IS_FATAL: - (*num_err)++; - if (output_error_inchi == 0) - { - return DO_EXIT_FUNCTION; - } - else - sd->pStrErrStruct[0] = '\0'; /* depress re-appearance of error as warning in ProcessOneStr */ - break; - case _IS_EOF: - return DO_EXIT_FUNCTION; - case _IS_ERROR: - (*num_err)++; - *have_err_in_GetOneStructure = 1; - if (output_error_inchi == 0) - { - return DO_CONTINUE_MAIN_LOOP; - } - else - sd->pStrErrStruct[0] = '\0'; /* depress re-appearance of error as warning in ProcessOneStr */ - break; - case _IS_SKIP: - return DO_CONTINUE_MAIN_LOOP; - default: - sd->pStrErrStruct[0] = '\0'; - } - - return DO_NEXT_STEP; -} - - -/****************************************************************************/ -int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, - CANON_GLOBALS* CG, - STRUCT_DATA* sd, - INPUT_PARMS* ip, - char* szTitle, - PINChI2* pINChI[INCHI_NUM], - PINChI_Aux2* pINChI_Aux[INCHI_NUM], - INCHI_IOSTREAM* inp_file, - INCHI_IOSTREAM* plog, - INCHI_IOSTREAM* pout, - INCHI_IOSTREAM* pprb, - ORIG_ATOM_DATA* orig_inp_data, - ORIG_ATOM_DATA* prep_inp_data, - long* num_inp, - STRUCT_FPTRS* pStructPtrs, - int* nRet, - int have_err_in_GetOneStructure, - long* num_err, - int output_error_inchi, - INCHI_IOS_STRING* strbuf, - unsigned long* pulTotalProcessingTime, - char* pLF, - char* pTAB, - char* ikey, - int silent) -{ - int nRet1; - int next_act = DO_NEXT_STEP; - /* related to hash of InChI */ - char ik_string[256]; /*^^^ Resulting InChIKey string */ - int ik_ret = 0; /*^^^ InChIKey-calc result code */ - int xhash1, xhash2; - char szXtra1[65], szXtra2[65]; - /* related to printing structure header */ - int print_record_info = 0; - INCHI_IOSTREAM temp_out; - INCHI_IOSTREAM* pout0 = &temp_out; - inchi_ios_init(pout0, INCHI_IOS_TYPE_STRING, NULL); - - - /* Calculate InChI */ - - nRet1 = ProcessOneStructureEx(ic, - CG, - sd, - ip, - szTitle, - pINChI, - pINChI_Aux, - inp_file, - plog, - pout0, /* note this */ - pprb, - orig_inp_data, - prep_inp_data, - *num_inp, strbuf, - 0 /* save_opt_bits */); - - inchi_ios_flush2(plog, stderr); - - - /* Output InChI */ - - /* print header for structure if applicable (no error arose, or have a request for empty InChI at error) */ - print_record_info = ((nRet1 == _IS_OKAY) || - (nRet1 == _IS_WARNING) || - ((nRet1 == _IS_ERROR || nRet1 == _IS_FATAL) && output_error_inchi)); - if (print_record_info) - { - Output_RecordInfo(pout, *num_inp, ip->bNoStructLabels, - ip->pSdfLabel, ip->pSdfValue, ip->lSdfId, pLF, pTAB); - } - if (pout0->s.pStr) - { - /* post-process output to correctly treat 'tabbed with InChIKey' mode */ - if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) - { - if (ip->bCalcInChIHash != INCHIHASH_NONE) - { - if (pout0->s.pStr) - { - if (pout0->s.nUsedLength > 0) - { - if (pout0->s.pStr[pout0->s.nUsedLength - 1] == '\n') - { - pout0->s.pStr[pout0->s.nUsedLength - 1] = '\t'; - } - } - } - } - } - /* print InChI string (may be string for empty InChI) */ - if (!ip->bHideInChI) - { - inchi_ios_print(pout, "%-s", pout0->s.pStr); - } - } - /*inchi_ios_close(pout0);*/ /* free temporary out */ - - - *pulTotalProcessingTime += sd->ulStructTime; - - if (nRet1 == _IS_SKIP) - { - next_act = DO_CONTINUE_MAIN_LOOP; - goto exit_function; - } - - *nRet = inchi_max(*nRet, nRet1); - switch (*nRet) - { - case _IS_FATAL: - if (!have_err_in_GetOneStructure) - { - /* increment error counter only if error did not appear earlier */ - (*num_err)++; - } - if (!(ip->bINChIOutputOptions & INCHI_OUT_NO_AUX_INFO) && - (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT)) - { - inchi_ios_print(pout, "\t"); - } - if (ip->bCalcInChIHash != INCHIHASH_NONE) - { - if (ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR) - { - if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) - { - inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYSA-N"); - } - else - { - inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYNA-N"); - } - } - } - inchi_ios_flush(pout); - next_act = DO_EXIT_FUNCTION; - goto exit_function; - - case _IS_ERROR: - if (!have_err_in_GetOneStructure) - { - /* increment error counter only if error did not appear earlier */ - (*num_err)++; - } - if (!(ip->bINChIOutputOptions & INCHI_OUT_NO_AUX_INFO) && - (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT)) - { - inchi_ios_print(pout, "\t"); - } - if (ip->bCalcInChIHash != INCHIHASH_NONE) - { - if (ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR) - { - if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) - { - inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYSA-N"); - } - else - { - inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYNA-N"); - } - } - } - inchi_ios_flush(pout); - next_act = DO_CONTINUE_MAIN_LOOP; - goto exit_function; - - case _IS_SKIP: - next_act = DO_CONTINUE_MAIN_LOOP; - goto exit_function; - } - - - /* Calculate hash[es] of InChI */ - - if (ip->bCalcInChIHash != INCHIHASH_NONE) - { - char* buf = NULL; - size_t slen = pout0->s.nUsedLength; - - extract_inchi_substring(&buf, pout0->s.pStr, slen); - - if (NULL == buf) - { - ik_ret = INCHIKEY_INVALID_INCHI; - } - else - { - xhash1 = xhash2 = 0; - if ((ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1) || - (ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1_XTRA2)) - { - xhash1 = 1; - } - if ((ip->bCalcInChIHash == INCHIHASH_KEY_XTRA2) || - (ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1_XTRA2)) - { - xhash2 = 1; - } - ik_ret = GetINCHIKeyFromINCHI(buf, xhash1, xhash2, ik_string, szXtra1, szXtra2); - inchi_free(buf); - } - - - /* Print hash[es] */ - - if (ik_ret == INCHIKEY_OK) - { - /* NB: correctly treat tabbed output with InChIKey & hash extensions */ - char csep = '\n'; - - if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) - { - csep = '\t'; - } - if (!ip->bMergeHash) - { - inchi_ios_print(pout, "InChIKey=%-s", ik_string); - } - else - { - inchi_ios_print(pout, "InChIHash=%-s", ik_string); - } - strcpy(ikey, ik_string); - - if (szXtra1[0] && ip->bMergeHash) - { - inchi_ios_print(pout, "-%-s", szXtra1); - } - else if (szXtra1[0] && !ip->bMergeHash) - { - inchi_ios_print(pout, "%cXHash1=%-s", csep, szXtra1); - } - else if (!szXtra1[0] && ip->bMergeHash) - { - inchi_ios_print(pout, "-"); - } - - if (szXtra2[0] && ip->bMergeHash) - { - inchi_ios_print(pout, "-%-s", szXtra2); - } - else if (szXtra2[0] && !ip->bMergeHash) - { - inchi_ios_print(pout, "%cXHash2=%-s", csep, szXtra2); - } - else if (!szXtra2[0] && ip->bMergeHash) - { - inchi_ios_print(pout, "-"); - } - - inchi_ios_print(pout, "\n"); - } - else - { - inchi_ios_print(plog, "Warning (Could not compute InChIKey: ", num_inp); - switch (ik_ret) - { - case INCHIKEY_UNKNOWN_ERROR: - inchi_ios_print(plog, "unresolved error)"); - break; - case INCHIKEY_EMPTY_INPUT: - inchi_ios_print(plog, "got an empty string)"); - break; - case INCHIKEY_INVALID_INCHI_PREFIX: - case INCHIKEY_INVALID_INCHI: - case INCHIKEY_INVALID_STD_INCHI: - inchi_ios_print(plog, "no valid InChI string found)"); - break; - case INCHIKEY_NOT_ENOUGH_MEMORY: - inchi_ios_print(plog, "not enough memory to treat the string)"); - break; - default: inchi_ios_print(plog, "internal program error)"); - break; - } - inchi_ios_print(plog, " structure #%-lu.\n", *num_inp); - if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) - { - inchi_ios_print(pout, "\n"); - } - } - - if (!silent) - { - inchi_ios_flush(pout); - inchi_ios_flush2(plog, stderr); - } - else - { - inchi_ios_free_str(pout); - inchi_ios_free_str(plog); - } - } - else - { - inchi_ios_flush(pout); - } - -exit_function: - inchi_ios_close(pout0); /* free temporary out */ - - return next_act; -} - - -#ifdef RENUMBER_ATOMS_AND_RECALC_V106 - -/*****************************************************************************/ - -int numbers_rrar[PERMAXATOMS]; /* djb-rwth: placed as a global variable to avoid function buffer issues */ -int RepeatedlyRenumberAtomsAndRecalcINCHI(struct tagINCHI_CLOCK* ic, - CANON_GLOBALS* CG, - STRUCT_DATA* sd, - INPUT_PARMS* ip, - char* szTitle, - PINChI2* pINChI[INCHI_NUM], - PINChI_Aux2* pINChI_Aux[INCHI_NUM], - INCHI_IOSTREAM* inp_file, - INCHI_IOSTREAM* plog, - INCHI_IOSTREAM* pout, - INCHI_IOSTREAM* pprb, - ORIG_ATOM_DATA* orig_inp_data, - ORIG_ATOM_DATA* prep_inp_data, - long* num_inp, - STRUCT_FPTRS* pStructPtrs, - int* nRet, - int have_err_in_GetOneStructure, - long* num_err, - int output_error_inchi, - INCHI_IOS_STRING* strbuf, - unsigned long* pulTotalProcessingTime, - char* pLF, - char* pTAB, - long int nrepeat) -{ - int next_action = DO_NEXT_STEP; - int dup_fail = 0; - ORIG_ATOM_DATA SavedOrigAtData; /* 0=> disconnected, 1=> original */ - ORIG_ATOM_DATA* saved_orig_inp_data = &SavedOrigAtData; - char ikey0[28]; - - const int very_silent = 2; /* 3 0;*/ - - /* Internal test mode: renumber atoms and recalculate repeatedly */ - - /* do not forget to use /key and to not use /auxnone */ - - - ikey0[0] = '\0'; - { - int k; - for (k = 0; k < orig_inp_data->num_inp_atoms; k++) - { - numbers_rrar[k] = k; - } - for (k = orig_inp_data->num_inp_atoms; k < PERMAXATOMS; k++) - { - numbers_rrar[k] = -1; - } - } - - - - -#if BIG_POLY_DEBUG - { int k; ITRACE_("\nAtoms = {"); for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) ITRACE_(" %-03d,", numbers_rrar[k]); ITRACE_(" %-03d }", numbers_rrar[orig_inp_data->num_inp_atoms - 1]); } - OrigAtData_DebugTrace(orig_inp_data); - OrigAtDataPolymer_DebugTrace(orig_inp_data->polymer); -#endif - - memset(saved_orig_inp_data, 0, sizeof(*saved_orig_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ - dup_fail = OrigAtData_Duplicate(saved_orig_inp_data, orig_inp_data); - - next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, - pINChI, pINChI_Aux, - inp_file, plog, pout, pprb, - orig_inp_data, prep_inp_data, num_inp, pStructPtrs, - nRet, have_err_in_GetOneStructure, - num_err, output_error_inchi, - strbuf, pulTotalProcessingTime, - pLF, pTAB, ikey0, very_silent); - FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); - FreeOrigAtData(orig_inp_data); - FreeOrigAtData(prep_inp_data); - FreeOrigAtData(prep_inp_data + 1); - - - if (ikey0[0]) - { - if (very_silent < 2) - { - inchi_ios_eprint(plog, "#%-ld-%08ld\t...\t%-s\t%s%s%s%s\n", *num_inp, 1, ikey0, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue)); - } - } - - - if (!dup_fail) - { - int irepeat = 0; - int ndiff = 0; - int n_written_problems = 0; - char ikey[28]; - ikey[0] = '\0'; - for (irepeat = 0; irepeat < nrepeat - 1; irepeat++) - { - dup_fail = OrigAtData_Duplicate(orig_inp_data, saved_orig_inp_data); - if (!dup_fail) - { - shuffle((void*)numbers_rrar, orig_inp_data->num_inp_atoms, sizeof(int)); - OrigAtData_Permute(orig_inp_data, saved_orig_inp_data, numbers_rrar); -#if BIG_POLY_DEBUG - { int k; ITRACE_("\nAtoms = {"); for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) ITRACE_(" %-03d,", numbers_rrar[k]); ITRACE_(" %-03d }", numbers_rrar[orig_inp_data->num_inp_atoms - 1]); } - OrigAtData_DebugTrace(saved_orig_inp_data); - OrigAtData_DebugTrace(orig_inp_data); - OrigAtDataPolymer_DebugTrace(saved_orig_inp_data->polymer); - OrigAtDataPolymer_DebugTrace(orig_inp_data->polymer); -#endif - next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, - pINChI, pINChI_Aux, - inp_file, plog, pout, pprb, - orig_inp_data, - prep_inp_data, num_inp, pStructPtrs, - nRet, have_err_in_GetOneStructure, - num_err, output_error_inchi, - strbuf, pulTotalProcessingTime, - pLF, pTAB, ikey, - 0 /* 1 be silent */); - - - if (ikey0[0] && ikey[0]) - { - if (strcmp(ikey, ikey0)) - { - int result, bINChIOutputOptions = ip->bINChIOutputOptions; /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - ndiff++; - /*inchi_ios_eprint( plog, "!!! #%-ld-%05ld %s%s%s%s\tcurr %-s != %-s orig\n", *num_inp, irepeat + 2, SDF_LBL_VAL( ip->pSdfLabel, ip->pSdfValue ), ikey, ikey0 );*/ - /*inchi_ios_eprint( plog, "!!! %s%s%s%s renum#%05ld\t%-s != %-s\n", SDF_LBL_VAL( ip->pSdfLabel, ip->pSdfValue ), irepeat + 2, ikey, ikey0 );*/ - inchi_ios_eprint(plog, "!!! #%-ld %s%s%s%s\t%-s --> %-s @ renum#%06d/%06ld\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue), ikey0, ikey, irepeat + 2, nrepeat); - if (!very_silent) - { - int k; - inchi_ios_eprint(plog, "Atoms = {"); - for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) - { - inchi_ios_eprint(plog, " %-d,", numbers_rrar[k] + 1); - } - inchi_ios_eprint(plog, " %-d }\n\n", numbers_rrar[orig_inp_data->num_inp_atoms - 1] + 1); - } - ip->bINChIOutputOptions |= INCHI_OUT_SDFILE_ONLY; - result = OrigAtData_SaveMolfile(orig_inp_data, sd, ip, *num_inp, pprb); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - inchi_ios_flush(pprb); - ip->bINChIOutputOptions = bINChIOutputOptions; - if (result == 0) - { - n_written_problems++; - } -#if 0 - /* second pass, non-silent one */ - FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); - FreeOrigAtData(orig_inp_data); - FreeOrigAtData(prep_inp_data); - FreeOrigAtData(prep_inp_data + 1); - dup_fail = OrigAtData_Duplicate(orig_inp_data, saved_orig_inp_data); - if (!dup_fail) - { - OrigAtData_Permute(orig_inp_data, saved_orig_inp_data, numbers_rrar); - next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, - pINChI, pINChI_Aux, - inp_file, plog, pout, pprb, - orig_inp_data, - prep_inp_data, num_inp, pStructPtrs, - nRet, have_err_in_GetOneStructure, - num_err, output_error_inchi, - strbuf, pulTotalProcessingTime, - pLF, pTAB, ikey, 0); - } -#endif - } - - if (irepeat == nrepeat - 2) - { - if (very_silent < 2) - { - inchi_ios_eprint(plog, "...........\n#%-ld-%08ld\t...\t%-s\t%s%s%s%s\n", *num_inp, irepeat + 2, ikey0, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue)); - } - } - - } - } - FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); - FreeOrigAtData(orig_inp_data); - FreeOrigAtData(prep_inp_data); - FreeOrigAtData(prep_inp_data + 1); - -#ifdef STOP_AFTER_FIRST_CHANGE_ON_RENUMBERING - if (ndiff == 1) - { - next_action = DO_CONTINUE_MAIN_LOOP; - break; - } -#endif - } - if (ndiff == 0) - { - if (very_silent < 3) - { - /*inchi_ios_eprint( plog, "#%-ld-%05ld\t...\tOK ALL\n", *num_inp, nrepeat );*/ - /*inchi_ios_eprint( plog, "OK #%-ld %s%s%s%s\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue));*/ - /*inchi_ios_eprint(plog, "#%-ld\n", *num_inp);*/ - inchi_ios_eprint(plog, "OK #%-ld %s%s%s%s\t%-s\t Same for %-d/%-d renums\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue), ikey0, nrepeat, nrepeat); - } - } - else - { -#ifdef STOP_AFTER_FIRST_CHANGE_ON_RENUMBERING - /*inchi_ios_eprint( plog, "#%-ld-%05ld\t...\tDIFF %-d\n", num_inp, nrepeat, ndiff );*/ -#else - inchi_ios_eprint(plog, "#%-ld-%05ld\t...\tDIFF %-d\n", num_inp, nrepeat, ndiff); -#endif - } - - FreeOrigAtData(saved_orig_inp_data); - } - - return next_action; -} - - -#endif From c34b488fb81cf8f1cb42c976f3a23d94e3a58d5f Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 8 Dec 2025 14:48:07 +0000 Subject: [PATCH 03/41] added unit test for ProcessSingleInputFile --- .gitignore | 1 + INCHI-1-SRC/INCHI_BASE/src/ichimain.c | 1 - INCHI-1-SRC/INCHI_BASE/src/ichimain.h | 5 +- .../tests/test_unit/fixtures/caffeine.mol | 55 + .../tests/test_unit/fixtures/test_mols.sdf | 1976 +++++++++++++++++ .../tests/test_unit/fixtures/test_mols_2.sdf | 320 +++ .../tests/test_unit/test_ichimain.cpp | 241 +- 7 files changed, 2583 insertions(+), 16 deletions(-) create mode 100644 INCHI-1-TEST/tests/test_unit/fixtures/caffeine.mol create mode 100644 INCHI-1-TEST/tests/test_unit/fixtures/test_mols.sdf create mode 100644 INCHI-1-TEST/tests/test_unit/fixtures/test_mols_2.sdf diff --git a/.gitignore b/.gitignore index ae1a6c21..8e8a17cd 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ build/ Testing/ googletest/ *.egg-info/ +inchi_mol_test_*/ .clang-format # Ignore core dump files core.*[0-9] diff --git a/INCHI-1-SRC/INCHI_BASE/src/ichimain.c b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c index ccdc9aeb..326dfb7b 100644 --- a/INCHI-1-SRC/INCHI_BASE/src/ichimain.c +++ b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c @@ -2,7 +2,6 @@ * International Chemical Identifier (InChI) * Version 1 * Software version 1.07 - * April 30, 2024 * * MIT License * diff --git a/INCHI-1-SRC/INCHI_BASE/src/ichimain.h b/INCHI-1-SRC/INCHI_BASE/src/ichimain.h index 02f999eb..779d6b3e 100644 --- a/INCHI-1-SRC/INCHI_BASE/src/ichimain.h +++ b/INCHI-1-SRC/INCHI_BASE/src/ichimain.h @@ -2,7 +2,6 @@ * International Chemical Identifier (InChI) * Version 1 * Software version 1.07 - * April 30, 2024 * * MIT License * @@ -164,7 +163,7 @@ typedef struct tagINCHI_OUT_CTL char szTag2[PRINT_INCHI_MAX_TAG_LEN]; char szTag3[PRINT_INCHI_MAX_TAG_LEN]; - int n_pzz; + int n_pzz; int n_zy; INCHI_SORT **pINChISortTautAndNonTaut; @@ -521,7 +520,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, OAD_StructureEdits *ed, int *ret); void OAD_CollectFragmentBondsAndAtoms( ORIG_ATOM_DATA *at_data, - int nforbidden, + int nforbidden, int *forbidden_orig, int *n_fragbonds, int **fragbonds, diff --git a/INCHI-1-TEST/tests/test_unit/fixtures/caffeine.mol b/INCHI-1-TEST/tests/test_unit/fixtures/caffeine.mol new file mode 100644 index 00000000..9373920c --- /dev/null +++ b/INCHI-1-TEST/tests/test_unit/fixtures/caffeine.mol @@ -0,0 +1,55 @@ +C8H10N4O2 +APtclcactv08142501153D 0 0.00000 0.00000 + + 24 25 0 0 0 0 0 0 0 0999 V2000 + 1.3120 -1.0479 0.0025 N 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2465 -2.1762 0.0031 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7906 0.2081 0.0010 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9938 0.3838 0.0002 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9714 1.2767 -0.0001 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5339 2.6294 -0.0017 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4026 1.0989 -0.0001 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4446 1.9342 -0.0010 N 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5608 1.2510 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2862 -0.0680 0.0015 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.2614 -1.1612 0.0029 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9114 -0.1939 0.0014 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0163 -1.2853 -0.0022 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4380 -2.4279 -0.0068 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2697 -1.8004 0.0022 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0830 -2.7828 0.8938 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0821 -2.7846 -0.8862 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.6223 2.5703 -0.0019 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1987 3.1611 -0.8923 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1990 3.1632 0.8877 H 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5520 1.6797 -0.0001 H 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5037 -1.4333 -1.0244 H 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8389 -2.0244 0.5173 H 0 0 0 0 0 0 0 0 0 0 0 0 + -4.1672 -0.8395 0.5168 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 1 3 1 0 0 0 0 + 3 4 2 0 0 0 0 + 3 5 1 0 0 0 0 + 5 6 1 0 0 0 0 + 5 7 1 0 0 0 0 + 7 8 1 0 0 0 0 + 8 9 2 0 0 0 0 + 9 10 1 0 0 0 0 + 10 11 1 0 0 0 0 + 10 12 1 0 0 0 0 + 7 12 2 0 0 0 0 + 12 13 1 0 0 0 0 + 1 13 1 0 0 0 0 + 13 14 2 0 0 0 0 + 2 15 1 0 0 0 0 + 2 16 1 0 0 0 0 + 2 17 1 0 0 0 0 + 6 18 1 0 0 0 0 + 6 19 1 0 0 0 0 + 6 20 1 0 0 0 0 + 9 21 1 0 0 0 0 + 11 22 1 0 0 0 0 + 11 23 1 0 0 0 0 + 11 24 1 0 0 0 0 +M END + diff --git a/INCHI-1-TEST/tests/test_unit/fixtures/test_mols.sdf b/INCHI-1-TEST/tests/test_unit/fixtures/test_mols.sdf new file mode 100644 index 00000000..d3d970d8 --- /dev/null +++ b/INCHI-1-TEST/tests/test_unit/fixtures/test_mols.sdf @@ -0,0 +1,1976 @@ +Compound 20652 +Actelion Java MolfileCreator 1.0 + +101110 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0153 1.5192 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2737 2.2865 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3351 2.2865 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9029 0.4297 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2277 3.8057 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3504 3.8057 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8875 -1.0589 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0614 4.5730 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3147 3.4528 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1766 -1.7955 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5678 -1.7955 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.8518 4.8799 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6344 2.7162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4656 -1.0282 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1612 -3.2840 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5524 -3.2840 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9541 3.4835 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6498 1.2277 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4503 0.4911 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4503 -4.0206 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8415 -4.0206 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7673 -4.0206 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2739 2.7469 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9695 0.4911 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3607 0.4911 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1305 1.2583 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7393 1.2583 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4349 -5.5091 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.0870 -3.2533 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7826 -5.5091 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2892 1.2583 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -8.5936 3.5142 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3761 -0.9975 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1152 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0283 0.5218 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7240 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7240 -6.2457 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1152 -6.2457 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1024 -1.7341 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1024 -6.2457 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5064 -6.2457 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -8.6090 5.0334 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -9.9133 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6958 -1.7341 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4042 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8568 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3174 1.2890 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0130 3.5449 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0130 -5.4784 -0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7086 -7.7342 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2686 -7.6422 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8133 -0.9668 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.4911 -7.7342 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.9287 5.8007 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.2331 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7111 -3.2226 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3889 5.0641 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7955 5.0641 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 9.6064 0.5524 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3020 2.8083 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3889 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7801 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8287 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.2484 5.0641 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -12.5528 2.8083 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4221 -3.9592 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0309 -3.9592 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 10.8955 1.3197 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 9.5911 3.5756 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3735 -9.9594 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.7315 -7.8724 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8415 -9.7292 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.0282 -10.0054 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1484 -7.7036 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.8801 2.8390 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.1845 0.5831 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.3277 4.8953 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 8.8238 4.8953 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.6626 -10.6960 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0538 -10.6960 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1484 -10.6960 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4681 -8.4402 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.1692 3.6062 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0385 -12.1845 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1637 -12.1845 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4681 -9.9287 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3275 -12.9211 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7187 -12.9211 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4835 -12.9211 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8747 -12.9211 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7879 -10.6653 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3990 -12.1538 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.8032 -12.1538 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4988 -14.4096 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8901 -14.4096 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3836 -10.6346 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2098 -15.1462 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5806 -10.1282 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5831 -9.7906 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2251 -16.6348 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 2 3 2 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 5 8 1 0 0 0 0 + 6 9 2 0 0 0 0 + 7 10 1 0 0 0 0 + 8 11 2 0 0 0 0 + 8 12 1 0 0 0 0 + 10 13 1 6 0 0 0 + 10 14 1 0 0 0 0 + 11 15 1 0 0 0 0 + 11 16 1 0 0 0 0 + 12 17 2 0 0 0 0 + 14 18 1 6 0 0 0 + 14 19 1 0 0 0 0 + 20 15 1 6 0 0 0 + 16 21 1 0 0 0 0 + 16 22 2 0 0 0 0 + 17 23 1 0 0 0 0 + 18 24 1 0 0 0 0 + 19 25 2 0 0 0 0 + 19 26 1 0 0 0 0 + 20 27 1 0 0 0 0 + 20 28 1 0 0 0 0 + 21 29 1 0 0 0 0 + 23 30 1 6 0 0 0 + 23 31 1 0 0 0 0 + 24 32 2 0 0 0 0 + 24 33 1 0 0 0 0 + 26 34 1 0 0 0 0 + 27 35 1 0 0 0 0 + 28 36 1 1 0 0 0 + 28 37 1 0 0 0 0 + 29 38 2 0 0 0 0 + 29 39 1 0 0 0 0 + 30 40 1 0 0 0 0 + 31 41 2 0 0 0 0 + 31 42 1 0 0 0 0 + 33 43 1 1 0 0 0 + 33 44 1 0 0 0 0 + 34 45 1 6 0 0 0 + 35 46 1 0 0 0 0 + 35 47 1 0 0 0 0 + 48 36 1 1 0 0 0 + 37 49 1 6 0 0 0 + 38 50 1 0 0 0 0 + 38 51 1 0 0 0 0 + 39 52 2 0 0 0 0 + 40 53 2 0 0 0 0 + 54 42 1 1 0 0 0 + 43 55 1 0 0 0 0 + 44 56 1 0 0 0 0 + 45 57 1 0 0 0 0 + 46 58 1 1 0 0 0 + 47 59 1 0 0 0 0 + 48 60 1 0 0 0 0 + 48 61 1 0 0 0 0 + 51 62 2 0 0 0 0 + 54 63 1 0 0 0 0 + 54 64 1 0 0 0 0 + 56 65 1 0 0 0 0 + 56 66 1 0 0 0 0 + 57 67 2 0 0 0 0 + 57 68 1 0 0 0 0 + 60 69 1 0 0 0 0 + 61 70 1 0 0 0 0 + 62 71 1 0 0 0 0 + 63 72 2 0 0 0 0 + 63 73 1 0 0 0 0 + 64 74 2 0 0 0 0 + 64 75 1 0 0 0 0 + 69 76 1 0 0 0 0 + 69 77 1 6 0 0 0 + 70 78 1 6 0 0 0 + 70 79 1 0 0 0 0 + 71 80 1 1 0 0 0 + 71 81 1 0 0 0 0 + 74 82 1 0 0 0 0 + 75 83 2 0 0 0 0 + 76 84 1 6 0 0 0 + 81 85 1 0 0 0 0 + 82 86 1 0 0 0 0 + 82 87 2 0 0 0 0 + 85 88 2 0 0 0 0 + 85 89 1 0 0 0 0 + 86 90 2 0 0 0 0 + 86 91 1 0 0 0 0 + 87 92 1 0 0 0 0 + 89 93 1 0 0 0 0 + 90 94 1 0 0 0 0 + 90 95 1 0 0 0 0 + 91 96 2 0 0 0 0 + 93 97 1 1 0 0 0 + 95 98 2 0 0 0 0 + 97 99 2 0 0 0 0 + 97100 1 0 0 0 0 + 98101 1 0 0 0 0 + 7 9 1 0 0 0 0 + 17 22 1 0 0 0 0 + 34 40 1 0 0 0 0 + 37 46 1 0 0 0 0 + 52 62 1 0 0 0 0 + 70 76 1 0 0 0 0 + 81 73 1 1 0 0 0 + 83 87 1 0 0 0 0 + 91 93 1 0 0 0 0 + 96 98 1 0 0 0 0 +M END +> +Compound 20652 + +> +BIO-423 + +> +VANCOMYCIN HYDROCHLORIDE + +> +Products for Life Science + +> +1404-93-9 + +> +1485.7 + +> +'93.5% (Vanomycin base) + +> +MFCD03613611 + +$$$$ +Compound 20656 +Actelion Java MolfileCreator 1.0 + + 75 78 0 0 1 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4488 -0.4553 -0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3036 1.4902 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7799 -1.9179 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8279 2.5112 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0631 -2.2628 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5243 4.0013 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2352 2.0559 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3804 -3.8496 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.3739 -1.3384 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.4974 0.3311 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4218 3.0907 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -5.0500 -4.4153 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.5467 -1.5453 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.8910 0.2070 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.9258 2.6630 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.8088 -3.2563 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -5.5329 -5.6019 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.9396 1.3522 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.9803 0.8141 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3259 0.9244 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0158 3.6564 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.7057 -6.0158 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2359 -6.7471 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.6229 1.2280 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2635 2.5112 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0079 2.2490 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.4429 0.0690 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5677 0.5657 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -5.7123 5.1466 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.1131 -5.1190 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.5671 -8.2097 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.3266 -0.1656 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.5060 2.3732 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.9541 -0.7727 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.8437 6.1676 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2911 5.6295 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.3687 -5.6295 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.7405 -3.5322 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0158 -8.6650 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4632 -9.2031 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -9.0237 2.2352 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.4304 -1.1866 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0020 -1.8627 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5401 7.6577 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9875 7.1196 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.7616 -2.6630 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.2504 -2.9251 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.6584 0.8693 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.9206 3.4770 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.6032 -0.2070 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.3056 -3.3391 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.1190 8.1407 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3949 -4.1807 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.6650 -0.2070 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -11.1762 0.7313 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -9.3135 4.8706 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.8844 -4.2083 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.4232 -3.9600 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.8154 9.6308 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.8496 -3.5460 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.8109 -0.6347 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.2103 6.1124 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.1328 -5.6985 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.6439 -5.2845 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6564 -2.4146 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5526 -4.7188 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -13.3286 -0.7727 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7281 5.9744 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.7333 -6.4849 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.9633 -2.1386 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -14.2255 0.4691 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -12.6249 7.2162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -12.0178 8.6098 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -14.1427 7.0782 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 1 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 5 7 1 1 0 0 0 + 5 8 1 0 0 0 0 + 6 9 1 0 0 0 0 + 6 10 1 6 0 0 0 + 8 11 2 0 0 0 0 + 8 12 1 0 0 0 0 + 9 13 1 0 0 0 0 + 10 14 2 0 0 0 0 + 10 15 1 0 0 0 0 + 12 16 1 0 0 0 0 + 13 17 2 0 0 0 0 + 13 18 1 0 0 0 0 + 15 19 1 0 0 0 0 + 15 20 1 0 0 0 0 + 16 21 1 0 0 0 0 + 16 22 1 6 0 0 0 + 18 23 1 0 0 0 0 + 18 24 1 6 0 0 0 + 19 25 1 6 0 0 0 + 19 26 1 0 0 0 0 + 20 27 1 0 0 0 0 + 21 28 2 0 0 0 0 + 21 29 1 0 0 0 0 + 22 30 1 0 0 0 0 + 23 31 1 0 0 0 0 + 24 32 1 0 0 0 0 + 25 33 2 0 0 0 0 + 25 34 1 0 0 0 0 + 29 35 1 0 0 0 0 + 30 36 2 0 0 0 0 + 30 37 1 0 0 0 0 + 31 38 2 0 0 0 0 + 31 39 1 0 0 0 0 + 32 40 2 0 0 0 0 + 32 41 1 0 0 0 0 + 42 34 1 6 0 0 0 + 35 43 1 0 0 0 0 + 35 44 1 1 0 0 0 + 36 45 1 0 0 0 0 + 37 46 2 0 0 0 0 + 39 47 1 0 0 0 0 + 39 48 1 1 0 0 0 + 42 49 1 0 0 0 0 + 42 50 1 0 0 0 0 + 43 51 2 0 0 0 0 + 44 52 1 0 0 0 0 + 45 53 2 0 0 0 0 + 48 54 1 0 0 0 0 + 49 55 2 0 0 0 0 + 49 56 1 0 0 0 0 + 50 57 1 0 0 0 0 + 52 58 2 0 0 0 0 + 52 59 1 0 0 0 0 + 53 60 1 0 0 0 0 + 54 61 1 0 0 0 0 + 56 62 1 0 0 0 0 + 57 63 1 0 0 0 0 + 58 64 1 0 0 0 0 + 59 65 2 0 0 0 0 + 61 66 2 0 0 0 0 + 61 67 1 0 0 0 0 + 62 68 1 0 0 0 0 + 63 69 1 0 0 0 0 + 64 70 2 0 0 0 0 + 68 71 2 0 0 0 0 + 68 72 1 0 0 0 0 + 69 73 2 0 0 0 0 + 73 74 1 0 0 0 0 + 73 75 1 0 0 0 0 + 26 27 1 0 0 0 0 + 43 47 1 0 0 0 0 + 46 53 1 0 0 0 0 + 65 70 1 0 0 0 0 +M END +> +Compound 20656 + +> +BIO-992 + +> +VASOPRESSIN + +> +Products for Life Science + +> + + +> + + +> +' + +> +MFCD03839092 + +$$$$ +Compound 20659 +Actelion Java MolfileCreator 1.0 + + 33 34 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2913 0.7582 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0118 -1.4927 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5825 0.0118 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2794 2.2745 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5707 -1.4808 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8738 0.7700 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5707 3.0327 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8620 -2.2271 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8620 2.2864 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5588 4.5491 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8501 3.8027 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2439 5.3072 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8501 5.3072 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1414 3.0564 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0711 4.5609 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2320 6.8236 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1414 4.5609 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.4327 5.3191 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.7239 4.5728 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 9.0152 5.3309 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.7121 3.0801 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.3065 4.5846 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 11.5977 5.3428 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.8890 4.5964 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 11.5859 6.8591 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 14.1803 5.3546 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.8772 7.6173 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 15.4715 4.6083 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 14.1684 6.8710 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 16.7628 5.3665 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 15.4597 7.6292 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 15.4478 9.1455 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 1 3 1 0 0 0 0 + 2 4 2 0 0 0 0 + 2 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 4 7 1 0 0 0 0 + 5 8 2 0 0 0 0 + 6 9 1 0 0 0 0 + 7 10 2 0 0 0 0 + 8 11 1 0 0 0 0 + 11 12 1 6 0 0 0 + 11 13 1 0 0 0 0 + 11 14 1 0 0 0 0 + 12 15 3 0 0 0 0 + 13 16 1 0 0 0 0 + 13 17 1 0 0 0 0 + 14 18 1 0 0 0 0 + 18 19 1 0 0 0 0 + 19 20 1 0 0 0 0 + 20 21 1 0 0 0 0 + 20 22 1 0 0 0 0 + 21 23 1 0 0 0 0 + 23 24 1 0 0 0 0 + 24 25 2 0 0 0 0 + 24 26 1 0 0 0 0 + 25 27 1 0 0 0 0 + 26 28 2 0 0 0 0 + 27 29 1 0 0 0 0 + 27 30 2 0 0 0 0 + 29 31 1 0 0 0 0 + 30 32 1 0 0 0 0 + 32 33 1 0 0 0 0 + 8 10 1 0 0 0 0 + 28 30 1 0 0 0 0 +M END +> +Compound 20659 + +> +BIO-424 + +> +VERAPAMIL HYDROCHLORIDE + +> +Products for Life Science + +> +152-11-4 + +> +491.1 + +> +'>99% + +> +MFCD00055208 + +$$$$ +Compound 20668 +Actelion Java MolfileCreator 1.0 + + 37 42 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.8775 -1.1977 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3598 -1.0198 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 0.2609 -2.5614 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2374 -2.2175 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2255 0.2135 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.6404 -1.3400 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1384 -3.7592 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.2451 -2.7156 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.6207 -3.5813 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.6604 -1.7313 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.6485 -0.2253 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5218 -5.1229 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1464 -1.4942 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.8618 -4.0793 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.4983 -4.7790 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9843 -5.2770 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7195 -6.0004 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3085 -4.5418 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.8736 -6.4866 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9092 -7.4827 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3085 -6.0360 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6248 -3.7829 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.6958 -7.9689 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9843 -8.6686 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9646 -8.5263 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.3441 -7.0677 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6248 -6.7831 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9411 -4.5300 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5099 -8.8702 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0121 -8.7042 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9411 -6.0241 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0239 -10.1983 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2574 -6.7712 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7313 -10.9336 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.3402 -10.9336 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2574 -8.2654 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 1 0 0 0 0 + 4 8 1 0 0 0 0 + 4 9 1 0 0 0 0 + 5 10 1 0 0 0 0 + 5 11 1 0 0 0 0 + 6 12 1 0 0 0 0 + 8 13 1 0 0 0 0 + 9 14 1 0 0 0 0 + 9 15 1 0 0 0 0 + 10 16 2 0 0 0 0 + 13 17 1 0 0 0 0 + 13 18 1 0 0 0 0 + 15 19 1 0 0 0 0 + 17 20 1 0 0 0 0 + 18 21 1 0 0 0 0 + 19 22 2 0 0 0 0 + 19 23 1 0 0 0 0 + 20 24 1 0 0 0 0 + 21 25 1 0 0 0 0 + 21 26 1 0 0 0 0 + 21 27 1 0 0 0 0 + 22 28 1 0 0 0 0 + 23 29 2 0 0 0 0 + 24 30 1 0 0 0 0 + 24 31 1 0 0 0 0 + 28 32 2 0 0 0 0 + 31 33 2 0 0 0 0 + 32 34 1 0 0 0 0 + 33 35 1 0 0 0 0 + 33 36 1 0 0 0 0 + 34 37 1 0 0 0 0 + 8 10 1 0 0 0 0 + 11 12 1 0 0 0 0 + 15 17 2 0 0 0 0 + 20 22 1 0 0 0 0 + 25 30 1 0 0 0 0 + 29 32 1 0 0 0 0 +M END +> +Compound 20668 + +> +BIO-1002 + +> +VERRUCULOGEN FROM PENICILLIUM VERRUCULOSUM + +> +Products for Life Science + +> +12771-72-1 + +> + + +> +' + +> +MFCD00079645 + +$$$$ +Compound 20680 +Actelion Java MolfileCreator 1.0 + + 67 75 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2923 -0.7469 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2804 -2.2407 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5846 0.0119 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0356 -2.9877 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5727 -2.9877 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8768 -0.7351 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5727 1.5294 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3516 -2.2289 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0474 -4.4815 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8650 -2.2289 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5609 -4.4815 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1691 0.0237 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8650 2.2882 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2449 -5.2284 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3634 -5.2284 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1573 -2.9758 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1573 -1.4701 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.4614 -0.7232 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1573 1.5413 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6794 -4.4696 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3753 -6.7222 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.4495 -2.2170 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 7.7537 0.0356 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1454 3.0588 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.4495 2.3000 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9954 -5.2165 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6913 -7.4691 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.7418 1.5531 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0073 -6.7104 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3114 -4.4578 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.7031 -8.9630 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 9.0341 2.3119 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 9.0341 0.8062 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3232 -7.4573 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 10.3264 1.5650 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3351 -8.9511 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.3145 0.0711 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 11.6187 2.3237 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.6511 -9.6980 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0428 -9.6980 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 11.6068 -0.6758 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.9110 1.5768 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.6630 -11.1919 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0547 -11.1919 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.8991 0.0830 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 11.5950 -2.1696 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3707 -11.9388 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.9789 -11.9388 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 14.1914 -0.6639 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3825 -13.4326 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 15.4837 0.0948 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0902 -14.1795 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 16.7759 -0.6521 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 15.4718 1.6124 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.1021 -15.6734 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.7980 -13.4208 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 18.0682 0.1067 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 16.7641 2.3712 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8098 -16.4203 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5057 -14.1677 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 18.0564 1.6242 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 19.3605 -0.6402 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5175 -15.6615 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8217 -17.9141 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 19.3486 2.3830 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2253 -16.4084 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 2 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 4 8 1 0 0 0 0 + 5 9 1 0 0 0 0 + 5 10 1 0 0 0 0 + 6 11 1 0 0 0 0 + 6 12 2 0 0 0 0 + 7 13 1 0 0 0 0 + 8 14 2 0 0 0 0 + 10 15 2 0 0 0 0 + 16 10 1 1 0 0 0 + 11 17 2 0 0 0 0 + 13 18 1 1 0 0 0 + 13 19 1 0 0 0 0 + 13 20 1 0 0 0 0 + 16 21 1 0 0 0 0 + 16 22 1 0 0 0 0 + 19 23 2 0 0 0 0 + 19 24 1 0 0 0 0 + 20 25 1 1 0 0 0 + 20 26 1 0 0 0 0 + 21 27 1 0 0 0 0 + 22 28 1 0 0 0 0 + 24 29 1 0 0 0 0 + 27 30 1 0 0 0 0 + 27 31 1 0 0 0 0 + 28 32 1 0 0 0 0 + 29 33 1 0 0 0 0 + 29 34 1 6 0 0 0 + 30 35 1 6 0 0 0 + 33 36 1 0 0 0 0 + 37 35 1 1 0 0 0 + 36 38 1 0 0 0 0 + 36 39 1 0 0 0 0 + 37 40 1 0 0 0 0 + 37 41 1 0 0 0 0 + 38 42 1 0 0 0 0 + 39 43 1 0 0 0 0 + 40 44 1 0 0 0 0 + 41 45 1 0 0 0 0 + 42 46 1 0 0 0 0 + 42 47 1 6 0 0 0 + 44 48 1 0 0 0 0 + 44 49 1 6 0 0 0 + 46 50 1 0 0 0 0 + 48 51 1 6 0 0 0 + 50 52 1 0 0 0 0 + 53 51 1 1 0 0 0 + 52 54 1 0 0 0 0 + 52 55 1 0 0 0 0 + 53 56 1 0 0 0 0 + 53 57 1 0 0 0 0 + 54 58 1 0 0 0 0 + 55 59 2 0 0 0 0 + 56 60 1 0 0 0 0 + 57 61 2 0 0 0 0 + 58 62 1 0 0 0 0 + 58 63 1 6 0 0 0 + 60 64 1 0 0 0 0 + 60 65 1 6 0 0 0 + 62 66 2 0 0 0 0 + 64 67 2 0 0 0 0 + 7 11 1 0 0 0 0 + 12 15 1 0 0 0 0 + 14 20 1 0 0 0 0 + 26 29 1 0 0 0 0 + 28 30 1 0 0 0 0 + 43 46 1 0 0 0 0 + 45 48 1 0 0 0 0 + 59 62 1 0 0 0 0 + 61 64 1 0 0 0 0 +M END +> +Compound 20680 + +> +BIO-718 + +> +VINEOMYCIN A1 + +> +Products for Life Science + +> +78164-00-8 + +> +934.98 + +> +'>80% + +> +MFCD00079639 + +$$$$ +Compound 20681 +Actelion Java MolfileCreator 1.0 + + 67 74 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3071 0.7536 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3188 2.2609 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6141 0.0118 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0353 3.0145 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6259 3.0145 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9212 0.7654 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6259 -1.4719 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2482 2.2727 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0471 4.5218 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9330 2.2727 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6377 4.5218 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2283 0.0236 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9330 -2.2138 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3542 5.2754 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2364 5.2754 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2401 3.0263 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5354 0.7772 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2401 -1.4602 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5199 4.5335 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2246 6.7826 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5471 -2.2020 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8035 5.2872 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5082 7.5363 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5589 -3.6857 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7917 6.7944 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0870 4.5453 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.4964 9.0435 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8660 -4.4276 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2754 -4.4276 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2754 -2.9321 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0752 7.5480 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1731 -3.6739 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2872 -5.9113 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0634 9.0553 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1848 -2.1667 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4801 -4.4158 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5942 -6.6531 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0036 -6.6531 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.3470 9.8089 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7564 9.8089 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4919 -1.4131 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7872 -3.6622 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.3352 11.3162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7446 11.3162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7990 -2.1549 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.5037 0.0942 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0281 12.0698 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.6187 12.0698 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.1061 -1.4013 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0163 13.5771 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -14.4131 -2.1431 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7093 14.3307 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -14.4249 -3.6268 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -15.7202 -1.3895 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6975 15.8380 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.4022 13.5888 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -15.7320 -4.3687 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -17.0273 -2.1314 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3904 16.5916 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.0951 14.3425 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -17.0390 -3.6151 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -15.7437 -5.8524 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.0833 15.8497 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3786 18.0988 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -18.3461 -4.3569 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2237 16.6034 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 2 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 4 8 1 0 0 0 0 + 5 9 1 0 0 0 0 + 5 10 1 0 0 0 0 + 6 11 1 0 0 0 0 + 6 12 2 0 0 0 0 + 7 13 1 0 0 0 0 + 8 14 2 0 0 0 0 + 10 15 2 0 0 0 0 + 16 10 1 1 0 0 0 + 11 17 2 0 0 0 0 + 13 18 1 0 0 0 0 + 13 19 2 0 0 0 0 + 16 20 1 0 0 0 0 + 16 21 1 0 0 0 0 + 19 22 1 0 0 0 0 + 20 23 1 0 0 0 0 + 21 24 1 0 0 0 0 + 22 25 1 0 0 0 0 + 23 26 1 0 0 0 0 + 23 27 1 1 0 0 0 + 24 28 1 1 0 0 0 + 25 29 1 0 0 0 0 + 25 30 1 0 0 0 0 + 25 31 1 1 0 0 0 + 26 32 1 6 0 0 0 + 33 29 1 1 0 0 0 + 30 34 1 0 0 0 0 + 35 32 1 6 0 0 0 + 33 36 1 0 0 0 0 + 33 37 1 0 0 0 0 + 34 38 2 0 0 0 0 + 34 39 1 0 0 0 0 + 35 40 1 0 0 0 0 + 35 41 1 0 0 0 0 + 36 42 1 0 0 0 0 + 37 43 1 0 0 0 0 + 40 44 1 0 0 0 0 + 41 45 1 0 0 0 0 + 42 46 1 0 0 0 0 + 42 47 1 6 0 0 0 + 44 48 1 0 0 0 0 + 44 49 1 1 0 0 0 + 46 50 1 6 0 0 0 + 48 51 1 1 0 0 0 + 52 50 1 6 0 0 0 + 53 51 1 1 0 0 0 + 52 54 1 0 0 0 0 + 52 55 1 0 0 0 0 + 53 56 1 0 0 0 0 + 53 57 1 0 0 0 0 + 54 58 1 0 0 0 0 + 55 59 2 0 0 0 0 + 56 60 1 0 0 0 0 + 57 61 2 0 0 0 0 + 58 62 1 0 0 0 0 + 58 63 1 1 0 0 0 + 60 64 1 0 0 0 0 + 60 65 1 6 0 0 0 + 62 66 2 0 0 0 0 + 64 67 2 0 0 0 0 + 7 11 1 0 0 0 0 + 12 15 1 0 0 0 0 + 14 19 1 0 0 0 0 + 24 26 1 0 0 0 0 + 43 46 1 0 0 0 0 + 45 48 1 0 0 0 0 + 59 62 1 0 0 0 0 + 61 64 1 0 0 0 0 +M END +> +Compound 20681 + +> +BIO-719 + +> +VINEOMYCIN B2 + +> +Products for Life Science + +> +80928-52-5 + +> +934.98 + +> +' + +> +MFCD09752773 + +$$$$ +Compound 20685 +Actelion Java MolfileCreator 1.0 + + 57 65 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2264 -1.4844 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.6982 -2.3020 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9435 -2.4027 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.8743 -3.5222 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5032 -2.8555 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9121 -3.5348 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.0441 -0.8806 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.6731 -1.6605 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8302 -4.3147 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.3208 -4.9186 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 3.4090 -3.6355 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2895 0.1258 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3334 -0.3396 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0820 -2.2769 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2769 -4.7676 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.4530 -5.8872 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7487 -5.0947 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5412 -2.6417 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9562 1.4844 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0945 -1.1321 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.4656 0.6793 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4090 -3.7361 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.9058 -6.1388 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.4781 -7.3841 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0569 -5.7991 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5915 -1.0315 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4531 1.5724 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7299 -4.4783 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.4154 -5.9627 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5348 -7.5099 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4215 -6.2897 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7864 -8.0886 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0821 -7.2961 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.2582 0.3271 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1198 2.9310 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0633 -3.8493 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.8117 -6.2646 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.4278 -8.5037 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.5160 -8.5414 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.1196 -7.7489 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.2896 4.2141 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.5224 -4.8557 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.0067 -5.3085 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.8243 -7.7615 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1637 -9.8874 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7802 -9.9629 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.8998 -9.1704 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.4156 -5.7614 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.8181 -3.7990 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.1451 -8.5037 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4593 -10.6674 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0381 -10.6674 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.9879 -2.8430 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.4660 -7.7364 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.4911 -6.3904 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -9.7868 -8.4785 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 4 2 1 1 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 4 7 1 0 0 0 0 + 4 8 1 0 0 0 0 + 6 9 2 0 0 0 0 + 6 10 1 0 0 0 0 + 7 11 1 0 0 0 0 + 7 12 2 0 0 0 0 + 8 13 1 0 0 0 0 + 9 14 1 0 0 0 0 + 9 15 1 0 0 0 0 + 10 16 2 0 0 0 0 + 11 17 1 0 0 0 0 + 12 18 1 0 0 0 0 + 12 19 1 0 0 0 0 + 13 20 1 0 0 0 0 + 13 21 1 0 0 0 0 + 14 22 1 0 0 0 0 + 15 23 2 0 0 0 0 + 24 16 1 1 0 0 0 + 17 25 1 0 0 0 0 + 18 26 1 0 0 0 0 + 19 27 1 0 0 0 0 + 20 28 2 0 0 0 0 + 23 29 1 0 0 0 0 + 24 30 1 0 0 0 0 + 24 31 1 0 0 0 0 + 24 32 1 0 0 0 0 + 25 33 2 0 0 0 0 + 26 34 2 0 0 0 0 + 27 35 1 0 0 0 0 + 28 36 1 0 0 0 0 + 29 37 1 0 0 0 0 + 30 38 1 0 0 0 0 + 31 39 1 6 0 0 0 + 31 40 1 0 0 0 0 + 32 41 1 0 0 0 0 + 36 42 1 0 0 0 0 + 38 43 1 6 0 0 0 + 38 44 1 0 0 0 0 + 38 45 1 0 0 0 0 + 39 46 1 0 0 0 0 + 40 47 1 0 0 0 0 + 40 48 1 1 0 0 0 + 44 49 2 0 0 0 0 + 44 50 1 0 0 0 0 + 45 51 1 6 0 0 0 + 46 52 1 0 0 0 0 + 48 53 1 0 0 0 0 + 50 54 1 0 0 0 0 + 51 55 1 0 0 0 0 + 55 56 2 0 0 0 0 + 55 57 1 0 0 0 0 + 16 23 1 0 0 0 0 + 17 18 2 0 0 0 0 + 21 27 1 0 0 0 0 + 28 35 1 0 0 0 0 + 30 29 1 1 0 0 0 + 33 34 1 0 0 0 0 + 39 41 1 0 0 0 0 + 40 45 1 0 0 0 0 + 47 52 2 0 0 0 0 +M END +> +Compound 20685 + +> +BIO-802 + +> +VINORELBINE DITARTRATE SALT + +> +Products for Life Science + +> +125317-39-7 + +> +1079.12 + +> +'98% + +> +MFCD07367166 + +$$$$ +Compound 20693 +Actelion Java MolfileCreator 1.0 + + 38 40 0 0 1 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.6991 -1.2863 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5173 -2.1531 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0832 -0.7410 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4401 -3.3135 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.5512 -0.5872 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1.4820 0.6431 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.0133 -4.6837 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.7403 -2.5586 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0053 -0.8389 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8728 0.8808 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5865 1.6358 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7896 -6.1377 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5093 -4.5019 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.7543 -1.0486 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0406 -3.2856 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.4247 0.6012 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.6690 -1.5379 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.9713 -7.6058 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.7669 -3.0060 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 8.0252 -0.9507 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3562 -8.9479 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.2069 -3.3415 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.9759 -2.0692 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6285 -9.7309 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4055 -10.0664 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 8.6264 -5.1031 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.8109 -10.8774 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.6404 -6.5712 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2789 -10.9333 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.1084 -6.7249 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 8.2629 -7.9972 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6770 -11.3807 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.5079 -9.2695 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.9633 -10.6537 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.6683 -10.1643 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.4313 -10.2901 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4181 -9.2416 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 5 8 1 0 0 0 0 + 5 9 1 1 0 0 0 + 6 10 1 0 0 0 0 + 6 11 1 0 0 0 0 + 7 12 1 0 0 0 0 + 8 13 1 0 0 0 0 + 8 14 1 1 0 0 0 + 9 15 1 0 0 0 0 + 9 16 1 0 0 0 0 + 10 17 2 0 0 0 0 + 10 18 1 0 0 0 0 + 13 19 2 0 0 0 0 + 18 20 1 0 0 0 0 + 18 21 2 0 0 0 0 + 19 22 1 0 0 0 0 + 20 23 2 0 0 0 0 + 21 24 1 0 0 0 0 + 22 25 2 0 0 0 0 + 22 26 1 0 0 0 0 + 23 27 1 0 0 0 0 + 26 28 1 0 0 0 0 + 27 29 1 0 0 0 0 + 28 30 1 0 0 0 0 + 29 31 2 0 0 0 0 + 29 32 1 0 0 0 0 + 30 33 2 0 0 0 0 + 32 34 1 0 0 0 0 + 33 35 1 0 0 0 0 + 34 36 1 6 0 0 0 + 34 37 1 0 0 0 0 + 35 38 1 0 0 0 0 + 11 12 1 0 0 0 0 + 23 24 1 0 0 0 0 + 35 37 2 0 0 0 0 +M END +> +Compound 20693 + +> +BIO-425 + +> +VIRGINIAMYCIN M1 + +> +Products for Life Science + +> +21411-53-0 + +> +525.59 + +> +' + +> +MFCD00869411 + +$$$$ +Compound 20694 +Actelion Java MolfileCreator 1.0 + + 60 65 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.0711 1.5058 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3991 1.8497 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5533 1.6837 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6915 2.6441 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8931 2.3358 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9446 0.2490 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6520 3.8180 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6875 1.5296 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.9603 3.3911 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.8893 -0.8181 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.3911 -0.1067 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.9562 3.0828 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.1855 5.2290 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1578 2.5137 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 4.6242 4.7428 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2806 -2.2528 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7824 -1.5414 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.2605 3.8417 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.6440 4.9681 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2330 6.7348 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 4.8140 6.2368 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7981 3.8298 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.7271 -2.6085 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.2842 5.3594 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.5648 3.1065 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.7943 8.1814 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5175 7.7189 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.1894 6.8178 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.1735 4.4108 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.8691 3.8654 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -7.5767 1.6244 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.9168 9.4026 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.1460 8.8691 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.9048 8.2525 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7587 9.0232 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.3632 5.9048 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3474 3.4978 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -10.1733 3.1303 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.2961 0.8893 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -8.8809 0.8893 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9721 10.4935 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.6956 10.2682 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.4147 8.0628 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.6204 10.0192 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 4.9088 9.9836 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.1852 1.6481 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2609 10.6832 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5374 11.5250 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2213 10.6002 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.3793 11.2642 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.6480 11.4776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2134 12.1890 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.6244 12.7108 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5414 12.0705 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7981 12.4380 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2370 12.0112 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.5372 13.9320 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9761 13.5052 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.1263 14.4656 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 4 7 1 0 0 0 0 + 5 8 1 0 0 0 0 + 5 9 1 0 0 0 0 + 6 10 1 0 0 0 0 + 7 11 2 0 0 0 0 + 7 12 1 0 0 0 0 + 8 13 1 0 0 0 0 + 8 14 1 0 0 0 0 + 10 15 2 0 0 0 0 + 10 16 1 0 0 0 0 + 11 17 1 0 0 0 0 + 12 18 2 0 0 0 0 + 13 19 1 0 0 0 0 + 14 20 2 0 0 0 0 + 14 21 1 0 0 0 0 + 16 22 1 0 0 0 0 + 16 23 1 0 0 0 0 + 17 24 2 0 0 0 0 + 19 25 2 0 0 0 0 + 19 26 1 0 0 0 0 + 21 27 1 0 0 0 0 + 22 28 1 0 0 0 0 + 22 29 1 0 0 0 0 + 23 30 1 0 0 0 0 + 26 31 2 0 0 0 0 + 26 32 1 0 0 0 0 + 27 33 1 0 0 0 0 + 27 34 1 0 0 0 0 + 28 35 2 0 0 0 0 + 28 36 1 0 0 0 0 + 29 37 1 0 0 0 0 + 30 38 2 0 0 0 0 + 31 39 1 0 0 0 0 + 32 40 1 0 0 0 0 + 32 41 2 0 0 0 0 + 33 42 2 0 0 0 0 + 33 43 1 0 0 0 0 + 34 44 1 0 0 0 0 + 36 45 1 0 0 0 0 + 36 46 1 0 0 0 0 + 39 47 2 0 0 0 0 + 43 48 1 0 0 0 0 + 43 49 1 0 0 0 0 + 45 50 1 0 0 0 0 + 45 51 1 0 0 0 0 + 46 52 1 0 0 0 0 + 48 53 1 0 0 0 0 + 49 54 1 0 0 0 0 + 50 55 2 0 0 0 0 + 52 56 2 0 0 0 0 + 52 57 1 0 0 0 0 + 56 58 1 0 0 0 0 + 57 59 2 0 0 0 0 + 58 60 2 0 0 0 0 + 18 24 1 0 0 0 0 + 30 37 1 0 0 0 0 + 41 47 1 0 0 0 0 + 48 50 1 0 0 0 0 + 53 54 1 0 0 0 0 + 59 60 1 0 0 0 0 +M END +> +Compound 20694 + +> +BIO-1003 + +> +VIRGINIAMYCIN S1 + +> +Products for Life Science + +> +23152-29-6 + +> +823.9 + +> +' + +> +MFCD00864857 + +$$$$ +Compound 20697 +Actelion Java MolfileCreator 1.0 + + 33 34 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2839 0.7539 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5678 0.0118 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2721 2.2616 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8518 0.7656 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5561 -1.4724 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5561 3.0154 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0353 3.0154 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8400 2.2734 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1357 0.0236 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8400 -2.2145 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5443 4.5232 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3428 2.2734 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1239 3.0272 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1239 -1.4606 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6503 3.0272 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9578 2.2851 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6621 4.5349 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2652 3.0390 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5727 2.2969 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8802 3.0508 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1877 2.3087 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8920 4.5585 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4952 3.0626 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.8026 2.3205 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.1101 3.0743 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -14.4176 2.3323 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.1219 4.5821 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -15.7251 3.0861 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -17.0325 2.3440 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -18.3400 3.0979 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -18.3518 4.6056 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -19.6475 2.3558 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 2 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 4 8 1 0 0 0 0 + 5 9 1 0 0 0 0 + 5 10 1 0 0 0 0 + 6 11 2 0 0 0 0 + 7 12 1 0 0 0 0 + 8 13 1 0 0 0 0 + 9 14 2 0 0 0 0 + 10 15 2 0 0 0 0 + 13 16 2 0 0 0 0 + 16 17 1 0 0 0 0 + 16 18 1 0 0 0 0 + 17 19 1 0 0 0 0 + 19 20 1 0 0 0 0 + 20 21 1 0 0 0 0 + 21 22 1 0 0 0 0 + 21 23 1 6 0 0 0 + 22 24 1 0 0 0 0 + 24 25 1 0 0 0 0 + 25 26 1 0 0 0 0 + 26 27 1 0 0 0 0 + 26 28 1 6 0 0 0 + 27 29 1 0 0 0 0 + 29 30 1 0 0 0 0 + 30 31 1 0 0 0 0 + 31 32 1 0 0 0 0 + 31 33 1 0 0 0 0 + 7 9 1 0 0 0 0 + 11 15 1 0 0 0 0 +M END +> +Compound 20697 + +> +BIO-1005 + +> +VITAMIN K1 + +> +Products for Life Science + +> +84-80-0 + +> +450.7 + +> +' + +> +MFCD00214063 + +$$$$ +Compound 20716 +Actelion Java MolfileCreator 1.0 + + 11 12 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3095 -0.7432 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6189 0.0118 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3213 -2.2296 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9284 -0.7314 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6307 -2.9729 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2379 0.0236 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9402 -2.2178 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.9493 -4.4239 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -5.0609 -3.2088 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.4475 -4.5655 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 5 7 2 0 0 0 0 + 5 8 1 0 0 0 0 + 6 9 1 0 0 0 0 + 8 10 1 0 0 0 0 + 9 11 1 0 0 0 0 + 6 8 2 0 0 0 0 + 10 11 2 0 0 0 0 +M END +> +Compound 20716 + +> +BIO-1006 + +> +XANTHINE + +> +Products for Life Science + +> +69-89-6 + +> +152.11 + +> +' + +> +MFCD00078453 + +$$$$ +Compound 20727 +Actelion Java MolfileCreator 1.0 + + 44 47 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + 0.1420 -1.4795 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.1657 1.5031 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.4795 0.1657 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5031 -0.1420 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.4027 1.0889 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1541 -1.4676 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7990 2.4737 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9058 0.9469 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6336 -1.6452 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.3196 2.6394 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6985 3.7046 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.5331 -0.4143 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2609 -3.0063 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0362 -0.5563 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -5.7403 -3.3022 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5152 -4.2964 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.9357 0.6746 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9060 -4.7816 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.5331 -5.3971 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -2.0357 -4.4384 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2198 -5.5273 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.1599 -3.2075 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4321 -5.7995 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2316 -7.0186 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -8.5336 -4.7580 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7162 -1.8819 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3196 -3.3495 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.0473 -5.9415 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.8473 -5.5036 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8995 -0.6510 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9232 -4.7106 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.6510 -7.3027 -0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + -11.1611 -4.7343 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.8592 -6.9949 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.4027 -4.8527 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0121 -6.6754 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7338 -7.9063 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2546 -8.6638 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -12.4749 -5.4799 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.1729 -7.7406 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2785 -3.6217 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0063 -6.2138 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -12.4867 -6.9713 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 1 3 2 0 0 0 0 + 1 4 1 0 0 0 0 + 1 5 1 0 0 0 0 + 5 6 2 0 0 0 0 + 5 7 1 0 0 0 0 + 6 8 1 0 0 0 0 + 6 9 1 0 0 0 0 + 7 10 2 0 0 0 0 + 8 11 2 0 0 0 0 + 8 12 1 0 0 0 0 + 9 13 2 0 0 0 0 + 10 14 1 0 0 0 0 + 13 15 1 0 0 0 0 + 14 16 2 0 0 0 0 + 14 17 1 0 0 0 0 + 15 18 1 0 0 0 0 + 16 19 1 0 0 0 0 + 17 20 1 0 0 0 0 + 17 21 1 0 0 0 0 + 19 22 1 0 0 0 0 + 21 23 2 0 0 0 0 + 21 24 1 0 0 0 0 + 22 25 2 0 0 0 0 + 22 26 1 0 0 0 0 + 23 27 1 0 0 0 0 + 23 28 1 0 0 0 0 + 24 29 2 0 0 0 0 + 26 30 1 0 0 0 0 + 27 31 1 0 0 0 0 + 28 32 2 0 0 0 0 + 29 33 1 0 0 0 0 + 30 34 2 0 0 0 0 + 30 35 1 0 0 0 0 + 32 36 1 0 0 0 0 + 33 37 2 0 0 0 0 + 33 38 2 0 0 0 0 + 33 39 1 0 0 0 0 + 34 40 1 0 0 0 0 + 35 41 2 0 0 0 0 + 36 42 2 0 0 0 0 + 36 43 1 0 0 0 0 + 40 44 2 0 0 0 0 + 10 13 1 0 0 0 0 + 19 20 2 0 0 0 0 + 29 32 1 0 0 0 0 + 41 44 1 0 0 0 0 +M CHG 5 8 1 12 -1 14 1 36 1 43 -1 +M END +> +Compound 20727 + +> +BIO-1007 + +> +XTT SODIUM SALT + +> +Products for Life Science + +> +111072-31-2 + +> +673.53 + +> +' + +> +MFCD00083517 + +$$$$ +Compound 20743 +Actelion Java MolfileCreator 1.0 + + 23 24 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0118 -1.4873 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3221 -2.2310 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2749 -2.2310 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6323 -1.4755 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2631 -3.7183 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5615 -1.4755 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6441 0.0354 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9426 -2.2192 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0472 -4.4620 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5497 -4.4620 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5497 0.0354 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8482 -2.2192 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9544 0.7909 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8364 -3.7065 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2394 0.7909 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9662 2.3018 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1230 -4.4502 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2276 2.3018 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6796 3.0573 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0826 3.0573 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6914 4.5682 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3929 2.3136 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 2 0 0 0 0 + 4 7 1 0 0 0 0 + 5 8 1 0 0 0 0 + 5 9 1 1 0 0 0 + 6 10 1 0 0 0 0 + 6 11 1 0 0 0 0 + 7 12 1 0 0 0 0 + 7 13 2 0 0 0 0 + 8 14 1 0 0 0 0 + 11 15 2 0 0 0 0 + 12 16 2 0 0 0 0 + 14 17 1 0 0 0 0 + 15 18 1 0 0 0 0 + 16 19 1 0 0 0 0 + 17 20 1 0 0 0 0 + 19 21 1 0 0 0 0 + 20 22 2 0 0 0 0 + 20 23 1 0 0 0 0 + 13 15 1 0 0 0 0 + 21 23 1 0 0 0 0 +M END +> +Compound 20743 + +> +BIO-1009 + +> +ZEARALENONE + +> +Products for Life Science + +> +17924-92-4 + +> +318.37 + +> +' + +> +MFCD00133085 + +$$$$ +Compound 20744 +Actelion Java MolfileCreator 1.0 + + 16 17 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3057 0.7529 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6115 0.0118 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9172 0.7646 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6232 -1.4704 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2230 0.0235 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5287 0.7764 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8344 0.0353 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8462 -1.4469 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1402 0.7881 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1519 -2.1880 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.4578 2.2586 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4459 0.0471 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4577 -1.4351 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -10.9517 2.4233 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.5634 1.0587 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 2 3 1 0 0 0 0 + 3 4 2 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 6 7 1 0 0 0 0 + 7 8 1 0 0 0 0 + 8 9 2 0 0 0 0 + 8 10 1 0 0 0 0 + 9 11 1 0 0 0 0 + 10 12 1 0 0 0 0 + 10 13 2 0 0 0 0 + 11 14 2 0 0 0 0 + 12 15 2 0 0 0 0 + 13 16 1 0 0 0 0 + 13 14 1 0 0 0 0 + 15 16 1 0 0 0 0 +M END +> +Compound 20744 + +> +BIO-428 + +> +"ZEATIN, trans ISOMER" + +> +Products for Life Science + +> +1637-39-4 + +> +219.25 + +> +'>99% trans isomer + +> +MFCD00213654 + +$$$$ +Compound 20745 +Actelion Java MolfileCreator 1.0 + + 25 27 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4974 -0.1415 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.6013 -1.3559 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5114 0.9786 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.8157 -1.5917 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5188 -2.3463 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0516 -1.6507 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2166 2.4524 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0088 0.8371 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.1952 -2.1930 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.3773 -3.8201 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0420 -0.5306 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9315 3.2070 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5254 3.2070 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6337 2.2166 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9432 4.7162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5372 4.7162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2520 5.4708 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.8459 5.4708 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.1547 4.7280 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.4634 5.4826 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.7722 4.7398 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.0809 5.4944 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.7840 3.2542 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.3897 4.7516 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 1 3 1 0 0 0 0 + 2 4 1 1 0 0 0 + 2 5 1 0 0 0 0 + 3 6 1 0 0 0 0 + 3 7 1 1 0 0 0 + 4 8 1 0 0 0 0 + 4 9 1 0 0 0 0 + 5 10 1 6 0 0 0 + 6 11 1 6 0 0 0 + 7 12 1 0 0 0 0 + 8 13 2 0 0 0 0 + 8 14 1 0 0 0 0 + 9 15 2 0 0 0 0 + 13 16 1 0 0 0 0 + 14 17 2 0 0 0 0 + 16 18 2 0 0 0 0 + 17 19 1 0 0 0 0 + 19 20 1 0 0 0 0 + 20 21 1 0 0 0 0 + 21 22 2 0 0 0 0 + 22 23 1 0 0 0 0 + 22 24 1 0 0 0 0 + 23 25 1 0 0 0 0 + 5 6 1 0 0 0 0 + 14 15 1 0 0 0 0 + 17 18 1 0 0 0 0 +M END +> +Compound 20745 + +> +BIO-429 + +> +"ZEATIN RIBOSIDE, trans ISOMER" + +> +Products for Life Science + +> +6025-53-2 + +> +351.37 + +> +'>98% HPLC + +> +MFCD00036809 + +$$$$ +Compound 20751 +Actelion Java MolfileCreator 1.0 + + 31 33 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + 0.7415 -1.2829 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7533 1.3065 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2829 0.7533 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3065 -0.7415 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6129 0.0118 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3182 -2.2245 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9194 -0.7297 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6247 -2.9660 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2258 0.0235 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9312 -2.2127 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5323 -0.7180 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2376 -2.9542 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8388 0.0353 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1452 -0.7062 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8505 1.5419 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4517 0.0471 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5676 2.2951 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1570 2.2951 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7581 -0.6944 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5794 3.8017 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1688 3.8017 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.0646 0.0588 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7699 -2.1774 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8858 4.5550 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.0764 1.5654 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -14.3711 -0.6827 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.0764 -2.9189 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7935 2.3187 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -14.3828 2.3187 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -14.3828 -2.1657 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 1 3 2 0 0 0 0 + 1 4 1 0 0 0 0 + 1 5 1 0 0 0 0 + 5 6 2 0 0 0 0 + 5 7 1 0 0 0 0 + 6 8 1 0 0 0 0 + 7 9 2 0 0 0 0 + 8 10 1 0 0 0 0 + 8 11 2 0 0 0 0 + 10 12 2 0 0 0 0 + 11 13 1 0 0 0 0 + 12 14 1 0 0 0 0 + 14 15 2 0 0 0 0 + 14 16 1 0 0 0 0 + 15 17 1 0 0 0 0 + 16 18 2 0 0 0 0 + 16 19 1 0 0 0 0 + 17 20 1 0 0 0 0 + 18 21 1 0 0 0 0 + 19 22 2 0 0 0 0 + 20 23 2 0 0 0 0 + 20 24 1 0 0 0 0 + 21 25 2 0 0 0 0 + 23 26 1 0 0 0 0 + 23 27 1 0 0 0 0 + 24 28 2 0 0 0 0 + 26 29 2 0 0 0 0 + 26 30 1 0 0 0 0 + 27 31 2 0 0 0 0 + 9 11 1 0 0 0 0 + 22 25 1 0 0 0 0 + 28 31 1 0 0 0 0 +M END +> +Compound 20751 + +> +BIO-700 + +> +ZINCON + +> +Products for Life Science + +> +62625-22-3 + +> + + +> +' + +> +MFCD00007507 + +$$$$ \ No newline at end of file diff --git a/INCHI-1-TEST/tests/test_unit/fixtures/test_mols_2.sdf b/INCHI-1-TEST/tests/test_unit/fixtures/test_mols_2.sdf new file mode 100644 index 00000000..4e335bd9 --- /dev/null +++ b/INCHI-1-TEST/tests/test_unit/fixtures/test_mols_2.sdf @@ -0,0 +1,320 @@ +Compound 20652 +Actelion Java MolfileCreator 1.0 + +101110 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0153 1.5192 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2737 2.2865 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3351 2.2865 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9029 0.4297 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2277 3.8057 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3504 3.8057 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8875 -1.0589 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0614 4.5730 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3147 3.4528 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1766 -1.7955 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5678 -1.7955 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.8518 4.8799 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6344 2.7162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4656 -1.0282 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1612 -3.2840 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5524 -3.2840 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9541 3.4835 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6498 1.2277 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4503 0.4911 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4503 -4.0206 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8415 -4.0206 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7673 -4.0206 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2739 2.7469 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9695 0.4911 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3607 0.4911 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1305 1.2583 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7393 1.2583 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4349 -5.5091 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.0870 -3.2533 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7826 -5.5091 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2892 1.2583 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -8.5936 3.5142 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3761 -0.9975 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1152 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0283 0.5218 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7240 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7240 -6.2457 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1152 -6.2457 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1024 -1.7341 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1024 -6.2457 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5064 -6.2457 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -8.6090 5.0334 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -9.9133 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6958 -1.7341 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4042 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8568 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3174 1.2890 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0130 3.5449 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0130 -5.4784 -0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7086 -7.7342 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2686 -7.6422 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8133 -0.9668 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.4911 -7.7342 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.9287 5.8007 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.2331 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7111 -3.2226 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3889 5.0641 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7955 5.0641 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 9.6064 0.5524 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3020 2.8083 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3889 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7801 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8287 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.2484 5.0641 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -12.5528 2.8083 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4221 -3.9592 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0309 -3.9592 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 10.8955 1.3197 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 9.5911 3.5756 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3735 -9.9594 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.7315 -7.8724 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8415 -9.7292 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.0282 -10.0054 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1484 -7.7036 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.8801 2.8390 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.1845 0.5831 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.3277 4.8953 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 8.8238 4.8953 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.6626 -10.6960 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0538 -10.6960 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1484 -10.6960 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4681 -8.4402 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.1692 3.6062 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0385 -12.1845 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1637 -12.1845 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4681 -9.9287 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3275 -12.9211 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7187 -12.9211 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4835 -12.9211 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8747 -12.9211 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7879 -10.6653 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3990 -12.1538 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.8032 -12.1538 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4988 -14.4096 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8901 -14.4096 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3836 -10.6346 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2098 -15.1462 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5806 -10.1282 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5831 -9.7906 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2251 -16.6348 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 2 3 2 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 5 8 1 0 0 0 0 + 6 9 2 0 0 0 0 + 7 10 1 0 0 0 0 + 8 11 2 0 0 0 0 + 8 12 1 0 0 0 0 + 10 13 1 6 0 0 0 + 10 14 1 0 0 0 0 + 11 15 1 0 0 0 0 + 11 16 1 0 0 0 0 + 12 17 2 0 0 0 0 + 14 18 1 6 0 0 0 + 14 19 1 0 0 0 0 + 20 15 1 6 0 0 0 + 16 21 1 0 0 0 0 + 16 22 2 0 0 0 0 + 17 23 1 0 0 0 0 + 18 24 1 0 0 0 0 + 19 25 2 0 0 0 0 + 19 26 1 0 0 0 0 + 20 27 1 0 0 0 0 + 20 28 1 0 0 0 0 + 21 29 1 0 0 0 0 + 23 30 1 6 0 0 0 + 23 31 1 0 0 0 0 + 24 32 2 0 0 0 0 + 24 33 1 0 0 0 0 + 26 34 1 0 0 0 0 + 27 35 1 0 0 0 0 + 28 36 1 1 0 0 0 + 28 37 1 0 0 0 0 + 29 38 2 0 0 0 0 + 29 39 1 0 0 0 0 + 30 40 1 0 0 0 0 + 31 41 2 0 0 0 0 + 31 42 1 0 0 0 0 + 33 43 1 1 0 0 0 + 33 44 1 0 0 0 0 + 34 45 1 6 0 0 0 + 35 46 1 0 0 0 0 + 35 47 1 0 0 0 0 + 48 36 1 1 0 0 0 + 37 49 1 6 0 0 0 + 38 50 1 0 0 0 0 + 38 51 1 0 0 0 0 + 39 52 2 0 0 0 0 + 40 53 2 0 0 0 0 + 54 42 1 1 0 0 0 + 43 55 1 0 0 0 0 + 44 56 1 0 0 0 0 + 45 57 1 0 0 0 0 + 46 58 1 1 0 0 0 + 47 59 1 0 0 0 0 + 48 60 1 0 0 0 0 + 48 61 1 0 0 0 0 + 51 62 2 0 0 0 0 + 54 63 1 0 0 0 0 + 54 64 1 0 0 0 0 + 56 65 1 0 0 0 0 + 56 66 1 0 0 0 0 + 57 67 2 0 0 0 0 + 57 68 1 0 0 0 0 + 60 69 1 0 0 0 0 + 61 70 1 0 0 0 0 + 62 71 1 0 0 0 0 + 63 72 2 0 0 0 0 + 63 73 1 0 0 0 0 + 64 74 2 0 0 0 0 + 64 75 1 0 0 0 0 + 69 76 1 0 0 0 0 + 69 77 1 6 0 0 0 + 70 78 1 6 0 0 0 + 70 79 1 0 0 0 0 + 71 80 1 1 0 0 0 + 71 81 1 0 0 0 0 + 74 82 1 0 0 0 0 + 75 83 2 0 0 0 0 + 76 84 1 6 0 0 0 + 81 85 1 0 0 0 0 + 82 86 1 0 0 0 0 + 82 87 2 0 0 0 0 + 85 88 2 0 0 0 0 + 85 89 1 0 0 0 0 + 86 90 2 0 0 0 0 + 86 91 1 0 0 0 0 + 87 92 1 0 0 0 0 + 89 93 1 0 0 0 0 + 90 94 1 0 0 0 0 + 90 95 1 0 0 0 0 + 91 96 2 0 0 0 0 + 93 97 1 1 0 0 0 + 95 98 2 0 0 0 0 + 97 99 2 0 0 0 0 + 97100 1 0 0 0 0 + 98101 1 0 0 0 0 + 7 9 1 0 0 0 0 + 17 22 1 0 0 0 0 + 34 40 1 0 0 0 0 + 37 46 1 0 0 0 0 + 52 62 1 0 0 0 0 + 70 76 1 0 0 0 0 + 81 73 1 1 0 0 0 + 83 87 1 0 0 0 0 + 91 93 1 0 0 0 0 + 96 98 1 0 0 0 0 +M END +> +Compound 20652 + +> +BIO-423 + +> +VANCOMYCIN HYDROCHLORIDE + +> +Products for Life Science + +> +1404-93-9 + +> +1485.7 + +> +'93.5% (Vanomycin base) + +> +MFCD03613611 + +$$$$ +caffeine +APtclcactv08142501153D 0 0.00000 0.00000 + + 24 25 0 0 0 0 0 0 0 0999 V2000 + 1.3120 -1.0479 0.0025 N 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2465 -2.1762 0.0031 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7906 0.2081 0.0010 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9938 0.3838 0.0002 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9714 1.2767 -0.0001 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5339 2.6294 -0.0017 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4026 1.0989 -0.0001 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4446 1.9342 -0.0010 N 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5608 1.2510 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2862 -0.0680 0.0015 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.2614 -1.1612 0.0029 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9114 -0.1939 0.0014 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0163 -1.2853 -0.0022 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4380 -2.4279 -0.0068 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2697 -1.8004 0.0022 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0830 -2.7828 0.8938 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0821 -2.7846 -0.8862 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.6223 2.5703 -0.0019 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1987 3.1611 -0.8923 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1990 3.1632 0.8877 H 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5520 1.6797 -0.0001 H 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5037 -1.4333 -1.0244 H 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8389 -2.0244 0.5173 H 0 0 0 0 0 0 0 0 0 0 0 0 + -4.1672 -0.8395 0.5168 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 1 3 1 0 0 0 0 + 3 4 2 0 0 0 0 + 3 5 1 0 0 0 0 + 5 6 1 0 0 0 0 + 5 7 1 0 0 0 0 + 7 8 1 0 0 0 0 + 8 9 2 0 0 0 0 + 9 10 1 0 0 0 0 + 10 11 1 0 0 0 0 + 10 12 1 0 0 0 0 + 7 12 2 0 0 0 0 + 12 13 1 0 0 0 0 + 1 13 1 0 0 0 0 + 13 14 2 0 0 0 0 + 2 15 1 0 0 0 0 + 2 16 1 0 0 0 0 + 2 17 1 0 0 0 0 + 6 18 1 0 0 0 0 + 6 19 1 0 0 0 0 + 6 20 1 0 0 0 0 + 9 21 1 0 0 0 0 + 11 22 1 0 0 0 0 + 11 23 1 0 0 0 0 + 11 24 1 0 0 0 0 +M END +> +caffeine + +> +XXXX + +> +CAFFEINE + +> +something something + +> + + +> + + +> +' + +> +??? + +$$$$ \ No newline at end of file diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 912eed02..abf7ec25 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -1,12 +1,212 @@ #include #include +#include +#include +#include +#include extern "C" { +#include "../../../INCHI-1-SRC/INCHI_BASE/src/ichitime.h" #include "../../../INCHI-1-SRC/INCHI_BASE/src/ichi_io.h" #include "../../../INCHI-1-SRC/INCHI_BASE/src/ichimain.h" } +static char* make_arg(const char* s) { + size_t len = strlen(s) + 1; + char* p = (char*)malloc(len); + memcpy(p, s, len); + return p; +} + +// TEST(ichimain_testing, test_ProcessSingleInputFile) +// { + + +// const char *test_file_2mols = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/test_mol2.sdf"; + +// char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; +// char *tmpd = mkdtemp(tmpl); +// ASSERT_NE(tmpd, nullptr); + +// std::string dst_path = std::string(tmpd) + "/caffeine.mol"; +// std::ifstream src(test_file_caffeine, std::ios::binary); +// ASSERT_TRUE(src.is_open()); +// std::ofstream dst(dst_path, std::ios::binary); +// ASSERT_TRUE(dst.is_open()); +// dst << src.rdbuf(); +// src.close(); +// dst.close(); + +// int argc = 2; +// char *a0 = make_arg("test_ichimain"); +// char *a1 = make_arg(dst_path.c_str()); +// char* argv[] = { a0, a1 }; + + + +// } + +TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) +{ + + const char *filename_caffeine = "caffeine.mol"; + + const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char *tmpd = mkdtemp(tmpl); + ASSERT_NE(tmpd, nullptr); + + std::string src_path = std::string(path_fixtures) + "/" + filename_caffeine; + std::string dst_path = std::string(tmpd) + "/" + filename_caffeine; + std::ifstream src(src_path, std::ios::binary); + ASSERT_TRUE(src.is_open()); + std::ofstream dst(dst_path, std::ios::binary); + ASSERT_TRUE(dst.is_open()); + dst << src.rdbuf(); + src.close(); + dst.close(); + + int argc = 2; + char *a0 = make_arg("test_ichimain"); + char *a1 = make_arg(dst_path.c_str()); + char* argv[] = { a0, a1 }; + + // int ProcessSingleInputFile(int argc, char* argv[]) + + int result = ProcessSingleInputFile(argc, argv); + + // Assert the expected result + EXPECT_EQ(result, 0); + + free(a0); + free(a1); + + std::string out_txt = dst_path + ".txt"; + std::string out_log = dst_path + ".log"; + std::string out_prb = dst_path + ".prb"; + + struct stat st; + // check existence and non-zero size + ASSERT_EQ(stat(out_txt.c_str(), &st), 0); + EXPECT_GT(st.st_size, 0); + ASSERT_EQ(stat(out_log.c_str(), &st), 0); + EXPECT_GT(st.st_size, 0); + ASSERT_EQ(stat(out_prb.c_str(), &st), 0); + // EXPECT_GT(st.st_size, 0); + EXPECT_EQ(st.st_size, 0); + + std::ifstream txt_in(out_txt); + ASSERT_TRUE(txt_in.is_open()); + std::string line; + std::string found_inchi; + while (std::getline(txt_in, line)) { + // trim leading/trailing whitespace + size_t start = line.find_first_not_of(" \t\r\n"); + if (start == std::string::npos) continue; + size_t end = line.find_last_not_of(" \t\r\n"); + std::string trimmed = line.substr(start, end - start + 1); + if (trimmed.rfind("InChI=", 0) == 0) { + found_inchi = trimmed; + break; + } + } + txt_in.close(); + + const std::string expected_inchi = "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3"; + ASSERT_FALSE(found_inchi.empty()); + EXPECT_EQ(found_inchi, expected_inchi); + + // cleanup + unlink(out_txt.c_str()); + unlink(out_log.c_str()); + unlink(out_prb.c_str()); + unlink(dst_path.c_str()); + rmdir(tmpd); +} +TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) +{ + + const char *filename_2mols = "test_mols_2.sdf"; + + const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char *tmpd = mkdtemp(tmpl); + ASSERT_NE(tmpd, nullptr); + + std::string src_path = std::string(path_fixtures) + "/" + filename_2mols; + std::string dst_path = std::string(tmpd) + "/" + filename_2mols; + std::ifstream src(src_path, std::ios::binary); + ASSERT_TRUE(src.is_open()); + std::ofstream dst(dst_path, std::ios::binary); + ASSERT_TRUE(dst.is_open()); + dst << src.rdbuf(); + src.close(); + dst.close(); + + int argc = 2; + char *a0 = make_arg("test_ichimain"); + char *a1 = make_arg(dst_path.c_str()); + char* argv[] = { a0, a1 }; + + // int ProcessSingleInputFile(int argc, char* argv[]) + + int result = ProcessSingleInputFile(argc, argv); + + // Assert the expected result + EXPECT_EQ(result, 0); + + free(a0); + free(a1); + + std::string out_txt = dst_path + ".txt"; + std::string out_log = dst_path + ".log"; + std::string out_prb = dst_path + ".prb"; + + struct stat st; + // check existence and non-zero size + ASSERT_EQ(stat(out_txt.c_str(), &st), 0); + EXPECT_GT(st.st_size, 0); + ASSERT_EQ(stat(out_log.c_str(), &st), 0); + EXPECT_GT(st.st_size, 0); + ASSERT_EQ(stat(out_prb.c_str(), &st), 0); + // EXPECT_GT(st.st_size, 0); + EXPECT_EQ(st.st_size, 0); + + std::ifstream txt_in(out_txt); + ASSERT_TRUE(txt_in.is_open()); + std::string line; + std::vector found_inchis; + while (std::getline(txt_in, line)) { + // trim leading/trailing whitespace + size_t start = line.find_first_not_of(" \t\r\n"); + if (start == std::string::npos) continue; + size_t end = line.find_last_not_of(" \t\r\n"); + std::string trimmed = line.substr(start, end - start + 1); + if (trimmed.rfind("InChI=", 0) == 0) { + found_inchis.push_back(trimmed); + } + } + txt_in.close(); + + std::vector expected_inchis = { + "InChI=1S/C66H75Cl2N9O24/c1-23(2)12-34(71-5)58(88)76-49-51(83)26-7-10-38(32(67)14-26)97-40-16-28-17-41(55(40)101-65-56(54(86)53(85)42(22-78)99-65)100-44-21-66(4,70)57(87)24(3)96-44)98-39-11-8-27(15-33(39)68)52(84)50-63(93)75-48(64(94)95)31-18-29(79)19-37(81)45(31)30-13-25(6-9-36(30)80)46(60(90)77-50)74-61(91)47(28)73-59(89)35(20-43(69)82)72-62(49)92/h6-11,13-19,23-24,34-35,42,44,46-54,56-57,65,71,78-81,83-87H,12,20-22,70H2,1-5H3,(H2,69,82)(H,72,92)(H,73,89)(H,74,91)(H,75,93)(H,76,88)(H,77,90)(H,94,95)/t24-,34+,35-,42?,44-,46+,47+,48-,49+,50-,51+,52+,53+,54-,56+,57+,65-,66-/m0/s1", + "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3" + }; + + ASSERT_EQ(found_inchis.size(), expected_inchis.size()); + for (size_t i = 0; i < expected_inchis.size(); ++i) { + EXPECT_EQ(found_inchis[i], expected_inchis[i]); + } + + // cleanup + unlink(out_txt.c_str()); + unlink(out_log.c_str()); + unlink(out_prb.c_str()); + unlink(dst_path.c_str()); + rmdir(tmpd); +} + TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) { @@ -86,24 +286,41 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) // long *num_err, // int output_error_inchi ); - tagINCHI_CLOCK *ic; - STRUCT_DATA *sd; - INPUT_PARMS *ip; + INCHI_CLOCK ic = {}; + memset(&ic, 0, sizeof(ic)); + + STRUCT_DATA *sd = new STRUCT_DATA; + INPUT_PARMS *ip = new INPUT_PARMS; + char *szTitle; INCHI_IOSTREAM *inp_file; - INCHI_IOSTREAM *plog; - INCHI_IOSTREAM *pout; - INCHI_IOSTREAM *pprb; + INCHI_IOSTREAM *plog = new INCHI_IOSTREAM; + INCHI_IOSTREAM *pout = new INCHI_IOSTREAM; + INCHI_IOSTREAM *pprb = new INCHI_IOSTREAM; ORIG_ATOM_DATA orig_at_data = {}; - long *num_inp; - STRUCT_FPTRS *pStructPtrs; - int *nRet; - int *have_err_in_GetOneStructure; + long *num_inp = new long(0); + + STRUCT_FPTRS *pStructPtrs = NULL; + + int *nRet = 0; + int *have_err_in_GetOneStructure = 0; long *num_err; int output_error_inchi; + + memset(ip, 0, sizeof(*ip)); + ip->last_struct_number = 1; + ip->nInputType = INPUT_MOLFILE; + + inchi_ios_init(pout, INCHI_IOS_TYPE_STRING, nullptr); + inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); + inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); + + // PrintInputParms(plog, ip); + // inchi_ios_flush2(plog, stderr); + // int ret = GetTheNextRecordOfInputFile( - // ic, + // &ic, // sd, // ip, // szTitle, @@ -119,7 +336,7 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) // num_err, // output_error_inchi); - // EXPECT_EQ(ret, 18); + // EXPECT_EQ(ret, DO_NEXT_STEP); inchi_ios_free_str(&input_stream); FreeOrigAtData(&orig_at_data); From a64a361ce8a0c0459811ece413cd8579a9efa06a Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 8 Dec 2025 15:10:53 +0000 Subject: [PATCH 04/41] Added prototype for ProcessMultipleInputFiles --- .../tests/test_unit/fixtures/naloxon.mol | 99 +++++++++++++++++++ .../tests/test_unit/test_ichimain.cpp | 26 +---- _deps/googletest-src | 1 + 3 files changed, 105 insertions(+), 21 deletions(-) create mode 100644 INCHI-1-TEST/tests/test_unit/fixtures/naloxon.mol create mode 160000 _deps/googletest-src diff --git a/INCHI-1-TEST/tests/test_unit/fixtures/naloxon.mol b/INCHI-1-TEST/tests/test_unit/fixtures/naloxon.mol new file mode 100644 index 00000000..6768159d --- /dev/null +++ b/INCHI-1-TEST/tests/test_unit/fixtures/naloxon.mol @@ -0,0 +1,99 @@ +naloxon + -OEChem-12082509532D + + 45 49 0 1 0 0 0 0 0999 V2000 + 2.2314 -0.2572 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.3794 -1.7611 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0000 -2.7122 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0000 2.0922 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.1607 -1.2611 0.0000 N 0 0 3 0 0 0 0 0 0 0 0 0 + 3.6897 -0.7855 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0 + 4.5133 -1.2611 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0 + 5.3370 -0.7855 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0 + 2.8660 -1.2611 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0 + 4.2392 -0.0881 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6897 0.1655 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5133 -2.2122 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.3370 0.1655 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.5918 -0.0881 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5133 0.6411 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6897 -2.6877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8660 -2.2122 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8660 0.6411 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.8418 -1.9932 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5133 1.5922 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8660 1.5922 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6897 2.0677 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.8164 -1.7694 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.4976 -2.5015 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.8739 -0.4755 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0496 -1.4975 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3760 0.5166 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6795 0.1787 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 4.7254 -2.7948 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1239 -2.1045 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.9476 0.0579 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.5490 0.7481 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 6.1840 0.0957 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.4989 0.5249 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2912 -3.1626 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 4.0882 -3.1626 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.3794 -2.3811 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 6.3215 -2.3303 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0834 -2.5642 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0503 1.9022 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6897 2.6877 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 7.9984 -1.1766 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0000 2.7122 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3157 -3.0942 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 9.1019 -2.3627 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1 9 1 0 0 0 0 + 1 18 1 0 0 0 0 + 7 2 1 1 0 0 0 + 2 37 1 0 0 0 0 + 3 17 2 0 0 0 0 + 4 21 1 0 0 0 0 + 4 43 1 0 0 0 0 + 5 8 1 0 0 0 0 + 5 14 1 0 0 0 0 + 5 19 1 0 0 0 0 + 6 7 1 0 0 0 0 + 6 9 1 0 0 0 0 + 6 10 1 1 0 0 0 + 6 11 1 0 0 0 0 + 7 8 1 0 0 0 0 + 7 12 1 0 0 0 0 + 8 13 1 0 0 0 0 + 8 25 1 0 0 0 0 + 9 17 1 0 0 0 0 + 9 26 1 1 0 0 0 + 10 14 1 0 0 0 0 + 10 27 1 0 0 0 0 + 10 28 1 0 0 0 0 + 11 15 2 0 0 0 0 + 11 18 1 0 0 0 0 + 12 16 1 0 0 0 0 + 12 29 1 0 0 0 0 + 12 30 1 0 0 0 0 + 13 15 1 0 0 0 0 + 13 31 1 0 0 0 0 + 13 32 1 0 0 0 0 + 14 33 1 0 0 0 0 + 14 34 1 0 0 0 0 + 15 20 1 0 0 0 0 + 16 17 1 0 0 0 0 + 16 35 1 0 0 0 0 + 16 36 1 0 0 0 0 + 18 21 2 0 0 0 0 + 19 23 1 0 0 0 0 + 19 38 1 0 0 0 0 + 19 39 1 0 0 0 0 + 20 22 2 0 0 0 0 + 20 40 1 0 0 0 0 + 21 22 1 0 0 0 0 + 22 41 1 0 0 0 0 + 23 24 2 0 0 0 0 + 23 42 1 0 0 0 0 + 24 44 1 0 0 0 0 + 24 45 1 0 0 0 0 +M END \ No newline at end of file diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index abf7ec25..8295f68f 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -19,33 +19,17 @@ static char* make_arg(const char* s) { return p; } -// TEST(ichimain_testing, test_ProcessSingleInputFile) -// { - - -// const char *test_file_2mols = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/test_mol2.sdf"; +TEST(ichimain_testing, test_ProcessMultipleInputFiles) +{ -// char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; -// char *tmpd = mkdtemp(tmpl); -// ASSERT_NE(tmpd, nullptr); + const char *test_file_mol1 = "caffeine.mol"; + const char *test_file_mol2 = "naloxon.mol"; -// std::string dst_path = std::string(tmpd) + "/caffeine.mol"; -// std::ifstream src(test_file_caffeine, std::ios::binary); -// ASSERT_TRUE(src.is_open()); -// std::ofstream dst(dst_path, std::ios::binary); -// ASSERT_TRUE(dst.is_open()); -// dst << src.rdbuf(); -// src.close(); -// dst.close(); -// int argc = 2; -// char *a0 = make_arg("test_ichimain"); -// char *a1 = make_arg(dst_path.c_str()); -// char* argv[] = { a0, a1 }; -// } +} TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) { diff --git a/_deps/googletest-src b/_deps/googletest-src new file mode 160000 index 00000000..52eb8108 --- /dev/null +++ b/_deps/googletest-src @@ -0,0 +1 @@ +Subproject commit 52eb8108c5bdec04579160ae17225d66034bd723 From b31865bd2214bed5f61d23ea4d0e8616e3f9d196 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Tue, 9 Dec 2025 10:54:52 +0000 Subject: [PATCH 05/41] added missing free --- INCHI-1-SRC/INCHI_BASE/src/ichimake.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/INCHI-1-SRC/INCHI_BASE/src/ichimake.c b/INCHI-1-SRC/INCHI_BASE/src/ichimake.c index 80652e13..e478e55b 100644 --- a/INCHI-1-SRC/INCHI_BASE/src/ichimake.c +++ b/INCHI-1-SRC/INCHI_BASE/src/ichimake.c @@ -4550,6 +4550,10 @@ int Create_INChI(CANON_GLOBALS* pCG, { inchi_free(t_group_info->nIsotopicEndpointAtomNumber); } + if (t_group_info->t_group) + { + inchi_free(t_group_info->t_group); + } memset(t_group_info, 0, sizeof(*t_group_info)); /* djb-rwth: memset_s C11/Annex K variant? */ } } From 72efe601089a31ff39b8c649aecf474a49a5fb8e Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Tue, 9 Dec 2025 13:27:51 +0000 Subject: [PATCH 06/41] Added unit tests for CalcAndPrintINCHIAndINCHIKEY, ProcessMultipleInputFiles --- CMakeLists.txt | 4 +- .../tests/test_unit/test_ichimain.cpp | 458 +++++++++++++++--- .../tests/test_unit/test_permutation_util.cpp | 7 + 3 files changed, 403 insertions(+), 66 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b324705..737bfafd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,8 @@ set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 11) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") include(FetchContent) FetchContent_Declare( diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 8295f68f..83fea5e3 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -8,6 +8,7 @@ extern "C" { #include "../../../INCHI-1-SRC/INCHI_BASE/src/ichitime.h" +#include "../../../INCHI-1-SRC/INCHI_BASE/src/ichicant.h" #include "../../../INCHI-1-SRC/INCHI_BASE/src/ichi_io.h" #include "../../../INCHI-1-SRC/INCHI_BASE/src/ichimain.h" } @@ -19,16 +20,344 @@ static char* make_arg(const char* s) { return p; } -TEST(ichimain_testing, test_ProcessMultipleInputFiles) +char *read_inchi_from_file(const char *filename) { + + std::ifstream txt_in(filename); + txt_in.is_open(); + std::string line; + std::string found_inchi; + while (std::getline(txt_in, line)) { + // trim leading/trailing whitespace + size_t start = line.find_first_not_of(" \t\r\n"); + if (start == std::string::npos) continue; + size_t end = line.find_last_not_of(" \t\r\n"); + std::string trimmed = line.substr(start, end - start + 1); + if (trimmed.rfind("InChI=", 0) == 0) { + found_inchi = trimmed; + break; + } + } + txt_in.close(); + + return make_arg(found_inchi.c_str()); +} + +TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { + + + INCHI_IOSTREAM input_stream; + + const char *molblock = + "enhanc_stereo1 \n" + " ACD/LABS08242216132D \n" + " \n" + " 0 0 0 0 0 0 0 0 0 0999 V3000 \n" + "M V30 BEGIN CTAB \n" + "M V30 COUNTS 18 17 0 0 1 \n" + "M V30 BEGIN ATOM \n" + "M V30 1 C 3424.1946 -1936.7935 0 0 \n" + "M V30 2 C 3352.3145 -1895.2935 0 0 \n" + "M V30 3 C 3280.4346 -1936.7935 0 0 \n" + "M V30 4 C 3208.5542 -1895.2935 0 0 \n" + "M V30 5 C 3136.6743 -1936.7935 0 0 \n" + "M V30 6 C 3064.7944 -1895.2935 0 0 \n" + "M V30 7 Br 3136.6743 -2019.7935 0 0 \n" + "M V30 8 Cl 3208.5542 -1812.2935 0 0 \n" + "M V30 9 Cl 3280.4346 -2019.7935 0 0 \n" + "M V30 10 Cl 3352.3145 -1812.2935 0 0 \n" + "M V30 11 Cl 3424.1946 -2019.7935 0 0 \n" + "M V30 12 C 3496.075 -1895.2935 0 0 \n" + "M V30 13 C 3567.9548 -1936.7942 0 0 \n" + "M V30 14 C 3639.835 -1895.2944 0 0 \n" + "M V30 15 C 3711.7148 -1936.7942 0 0 \n" + "M V30 16 Cl 3639.835 -1812.2944 0 0 \n" + "M V30 17 Cl 3567.9548 -2019.7942 0 0 \n" + "M V30 18 Cl 3496.075 -1812.2937 0 0 \n" + "M V30 END ATOM \n" + "M V30 BEGIN BOND \n" + "M V30 1 1 1 2 \n" + "M V30 2 1 1 11 CFG=3 \n" + "M V30 3 1 1 12 \n" + "M V30 4 1 2 3 \n" + "M V30 5 1 2 10 CFG=1 \n" + "M V30 6 1 3 4 \n" + "M V30 7 1 3 9 CFG=1 \n" + "M V30 8 1 4 5 \n" + "M V30 9 1 4 8 CFG=1 \n" + "M V30 10 1 5 6 \n" + "M V30 11 1 5 7 CFG=1 \n" + "M V30 12 1 12 13 \n" + "M V30 13 1 12 18 CFG=3 \n" + "M V30 14 1 13 14 \n" + "M V30 15 1 13 17 CFG=1 \n" + "M V30 16 1 14 15 \n" + "M V30 17 1 14 16 CFG=1 \n" + "M V30 END BOND \n" + "M V30 BEGIN COLLECTION \n" + "M V30 MDLV30/STERAC2 ATOMS=(1 1) \n" + "M V30 MDLV30/STERAC1 ATOMS=(2 2 3) \n" + "M V30 MDLV30/STEABS ATOMS=(2 4 5) \n" + "M V30 MDLV30/STEREL1 ATOMS=(2 12 13) \n" + "M V30 MDLV30/STEREL2 ATOMS=(1 14) \n" + "M V30 END COLLECTION \n" + "M V30 END CTAB \n" + "M END \n"; + + inchi_ios_init(&input_stream, INCHI_IOS_TYPE_STRING, nullptr); + inchi_ios_print_nodisplay(&input_stream, molblock); + + // int GetTheNextRecordOfInputFile( struct tagINCHI_CLOCK *ic, + // STRUCT_DATA *sd, INPUT_PARMS *ip, + // char *szTitle, + // INCHI_IOSTREAM *inp_file, + // INCHI_IOSTREAM *plog, + // INCHI_IOSTREAM *pout, + // INCHI_IOSTREAM *pprb, + // ORIG_ATOM_DATA *orig_inp_data, + // long *num_inp, + // STRUCT_FPTRS *pStructPtrs, + // int *nRet, + // int *have_err_in_GetOneStructure, + // long *num_err, + // int output_error_inchi ); + + INCHI_CLOCK ic = {}; + memset(&ic, 0, sizeof(ic)); + + STRUCT_DATA *sd = new STRUCT_DATA; + // sd->ulStructTime = 0; + INPUT_PARMS *ip = new INPUT_PARMS; + + char *szTitle; + INCHI_IOSTREAM *inp_file; + INCHI_IOSTREAM *plog = new INCHI_IOSTREAM; + INCHI_IOSTREAM *pout = new INCHI_IOSTREAM; + INCHI_IOSTREAM *pprb = new INCHI_IOSTREAM; + ORIG_ATOM_DATA orig_at_data = {}; + long *num_inp = new long(0); + + STRUCT_FPTRS *pStructPtrs = nullptr; + + int nRet = 0; + int have_err_in_GetOneStructure = 0; + long num_err = 0; + int output_error_inchi; + + + memset(ip, 0, sizeof(*ip)); + ip->last_struct_number = 1; + ip->nInputType = INPUT_MOLFILE; + + inchi_ios_init(pout, INCHI_IOS_TYPE_STRING, nullptr); + inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); + inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); + + // PrintInputParms(plog, ip); + inchi_ios_flush2(plog, stderr); + + int ret = GetTheNextRecordOfInputFile( + &ic, + sd, + ip, + szTitle, + &input_stream, + plog, + pout, + pprb, + &orig_at_data, + num_inp, + pStructPtrs, + &nRet, + &have_err_in_GetOneStructure, + &num_err, + output_error_inchi); + + EXPECT_EQ(ret, DO_NEXT_STEP); + + CANON_GLOBALS CG = {}; + // STRUCT_DATA* sd; + // INPUT_PARMS* ip; + // char* szTitle; + PINChI2* pINChI[INCHI_NUM]; + PINChI_Aux2* pINChI_Aux[INCHI_NUM]; + // INCHI_IOSTREAM* inp_file; + // INCHI_IOSTREAM* plog; + // INCHI_IOSTREAM* pout; + // INCHI_IOSTREAM* pprb; + // ORIG_ATOM_DATA* orig_inp_data; + ORIG_ATOM_DATA prep_inp_data = {}; + // long* num_inp; + // STRUCT_FPTRS* pStructPtrs; + // int* nRet; + // int have_err_in_GetOneStructure; + // long* num_err; + // int output_error_inchi; + INCHI_IOS_STRING* strbuf; + unsigned long pulTotalProcessingTime = 0; + char* pLF; + char* pTAB; + char* ikey; + int silent; + + set_line_separators(ip->bINChIOutputOptions, &pLF, &pTAB); + + ret = CalcAndPrintINCHIAndINCHIKEY( + &ic, + &CG, + sd, + ip, + szTitle, + pINChI, + pINChI_Aux, + &input_stream, + plog, + pout, + pprb, + &orig_at_data, + &prep_inp_data, + num_inp, + pStructPtrs, + &nRet, + have_err_in_GetOneStructure, + &num_err, + output_error_inchi, + strbuf, + &pulTotalProcessingTime, + pLF, + pTAB, + ikey, + silent + ); + + + + + inchi_ios_free_str(&input_stream); + FreeOrigAtData(&orig_at_data); + + for (int i = 0; i < MAX_NUM_PATHS; i++) + { + if (ip->path[i]) + { + inchi_free((void*)ip->path[i]); /* cast deliberately discards 'const' qualifier */ + ip->path[i] = NULL; + } + } + delete ip; + delete sd; + + delete plog; + delete pout; + delete pprb; + delete num_inp; + + + // int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, + // CANON_GLOBALS* CG, + // STRUCT_DATA* sd, + // INPUT_PARMS* ip, + // char* szTitle, + // PINChI2* pINChI[INCHI_NUM], + // PINChI_Aux2* pINChI_Aux[INCHI_NUM], + // INCHI_IOSTREAM* inp_file, + // INCHI_IOSTREAM* plog, + // INCHI_IOSTREAM* pout, + // INCHI_IOSTREAM* pprb, + // ORIG_ATOM_DATA* orig_inp_data, + // ORIG_ATOM_DATA* prep_inp_data, + // long* num_inp, + // STRUCT_FPTRS* pStructPtrs, + // int* nRet, + // int have_err_in_GetOneStructure, + // long* num_err, + // int output_error_inchi, + // INCHI_IOS_STRING* strbuf, + // unsigned long* pulTotalProcessingTime, + // char* pLF, + // char* pTAB, + // char* ikey, + // int silent) + +} + +TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) { - const char *test_file_mol1 = "caffeine.mol"; - const char *test_file_mol2 = "naloxon.mol"; + std::vector expected_inchis = { + "InChI=1S/C19H21NO4/c1-2-8-20-9-7-18-15-11-3-4-12(21)16(15)24-17(18)13(22)5-6-19(18,23)14(20)10-11/h2-4,14,17,21,23H,1,5-10H2/t14?,17-,18-,19+/m0/s1", + "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3" + }; + std::vector input_mols = { + "naloxon.mol", + "caffeine.mol" + }; + + const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; + + char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char *tmpd = mkdtemp(tmpl); + ASSERT_NE(tmpd, nullptr); + + std::vector dist_paths; + for (auto cur_filename : input_mols) { + std::string src_path = std::string(path_fixtures) + "/" + cur_filename; + std::string dst_path = std::string(tmpd) + "/" + cur_filename; + std::ifstream src(src_path, std::ios::binary); + ASSERT_TRUE(src.is_open()); + std::ofstream dst(dst_path, std::ios::binary); + ASSERT_TRUE(dst.is_open()); + dst << src.rdbuf(); + src.close(); + dst.close(); + + dist_paths.push_back(dst_path); + } + int argc = input_mols.size() + 2; + + char *inchi_filename = make_arg("test_ichimain"); + + std::vector argv_vec; + argv_vec.push_back(inchi_filename); + for (const auto &p : dist_paths) { + argv_vec.push_back(make_arg(p.c_str())); + } + argv_vec.push_back(make_arg("-AMI")); + char** argv = argv_vec.data(); + //int ProcessMultipleInputFiles(int argc, char* argv[]) + int ret = ProcessMultipleInputFiles(argc, argv); + // Assert the expected result + ASSERT_EQ(ret, 0); + + for (int i = 0; i < expected_inchis.size(); i++) { + std::string out_txt = dist_paths[i] + ".txt"; + char *inchi = read_inchi_from_file(out_txt.c_str()); + ASSERT_STREQ(inchi, expected_inchis[i].c_str()); + free(inchi); + } + + // Clean up + + for (auto p : dist_paths) { + + std::string out_txt = p + ".txt"; + std::string out_log = p + ".log"; + std::string out_prb = p + ".prb"; + + remove(p.c_str()); + remove(out_txt.c_str()); + remove(out_log.c_str()); + remove(out_prb.c_str()); + } + rmdir(tmpd); + + for (auto p : argv_vec) { + free(p); + } } TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) @@ -52,9 +381,9 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) dst.close(); int argc = 2; - char *a0 = make_arg("test_ichimain"); - char *a1 = make_arg(dst_path.c_str()); - char* argv[] = { a0, a1 }; + char *inchi_filename = make_arg("test_ichimain"); + char *input_file = make_arg(dst_path.c_str()); + char* argv[] = { inchi_filename, input_file }; // int ProcessSingleInputFile(int argc, char* argv[]) @@ -63,8 +392,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) // Assert the expected result EXPECT_EQ(result, 0); - free(a0); - free(a1); + free(inchi_filename); + free(input_file); std::string out_txt = dst_path + ".txt"; std::string out_log = dst_path + ".log"; @@ -77,35 +406,20 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) ASSERT_EQ(stat(out_log.c_str(), &st), 0); EXPECT_GT(st.st_size, 0); ASSERT_EQ(stat(out_prb.c_str(), &st), 0); - // EXPECT_GT(st.st_size, 0); EXPECT_EQ(st.st_size, 0); - std::ifstream txt_in(out_txt); - ASSERT_TRUE(txt_in.is_open()); - std::string line; - std::string found_inchi; - while (std::getline(txt_in, line)) { - // trim leading/trailing whitespace - size_t start = line.find_first_not_of(" \t\r\n"); - if (start == std::string::npos) continue; - size_t end = line.find_last_not_of(" \t\r\n"); - std::string trimmed = line.substr(start, end - start + 1); - if (trimmed.rfind("InChI=", 0) == 0) { - found_inchi = trimmed; - break; - } - } - txt_in.close(); + char *found_inchi = read_inchi_from_file(out_txt.c_str()); + std::string expected_inchi = "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3"; - const std::string expected_inchi = "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3"; - ASSERT_FALSE(found_inchi.empty()); + ASSERT_NE(found_inchi, nullptr); EXPECT_EQ(found_inchi, expected_inchi); // cleanup - unlink(out_txt.c_str()); - unlink(out_log.c_str()); - unlink(out_prb.c_str()); - unlink(dst_path.c_str()); + free(found_inchi); + remove(out_txt.c_str()); + remove(out_log.c_str()); + remove(out_prb.c_str()); + remove(dst_path.c_str()); rmdir(tmpd); } TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) @@ -129,9 +443,9 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) dst.close(); int argc = 2; - char *a0 = make_arg("test_ichimain"); - char *a1 = make_arg(dst_path.c_str()); - char* argv[] = { a0, a1 }; + char *inchi_filename = make_arg("test_ichimain"); + char *input_file = make_arg(dst_path.c_str()); + char* argv[] = { inchi_filename, input_file }; // int ProcessSingleInputFile(int argc, char* argv[]) @@ -140,8 +454,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) // Assert the expected result EXPECT_EQ(result, 0); - free(a0); - free(a1); + free(inchi_filename); + free(input_file); std::string out_txt = dst_path + ".txt"; std::string out_log = dst_path + ".log"; @@ -184,10 +498,10 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) } // cleanup - unlink(out_txt.c_str()); - unlink(out_log.c_str()); - unlink(out_prb.c_str()); - unlink(dst_path.c_str()); + remove(out_txt.c_str()); + remove(out_log.c_str()); + remove(out_prb.c_str()); + remove(dst_path.c_str()); rmdir(tmpd); } @@ -277,17 +591,17 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) INPUT_PARMS *ip = new INPUT_PARMS; char *szTitle; - INCHI_IOSTREAM *inp_file; + // INCHI_IOSTREAM *inp_file; INCHI_IOSTREAM *plog = new INCHI_IOSTREAM; INCHI_IOSTREAM *pout = new INCHI_IOSTREAM; INCHI_IOSTREAM *pprb = new INCHI_IOSTREAM; ORIG_ATOM_DATA orig_at_data = {}; long *num_inp = new long(0); - STRUCT_FPTRS *pStructPtrs = NULL; + STRUCT_FPTRS *pStructPtrs = nullptr; - int *nRet = 0; - int *have_err_in_GetOneStructure = 0; + int nRet = 0; + int have_err_in_GetOneStructure = 0; long *num_err; int output_error_inchi; @@ -301,27 +615,43 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); // PrintInputParms(plog, ip); - // inchi_ios_flush2(plog, stderr); - - // int ret = GetTheNextRecordOfInputFile( - // &ic, - // sd, - // ip, - // szTitle, - // &input_stream, - // plog, - // pout, - // pprb, - // &orig_at_data, - // num_inp, - // pStructPtrs, - // nRet, - // have_err_in_GetOneStructure, - // num_err, - // output_error_inchi); - - // EXPECT_EQ(ret, DO_NEXT_STEP); + inchi_ios_flush2(plog, stderr); + + int ret = GetTheNextRecordOfInputFile( + &ic, + sd, + ip, + szTitle, + &input_stream, + plog, + pout, + pprb, + &orig_at_data, + num_inp, + pStructPtrs, + &nRet, + &have_err_in_GetOneStructure, + num_err, + output_error_inchi); + + EXPECT_EQ(ret, DO_NEXT_STEP); inchi_ios_free_str(&input_stream); FreeOrigAtData(&orig_at_data); + + for (int i = 0; i < MAX_NUM_PATHS; i++) + { + if (ip->path[i]) + { + inchi_free((void*)ip->path[i]); /* cast deliberately discards 'const' qualifier */ + ip->path[i] = NULL; + } + } + delete ip; + delete sd; + + delete plog; + delete pout; + delete pprb; + delete num_inp; } diff --git a/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp b/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp index 174bf847..ad98e559 100644 --- a/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp @@ -107,4 +107,11 @@ TEST(permutation_util_testing, test_OrigAtData_Permute) EXPECT_STREQ(molblock, output_file->s.pStr); EXPECT_STRNE(output_file->s.pStr, permuted_output_file->s.pStr); + + inchi_ios_free_str(&input_stream); + inchi_ios_free_str(&output_stream); + inchi_ios_free_str(&permuted_output_stream); + + FreeOrigAtData(&atom_data); + FreeOrigAtData(&permuted_atom_data); } From 1a453727779d654f953d4cae9c6813fc8e40aa3b Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Wed, 10 Dec 2025 14:40:19 +0000 Subject: [PATCH 07/41] Added unit test flags for initializing input params --- .../tests/test_unit/test_ichimain.cpp | 92 +++++++++++++------ 1 file changed, 62 insertions(+), 30 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 83fea5e3..7b8b77f9 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -48,9 +48,9 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { INCHI_IOSTREAM input_stream; const char *molblock = - "enhanc_stereo1 \n" + "enhanc_stereo1 \n" " ACD/LABS08242216132D \n" - " \n" + " \n" " 0 0 0 0 0 0 0 0 0 0999 V3000 \n" "M V30 BEGIN CTAB \n" "M V30 COUNTS 18 17 0 0 1 \n" @@ -147,6 +147,23 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { memset(ip, 0, sizeof(*ip)); ip->last_struct_number = 1; ip->nInputType = INPUT_MOLFILE; + ip->bINChIOutputOptions = INCHI_OUT_PLAIN_TEXT; + // ip->bINChIOutputOptions2 = INCHI_OUT_PLAIN_TEXT; + // ip->nMode = REQ_MODE_TAUT; // REQ_MODE_BASIC; + // ip->bTautFlags |= (TG_FLAG_DISCONNECT_COORD | TG_FLAG_RECONNECT_COORD); + // ip->nMode |= (REQ_MODE_BASIC | REQ_MODE_TAUT | REQ_MODE_STEREO | REQ_MODE_ISO_STEREO | REQ_MODE_ISO); + + int bReleaseVersion = bRELEASE_VERSION; + unsigned long ulDisplTime = 0; /* infinite, milliseconds */ + unsigned long ulTotalProcessingTime = 0; + + int argc = 0; + char *argv[1]; + char *szSdfDataValue = nullptr; + + ReadCommandLineParms(argc, (const char**)argv, ip, + szSdfDataValue, &ulDisplTime, + bReleaseVersion, plog); inchi_ios_init(pout, INCHI_IOS_TYPE_STRING, nullptr); inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); @@ -174,6 +191,9 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { EXPECT_EQ(ret, DO_NEXT_STEP); + EXPECT_EQ(orig_at_data.num_inp_atoms, 18); + EXPECT_EQ(orig_at_data.num_inp_bonds, 17); + CANON_GLOBALS CG = {}; // STRUCT_DATA* sd; // INPUT_PARMS* ip; @@ -192,7 +212,10 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { // int have_err_in_GetOneStructure; // long* num_err; // int output_error_inchi; - INCHI_IOS_STRING* strbuf; + INCHI_IOS_STRING *strbuf = new INCHI_IOS_STRING; + memset(strbuf, 0, sizeof(*strbuf)); + inchi_strbuf_init(strbuf, INCHI_STRBUF_INITIAL_SIZE, INCHI_STRBUF_SIZE_INCREMENT); + unsigned long pulTotalProcessingTime = 0; char* pLF; char* pTAB; @@ -201,6 +224,33 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { set_line_separators(ip->bINChIOutputOptions, &pLF, &pTAB); + + // int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, + // CANON_GLOBALS* CG, + // STRUCT_DATA* sd, + // INPUT_PARMS* ip, + // char* szTitle, + // PINChI2* pINChI[INCHI_NUM], + // PINChI_Aux2* pINChI_Aux[INCHI_NUM], + // INCHI_IOSTREAM* inp_file, + // INCHI_IOSTREAM* plog, + // INCHI_IOSTREAM* pout, + // INCHI_IOSTREAM* pprb, + // ORIG_ATOM_DATA* orig_inp_data, + // ORIG_ATOM_DATA* prep_inp_data, + // long* num_inp, + // STRUCT_FPTRS* pStructPtrs, + // int* nRet, + // int have_err_in_GetOneStructure, + // long* num_err, + // int output_error_inchi, + // INCHI_IOS_STRING* strbuf, + // unsigned long* pulTotalProcessingTime, + // char* pLF, + // char* pTAB, + // char* ikey, + // int silent) + ret = CalcAndPrintINCHIAndINCHIKEY( &ic, &CG, @@ -229,11 +279,17 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { silent ); + EXPECT_EQ(ret, DO_NEXT_STEP); + char *inchi = "InChI=1S/C10H14BrCl7/c1-3(11)5(13)7(15)9(17)10(18)8(16)6(14)4(2)12/h3-10H,1-2H3/t3-,4-,5+,6+,7-,8+,9+,10-/m0/s1"; + //ios->s.pStr + EXPECT_STREQ(inchi, pout->s.pStr); + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); inchi_ios_free_str(&input_stream); FreeOrigAtData(&orig_at_data); + FreeOrigAtData(&prep_inp_data); for (int i = 0; i < MAX_NUM_PATHS; i++) { @@ -251,33 +307,6 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { delete pprb; delete num_inp; - - // int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, - // CANON_GLOBALS* CG, - // STRUCT_DATA* sd, - // INPUT_PARMS* ip, - // char* szTitle, - // PINChI2* pINChI[INCHI_NUM], - // PINChI_Aux2* pINChI_Aux[INCHI_NUM], - // INCHI_IOSTREAM* inp_file, - // INCHI_IOSTREAM* plog, - // INCHI_IOSTREAM* pout, - // INCHI_IOSTREAM* pprb, - // ORIG_ATOM_DATA* orig_inp_data, - // ORIG_ATOM_DATA* prep_inp_data, - // long* num_inp, - // STRUCT_FPTRS* pStructPtrs, - // int* nRet, - // int have_err_in_GetOneStructure, - // long* num_err, - // int output_error_inchi, - // INCHI_IOS_STRING* strbuf, - // unsigned long* pulTotalProcessingTime, - // char* pLF, - // char* pTAB, - // char* ikey, - // int silent) - } TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) @@ -636,6 +665,9 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) EXPECT_EQ(ret, DO_NEXT_STEP); + EXPECT_EQ(orig_at_data.num_inp_atoms, 18); + EXPECT_EQ(orig_at_data.num_inp_bonds, 17); + inchi_ios_free_str(&input_stream); FreeOrigAtData(&orig_at_data); From c2d2935c7c045730028ae5f3f7dbe6cbd342a19b Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 10:56:17 +0000 Subject: [PATCH 08/41] Added unit test for CalcAndPrintInchi... --- .../tests/test_unit/test_ichimain.cpp | 48 ++++++++++++------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 7b8b77f9..f06648b1 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -34,6 +34,15 @@ char *read_inchi_from_file(const char *filename) { std::string trimmed = line.substr(start, end - start + 1); if (trimmed.rfind("InChI=", 0) == 0) { found_inchi = trimmed; + break; + } else if (trimmed.find("InChI=", 0) != std::string::npos) { + size_t start_pos = trimmed.find("InChI="); + if(start_pos != 0) { + found_inchi = trimmed.substr(start_pos); + } else { + found_inchi = trimmed; + } + break; } } @@ -165,7 +174,13 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { szSdfDataValue, &ulDisplTime, bReleaseVersion, plog); - inchi_ios_init(pout, INCHI_IOS_TYPE_STRING, nullptr); + + const char* inchi_filename = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; + + FILE *file_inchi; + file_inchi = fopen(inchi_filename, "w"); + + inchi_ios_init(pout, INCHI_IOS_TYPE_FILE, file_inchi); //nullptr INCHI_IOS_TYPE_STRING inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); @@ -195,23 +210,9 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { EXPECT_EQ(orig_at_data.num_inp_bonds, 17); CANON_GLOBALS CG = {}; - // STRUCT_DATA* sd; - // INPUT_PARMS* ip; - // char* szTitle; PINChI2* pINChI[INCHI_NUM]; PINChI_Aux2* pINChI_Aux[INCHI_NUM]; - // INCHI_IOSTREAM* inp_file; - // INCHI_IOSTREAM* plog; - // INCHI_IOSTREAM* pout; - // INCHI_IOSTREAM* pprb; - // ORIG_ATOM_DATA* orig_inp_data; ORIG_ATOM_DATA prep_inp_data = {}; - // long* num_inp; - // STRUCT_FPTRS* pStructPtrs; - // int* nRet; - // int have_err_in_GetOneStructure; - // long* num_err; - // int output_error_inchi; INCHI_IOS_STRING *strbuf = new INCHI_IOS_STRING; memset(strbuf, 0, sizeof(*strbuf)); inchi_strbuf_init(strbuf, INCHI_STRBUF_INITIAL_SIZE, INCHI_STRBUF_SIZE_INCREMENT); @@ -281,15 +282,25 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { EXPECT_EQ(ret, DO_NEXT_STEP); - char *inchi = "InChI=1S/C10H14BrCl7/c1-3(11)5(13)7(15)9(17)10(18)8(16)6(14)4(2)12/h3-10H,1-2H3/t3-,4-,5+,6+,7-,8+,9+,10-/m0/s1"; - //ios->s.pStr - EXPECT_STREQ(inchi, pout->s.pStr); + fclose(file_inchi); + + char *found_inchi = read_inchi_from_file(inchi_filename); + + const char *inchi = "InChI=1S/C10H14BrCl7/c1-3(11)5(13)7(15)9(17)10(18)8(16)6(14)4(2)12/h3-10H,1-2H3/t3-,4-,5+,6+,7-,8+,9+,10-/m0/s1"; + + EXPECT_STREQ(inchi, found_inchi); //pout->s.pStr); + + free(found_inchi); + + remove(inchi_filename); FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + inchi_strbuf_close(strbuf); inchi_ios_free_str(&input_stream); FreeOrigAtData(&orig_at_data); FreeOrigAtData(&prep_inp_data); + SetBitFree(&CG); for (int i = 0; i < MAX_NUM_PATHS; i++) { @@ -306,6 +317,7 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { delete pout; delete pprb; delete num_inp; + delete strbuf; } From 9e08c08f756a536a7c2e2139dcc5b647ff45583f Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 10:56:43 +0000 Subject: [PATCH 09/41] Formatting whitespace removal --- INCHI-1-SRC/INCHI_BASE/src/runichi.c | 97 ++++++++++++++-------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/INCHI-1-SRC/INCHI_BASE/src/runichi.c b/INCHI-1-SRC/INCHI_BASE/src/runichi.c index a5dc9e1c..d8630a59 100644 --- a/INCHI-1-SRC/INCHI_BASE/src/runichi.c +++ b/INCHI-1-SRC/INCHI_BASE/src/runichi.c @@ -267,7 +267,6 @@ int ProcessOneStructure( INCHI_CLOCK *ic, memset( composite_norm_data, 0, sizeof( composite_norm_data ) ); /* djb-rwth: memset_s C11/Annex K variant? */ memset( pncFlags, 0, sizeof( *pncFlags ) ); /* djb-rwth: memset_s C11/Annex K variant? */ - /* For experimental purposes only */ /*ret1 = DoOneStructureEarlyPreprocessing( num_inp, sd, ip, inp_file, log_file, out_file, prb_file, @@ -1156,7 +1155,7 @@ int CreateOneStructureINChI( CANON_GLOBALS *pCG, /* allocate pINChI[iINChI] and pINChI_Aux2[iINChI] -- arrays of pointers to INChI and INChI_Aux */ /* assign values to sd->num_components[] */ - + /* djb-rwth: MYREALLOC2 has been replaced and the whole block rewritten to address memory leaks and reading from freed memory locations */ do { if( (sd->num_components[iINChI]) <= ((long long)cur_prep_inp_data->num_components) ) { @@ -1327,7 +1326,7 @@ int CreateOneStructureINChI( CANON_GLOBALS *pCG, } #endif - /*#ifndef COMPILE_ANSI_ONLY + /*#ifndef COMPILE_ANSI_ONLY { */ /* b) Display the extracted original component structure */ @@ -2039,7 +2038,7 @@ int ProcessOneStructureEx( struct tagINCHI_CLOCK *ic, { int ret = _IS_OKAY; char *sinchi_noedits=NULL, *saux_noedits=NULL; - + /* PREPROCESS */ @@ -2048,7 +2047,7 @@ int ProcessOneStructureEx( struct tagINCHI_CLOCK *ic, if (ip->bFilterSS) { int present, ok = 0; - + present = OrigAtData_CheckForSubstructure(orig_inp_data); if (ip->bFilterSS == 1 && present) ok = 1; @@ -2073,11 +2072,11 @@ int ProcessOneStructureEx( struct tagINCHI_CLOCK *ic, &sinchi_noedits, &saux_noedits); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ /* CALCULATE INCHI */ - - /* Perform calculation as usual either for untouched (modes POLYMERS_LEGACY and POLYMERS_LEGACY_PLUS) + + /* Perform calculation as usual either for untouched (modes POLYMERS_LEGACY and POLYMERS_LEGACY_PLUS) or just edited, probably (mode POLYMERS_MODERN) structure as passed in orig_inp_data */ - ret = ProcessOneStructureExCore( ic, CG, sd, ip, szTitle, + ret = ProcessOneStructureExCore( ic, CG, sd, ip, szTitle, pINChI2, pINChI_Aux2, inp_file, log_file, out_file, prb_file, orig_inp_data, prep_inp_data, @@ -2118,7 +2117,7 @@ int ProcessOneStructureEx( struct tagINCHI_CLOCK *ic, inchi_free(sinchi_noedits); inchi_free(saux_noedits); - + #ifdef TARGET_LIB_FOR_WINCHI push_to_winchi_text_window(out_file); @@ -2135,7 +2134,7 @@ int ProcessOneStructureEx( struct tagINCHI_CLOCK *ic, /**************************************************************************** - Special treatment for polymers: perform CRU frame shift analysis + Special treatment for polymers: perform CRU frame shift analysis and make related edits in orig_inp_data whenever applicable ****************************************************************************/ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, @@ -2161,7 +2160,7 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, char *sinchi_105p = NULL, *saux_105p = NULL; OAD_StructureEdits edits_unit_frame_shift, *ed_fs = &edits_unit_frame_shift; OAD_StructureEdits edits_unit_folding, *ed_fold = &edits_unit_folding; - + OAD_StructureEdits_Init(ed_fold); OAD_StructureEdits_Init(ed_fs); @@ -2192,7 +2191,7 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, sinchi_noedits, saux_noedits); if (ret == _IS_FATAL || ret == _IS_ERROR) { - ret = _IS_WARNING; + ret = _IS_WARNING; if (!ip->bNoWarnings) { AddErrorMessage(sd->pStrErrStruct, "CRU folding and frame shift analysis failed"); @@ -2205,10 +2204,10 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, /* CRU having both caps of indefinite nature, Zz */ goto exit_function; } - + /* Prepare and perform CRU folding related edits */ - if (ip->bFoldPolymerSRU != 0) + if (ip->bFoldPolymerSRU != 0) { /* Get interim 105+ flavour of InChI and AuxInfo and prepare */ int old_bFrameShiftScheme = ip->bFrameShiftScheme; @@ -2228,7 +2227,7 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, /* AddErrorMessage(sd->pStrErrStruct, "CRU fold analysis failed");*/ ; } - goto frame_shift; + goto frame_shift; } ret = OAD_Polymer_PrepareFoldCRUEdits( orig_inp_data, *sinchi_noedits, *saux_noedits, sinchi_105p, saux_105p, ed_fold); @@ -2244,7 +2243,7 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, if (ret == _IS_WARNING) { /* inchi_ios_eprint(log_file, "Warning (CRU fold analysis failed) structure #%ld.%s%s%s%s\n", - num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue));*/ + num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue));*/ ; } /* else */ @@ -2283,7 +2282,7 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, frame_shift: ; /* Prepare and perform frame shift related edits */ - if (ip->bFrameShiftScheme != FSS_NONE) + if (ip->bFrameShiftScheme != FSS_NONE) { /* Clear buffers */ if (sinchi_105p) @@ -2314,7 +2313,7 @@ frame_shift: ; } ret = OAD_Polymer_PrepareFrameShiftEdits( orig_inp_data, sinchi_105p, saux_105p, ed_fs); - + if (ret == _IS_FATAL || ret == _IS_ERROR) /* djb-rwth: logical operator corrected */ { ret = _IS_WARNING; @@ -2386,7 +2385,7 @@ frame_shift: ; OAD_StructureEdits_Clear(ed_fold); /* Clear edits collection */ OAD_StructureEdits_Clear(ed_fs); /* Clear edits collection */ - + return ret; } @@ -2395,17 +2394,17 @@ frame_shift: ; void swap_atoms_xyz( ORIG_ATOM_DATA *orig_at_data, int ia1, int ia2 ) { double x, y, z; - + if (ia1 != ia2) { - x = orig_at_data->at[ia1].x; - y = orig_at_data->at[ia1].y; + x = orig_at_data->at[ia1].x; + y = orig_at_data->at[ia1].y; z = orig_at_data->at[ia1].z; orig_at_data->at[ia1].x = orig_at_data->at[ia2].x; orig_at_data->at[ia1].y = orig_at_data->at[ia2].y; orig_at_data->at[ia1].z = orig_at_data->at[ia2].z; - + orig_at_data->at[ia2].x = x; orig_at_data->at[ia2].y = y; orig_at_data->at[ia2].z = z; @@ -2418,10 +2417,10 @@ void swap_atoms_xyz( ORIG_ATOM_DATA *orig_at_data, int ia1, int ia2 ) /**************************************************************************** OAD_StructureEdits_Edit ****************************************************************************/ -int OAD_StructureEdits_Apply( STRUCT_DATA *sd, - INPUT_PARMS *ip, - ORIG_ATOM_DATA *orig_at_data, - OAD_StructureEdits *ed, +int OAD_StructureEdits_Apply( STRUCT_DATA *sd, + INPUT_PARMS *ip, + ORIG_ATOM_DATA *orig_at_data, + OAD_StructureEdits *ed, int *ret) { int ok = 0, fail; @@ -2469,7 +2468,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, n_edits++; } } - + /* Add bonds */ if (n_new_bond) { @@ -2488,7 +2487,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, n_edits++; } } - + /* Modify bonds */ if (n_mod_bond) { @@ -2551,7 +2550,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, } } - + /* Delete atoms */ if (n_del_atom) { @@ -2572,7 +2571,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, goto exit_function; } - fail = mark_atoms_to_delete_or_renumber(orig_at_data, ed, at_renum); + fail = mark_atoms_to_delete_or_renumber(orig_at_data, ed, at_renum); if (fail) { *ret = _IS_ERROR; @@ -2594,20 +2593,20 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, AT_NUMB nbr0[MAXVAL]; U_CHAR btype0[MAXVAL]; int m, macc, valen; - int new_num = at_renum[i]; + int new_num = at_renum[i]; if (new_num == -1) { /* Skip removed atom */ continue; } - /* Atom to keep; copy it */ + /* Atom to keep; copy it */ new_at0 = new_at + nacc; ++nacc; memcpy(new_at0, orig_at_data->at + i, sizeof(new_at[0])); /* Correct its own number(s) */ new_at0->orig_at_number = new_num + 1; - + /* Correct its nbr number(s) */ valen = new_at0->valence; memcpy(nbr0, new_at0->neighbor, valen * sizeof(AT_NUMB)); @@ -2620,7 +2619,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, if (renum2 == num2) { /* keep old */ - new_at0->neighbor[macc++] = num2; + new_at0->neighbor[macc++] = num2; } else if (renum2 == -1) { @@ -2628,7 +2627,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, new_at0->chem_bonds_valence -= btype0[m]; new_at0->valence--; } - else + else { /* set renumbered */ new_at0->neighbor[macc++] = renum2; @@ -2746,7 +2745,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, } /* if (n_del_atom) */ - + exit_function: if (ibuf) @@ -2759,7 +2758,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, } return n_edits; } - + /**************************************************************************** Set each element of number to renum[element] or delete it if renum==(base -1) @@ -2868,7 +2867,7 @@ int ProcessOneStructureExCore( struct tagINCHI_CLOCK *ic, /**************************************************************************** - Treat pseudoelement and polymers: parse, validate and set details + Treat pseudoelement and polymers: parse, validate and set details ****************************************************************************/ int ValidateAndPreparePolymerAndPseudoatoms( struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *CG, @@ -2891,7 +2890,7 @@ int ValidateAndPreparePolymerAndPseudoatoms( struct tagINCHI_CLOCK *ic, int res = _IS_OKAY; int mind_pseudoelements = 0; - + *mind_polymers = orig_inp_data && orig_inp_data->polymer && orig_inp_data->polymer->n > 0; *mind_polymers = *mind_polymers && orig_inp_data->valid_polymer && (ip->nInputType == INPUT_MOLFILE || ip->nInputType == INPUT_SDFILE); @@ -2923,8 +2922,8 @@ int ValidateAndPreparePolymerAndPseudoatoms( struct tagINCHI_CLOCK *ic, ip->bPolymers != POLYMERS_MODERN && (ip->bFrameShiftScheme == FSS_STARS_CYCLED || ip->bFrameShiftScheme == FSS_STARS_CYCLED_SORTED)) { - /* Analyze and cyclize frame-shift eligible CRUs using InChI canonical numbers - (do this only at older polymer treatment modes 1.05, 1.05+) + /* Analyze and cyclize frame-shift eligible CRUs using InChI canonical numbers + (do this only at older polymer treatment modes 1.05, 1.05+) */ res = OAD_Polymer_CyclizeCloseableUnits( orig_inp_data, ip->bPolymers, @@ -2951,7 +2950,7 @@ int ValidateAndPreparePolymerAndPseudoatoms( struct tagINCHI_CLOCK *ic, /**************************************************************************** Get InChI and AuxInfo of totally unedited original structure. The intent is to preserve AuxInfo for the very original structure - in order to keep a final ability to restore that structure. + in order to keep a final ability to restore that structure. ****************************************************************************/ int OAD_ProcessOneStructureNoEdits( struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *CG, @@ -2970,7 +2969,7 @@ int OAD_ProcessOneStructureNoEdits( struct tagINCHI_CLOCK *ic, INCHI_IOS_STRING *strbuf, unsigned char save_opt_bits, int *n_pzz, - char **sinchi, + char **sinchi, char **saux) { size_t slen; @@ -3013,7 +3012,7 @@ int OAD_ProcessOneStructureNoEdits( struct tagINCHI_CLOCK *ic, { goto exit_function; } - + *n_pzz = dup->orig_inp_data->polymer->n_pzz; /* Extract InChI */ slen = dup->out_file->s.nUsedLength; @@ -3150,9 +3149,9 @@ int mark_atoms_to_delete_or_renumber( ORIG_ATOM_DATA *orig_at_data, size_t *atnums = NULL; /* djb-rwth: needs to be size_t type */ size_t max_atoms = orig_at_data->num_inp_atoms; - /* NB: new/old ORIG_ATOM_DATA atom numbers are 0-based (==orig_number-1) + /* NB: new/old ORIG_ATOM_DATA atom numbers are 0-based (==orig_number-1) while those in ed->... are just 1-based orig_numbers */ - + for (i = 0; (size_t)i < max_atoms; i++) { at_renum[i] = i; @@ -3219,7 +3218,7 @@ int mark_atoms_to_delete_or_renumber( ORIG_ATOM_DATA *orig_at_data, for (i = max_atoms - 1; i >= 0; i--) { int orig_num = i + 1; /* NB: ed->del_atom->item contains orig# which are (OAD# + 1) */ - if (is_in_the_ilist(ed->del_atom->item, orig_num, ed->del_atom->used)) + if (is_in_the_ilist(ed->del_atom->item, orig_num, ed->del_atom->used)) { /* mark as deleted atnum */ at_renum[i] = -1; @@ -3262,7 +3261,7 @@ int check_presence_of_the_encoded_substructure(ORIG_ATOM_DATA *oad) /* Place sub-structure filtering code below. Return 1 if structure matches some hard-coded pattern - + In this example pattern is a presence of a pseudo atom. */ From 31067d9660ca16b519f81c5f88f44bceabea0862 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 11:10:40 +0000 Subject: [PATCH 10/41] removed sanitizing flags --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 737bfafd..2b324705 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,8 @@ set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 11) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") +# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") +# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") include(FetchContent) FetchContent_Declare( From 2bc425678b94dbca1893cf4f3d174c1b3f86999a Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 11:29:57 +0000 Subject: [PATCH 11/41] fixed missing initialization --- INCHI-1-TEST/tests/test_unit/test_ichimain.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index f06648b1..c3c8729e 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -210,8 +210,8 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { EXPECT_EQ(orig_at_data.num_inp_bonds, 17); CANON_GLOBALS CG = {}; - PINChI2* pINChI[INCHI_NUM]; - PINChI_Aux2* pINChI_Aux[INCHI_NUM]; + PINChI2* pINChI[INCHI_NUM] = {}; + PINChI_Aux2* pINChI_Aux[INCHI_NUM] = {}; ORIG_ATOM_DATA prep_inp_data = {}; INCHI_IOS_STRING *strbuf = new INCHI_IOS_STRING; memset(strbuf, 0, sizeof(*strbuf)); @@ -282,7 +282,9 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { EXPECT_EQ(ret, DO_NEXT_STEP); - fclose(file_inchi); + if (file_inchi != nullptr) { + fclose(file_inchi); + } char *found_inchi = read_inchi_from_file(inchi_filename); From 36cd7ca7bf91135d73bfc4490831a1f0bbc36a0c Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 12:43:42 +0000 Subject: [PATCH 12/41] Added write permissions to workflow in ci pipeline --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9e27ffd..85a316d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,9 @@ jobs: - id: setup run: ./.devcontainer/post_create_commands.sh + - name: Fix file permissions + run: chmod -R +rw ${{ github.workspace }} + - name: Run unit tests run: cd CMake_build/full_build/INCHI-1-TEST/tests/test_unit && ctest --output-on-failure From c5666fda0bb3e8caa27bfdf57caf8b768dba31e7 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 13:06:16 +0000 Subject: [PATCH 13/41] Reverted file permissions --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85a316d6..b9e27ffd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,6 @@ jobs: - id: setup run: ./.devcontainer/post_create_commands.sh - - name: Fix file permissions - run: chmod -R +rw ${{ github.workspace }} - - name: Run unit tests run: cd CMake_build/full_build/INCHI-1-TEST/tests/test_unit && ctest --output-on-failure From 5e355389fed499125c14db7a618e42ecbcd87a25 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 13:22:12 +0000 Subject: [PATCH 14/41] Path fix for ci pipeline --- INCHI-1-TEST/tests/test_unit/test_ichimain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index c3c8729e..8afe3243 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -175,7 +175,7 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { bReleaseVersion, plog); - const char* inchi_filename = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; + const char* inchi_filename = "../../../INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; FILE *file_inchi; file_inchi = fopen(inchi_filename, "w"); From 87ae02a2bdf32933fb14eab6f3c4667728a7b11b Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 13:32:51 +0000 Subject: [PATCH 15/41] Path fix for ci pipeline --- INCHI-1-TEST/tests/test_unit/test_ichimain.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 8afe3243..55d60776 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -335,10 +335,11 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) "naloxon.mol", "caffeine.mol" }; + // ../../../ + // /workspaces/InChI/ + const char *path_fixtures = "../../../INCHI-1-TEST/tests/test_unit/fixtures"; - const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; - - char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char tmpl[] = "../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); From 7691e9ea1b26c94c313e828255c710c6ee08dc51 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 13:43:23 +0000 Subject: [PATCH 16/41] Path fix for ci pipeline --- INCHI-1-TEST/tests/test_unit/test_ichimain.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 55d60776..04315ba6 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -175,7 +175,7 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { bReleaseVersion, plog); - const char* inchi_filename = "../../../INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; + const char* inchi_filename = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; FILE *file_inchi; file_inchi = fopen(inchi_filename, "w"); @@ -337,9 +337,9 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) }; // ../../../ // /workspaces/InChI/ - const char *path_fixtures = "../../../INCHI-1-TEST/tests/test_unit/fixtures"; + const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); @@ -409,8 +409,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) const char *filename_caffeine = "caffeine.mol"; - const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); @@ -471,8 +471,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) const char *filename_2mols = "test_mols_2.sdf"; - const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); From bc4e2d3d89798eabe4ef9e57f3c1d583e3cac4c8 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Tue, 16 Dec 2025 10:22:16 +0000 Subject: [PATCH 17/41] Fixed directory for fixtures --- .../tests/test_unit/test_ichimain.cpp | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 04315ba6..7e06de36 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include extern "C" @@ -53,7 +54,6 @@ char *read_inchi_from_file(const char *filename) { TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { - INCHI_IOSTREAM input_stream; const char *molblock = @@ -174,11 +174,10 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { szSdfDataValue, &ulDisplTime, bReleaseVersion, plog); - - const char* inchi_filename = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; - - FILE *file_inchi; + const char* inchi_filename = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; + FILE *file_inchi = nullptr; file_inchi = fopen(inchi_filename, "w"); + EXPECT_NE(file_inchi, nullptr); inchi_ios_init(pout, INCHI_IOS_TYPE_FILE, file_inchi); //nullptr INCHI_IOS_TYPE_STRING inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); @@ -205,7 +204,6 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { output_error_inchi); EXPECT_EQ(ret, DO_NEXT_STEP); - EXPECT_EQ(orig_at_data.num_inp_atoms, 18); EXPECT_EQ(orig_at_data.num_inp_bonds, 17); @@ -225,7 +223,6 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { set_line_separators(ip->bINChIOutputOptions, &pLF, &pTAB); - // int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, // CANON_GLOBALS* CG, // STRUCT_DATA* sd, @@ -288,6 +285,8 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { char *found_inchi = read_inchi_from_file(inchi_filename); + EXPECT_NE(found_inchi, nullptr); + const char *inchi = "InChI=1S/C10H14BrCl7/c1-3(11)5(13)7(15)9(17)10(18)8(16)6(14)4(2)12/h3-10H,1-2H3/t3-,4-,5+,6+,7-,8+,9+,10-/m0/s1"; EXPECT_STREQ(inchi, found_inchi); //pout->s.pStr); @@ -312,9 +311,9 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { ip->path[i] = NULL; } } + delete ip; delete sd; - delete plog; delete pout; delete pprb; @@ -337,9 +336,9 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) }; // ../../../ // /workspaces/InChI/ - const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; + const char *path_fixtures = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char tmpl[] = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); @@ -409,8 +408,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) const char *filename_caffeine = "caffeine.mol"; - const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + const char *path_fixtures = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); @@ -466,13 +465,14 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) remove(dst_path.c_str()); rmdir(tmpd); } + TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) { const char *filename_2mols = "test_mols_2.sdf"; - const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + const char *path_fixtures = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); From a1c2f8275115b1344c154a7984b2bf2d8e9598ce Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Tue, 16 Dec 2025 15:38:28 +0000 Subject: [PATCH 18/41] Removed commented lines --- .../tests/test_unit/test_ichimain.cpp | 60 ++++--------------- _deps/googletest-src | 1 - 2 files changed, 12 insertions(+), 49 deletions(-) delete mode 160000 _deps/googletest-src diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 7e06de36..d50a451d 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -115,21 +115,6 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { inchi_ios_init(&input_stream, INCHI_IOS_TYPE_STRING, nullptr); inchi_ios_print_nodisplay(&input_stream, molblock); - // int GetTheNextRecordOfInputFile( struct tagINCHI_CLOCK *ic, - // STRUCT_DATA *sd, INPUT_PARMS *ip, - // char *szTitle, - // INCHI_IOSTREAM *inp_file, - // INCHI_IOSTREAM *plog, - // INCHI_IOSTREAM *pout, - // INCHI_IOSTREAM *pprb, - // ORIG_ATOM_DATA *orig_inp_data, - // long *num_inp, - // STRUCT_FPTRS *pStructPtrs, - // int *nRet, - // int *have_err_in_GetOneStructure, - // long *num_err, - // int output_error_inchi ); - INCHI_CLOCK ic = {}; memset(&ic, 0, sizeof(ic)); @@ -137,6 +122,11 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { // sd->ulStructTime = 0; INPUT_PARMS *ip = new INPUT_PARMS; + memset(ip, 0, sizeof(*ip)); + ip->last_struct_number = 1; + ip->nInputType = INPUT_MOLFILE; + ip->bINChIOutputOptions = INCHI_OUT_PLAIN_TEXT; + char *szTitle; INCHI_IOSTREAM *inp_file; INCHI_IOSTREAM *plog = new INCHI_IOSTREAM; @@ -152,18 +142,8 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { long num_err = 0; int output_error_inchi; - - memset(ip, 0, sizeof(*ip)); - ip->last_struct_number = 1; - ip->nInputType = INPUT_MOLFILE; - ip->bINChIOutputOptions = INCHI_OUT_PLAIN_TEXT; - // ip->bINChIOutputOptions2 = INCHI_OUT_PLAIN_TEXT; - // ip->nMode = REQ_MODE_TAUT; // REQ_MODE_BASIC; - // ip->bTautFlags |= (TG_FLAG_DISCONNECT_COORD | TG_FLAG_RECONNECT_COORD); - // ip->nMode |= (REQ_MODE_BASIC | REQ_MODE_TAUT | REQ_MODE_STEREO | REQ_MODE_ISO_STEREO | REQ_MODE_ISO); - int bReleaseVersion = bRELEASE_VERSION; - unsigned long ulDisplTime = 0; /* infinite, milliseconds */ + unsigned long ulDisplTime = 0; unsigned long ulTotalProcessingTime = 0; int argc = 0; @@ -179,11 +159,10 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { file_inchi = fopen(inchi_filename, "w"); EXPECT_NE(file_inchi, nullptr); - inchi_ios_init(pout, INCHI_IOS_TYPE_FILE, file_inchi); //nullptr INCHI_IOS_TYPE_STRING + inchi_ios_init(pout, INCHI_IOS_TYPE_FILE, file_inchi); inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); - // PrintInputParms(plog, ip); inchi_ios_flush2(plog, stderr); int ret = GetTheNextRecordOfInputFile( @@ -334,8 +313,7 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) "naloxon.mol", "caffeine.mol" }; - // ../../../ - // /workspaces/InChI/ + const char *path_fixtures = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures"; char tmpl[] = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; @@ -373,7 +351,6 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) int ret = ProcessMultipleInputFiles(argc, argv); - // Assert the expected result ASSERT_EQ(ret, 0); for (int i = 0; i < expected_inchis.size(); i++) { @@ -383,8 +360,6 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) free(inchi); } - // Clean up - for (auto p : dist_paths) { std::string out_txt = p + ".txt"; @@ -432,18 +407,13 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) int result = ProcessSingleInputFile(argc, argv); - // Assert the expected result EXPECT_EQ(result, 0); - free(inchi_filename); - free(input_file); - std::string out_txt = dst_path + ".txt"; std::string out_log = dst_path + ".log"; std::string out_prb = dst_path + ".prb"; struct stat st; - // check existence and non-zero size ASSERT_EQ(stat(out_txt.c_str(), &st), 0); EXPECT_GT(st.st_size, 0); ASSERT_EQ(stat(out_log.c_str(), &st), 0); @@ -458,6 +428,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) EXPECT_EQ(found_inchi, expected_inchi); // cleanup + free(inchi_filename); + free(input_file); free(found_inchi); remove(out_txt.c_str()); remove(out_log.c_str()); @@ -492,27 +464,20 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) char* argv[] = { inchi_filename, input_file }; // int ProcessSingleInputFile(int argc, char* argv[]) - int result = ProcessSingleInputFile(argc, argv); - // Assert the expected result EXPECT_EQ(result, 0); - free(inchi_filename); - free(input_file); - std::string out_txt = dst_path + ".txt"; std::string out_log = dst_path + ".log"; std::string out_prb = dst_path + ".prb"; struct stat st; - // check existence and non-zero size ASSERT_EQ(stat(out_txt.c_str(), &st), 0); EXPECT_GT(st.st_size, 0); ASSERT_EQ(stat(out_log.c_str(), &st), 0); EXPECT_GT(st.st_size, 0); ASSERT_EQ(stat(out_prb.c_str(), &st), 0); - // EXPECT_GT(st.st_size, 0); EXPECT_EQ(st.st_size, 0); std::ifstream txt_in(out_txt); @@ -520,7 +485,6 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) std::string line; std::vector found_inchis; while (std::getline(txt_in, line)) { - // trim leading/trailing whitespace size_t start = line.find_first_not_of(" \t\r\n"); if (start == std::string::npos) continue; size_t end = line.find_last_not_of(" \t\r\n"); @@ -542,6 +506,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) } // cleanup + free(inchi_filename); + free(input_file); remove(out_txt.c_str()); remove(out_log.c_str()); remove(out_prb.c_str()); @@ -649,7 +615,6 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) long *num_err; int output_error_inchi; - memset(ip, 0, sizeof(*ip)); ip->last_struct_number = 1; ip->nInputType = INPUT_MOLFILE; @@ -658,7 +623,6 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); - // PrintInputParms(plog, ip); inchi_ios_flush2(plog, stderr); int ret = GetTheNextRecordOfInputFile( diff --git a/_deps/googletest-src b/_deps/googletest-src deleted file mode 160000 index 52eb8108..00000000 --- a/_deps/googletest-src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 52eb8108c5bdec04579160ae17225d66034bd723 From a997d00f4c53705f9c4a5dba8731b7abfe70bf3a Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Thu, 4 Dec 2025 14:03:33 +0000 Subject: [PATCH 19/41] Decoupled main from ichimain.c --- .../Geometries/data/cis_platin.mol | 26 - .../Geometries/data/mol_alkene.ds_0.mol | 18 - .../Geometries/data/mol_bidentate.ds_7.mol | 135 -- .../Geometries/data/mol_carbonyl.ds_0.mol | 41 - .../demos/mol2inchi/src/CMakeLists.txt | 4 +- .../inchi-1 => INCHI_BASE}/src/dispstru.c | 116 +- .../inchi-1 => INCHI_BASE}/src/dispstru.h | 0 INCHI-1-SRC/INCHI_BASE/src/ichimain.c | 1529 +++++++++++++++++ .../INCHI_EXE/inchi-1/src/CMakeLists.txt | 13 +- .../src/{ichimain.c => backup_ichimain.c} | 0 INCHI-1-SRC/INCHI_EXE/inchi-1/src/main.c | 266 +++ 11 files changed, 1862 insertions(+), 286 deletions(-) delete mode 100644 INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/cis_platin.mol delete mode 100644 INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_alkene.ds_0.mol delete mode 100644 INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_bidentate.ds_7.mol delete mode 100644 INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_carbonyl.ds_0.mol rename INCHI-1-SRC/{INCHI_EXE/inchi-1 => INCHI_BASE}/src/dispstru.c (98%) rename INCHI-1-SRC/{INCHI_EXE/inchi-1 => INCHI_BASE}/src/dispstru.h (100%) create mode 100644 INCHI-1-SRC/INCHI_BASE/src/ichimain.c rename INCHI-1-SRC/INCHI_EXE/inchi-1/src/{ichimain.c => backup_ichimain.c} (100%) create mode 100644 INCHI-1-SRC/INCHI_EXE/inchi-1/src/main.c diff --git a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/cis_platin.mol b/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/cis_platin.mol deleted file mode 100644 index 92a570bd..00000000 --- a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/cis_platin.mol +++ /dev/null @@ -1,26 +0,0 @@ - - ACCLDraw09152511572D - - 11 10 0 0 0 0 0 0 0 0999 V2000 - 13.6841 -9.2760 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 - 13.6841 -10.4428 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 - 13.1007 -9.8594 0.0000 Pt 0 0 0 0 0 0 0 0 0 0 0 0 - 12.7309 -8.4791 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 11.7204 -10.2293 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 11.7204 -9.4896 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 12.7308 -11.2397 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 12.5173 -10.4428 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 - 12.3038 -11.2397 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 12.5173 -9.2760 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 - 11.7204 -9.0625 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 - 3 1 1 0 0 0 0 - 3 2 1 0 0 0 0 - 3 8 1 0 0 0 0 - 3 10 1 0 0 0 0 - 10 6 1 0 0 0 0 - 10 4 1 0 0 0 0 - 8 5 1 0 0 0 0 - 8 7 1 0 0 0 0 - 8 9 1 0 0 0 0 - 10 11 1 0 0 0 0 -M END diff --git a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_alkene.ds_0.mol b/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_alkene.ds_0.mol deleted file mode 100644 index 58be810f..00000000 --- a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_alkene.ds_0.mol +++ /dev/null @@ -1,18 +0,0 @@ - -Generated by WebMolKit - - 6 6 0 0 1 0 0 0 0 0999 V2000 - 0.0000 0.0000 0.0000 Pt 0 5 0 0 0 0 0 0 0 0 0 0 - 1.5000 0.0000 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 1.5000 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 -1.5000 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 - -1.5990 0.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.5990 -0.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1 2 1 0 0 0 0 - 1 3 1 0 0 0 0 - 1 4 1 0 0 0 0 - 1 5 0 0 0 0 0 - 5 6 2 0 0 0 0 - 6 1 0 0 0 0 0 -M CHG 1 1 -1 -M END \ No newline at end of file diff --git a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_bidentate.ds_7.mol b/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_bidentate.ds_7.mol deleted file mode 100644 index b768f346..00000000 --- a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_bidentate.ds_7.mol +++ /dev/null @@ -1,135 +0,0 @@ - -Generated by WebMolKit - - 55 61 0 0 1 0 0 0 0 0999 V2000 - 0.0000 0.0000 0.0000 Ru 0 0 0 0 0 0 0 0 0 0 0 0 - -1.7532 -0.4698 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - -1.7290 0.9982 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - -3.0281 1.7482 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - -2.1414 -1.9186 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.0807 -2.9793 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 3.3492 0.0125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.5775 1.2989 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 2.6210 -1.2989 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - -2.0000 2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 4.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.0000 2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -2.7500 0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -2.7500 3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -4.2500 0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -5.0000 2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -4.2500 3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.2990 4.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2990 4.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.2990 6.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 7.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2990 6.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.7500 3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.7500 0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 4.2500 3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 5.0000 2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 4.2500 0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 2.0000 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0 - 2.0000 -2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 -4.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -2.0000 -2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.7500 -0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 2.7500 -3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 4.2500 -0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 5.0000 -2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 4.2500 -3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2990 -4.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.2990 -4.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2990 -6.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 -7.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -1.2990 -6.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -2.7500 -3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -2.7500 -0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -4.2500 -3.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -5.0000 -2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - -4.2500 -0.7010 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 -2.0000 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0 - -3.2020 -3.7558 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - -3.9786 -0.8580 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - -5.0391 -2.6952 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - -3.5903 -2.3069 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 4.8240 1.5373 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - 4.8740 -1.4623 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - 6.3488 0.0625 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 - 4.8490 0.0375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 - 1 2 1 0 0 0 0 - 1 3 0 0 0 0 0 - 3 4 2 0 0 0 0 - 2 5 1 0 0 0 0 - 5 6 2 0 0 0 0 - 7 8 2 0 0 0 0 - 7 9 1 0 0 0 0 - 9 1 1 0 0 0 0 - 8 1 0 0 0 0 0 - 28 10 1 0 0 0 0 - 28 11 1 0 0 0 0 - 28 12 1 0 0 0 0 - 10 13 1 0 0 0 0 - 10 14 2 0 0 0 0 - 13 15 2 0 0 0 0 - 15 16 1 0 0 0 0 - 16 17 2 0 0 0 0 - 17 14 1 0 0 0 0 - 11 18 1 0 0 0 0 - 11 19 2 0 0 0 0 - 18 20 2 0 0 0 0 - 20 21 1 0 0 0 0 - 21 22 2 0 0 0 0 - 22 19 1 0 0 0 0 - 12 23 1 0 0 0 0 - 12 24 2 0 0 0 0 - 23 25 2 0 0 0 0 - 25 26 1 0 0 0 0 - 26 27 2 0 0 0 0 - 27 24 1 0 0 0 0 - 1 28 0 0 0 0 0 - 47 29 1 0 0 0 0 - 47 30 1 0 0 0 0 - 47 31 1 0 0 0 0 - 29 32 1 0 0 0 0 - 29 33 2 0 0 0 0 - 32 34 2 0 0 0 0 - 34 35 1 0 0 0 0 - 35 36 2 0 0 0 0 - 36 33 1 0 0 0 0 - 30 37 1 0 0 0 0 - 30 38 2 0 0 0 0 - 37 39 2 0 0 0 0 - 39 40 1 0 0 0 0 - 40 41 2 0 0 0 0 - 41 38 1 0 0 0 0 - 31 42 1 0 0 0 0 - 31 43 2 0 0 0 0 - 42 44 2 0 0 0 0 - 44 45 1 0 0 0 0 - 45 46 2 0 0 0 0 - 46 43 1 0 0 0 0 - 1 47 0 0 0 0 0 - 51 48 1 0 0 0 0 - 51 49 1 0 0 0 0 - 51 50 1 0 0 0 0 - 5 51 1 0 0 0 0 - 55 52 1 0 0 0 0 - 55 53 1 0 0 0 0 - 55 54 1 0 0 0 0 - 7 55 1 0 0 0 0 -M STY 1 1 SUP -M SAL 1 15 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 -M SAL 1 4 25 26 27 28 -M SMT 1 P|Ph{3} -M STY 1 2 SUP -M SAL 2 15 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 -M SAL 2 4 44 45 46 47 -M SMT 2 P|Ph{3} -M STY 1 3 SUP -M SAL 3 4 48 49 50 51 -M SMT 3 C|F{3} -M STY 1 4 SUP -M SAL 4 4 52 53 54 55 -M SMT 4 C|F{3} -M END \ No newline at end of file diff --git a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_carbonyl.ds_0.mol b/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_carbonyl.ds_0.mol deleted file mode 100644 index 2d2ca465..00000000 --- a/INCHI-1-DOC/Notebooks/Molecular_inorganics/Geometries/data/mol_carbonyl.ds_0.mol +++ /dev/null @@ -1,41 +0,0 @@ - -Generated by WebMolKit - - 11 10 0 0 1 0 0 0 0 0999 V2000 - 0.0000 0.0000 0.0000 Fe 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 1.5000 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - 0.0000 3.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 0.0000 -1.5000 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - 0.0000 -3.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2991 -0.7500 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - 2.5981 -1.5000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 1.2990 0.7500 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - 2.5980 1.5001 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - -1.5000 0.0000 0.0000 C 0 0 0 0 0 2 0 0 0 0 0 0 - -3.0000 0.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 - 1 2 0 0 0 0 0 - 2 3 2 0 0 0 0 - 1 4 0 0 0 0 0 - 4 5 2 0 0 0 0 - 1 6 0 0 0 0 0 - 6 7 2 0 0 0 0 - 1 8 0 0 0 0 0 - 8 9 2 0 0 0 0 - 1 10 0 0 0 0 0 - 10 11 2 0 0 0 0 -M STY 1 1 SUP -M SAL 1 2 2 3 -M SMT 1 C|O -M STY 1 2 SUP -M SAL 2 2 4 5 -M SMT 2 C|O -M STY 1 3 SUP -M SAL 3 2 6 7 -M SMT 3 C|O -M STY 1 4 SUP -M SAL 4 2 8 9 -M SMT 4 C|O -M STY 1 5 SUP -M SAL 5 2 10 11 -M SMT 5 C|O -M END \ No newline at end of file diff --git a/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt b/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt index 8654f50e..1f89d99a 100644 --- a/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt +++ b/INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt @@ -51,7 +51,7 @@ if(MATH_LIBRARY) target_link_libraries(mol2inchi PUBLIC ${MATH_LIBRARY}) endif() -target_compile_definitions(mol2inchi PRIVATE +target_compile_definitions(mol2inchi PRIVATE BUILD_LINK_AS_DLL TARGET_EXE_USING_API ) @@ -70,7 +70,7 @@ else() set(CMAKE_THREAD_PREFER_PTHREAD TRUE) set(THREADS_PREFER_PTHREAD_FLAG TRUE) find_package(Threads REQUIRED) - target_link_libraries(mol2inchi Threads::Threads) + target_link_libraries(mol2inchi PRIVATE Threads::Threads) add_custom_command(TARGET mol2inchi POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ $ COMMAND_EXPAND_LISTS diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/dispstru.c b/INCHI-1-SRC/INCHI_BASE/src/dispstru.c similarity index 98% rename from INCHI-1-SRC/INCHI_EXE/inchi-1/src/dispstru.c rename to INCHI-1-SRC/INCHI_BASE/src/dispstru.c index c70ce860..f5bff79f 100644 --- a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/dispstru.c +++ b/INCHI-1-SRC/INCHI_BASE/src/dispstru.c @@ -40,7 +40,7 @@ /* Draw input atom -- Win32 specific */ -#include "../../../INCHI_BASE/src/mode.h" +#include "mode.h" #ifndef COMPILE_ANSI_ONLY @@ -347,13 +347,13 @@ BOOL TextOutVert( HDC pDC, /* handle to DC */ GetTextMetrics( pDC, &TextMetric ); dy = TextMetric.tmHeight; - + for (i = 0, ret = 1; ret && i < cbString; nYStart += dy, i++) { char_width = GetOneCharInStringWidth( pDC, lpString + i ); ret = TextOut( pDC, nXStart + ( cell_width - char_width ) / 2, nYStart, lpString + i, 1 ); } - + return ret; } @@ -366,8 +366,8 @@ BOOL TextOutHoriz( HDC pDC, /* handle to DC */ int cbString, /* number of characters */ int cell_width ) { - int dX = ( cell_width && cbString == 1 ) - ? ( cell_width - GetOneCharInStringWidth( pDC, lpString ) ) / 2 + int dX = ( cell_width && cbString == 1 ) + ? ( cell_width - GetOneCharInStringWidth( pDC, lpString ) ) / 2 : 0; return TextOut( pDC, nXStart + dX, nYStart, lpString, cbString ); @@ -663,7 +663,7 @@ int DrawBond( HDC pDC, { DrawBondParity( pDC, x1, y1, x2, y2, b_parity ); } - + if (xCRU) { DrawBondCrossingCRU(pDC, x1, y1, x2, y2); @@ -726,7 +726,7 @@ void DrawPenColorFilledPolygon( HDC pDC, const POINT *pnt, int num ) ret = GetObject( penOld, sizeof( LogPen ), &LogPen ); SelectObject( pDC, penOld ); - + /* do not need to delete stock object penNew */ if (ret) { @@ -829,7 +829,7 @@ int DrawBondStereo( HDC pDC, POINT pnt[4]; - + if (b_highlight) { hHighlightPen = CreatePen( PS_SOLID, nPenWidth, clrHighlight ); @@ -1012,27 +1012,27 @@ int DrawBondParity( HDC pDC, parity_mark = parity_mark0; } - if (parity_mark == BOND_MARK_ODD) + if (parity_mark == BOND_MARK_ODD) { - p = "(-)"; + p = "(-)"; } - else if (parity_mark == BOND_MARK_EVEN) + else if (parity_mark == BOND_MARK_EVEN) { p = "(+)"; /*" |"; */ } - else if (parity_mark == BOND_MARK_UNDF) + else if (parity_mark == BOND_MARK_UNDF) { - p = "(?)"; + p = "(?)"; } - else if (parity_mark == BOND_MARK_UNKN) + else if (parity_mark == BOND_MARK_UNKN) { - p = "(u)"; + p = "(u)"; } - else if (parity_mark == BOND_MARK_ERR) + else if (parity_mark == BOND_MARK_ERR) { - p = "(!)"; + p = "(!)"; } - else + else { return 0; } @@ -1084,7 +1084,7 @@ int DrawBondCrossingCRU(HDC pDC, int x1, int y1, int x2, int y2) char *p; p = " //"; /*"(+)"; */ - + if (abs(x2 - x1) > 10 * abs(y2 - y1)) { /* almost horizontal bond; draw parity closer (1:2) to the right end */ @@ -1137,7 +1137,7 @@ int DrawBondNoStereo( HDC pDC, COLORREF clr = clrPen; switch (b_type) - { + { /* c=center, l=left, r=right */ case 0: c = 'D'; @@ -1240,8 +1240,8 @@ int DrawBondNoStereo( HDC pDC, DrawLine( pDC, x1, y1, x2, y2 ); hLongDashedPen = (HPEN) SelectObject( pDC, hSolidPen ); } - - + + /* draw lines parallel to line between bonds */ if (l || r) @@ -1252,14 +1252,14 @@ int DrawBondNoStereo( HDC pDC, bond_sep = hfont / 12.0; if (( x1 == x2 ) || ( y1 == y2 )) { - if (bond_sep < 1.0) + if (bond_sep < 1.0) { bond_sep = 1.0; } } else { - if (bond_sep < 2.0) + if (bond_sep < 2.0) { bond_sep = 2.0; } @@ -1270,14 +1270,14 @@ int DrawBondNoStereo( HDC pDC, bond_sep = hfont / 6.0; if (( x1 == x2 ) || ( y1 == y2 )) { - if (bond_sep < 2.0) + if (bond_sep < 2.0) { bond_sep = 2.0; } } else { - if (bond_sep < 4.0) + if (bond_sep < 4.0) { bond_sep = 4.0; } @@ -1397,9 +1397,9 @@ int MyTextOutABC( const char *p, int iFst, int iLst, HDC pDC ) { return 0; } - + GetCurrentPositionEx( pDC, &pt ); - + if (GetCharABCWidths( pDC, /* handle to DC */ (int) p[iFst], /* first character in range */ (int) p[iFst], /* last character in range */ @@ -1411,7 +1411,7 @@ int MyTextOutABC( const char *p, int iFst, int iLst, HDC pDC ) } TextOut( pDC, pt.x, pt.y, p + iFst, iLst - iFst + 1 ); - + if (GetCharABCWidths( pDC, /* handle to DC */ (int) p[iLst], /* first character in range */ (int) p[iLst], /* last character in range */ @@ -1422,7 +1422,7 @@ int MyTextOutABC( const char *p, int iFst, int iLst, HDC pDC ) pt.x -= abc.abcC; MoveToEx( pDC, pt.x, pt.y, NULL ); } - + return 1; } @@ -1438,15 +1438,15 @@ int DrawColorString( HDC pDC,const char *st, int xs, int ys, int bHighlightTheAt COLORREF NewBkColor=0; int bWritingAtomStringColored = 0; - /* - Draw the string character by character. - For each character within the first part of the string - make a decision if it is a subscript or a superscript - The first part ends with '/'=start of the canonical number or '(' = start of the parity mark - The superscript first character is ^ or + or - or . (. initiates double shift) - The the superscript ends with not the first character and not a digit or the end of the first part - The first character of a subscript (if it is not in the superscript) is a digit - The subscript ends a non-digit + /* + Draw the string character by character. + For each character within the first part of the string + make a decision if it is a subscript or a superscript + The first part ends with '/'=start of the canonical number or '(' = start of the parity mark + The superscript first character is ^ or + or - or . (. initiates double shift) + The the superscript ends with not the first character and not a digit or the end of the first part + The first character of a subscript (if it is not in the superscript) is a digit + The subscript ends a non-digit */ const char *p = st; UINT uPrevTextAlign = SetTextAlign( pDC, TA_UPDATECP ); @@ -1672,11 +1672,11 @@ int DrawColorString( HDC pDC,const char *st, int xs, int ys, int bHighlightTheAt /****************************************************************************/ -int DrawPreparedString( HDC pDC, - char *st1, - int shift, - int x, - int y, +int DrawPreparedString( HDC pDC, + char *st1, + int shift, + int x, + int y, int bHighlightTheAtom ) { DrawColorString( pDC, st1, x + shift, y - GetFontAscent( pDC ) / 2, bHighlightTheAtom ); @@ -1705,7 +1705,7 @@ int DrawString( HDC pDC, char *st1, int shift, int x, int y ) ys = y - afont / 2; /* Single element */ - if (strlen( st ) == 1) + if (strlen( st ) == 1) { goto draw; } @@ -1719,7 +1719,7 @@ int DrawString( HDC pDC, char *st1, int shift, int x, int y ) start = MoveHydrogenAtomToTheLeft(st, start, 'D'); start = MoveHydrogenAtomToTheLeft(st, start, 'H'); /* determine the position */ - if (( strlen( st ) == 2 ) && islower( st[1] )) + if (( strlen( st ) == 2 ) && islower( st[1] )) { goto draw; } @@ -1918,7 +1918,7 @@ void CalcTblParms( HDC hMemoryDC, tp->tblRows = inchi_max( tp->tblRows, n ); } if (tdp->nOrientation) - { + { /* here are tp->tblCols columns and tp->tblRows rows. */ tp->tblHeight = tp->thdrHeight + ( 2 * tp->tblRows + 2 )*tp->tcellHeight; /* empty lines above the header and around each cell */ tp->thdrWidth = tp->tcellWidth = inchi_max( tp->tcellWidth, tp->thdrWidth ); @@ -1930,7 +1930,7 @@ void CalcTblParms( HDC hMemoryDC, tp->ytblOffs = yoffs1; } else - { + { /* Do not believe your eyes: here are tp->tblCols rows and tp->tblRows columns. */ tp->thdrHeight = tp->tcellHeight = inchi_max( tp->thdrHeight, tp->tcellHeight ); tp->tblWidth = tp->thdrWidth + ( 2 * tp->tblRows + 2 )*tp->tcellWidth; @@ -1956,7 +1956,7 @@ int DrawTheTable( HDC hDC, int dx = tp->tcellWidth / 2; int dy = tp->tcellHeight / 2; int x1, y1, x2, y2; - + /* draw frame around the table */ ret = Rectangle( hDC, tp->xtblOffs + dx + x_offs, tp->ytblOffs + dy + y_offs, tp->xtblOffs + tp->tblWidth - dx + x_offs, tp->ytblOffs + tp->tblHeight - dy + y_offs ); /* djb-rwth: removing redundant variable *//* djb-rwth: ignoring LLVM warning: variable used to store function return value */ @@ -1979,7 +1979,7 @@ int DrawTheTable( HDC hDC, } DrawLine( hDC, x1 + x_offs, y1 + y_offs, x2 + x_offs, y2 + y_offs ); } - + /* draw lines between requested/Shown/Found types */ for (i = 0; i < tp->tblRows; i++) { @@ -2604,7 +2604,7 @@ int CreateInputStructPicture( HDC hDC, /* Calculate requested/Shown/Found table sizes */ /***********************************************/ memset(&tp, 0, sizeof(tp)); /* djb-rwth: memset_s C11/Annex K variant? */ - + #ifdef TARGET_LIB_FOR_WINCHI bDrawTbl = 0; #else @@ -2760,15 +2760,15 @@ int CreateInputStructPicture( HDC hDC, { strcat(str, ":"); } - if (bTaut) + if (bTaut) { strcat(str, " Mobile H"); } - if (bIso) + if (bIso) { strcat(str, " Isotopic"); } - if (bSter) + if (bSter) { strcat(str, " Stereo"); } @@ -2776,7 +2776,7 @@ int CreateInputStructPicture( HDC hDC, } if (pWinData->inf_at_data.szRemovedProtons[0]) { - if (str[0]) + if (str[0]) strcat( str, "; " ); /* djb-rwth: function replaced with its safe C11 variant */ strcat(str, pWinData->inf_at_data.szRemovedProtons); } @@ -3297,7 +3297,7 @@ int DisplayInputStructure( char *szOutputString, UnregisterClass( szWindowClassName, /* address of class name string */ hInstance /* handle of application instance */ ); - + /* Save window size and position */ if (WinData.rc.bottom > WinData.rc.top && WinData.rc.right > WinData.rc.left) { @@ -3306,12 +3306,12 @@ int DisplayInputStructure( char *szOutputString, dp->pdp->rcPict[2] = WinData.rc.right - WinData.rc.left; dp->pdp->rcPict[3] = WinData.rc.bottom - WinData.rc.top; } - + if (WinData.bEsc) { dp->rdp.bEsc = 1; } - + return WinData.bEsc ? 27 : 1; } #endif diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/dispstru.h b/INCHI-1-SRC/INCHI_BASE/src/dispstru.h similarity index 100% rename from INCHI-1-SRC/INCHI_EXE/inchi-1/src/dispstru.h rename to INCHI-1-SRC/INCHI_BASE/src/dispstru.h diff --git a/INCHI-1-SRC/INCHI_BASE/src/ichimain.c b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c new file mode 100644 index 00000000..a575437b --- /dev/null +++ b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c @@ -0,0 +1,1529 @@ +/* + * International Chemical Identifier (InChI) + * Version 1 + * Software version 1.07 + * April 30, 2024 + * + * MIT License + * + * Copyright (c) 2024 IUPAC and InChI Trust + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +* +* The InChI library and programs are free software developed under the + * auspices of the International Union of Pure and Applied Chemistry (IUPAC). + * Originally developed at NIST. + * Modifications and additions by IUPAC and the InChI Trust. + * Some portions of code were developed/changed by external contributors + * (either contractor or volunteer) which are listed in the file + * 'External-contributors' included in this distribution. + * + * info@inchi-trust.org + * +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef COMPILE_ANSI_ONLY +// #include +#ifndef TARGET_LIB_FOR_WINCHI +// #include +#endif +#endif + +#include "mode.h" + +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) +#include +#include +#endif + + +#ifdef _WIN32 +#include +#endif +#include "ichitime.h" +#include "incomdef.h" +#include "ichidrp.h" +#include "inpdef.h" +#include "ichi.h" +#include "strutil.h" +#include "util.h" +#include "ichierr.h" +#include "ichimain.h" +#include "ichicomp.h" +#include "ichi_io.h" +#ifdef TARGET_EXE_STANDALONE +#include "inchi_api.h" +#endif + +#include "bcf_s.h" +#include "permutation_util.h" + + /* Console-specific */ + + + +#ifndef TARGET_LIB_FOR_WINCHI +/* COVERS THE CODE FROM HERE TO THE END OF FILE */ + + +/* Enable/disable internal tests */ + +/* Uncomment for INCHI_LIB testing only */ +/*#define TEST_FPTRS*/ + +/* Windows-console-mode specific */ + +// int bInterrupted = 0; + + +/****************************************************************************/ +int ProcessMultipleInputFiles(int argc, char* argv[]) +{ + int i, ret = 0, nfn_ins = 0, + AMIOutStd = 0, AMILogStd = 0, AMIPrbNone = 0; + char* fn_out, * fn_log, * fn_prb; + char pNUL[] = "NUL"; + char** fn_ins = NULL, ** targv = NULL; + int ret_val; /* djb-rwth: adding return value */ /* djb-rwth: ignoring LLVM warning */ + +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) +#ifdef _WIN64 + typedef __int64 intptr_t; /* x64 */ +#else + typedef long int intptr_t; /* VC 6.0 has no intptr_t and no x64 */ +#endif + struct _finddata_t file_info; + intptr_t hFile = -1; + int retFile, lenPath; + char* pName, * pOutPath = NULL; /* djb-rwth: ignoring LLVM warning */ + char pathname[_MAX_PATH]; + char szBlank[] = ""; /* djb-rwth: ignoring LLVM warning */ + int numFiles = 0; /* counts processed files */ +#else + int p; +#endif + + fn_ins = (char**)inchi_calloc(argc, sizeof(char*)); + if (!fn_ins) + { + fprintf(stderr, "Not enough memory.\n"); + goto exit_ami; + } + + /* Check for other options and collect inputs. */ + for (i = 1; i < argc; i++) + { + if (argv[i][0] == INCHI_OPTION_PREFX) + { + if (!inchi_stricmp(argv[i] + 1, "STDIO")) + { + fprintf(stderr, "Options AMI and STDIO are not compatible.\n"); + goto exit_ami; + } + else if (!inchi_stricmp(argv[i] + 1, "AMIOutStd")) + { + AMIOutStd = 1; + } + else if (!inchi_stricmp(argv[i] + 1, "AMILogStd")) + { + AMILogStd = 1; + } + else if (!inchi_stricmp(argv[i] + 1, "AMIPrbNone")) + { + AMIPrbNone = 1; + } +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) + else if (!inchi_memicmp(argv[i] + 1, "OP:", 3)) + { + pOutPath = argv[i] + 4; /* output path */ + } +#endif + } + else + { + fn_ins[nfn_ins] = argv[i]; + nfn_ins++; + } + } + + if (!nfn_ins) + { + fprintf(stderr, "At least one input file is expected in AMI mode.\n"); + goto exit_ami; + } + + targv = (char**)inchi_calloc((long long)argc + 3, sizeof(char*)); /* djb-rwth: cast operator added */ + + if (!targv) + { + fprintf(stderr, "Not enough memory.\n"); + goto exit_ami; + } + +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) + if ((pName = strrchr(fn_ins[0], INCHI_PATH_DELIM))) /* djb-rwth: addressing LLVM warning */ + { + pName++; + lenPath = pName - fn_ins[0]; + } + else + { + pName = fn_ins[0]; + lenPath = 0; + } + for (hFile = _findfirst(fn_ins[0], &file_info), retFile = 0; + !retFile && -1 != hFile; + retFile = _findnext(hFile, &file_info), numFiles++) +#else + for (p = 0; p < nfn_ins; p++) +#endif + { + int targc; +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) + const char* fn_in; + int inlen = lenPath + strlen(file_info.name); + if (!file_info.size || (file_info.attrib & _A_SUBDIR) || inlen >= _MAX_PATH) + { + continue; + } + memcpy(pathname, fn_ins[0], lenPath); + strcpy(pathname + lenPath, file_info.name); + fn_in = pathname; + if (0 == numFiles % 5000) + { + ret_val = _heapmin(); /* reduce heap fragmentation */ /* djb-rwth: return value variable added */ + } +#else + const char* fn_in = fn_ins[p]; + int inlen = strlen(fn_in); +#endif + fn_out = fn_log = fn_prb = NULL; + + targv[0] = argv[0]; + targv[1] = (char*)fn_in; + targc = 1; + + if (AMIOutStd) + { + targv[++targc] = pNUL; + } +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) + else if (pOutPath) + { + targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ + } +#endif + else + { + /* make output name as input name plus ext. */ + fn_out = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ + if (fn_out) + { + strcpy(fn_out, fn_in); + strcat(fn_out, ".txt"); + } + targv[++targc] = fn_out; + } + + if (AMILogStd) + { + targv[++targc] = pNUL; + } +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) + else if (pOutPath) + { + targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ + } +#endif + else + { + /* Make log name as input name plus ext. */ + fn_log = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ + if (fn_log) + { + strcpy(fn_log, fn_in); + strcat(fn_log, ".log"); + } + targv[++targc] = fn_log; + } + if (AMIPrbNone) + { + targv[++targc] = pNUL; + } +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) + else if (pOutPath) + { + targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ + } +#endif + else + { + /* Make problem file name as input file name plus ext. */ + fn_prb = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ + if (fn_prb) + { + strcpy(fn_prb, fn_in); + strcat(fn_prb, ".prb"); + } + targv[++targc] = fn_prb; + } + + for (i = 1; i < argc; i++) + { + if (argv[i][0] == INCHI_OPTION_PREFX) + { + /* avoid strnicmp/strncasecmp */ + if ((strlen(argv[i]) > 3) && + (toupper(argv[i][1]) == 'A') && (toupper(argv[i][2]) == 'M') && (toupper(argv[i][3]) == 'I')) + { + continue; + } + targv[++targc] = argv[i]; + } + } + /* djb-rwth: fixing undefined index value / buffer overflow */ + ++targc; + if (targc < argc + 3) + { + targv[targc] = NULL; + } + + ret = ProcessSingleInputFile(targc, targv); /* ProcessSingleInputFile() is a former main() */ + + if (fn_out) + { + inchi_free(fn_out); + } + if (fn_log) + { + inchi_free(fn_log); + } + if (fn_prb) + { + inchi_free(fn_prb); + } + +#if ( defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) + if (ret == CTRL_STOP_EVENT) + { + goto exit_ami; + } +#endif + } + + +exit_ami: +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) + if (hFile != -1) + { + _findclose(hFile); + } +#endif + if (targv) + { + inchi_free(targv); + } + if (fn_ins) + { + inchi_free(fn_ins); + } + + return 0; +} + + + +/****************************************************************************/ +int ProcessSingleInputFile(int argc, char* argv[]) +{ + /**************************************/ +#endif /* #if ( BUILD_WITH_AMI == 1 ) */ +/**************************************/ + +/**** IF NOT IN AMI MODE, main() STARTS HERE ****/ + + int bReleaseVersion = bRELEASE_VERSION; + const int nStrLen = INCHI_SEGM_BUFLEN; + int nRet = 0; + int i; + long num_err, num_output, num_inp; + /* long rcPict[4] = {0,0,0,0}; */ + unsigned long ulDisplTime = 0; /* infinite, milliseconds */ + unsigned long ulTotalProcessingTime = 0; + + CANON_GLOBALS CG; + INCHI_CLOCK ic; + + char szTitle[MAX_SDF_HEADER + MAX_SDF_VALUE + 256]; + char szSdfDataValue[MAX_SDF_VALUE + 1]; + + INPUT_PARMS inp_parms; + INPUT_PARMS* ip = &inp_parms; + + STRUCT_DATA struct_data; + STRUCT_DATA* sd = &struct_data; + + ORIG_ATOM_DATA OrigAtData; /* 0=> disconnected, 1=> original */ + ORIG_ATOM_DATA* orig_inp_data = &OrigAtData; + ORIG_ATOM_DATA PrepAtData[2]; /* 0=> disconnected, 1=> original */ + ORIG_ATOM_DATA* prep_inp_data = PrepAtData; + + PINChI2* pINChI[INCHI_NUM]; + PINChI_Aux2* pINChI_Aux[INCHI_NUM]; + + char* pLF, * pTAB; + INCHI_IOS_STRING temp_string_container; + INCHI_IOS_STRING* strbuf = &temp_string_container; + INCHI_IOSTREAM outputstr, logstr, prbstr, instr; + INCHI_IOSTREAM* pout = &outputstr, * plog = &logstr, * pprb = &prbstr, * inp_file = &instr; + +#ifdef TARGET_EXE_STANDALONE + int inchi_ios_type = INCHI_IOS_TYPE_STRING; +#else + int inchi_ios_type = INCHI_IOS_TYPE_FILE; +#endif +#if ( READ_INCHI_STRING == 1 ) + const int may_get_inchi_string_input = 1; +#else + const int may_get_inchi_string_input = 0; +#endif + int bInChI2Structure = 0; + int output_error_inchi = 0; + + + /* internal tests --- */ +#ifndef TEST_FPTRS + STRUCT_FPTRS* pStructPtrs = NULL; +#else + STRUCT_FPTRS struct_fptrs, * pStructPtrs = &struct_fptrs; /* INCHI_LIB debug only */ +#endif + +#if ( defined(_WIN32) && defined(_MSC_VER) ) +#if WINVER >= 0x0501 /* XP or newer */ /* 0x0600 Vista or newer */ + DWORD tick_inchi_start, tick_inchi_stop; + tick_inchi_start = GetTickCount64(); /* djb-rwth: GetTickCount64() should be used */ +#endif +#endif + +#ifdef _WIN32 +#if ( TRACE_MEMORY_LEAKS == 1 ) + _CrtSetDbgFlag(_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF); + /* for execution outside the VC++ debugger uncomment one of the following two */ + /*#define MY_REPORT_FILE _CRTDBG_FILE_STDERR */ + /*#define MY_REPORT_FILE _CRTDBG_FILE_STDOUT */ +#ifdef MY_REPORT_FILE + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_WARN, MY_REPORT_FILE); + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ERROR, MY_REPORT_FILE); + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ASSERT, MY_REPORT_FILE); +#else + _CrtSetReportMode(_CRT_WARN | _CRT_ERROR, _CRTDBG_MODE_DEBUG); +#endif + /* turn on floating point exceptions */ + { + /* Get the default control word. */ + int cw = _controlfp(0, 0); + + /* Set the exception masks OFF, turn exceptions on. */ + /*cw &=~(EM_OVERFLOW|EM_UNDERFLOW|EM_INEXACT|EM_ZERODIVIDE|EM_DENORMAL);*/ + cw &= ~(EM_OVERFLOW | EM_UNDERFLOW | EM_ZERODIVIDE | EM_DENORMAL); + + /* Set the control word. */ + _controlfp(cw, MCW_EM); +} +#endif +#endif + + sd->bUserQuit = 0; + /* djb-rwth: fixing coverity CID #499552 */ + sd->num_components[0] = 0; + sd->num_components[1] = 0; +#if ( defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) + if (SetConsoleCtrlHandler(MyHandlerRoutine, 1)) + { + ConsoleQuit = WasInterrupted; + } +#endif + + num_inp = 0; + num_err = 0; + num_output = 0; + + inchi_ios_init(inp_file, INCHI_IOS_TYPE_FILE, NULL); + inchi_ios_init(pout, inchi_ios_type, NULL); + inchi_ios_init(plog, inchi_ios_type, stdout); + inchi_ios_init(pprb, inchi_ios_type, NULL); + memset(strbuf, 0, sizeof(*strbuf)); /* djb-rwth: memset_s C11/Annex K variant?; dereferencing strbuf */ + + if (argc == 1 || (argc == 2 && (argv[1][0] == INCHI_OPTION_PREFX) && + ((!strcmp(argv[1] + 1, "?") || !inchi_stricmp(argv[1] + 1, "help"))))) /* djb-rwth: addressing LLVM warning */ + { + HelpCommandLineParms(plog); + inchi_ios_flush(plog); + return 0; + } + + /* djb-rwth: printing out InChI version */ + if (argc == 2 && ((argv[1][0] == INCHI_OPTION_PREFX)) && (!strcmp(argv[1] + 1, "v") || !strcmp(argv[1] + 1, "V"))) + { + printf("%s\n", APP_DESCRIPTION); + return 0; + } + + /* djb-rwth: disallowing endless execution if no file(s) is given as the first argument */ + if (argc >= 2 && ((argv[1][0] == INCHI_OPTION_PREFX)) && (strcmp(argv[1] + 1, "v") || strcmp(argv[1] + 1, "V") || strcmp(argv[1] + 1, "?") || inchi_stricmp(argv[1] + 1, "help"))) + { + HelpCommandLineParms(plog); + inchi_ios_flush(plog); + return 0; + } + + /* original input structure */ + memset(orig_inp_data, 0, sizeof(*orig_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ + memset(prep_inp_data, 0, 2 * sizeof(*prep_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ + memset(pINChI, 0, sizeof(pINChI)); /* djb-rwth: memset_s C11/Annex K variant? */ + memset(pINChI_Aux, 0, sizeof(pINChI_Aux)); /* djb-rwth: memset_s C11/Annex K variant? */ + memset(szSdfDataValue, 0, sizeof(szSdfDataValue)); /* djb-rwth: memset_s C11/Annex K variant? */ + + memset(&CG, 0, sizeof(CG)); /* djb-rwth: memset_s C11/Annex K variant? */ + memset(&ic, 0, sizeof(ic)); /* djb-rwth: memset_s C11/Annex K variant? */ + + plog->f = stderr; + + if (0 > ReadCommandLineParms(argc, (const char**)argv, ip, + szSdfDataValue, &ulDisplTime, + bReleaseVersion, plog)) + { + goto exit_function; + } + + if (!OpenFiles(&(inp_file->f), &(pout->f), &(plog->f), &(pprb->f), ip)) + { + goto exit_function; + } + + + if (ip->bNoStructLabels) + { + ip->pSdfLabel = NULL; + ip->pSdfValue = NULL; + } + else if (ip->nInputType == INPUT_INCHI_PLAIN || + ip->nInputType == INPUT_INCHI) + { + /* the input may contain both the header and the label of the structure */ + if (!ip->pSdfLabel) + { + ip->pSdfLabel = ip->szSdfDataHeader; + } + if (!ip->pSdfValue) + { + ip->pSdfValue = szSdfDataValue; + } + } + + set_line_separators(ip->bINChIOutputOptions, &pLF, &pTAB); + + save_command_line(argc, argv, plog); + + PrintInputParms(plog, ip); + + inchi_ios_flush2(plog, stderr); + + if (0 >= inchi_strbuf_init(strbuf, INCHI_STRBUF_INITIAL_SIZE, INCHI_STRBUF_SIZE_INCREMENT)) + { + inchi_ios_eprint(plog, "Cannot allocate internal string buffer. Terminating\n"); + inchi_ios_flush2(plog, stderr); + goto exit_function; + } + + + /* Process InChI string as input; output may be */ + /* a) InChI string or b) structure */ + /*#if ( READ_INCHI_STRING == 1 )*/ + if (may_get_inchi_string_input && ip->nInputType == INPUT_INCHI) + { + bInChI2Structure = 0 != (ip->bReadInChIOptions & READ_INCHI_TO_STRUCTURE); + memset(sd, 0, sizeof(*sd)); /* djb-rwth: memset_s C11/Annex K variant? */ + if (bInChI2Structure) + { + /* loop through file lines here */ + INCHI_IOSTREAM tmpinpustream; + INCHI_IOS_STRING* pTmpIn = &tmpinpustream.s; + int crlf2lf = 0, preserve_lf = 1, read_result = 0; + inchi_ios_init(&tmpinpustream, INCHI_IOS_TYPE_STRING, NULL); + while (1) + { + char* p, * pi; + + read_result = inchi_strbuf_getline(pTmpIn, inp_file->f, crlf2lf, preserve_lf); + + if (read_result == -1) +#if (FIX_ONE_LINE_INCHI_INPUT_CONVERSION_ISSUE==1) + { + if (!pTmpIn->pStr) + { + break; + } + if (strlen(pTmpIn->pStr) < 8) /* 7 = strlen("InChI=1") */ + { + break; + } + } +#else + break; /* EOF or read error */ +#endif + + p = pTmpIn->pStr; + if (!p) + { + continue; + } + pi = strstr(p, "InChI=1"); + if (pi != p) + { + continue; + } + + num_inp++; + ip->lMolfileNumber = num_inp; + + ReadWriteInChI(&ic, &CG, &tmpinpustream, pout, plog, ip, sd, NULL, 0, 0, NULL, NULL, NULL, 0, NULL); + + /*fprintf( stderr, "%ld", num_inp );*/ + inchi_strbuf_reset(pTmpIn); + inchi_ios_flush2(plog, stderr); + } + fprintf(stderr, "\r"); + inchi_strbuf_close(pTmpIn); + } + else + { + /* loop through file lines within ReadWriteInChI */ + ReadWriteInChI(&ic, &CG, inp_file, pout, plog, ip, sd, NULL, 0, 0, NULL, NULL, NULL, 0, NULL); + + num_inp = sd->fPtrStart; + num_err = sd->fPtrEnd; + } + + inchi_ios_flush2(plog, stderr); + ulTotalProcessingTime = sd->ulStructTime; + /*num_inp = sd->fPtrStart; + num_err = sd->fPtrEnd; + */ + goto exit_function; + } + + + ulTotalProcessingTime = 0; + if (pStructPtrs) + { + memset(pStructPtrs, 0, sizeof(pStructPtrs[0])); /* djb-rwth: memset_s C11/Annex K variant? */ + } + output_error_inchi = ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR; + + + /*************************************************************/ + /* Main cycle : read input structures and create their INChI */ + /*************************************************************/ + + + while (!sd->bUserQuit ) //&& !bInterrupted + { + int do_renumbering = 0; + int next_action; + int have_err_in_GetOneStructure = 0; + int dup_fail = 0; + ORIG_ATOM_DATA SavedOrigAtData; /* 0=> disconnected, 1=> original */ + ORIG_ATOM_DATA* saved_orig_inp_data = &SavedOrigAtData; + char ikey0[28]; + ikey0[0] = '\0'; + + + next_action = GetTheNextRecordOfInputFile(&ic, sd, ip, szTitle, + inp_file, plog, pout, pprb, + orig_inp_data, &num_inp, pStructPtrs, + &nRet, &have_err_in_GetOneStructure, + &num_err, output_error_inchi); + if (next_action == DO_EXIT_FUNCTION) + { + goto exit_function; + } + else if (next_action == DO_BREAK_MAIN_LOOP) + { + break; + } + else if (next_action == DO_CONTINUE_MAIN_LOOP) + { + if (nRet == _IS_ERROR) /* may also be _IS_SKIP ... */ + { + if (output_error_inchi) + { + Output_RecordInfo(pout, num_inp, ip->bNoStructLabels, ip->pSdfLabel, ip->pSdfValue, ip->lSdfId, + pLF, pTAB); + emit_empty_inchi(ip, num_inp, pLF, pTAB, pout); + } + } + continue; + } + + + /* Create INChI for each connected component of the structure; + optionally display them; + output INChI for the whole structure */ + +#if (RENUMBER_ATOMS_AND_RECALC_V106 == 1 ) + if (ip->bRenumber == 1) + { + do_renumbering = 1; + } +#endif + if (do_renumbering == 0) + { + /* Normal calculations */ + next_action = CalcAndPrintINCHIAndINCHIKEY(&ic, &CG, sd, ip, szTitle, + pINChI, pINChI_Aux, + inp_file, plog, pout, pprb, + orig_inp_data, prep_inp_data, &num_inp, pStructPtrs, + &nRet, have_err_in_GetOneStructure, + &num_err, output_error_inchi, + strbuf, &ulTotalProcessingTime, + pLF, pTAB, ikey0, + 0 /* not silent */); + + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + FreeOrigAtData(orig_inp_data); + FreeOrigAtData(prep_inp_data); + FreeOrigAtData(prep_inp_data + 1); + } + else + { + /* Internal test mode: renumber atoms and recalculate repeatedly */ + long int nrepeat = 1; + /* 2! = 2 3! = 6 4! = 24 5! = 120 6! = 520 7! = 5040 8! = 40320 */ + if (orig_inp_data->num_inp_atoms == 1) + { + nrepeat = 1; + } + else if (orig_inp_data->num_inp_atoms == 2) + { + nrepeat = 2; + } + else if (orig_inp_data->num_inp_atoms == 3) + { + nrepeat = 6; + } + else + { + nrepeat = 1000; /* 100000;*/ /*16;*/ + } + /* correct (decrease repeat number) for relatively large molecules */ + if (orig_inp_data->num_inp_atoms > 128) + { + nrepeat = 100; /* 100000;*/ /*16;*/ + } + if (orig_inp_data->num_inp_atoms > 256) + { + nrepeat = 50; /* 100000;*/ /*16;*/ + } + if (orig_inp_data->num_inp_atoms > 512) + { + nrepeat = 25; /* 100000;*/ /*16;*/ + } + if (orig_inp_data->num_inp_atoms > 1024) + { + nrepeat = 10; /* 100000;*/ /*16;*/ + } + + /*inchi_ios_eprint(plog, "Number of random atom renumberings up to: %-ld\n", nrepeat); + inchi_ios_flush2(plog, stderr);*/ + +#if 0 + else if (orig_inp_data->num_inp_atoms == 4) + { + nrepeat = 24; + } + else + { + nrepeat = 10; + } + + else if (orig_inp_data->num_inp_atoms == 4) + { + nrepeat = 24; + } + else if (orig_inp_data->num_inp_atoms == 5) + { + nrepeat = 120; + } + else if (orig_inp_data->num_inp_atoms == 6) + { + nrepeat = 520; + } + else if (orig_inp_data->num_inp_atoms == 7) + { + nrepeat = 1000; + } + else + { + nrepeat = 10000; + } +#endif + + next_action = RepeatedlyRenumberAtomsAndRecalcINCHI(&ic, &CG, sd, ip, szTitle, + pINChI, pINChI_Aux, + inp_file, plog, pout, pprb, + orig_inp_data, prep_inp_data, &num_inp, pStructPtrs, + &nRet, have_err_in_GetOneStructure, + &num_err, output_error_inchi, + strbuf, &ulTotalProcessingTime, + pLF, pTAB, nrepeat); + } /* if (ip->bRenumber == 1) */ + + if (next_action == DO_EXIT_FUNCTION) + { + goto exit_function; + } + else if (next_action == DO_BREAK_MAIN_LOOP) + { + break; + } + else if (next_action == DO_CONTINUE_MAIN_LOOP) + { + continue; + } + } /* end of main cycle - while ( !sd->bUserQuit && !bInterrupted ) */ + + +exit_function: + /* Avoid memory leaks in case of fatal error */ + if (pStructPtrs && pStructPtrs->fptr) + { + inchi_free(pStructPtrs->fptr); + } + /* Free INChI memory */ + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + /* Free structure data */ + FreeOrigAtData(orig_inp_data); + FreeOrigAtData(prep_inp_data); + FreeOrigAtData(prep_inp_data + 1); + /* Close files */ + inchi_ios_close(inp_file); + inchi_ios_close(pout); + inchi_ios_close(pprb); + { + int hours, minutes, seconds, mseconds; + + SplitTime(ulTotalProcessingTime, &hours, &minutes, &seconds, &mseconds); + + inchi_ios_eprint(plog, "Finished processing %ld structure%s: %ld error%s, processing time %d:%02d:%02d.%02d\n", + num_inp, num_inp == 1 ? "" : "s", + num_err, num_err == 1 ? "" : "s", + hours, minutes, seconds, mseconds / 10); + inchi_ios_flush2(plog, stderr); + } +#if ( defined(_WIN32) && defined(_MSC_VER) ) +#if WINVER >= 0x0501 /* XP or newer */ /* 0x0600 Vista or newer */ + tick_inchi_stop = GetTickCount64(); /* djb-rwth: GetTickCount64() should be used */ + inchi_ios_eprint(plog, "\nElapsed walltime: %d msec.\n", tick_inchi_stop - tick_inchi_start); + inchi_ios_flush2(plog, stderr); +#endif +#endif + /* Final cleanup */ + inchi_ios_close(plog); + inchi_strbuf_close(strbuf); + for (i = 0; i < MAX_NUM_PATHS; i++) + { + if (ip->path[i]) + { + inchi_free((void*)ip->path[i]); /* cast deliberately discards 'const' qualifier */ + ip->path[i] = NULL; + } + } + SetBitFree(&CG); +#if ( ( BUILD_WITH_AMI==1 ) && defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) + if (bInterrupted) + { + return CTRL_STOP_EVENT; + } +#endif + + return 0; +} + + +/****************************************************************************/ +void save_command_line(int argc, char* argv[], INCHI_IOSTREAM* plog) +{ + int k; + + inchi_ios_eprint(plog, "The command line used:\n\""); + for (k = 0; k < argc - 1; k++) + { +#if( ALLOW_EMPTY_PATHS == 1 ) + inchi_ios_eprint(plog, "%-s ", argv[k][0] ? argv[k] : "\"\""); +#else + inchi_ios_eprint(plog, "%-s ", argv[k]); +#endif + } + + inchi_ios_eprint(plog, "%-s\"\n", argv[argc - 1]); + + return; +} + + +/*****************************************************************************/ +void emit_empty_inchi(INPUT_PARMS* ip, + long num_inp, + char* pLF, + char* pTAB, + INCHI_IOSTREAM* pout) +{ + if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) + { + inchi_ios_eprint(pout, "InChI=1S//\n"); /* emit empty Std InChI */ + } + else + { + inchi_ios_eprint(pout, "InChI=1//\n"); /* emit empty InChI */ + } + inchi_ios_flush(pout); +} + + + +/*****************************************************************************/ +int GetTheNextRecordOfInputFile(struct tagINCHI_CLOCK* ic, + STRUCT_DATA* sd, INPUT_PARMS* ip, + char* szTitle, + INCHI_IOSTREAM* inp_file, + INCHI_IOSTREAM* plog, + INCHI_IOSTREAM* pout, + INCHI_IOSTREAM* pprb, + ORIG_ATOM_DATA* orig_inp_data, + long* num_inp, + STRUCT_FPTRS* pStructPtrs, + int* nRet, + int* have_err_in_GetOneStructure, + long* num_err, + int output_error_inchi) +{ + if (ip->last_struct_number && *num_inp >= ip->last_struct_number) + { + *nRet = _IS_EOF; /* simulate end of file */ + return DO_EXIT_FUNCTION; + } + + + *nRet = GetOneStructure(ic, sd, ip, szTitle, inp_file, + plog, pout, pprb, orig_inp_data, + num_inp, pStructPtrs); + + inchi_ios_flush2(plog, stderr); + + if (pStructPtrs) + pStructPtrs->cur_fptr++; + + if (sd->bUserQuit) + { + { + return DO_BREAK_MAIN_LOOP; + } + } + + *have_err_in_GetOneStructure = 0; + switch (*nRet) + { + case _IS_FATAL: + (*num_err)++; + if (output_error_inchi == 0) + { + return DO_EXIT_FUNCTION; + } + else + sd->pStrErrStruct[0] = '\0'; /* depress re-appearance of error as warning in ProcessOneStr */ + break; + case _IS_EOF: + return DO_EXIT_FUNCTION; + case _IS_ERROR: + (*num_err)++; + *have_err_in_GetOneStructure = 1; + if (output_error_inchi == 0) + { + return DO_CONTINUE_MAIN_LOOP; + } + else + sd->pStrErrStruct[0] = '\0'; /* depress re-appearance of error as warning in ProcessOneStr */ + break; + case _IS_SKIP: + return DO_CONTINUE_MAIN_LOOP; + default: + sd->pStrErrStruct[0] = '\0'; + } + + return DO_NEXT_STEP; +} + + +/****************************************************************************/ +int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, + CANON_GLOBALS* CG, + STRUCT_DATA* sd, + INPUT_PARMS* ip, + char* szTitle, + PINChI2* pINChI[INCHI_NUM], + PINChI_Aux2* pINChI_Aux[INCHI_NUM], + INCHI_IOSTREAM* inp_file, + INCHI_IOSTREAM* plog, + INCHI_IOSTREAM* pout, + INCHI_IOSTREAM* pprb, + ORIG_ATOM_DATA* orig_inp_data, + ORIG_ATOM_DATA* prep_inp_data, + long* num_inp, + STRUCT_FPTRS* pStructPtrs, + int* nRet, + int have_err_in_GetOneStructure, + long* num_err, + int output_error_inchi, + INCHI_IOS_STRING* strbuf, + unsigned long* pulTotalProcessingTime, + char* pLF, + char* pTAB, + char* ikey, + int silent) +{ + int nRet1; + int next_act = DO_NEXT_STEP; + /* related to hash of InChI */ + char ik_string[256]; /*^^^ Resulting InChIKey string */ + int ik_ret = 0; /*^^^ InChIKey-calc result code */ + int xhash1, xhash2; + char szXtra1[65], szXtra2[65]; + /* related to printing structure header */ + int print_record_info = 0; + INCHI_IOSTREAM temp_out; + INCHI_IOSTREAM* pout0 = &temp_out; + inchi_ios_init(pout0, INCHI_IOS_TYPE_STRING, NULL); + + + /* Calculate InChI */ + + nRet1 = ProcessOneStructureEx(ic, + CG, + sd, + ip, + szTitle, + pINChI, + pINChI_Aux, + inp_file, + plog, + pout0, /* note this */ + pprb, + orig_inp_data, + prep_inp_data, + *num_inp, strbuf, + 0 /* save_opt_bits */); + + inchi_ios_flush2(plog, stderr); + + + /* Output InChI */ + + /* print header for structure if applicable (no error arose, or have a request for empty InChI at error) */ + print_record_info = ((nRet1 == _IS_OKAY) || + (nRet1 == _IS_WARNING) || + ((nRet1 == _IS_ERROR || nRet1 == _IS_FATAL) && output_error_inchi)); + if (print_record_info) + { + Output_RecordInfo(pout, *num_inp, ip->bNoStructLabels, + ip->pSdfLabel, ip->pSdfValue, ip->lSdfId, pLF, pTAB); + } + if (pout0->s.pStr) + { + /* post-process output to correctly treat 'tabbed with InChIKey' mode */ + if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) + { + if (ip->bCalcInChIHash != INCHIHASH_NONE) + { + if (pout0->s.pStr) + { + if (pout0->s.nUsedLength > 0) + { + if (pout0->s.pStr[pout0->s.nUsedLength - 1] == '\n') + { + pout0->s.pStr[pout0->s.nUsedLength - 1] = '\t'; + } + } + } + } + } + /* print InChI string (may be string for empty InChI) */ + if (!ip->bHideInChI) + { + inchi_ios_print(pout, "%-s", pout0->s.pStr); + } + } + /*inchi_ios_close(pout0);*/ /* free temporary out */ + + + *pulTotalProcessingTime += sd->ulStructTime; + + if (nRet1 == _IS_SKIP) + { + next_act = DO_CONTINUE_MAIN_LOOP; + goto exit_function; + } + + *nRet = inchi_max(*nRet, nRet1); + switch (*nRet) + { + case _IS_FATAL: + if (!have_err_in_GetOneStructure) + { + /* increment error counter only if error did not appear earlier */ + (*num_err)++; + } + if (!(ip->bINChIOutputOptions & INCHI_OUT_NO_AUX_INFO) && + (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT)) + { + inchi_ios_print(pout, "\t"); + } + if (ip->bCalcInChIHash != INCHIHASH_NONE) + { + if (ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR) + { + if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) + { + inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYSA-N"); + } + else + { + inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYNA-N"); + } + } + } + inchi_ios_flush(pout); + next_act = DO_EXIT_FUNCTION; + goto exit_function; + + case _IS_ERROR: + if (!have_err_in_GetOneStructure) + { + /* increment error counter only if error did not appear earlier */ + (*num_err)++; + } + if (!(ip->bINChIOutputOptions & INCHI_OUT_NO_AUX_INFO) && + (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT)) + { + inchi_ios_print(pout, "\t"); + } + if (ip->bCalcInChIHash != INCHIHASH_NONE) + { + if (ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR) + { + if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) + { + inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYSA-N"); + } + else + { + inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYNA-N"); + } + } + } + inchi_ios_flush(pout); + next_act = DO_CONTINUE_MAIN_LOOP; + goto exit_function; + + case _IS_SKIP: + next_act = DO_CONTINUE_MAIN_LOOP; + goto exit_function; + } + + + /* Calculate hash[es] of InChI */ + + if (ip->bCalcInChIHash != INCHIHASH_NONE) + { + char* buf = NULL; + size_t slen = pout0->s.nUsedLength; + + extract_inchi_substring(&buf, pout0->s.pStr, slen); + + if (NULL == buf) + { + ik_ret = INCHIKEY_INVALID_INCHI; + } + else + { + xhash1 = xhash2 = 0; + if ((ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1) || + (ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1_XTRA2)) + { + xhash1 = 1; + } + if ((ip->bCalcInChIHash == INCHIHASH_KEY_XTRA2) || + (ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1_XTRA2)) + { + xhash2 = 1; + } + ik_ret = GetINCHIKeyFromINCHI(buf, xhash1, xhash2, ik_string, szXtra1, szXtra2); + inchi_free(buf); + } + + + /* Print hash[es] */ + + if (ik_ret == INCHIKEY_OK) + { + /* NB: correctly treat tabbed output with InChIKey & hash extensions */ + char csep = '\n'; + + if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) + { + csep = '\t'; + } + if (!ip->bMergeHash) + { + inchi_ios_print(pout, "InChIKey=%-s", ik_string); + } + else + { + inchi_ios_print(pout, "InChIHash=%-s", ik_string); + } + strcpy(ikey, ik_string); + + if (szXtra1[0] && ip->bMergeHash) + { + inchi_ios_print(pout, "-%-s", szXtra1); + } + else if (szXtra1[0] && !ip->bMergeHash) + { + inchi_ios_print(pout, "%cXHash1=%-s", csep, szXtra1); + } + else if (!szXtra1[0] && ip->bMergeHash) + { + inchi_ios_print(pout, "-"); + } + + if (szXtra2[0] && ip->bMergeHash) + { + inchi_ios_print(pout, "-%-s", szXtra2); + } + else if (szXtra2[0] && !ip->bMergeHash) + { + inchi_ios_print(pout, "%cXHash2=%-s", csep, szXtra2); + } + else if (!szXtra2[0] && ip->bMergeHash) + { + inchi_ios_print(pout, "-"); + } + + inchi_ios_print(pout, "\n"); + } + else + { + inchi_ios_print(plog, "Warning (Could not compute InChIKey: ", num_inp); + switch (ik_ret) + { + case INCHIKEY_UNKNOWN_ERROR: + inchi_ios_print(plog, "unresolved error)"); + break; + case INCHIKEY_EMPTY_INPUT: + inchi_ios_print(plog, "got an empty string)"); + break; + case INCHIKEY_INVALID_INCHI_PREFIX: + case INCHIKEY_INVALID_INCHI: + case INCHIKEY_INVALID_STD_INCHI: + inchi_ios_print(plog, "no valid InChI string found)"); + break; + case INCHIKEY_NOT_ENOUGH_MEMORY: + inchi_ios_print(plog, "not enough memory to treat the string)"); + break; + default: inchi_ios_print(plog, "internal program error)"); + break; + } + inchi_ios_print(plog, " structure #%-lu.\n", *num_inp); + if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) + { + inchi_ios_print(pout, "\n"); + } + } + + if (!silent) + { + inchi_ios_flush(pout); + inchi_ios_flush2(plog, stderr); + } + else + { + inchi_ios_free_str(pout); + inchi_ios_free_str(plog); + } + } + else + { + inchi_ios_flush(pout); + } + +exit_function: + inchi_ios_close(pout0); /* free temporary out */ + + return next_act; +} + + +#ifdef RENUMBER_ATOMS_AND_RECALC_V106 + +/*****************************************************************************/ + +int numbers_rrar[PERMAXATOMS]; /* djb-rwth: placed as a global variable to avoid function buffer issues */ +int RepeatedlyRenumberAtomsAndRecalcINCHI(struct tagINCHI_CLOCK* ic, + CANON_GLOBALS* CG, + STRUCT_DATA* sd, + INPUT_PARMS* ip, + char* szTitle, + PINChI2* pINChI[INCHI_NUM], + PINChI_Aux2* pINChI_Aux[INCHI_NUM], + INCHI_IOSTREAM* inp_file, + INCHI_IOSTREAM* plog, + INCHI_IOSTREAM* pout, + INCHI_IOSTREAM* pprb, + ORIG_ATOM_DATA* orig_inp_data, + ORIG_ATOM_DATA* prep_inp_data, + long* num_inp, + STRUCT_FPTRS* pStructPtrs, + int* nRet, + int have_err_in_GetOneStructure, + long* num_err, + int output_error_inchi, + INCHI_IOS_STRING* strbuf, + unsigned long* pulTotalProcessingTime, + char* pLF, + char* pTAB, + long int nrepeat) +{ + int next_action = DO_NEXT_STEP; + int dup_fail = 0; + ORIG_ATOM_DATA SavedOrigAtData; /* 0=> disconnected, 1=> original */ + ORIG_ATOM_DATA* saved_orig_inp_data = &SavedOrigAtData; + char ikey0[28]; + + const int very_silent = 2; /* 3 0;*/ + + /* Internal test mode: renumber atoms and recalculate repeatedly */ + + /* do not forget to use /key and to not use /auxnone */ + + + ikey0[0] = '\0'; + { + int k; + for (k = 0; k < orig_inp_data->num_inp_atoms; k++) + { + numbers_rrar[k] = k; + } + for (k = orig_inp_data->num_inp_atoms; k < PERMAXATOMS; k++) + { + numbers_rrar[k] = -1; + } + } + + + + +#if BIG_POLY_DEBUG + { int k; ITRACE_("\nAtoms = {"); for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) ITRACE_(" %-03d,", numbers_rrar[k]); ITRACE_(" %-03d }", numbers_rrar[orig_inp_data->num_inp_atoms - 1]); } + OrigAtData_DebugTrace(orig_inp_data); + OrigAtDataPolymer_DebugTrace(orig_inp_data->polymer); +#endif + + memset(saved_orig_inp_data, 0, sizeof(*saved_orig_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ + dup_fail = OrigAtData_Duplicate(saved_orig_inp_data, orig_inp_data); + + next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, + pINChI, pINChI_Aux, + inp_file, plog, pout, pprb, + orig_inp_data, prep_inp_data, num_inp, pStructPtrs, + nRet, have_err_in_GetOneStructure, + num_err, output_error_inchi, + strbuf, pulTotalProcessingTime, + pLF, pTAB, ikey0, very_silent); + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + FreeOrigAtData(orig_inp_data); + FreeOrigAtData(prep_inp_data); + FreeOrigAtData(prep_inp_data + 1); + + + if (ikey0[0]) + { + if (very_silent < 2) + { + inchi_ios_eprint(plog, "#%-ld-%08ld\t...\t%-s\t%s%s%s%s\n", *num_inp, 1, ikey0, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue)); + } + } + + + if (!dup_fail) + { + int irepeat = 0; + int ndiff = 0; + int n_written_problems = 0; + char ikey[28]; + ikey[0] = '\0'; + for (irepeat = 0; irepeat < nrepeat - 1; irepeat++) + { + dup_fail = OrigAtData_Duplicate(orig_inp_data, saved_orig_inp_data); + if (!dup_fail) + { + shuffle((void*)numbers_rrar, orig_inp_data->num_inp_atoms, sizeof(int)); + OrigAtData_Permute(orig_inp_data, saved_orig_inp_data, numbers_rrar); +#if BIG_POLY_DEBUG + { int k; ITRACE_("\nAtoms = {"); for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) ITRACE_(" %-03d,", numbers_rrar[k]); ITRACE_(" %-03d }", numbers_rrar[orig_inp_data->num_inp_atoms - 1]); } + OrigAtData_DebugTrace(saved_orig_inp_data); + OrigAtData_DebugTrace(orig_inp_data); + OrigAtDataPolymer_DebugTrace(saved_orig_inp_data->polymer); + OrigAtDataPolymer_DebugTrace(orig_inp_data->polymer); +#endif + next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, + pINChI, pINChI_Aux, + inp_file, plog, pout, pprb, + orig_inp_data, + prep_inp_data, num_inp, pStructPtrs, + nRet, have_err_in_GetOneStructure, + num_err, output_error_inchi, + strbuf, pulTotalProcessingTime, + pLF, pTAB, ikey, + 0 /* 1 be silent */); + + + if (ikey0[0] && ikey[0]) + { + if (strcmp(ikey, ikey0)) + { + int result, bINChIOutputOptions = ip->bINChIOutputOptions; /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + ndiff++; + /*inchi_ios_eprint( plog, "!!! #%-ld-%05ld %s%s%s%s\tcurr %-s != %-s orig\n", *num_inp, irepeat + 2, SDF_LBL_VAL( ip->pSdfLabel, ip->pSdfValue ), ikey, ikey0 );*/ + /*inchi_ios_eprint( plog, "!!! %s%s%s%s renum#%05ld\t%-s != %-s\n", SDF_LBL_VAL( ip->pSdfLabel, ip->pSdfValue ), irepeat + 2, ikey, ikey0 );*/ + inchi_ios_eprint(plog, "!!! #%-ld %s%s%s%s\t%-s --> %-s @ renum#%06d/%06ld\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue), ikey0, ikey, irepeat + 2, nrepeat); + if (!very_silent) + { + int k; + inchi_ios_eprint(plog, "Atoms = {"); + for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) + { + inchi_ios_eprint(plog, " %-d,", numbers_rrar[k] + 1); + } + inchi_ios_eprint(plog, " %-d }\n\n", numbers_rrar[orig_inp_data->num_inp_atoms - 1] + 1); + } + ip->bINChIOutputOptions |= INCHI_OUT_SDFILE_ONLY; + result = OrigAtData_SaveMolfile(orig_inp_data, sd, ip, *num_inp, pprb); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + inchi_ios_flush(pprb); + ip->bINChIOutputOptions = bINChIOutputOptions; + if (result == 0) + { + n_written_problems++; + } +#if 0 + /* second pass, non-silent one */ + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + FreeOrigAtData(orig_inp_data); + FreeOrigAtData(prep_inp_data); + FreeOrigAtData(prep_inp_data + 1); + dup_fail = OrigAtData_Duplicate(orig_inp_data, saved_orig_inp_data); + if (!dup_fail) + { + OrigAtData_Permute(orig_inp_data, saved_orig_inp_data, numbers_rrar); + next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, + pINChI, pINChI_Aux, + inp_file, plog, pout, pprb, + orig_inp_data, + prep_inp_data, num_inp, pStructPtrs, + nRet, have_err_in_GetOneStructure, + num_err, output_error_inchi, + strbuf, pulTotalProcessingTime, + pLF, pTAB, ikey, 0); + } +#endif + } + + if (irepeat == nrepeat - 2) + { + if (very_silent < 2) + { + inchi_ios_eprint(plog, "...........\n#%-ld-%08ld\t...\t%-s\t%s%s%s%s\n", *num_inp, irepeat + 2, ikey0, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue)); + } + } + + } + } + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + FreeOrigAtData(orig_inp_data); + FreeOrigAtData(prep_inp_data); + FreeOrigAtData(prep_inp_data + 1); + +#ifdef STOP_AFTER_FIRST_CHANGE_ON_RENUMBERING + if (ndiff == 1) + { + next_action = DO_CONTINUE_MAIN_LOOP; + break; + } +#endif + } + if (ndiff == 0) + { + if (very_silent < 3) + { + /*inchi_ios_eprint( plog, "#%-ld-%05ld\t...\tOK ALL\n", *num_inp, nrepeat );*/ + /*inchi_ios_eprint( plog, "OK #%-ld %s%s%s%s\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue));*/ + /*inchi_ios_eprint(plog, "#%-ld\n", *num_inp);*/ + inchi_ios_eprint(plog, "OK #%-ld %s%s%s%s\t%-s\t Same for %-d/%-d renums\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue), ikey0, nrepeat, nrepeat); + } + } + else + { +#ifdef STOP_AFTER_FIRST_CHANGE_ON_RENUMBERING + /*inchi_ios_eprint( plog, "#%-ld-%05ld\t...\tDIFF %-d\n", num_inp, nrepeat, ndiff );*/ +#else + inchi_ios_eprint(plog, "#%-ld-%05ld\t...\tDIFF %-d\n", num_inp, nrepeat, ndiff); +#endif + } + + FreeOrigAtData(saved_orig_inp_data); + } + + return next_action; +} + + +#endif diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt index ead78dec..8b83d19d 100644 --- a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt +++ b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/CMakeLists.txt @@ -25,9 +25,10 @@ include_directories(${P_BASE} ${P_CURRENT}) add_executable(inchi-1) target_sources(inchi-1 PRIVATE - dispstru.c - dispstru.h - ichimain.c + main.c + ${P_BASE}/ichimain.c + ${P_BASE}/dispstru.c + ${P_BASE}/dispstru.h ${P_BASE}/bcf_s.h ${P_BASE}/bcf_s.c ${P_BASE}/extr_ct.h @@ -132,8 +133,8 @@ if(MATH_LIBRARY) target_link_libraries(inchi-1 PUBLIC ${MATH_LIBRARY}) endif() -target_compile_definitions(inchi-1 PRIVATE - COMPILE_ANSI_ONLY +target_compile_definitions(inchi-1 PRIVATE + COMPILE_ANSI_ONLY TARGET_EXE_STANDALONE ADD_AMI_MODE ) @@ -141,4 +142,4 @@ target_compile_definitions(inchi-1 PRIVATE target_include_directories(inchi-1 PUBLIC "${PROJECT_BINARY_DIR}") string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") -string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") \ No newline at end of file +string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/ichimain.c b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c similarity index 100% rename from INCHI-1-SRC/INCHI_EXE/inchi-1/src/ichimain.c rename to INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/main.c b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/main.c new file mode 100644 index 00000000..5e1f3f46 --- /dev/null +++ b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/main.c @@ -0,0 +1,266 @@ +/* + * International Chemical Identifier (InChI) + * Version 1 + * Software version 1.07 + * April 30, 2024 + * + * MIT License + * + * Copyright (c) 2024 IUPAC and InChI Trust + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +* +* The InChI library and programs are free software developed under the + * auspices of the International Union of Pure and Applied Chemistry (IUPAC). + * Originally developed at NIST. + * Modifications and additions by IUPAC and the InChI Trust. + * Some portions of code were developed/changed by external contributors + * (either contractor or volunteer) which are listed in the file + * 'External-contributors' included in this distribution. + * + * info@inchi-trust.org + * +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef COMPILE_ANSI_ONLY +#include +#ifndef TARGET_LIB_FOR_WINCHI +#include +#endif +#endif + +#include "../../../INCHI_BASE/src/mode.h" + +#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) +#include +#include +#endif + + +#ifdef _WIN32 +#include +#endif +#include "../../../INCHI_BASE/src/ichitime.h" +#include "../../../INCHI_BASE/src/incomdef.h" +#include "../../../INCHI_BASE/src/ichidrp.h" +#include "../../../INCHI_BASE/src/inpdef.h" +#include "../../../INCHI_BASE/src/ichi.h" +#include "../../../INCHI_BASE/src/strutil.h" +#include "../../../INCHI_BASE/src/util.h" +#include "../../../INCHI_BASE/src/ichierr.h" +#include "../../../INCHI_BASE/src/ichimain.h" +#include "../../../INCHI_BASE/src/ichicomp.h" +#include "../../../INCHI_BASE/src/ichi_io.h" +#ifdef TARGET_EXE_STANDALONE +#include "../../../INCHI_BASE/src/inchi_api.h" +#endif + +#include "../../../INCHI_BASE/src/bcf_s.h" +#include "../../../INCHI_BASE/src/permutation_util.h" + + /* Console-specific */ + +#if !defined(TARGET_API_LIB) && !defined(COMPILE_ANSI_ONLY) + +/* Use Windows additional features */ + + +/****************************************************************************/ +int user_quit(struct tagINCHI_CLOCK* ic, + const char* msg, + unsigned long ulMaxTime) +{ +#if defined(TARGET_LIB_FOR_WINCHI) + return 0; +#endif + +#if ( !defined(TARGET_LIB_FOR_WINCHI) && defined(_WIN32) ) + + int quit, enter, ret; + printf("%s", msg); /* djb-rwth: format string added for security */ + if (ulMaxTime) + { + inchiTime ulEndTime; + InchiTimeGet(&ulEndTime); + InchiTimeAddMsec(ic, &ulEndTime, ulMaxTime); + while (!_kbhit()) + { + if (bInchiTimeIsOver(ic, &ulEndTime)) + { + printf("\n"); + return 0; + } + MySleep(100); + } + } + while (1) + { + quit = ('q' == (ret = _getch()) || 'Q' == ret || /*Esc*/ 27 == ret); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + enter = ('\r' == ret); + if (ret == 0xE0) + { + ret = _getch(); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + } + else + { + _putch(ret); /* echo */ + } + if (quit || enter) + { + break; + } + printf("\r"); + printf("%s", msg); /* djb-rwth: format string added for security */ + } + _putch('\n'); + + return quit; +#else + return 0; + +#endif /* #if ( defined(_WIN32) && !defined(TARGET_LIB_FOR_WINCHI) ) */ +} + + +/****************************************************************************/ +void eat_keyboard_input(void) +{ + int ret_val; /* djb-rwth: adding return value */ /* djb-rwth: ignoring LLVM warning */ +#ifndef TARGET_LIB_FOR_WINCHI + + while (_kbhit()) + { + if (0xE0 == _getch()) + { + ret_val = _getch(); /* djb-rwth: return value variable added */ + } + } + +#endif +} + +#endif /* end of !COMPILE_ANSI_ONLY */ + + +// #ifndef TARGET_LIB_FOR_WINCHI +/* COVERS THE CODE FROM HERE TO THE END OF FILE */ + + +/* Enable/disable internal tests */ + +/* Uncomment for INCHI_LIB testing only */ +/*#define TEST_FPTRS*/ + +/* Windows-console-mode specific */ + +int bInterrupted = 0; + +#if ( defined( _WIN32 ) && defined( _CONSOLE ) ) +#ifndef COMPILE_ANSI_ONLY + + +/****************************************************************************/ +BOOL WINAPI MyHandlerRoutine(DWORD dwCtrlType /* control signal type */) +{ + if (dwCtrlType == CTRL_C_EVENT || + dwCtrlType == CTRL_BREAK_EVENT || + dwCtrlType == CTRL_CLOSE_EVENT || + dwCtrlType == CTRL_LOGOFF_EVENT) + { + bInterrupted = 1; + return TRUE; + } + return FALSE; +} + + +/****************************************************************************/ +int WasInterrupted(void) +{ +#ifdef _DEBUG + if (bInterrupted) + { + int stop = 1; /* for debug only */ + } +#endif + return bInterrupted; +} +#if ( BUILD_WITH_AMI == 1 ) +#define CTRL_STOP_EVENT 101 +#endif +#endif /* ifndef COMPILE_ANSI_ONLY */ +#endif /* if( defined( _WIN32 ) && defined( _CONSOLE ) ) */ + + + +/****************************************************************************/ +int main(int argc, char* argv[]) +{ +#ifdef GHI100_FIX +#if ((SPRINTF_FLAG != 1) && (SPRINTF_FLAG != 2)) + setlocale(LC_ALL, "en-US"); /* djb-rwth: setting all locales to "en-US" */ +#endif +#endif + +/*************************/ +// #if ( BUILD_WITH_AMI == 1 ) +/*************************/ + +/**** IF IN AMI MODE, main() STARTS HERE ****/ + int i, ret = 0, ami = 0; /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + + /* Check if multiple inputs expected */ + for (i = 1; i < argc; i++) + { + if (argv[i][0] == INCHI_OPTION_PREFX) + { + if (!inchi_stricmp(argv[i] + 1, "AMI")) + { + ami = 1; + break; + } + } + } + + if (ami) + { + ret = ProcessMultipleInputFiles(argc, argv); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + } + else + { + ret = ProcessSingleInputFile(argc, argv); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ + } + + return 0; +} + + +// #endif /* ifndef TARGET_LIB_FOR_WINCHI */ + From 8b0f9d84e5154177a9cb24a33100f441f7efe727 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 8 Dec 2025 08:43:05 +0000 Subject: [PATCH 20/41] formatting --- INCHI-1-SRC/INCHI_BASE/src/ichimain.c | 3 +- .../INCHI_EXE/inchi-1/src/backup_ichimain.c | 1688 ----------------- 2 files changed, 2 insertions(+), 1689 deletions(-) delete mode 100644 INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c diff --git a/INCHI-1-SRC/INCHI_BASE/src/ichimain.c b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c index a575437b..ccdc9aeb 100644 --- a/INCHI-1-SRC/INCHI_BASE/src/ichimain.c +++ b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c @@ -363,7 +363,8 @@ int ProcessMultipleInputFiles(int argc, char* argv[]) /****************************************************************************/ int ProcessSingleInputFile(int argc, char* argv[]) { - /**************************************/ + +/**************************************/ #endif /* #if ( BUILD_WITH_AMI == 1 ) */ /**************************************/ diff --git a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c b/INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c deleted file mode 100644 index cc422b04..00000000 --- a/INCHI-1-SRC/INCHI_EXE/inchi-1/src/backup_ichimain.c +++ /dev/null @@ -1,1688 +0,0 @@ -/* - * International Chemical Identifier (InChI) - * Version 1 - * Software version 1.07 - * April 30, 2024 - * - * MIT License - * - * Copyright (c) 2024 IUPAC and InChI Trust - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. -* -* The InChI library and programs are free software developed under the - * auspices of the International Union of Pure and Applied Chemistry (IUPAC). - * Originally developed at NIST. - * Modifications and additions by IUPAC and the InChI Trust. - * Some portions of code were developed/changed by external contributors - * (either contractor or volunteer) which are listed in the file - * 'External-contributors' included in this distribution. - * - * info@inchi-trust.org - * -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef COMPILE_ANSI_ONLY -#include -#ifndef TARGET_LIB_FOR_WINCHI -#include -#endif -#endif - -#include "../../../INCHI_BASE/src/mode.h" - -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) -#include -#include -#endif - - -#ifdef _WIN32 -#include -#endif -#include "../../../INCHI_BASE/src/ichitime.h" -#include "../../../INCHI_BASE/src/incomdef.h" -#include "../../../INCHI_BASE/src/ichidrp.h" -#include "../../../INCHI_BASE/src/inpdef.h" -#include "../../../INCHI_BASE/src/ichi.h" -#include "../../../INCHI_BASE/src/strutil.h" -#include "../../../INCHI_BASE/src/util.h" -#include "../../../INCHI_BASE/src/ichierr.h" -#include "../../../INCHI_BASE/src/ichimain.h" -#include "../../../INCHI_BASE/src/ichicomp.h" -#include "../../../INCHI_BASE/src/ichi_io.h" -#ifdef TARGET_EXE_STANDALONE -#include "../../../INCHI_BASE/src/inchi_api.h" -#endif - -#include "../../../INCHI_BASE/src/bcf_s.h" -#include "../../../INCHI_BASE/src/permutation_util.h" - - /* Console-specific */ - -#if !defined(TARGET_API_LIB) && !defined(COMPILE_ANSI_ONLY) - -/* Use Windows additional features */ - - -/****************************************************************************/ -int user_quit(struct tagINCHI_CLOCK* ic, - const char* msg, - unsigned long ulMaxTime) -{ -#if defined(TARGET_LIB_FOR_WINCHI) - return 0; -#endif - -#if ( !defined(TARGET_LIB_FOR_WINCHI) && defined(_WIN32) ) - - int quit, enter, ret; - printf("%s", msg); /* djb-rwth: format string added for security */ - if (ulMaxTime) - { - inchiTime ulEndTime; - InchiTimeGet(&ulEndTime); - InchiTimeAddMsec(ic, &ulEndTime, ulMaxTime); - while (!_kbhit()) - { - if (bInchiTimeIsOver(ic, &ulEndTime)) - { - printf("\n"); - return 0; - } - MySleep(100); - } - } - while (1) - { - quit = ('q' == (ret = _getch()) || 'Q' == ret || /*Esc*/ 27 == ret); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - enter = ('\r' == ret); - if (ret == 0xE0) - { - ret = _getch(); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - } - else - { - _putch(ret); /* echo */ - } - if (quit || enter) - { - break; - } - printf("\r"); - printf("%s", msg); /* djb-rwth: format string added for security */ - } - _putch('\n'); - - return quit; -#else - return 0; - -#endif /* #if ( defined(_WIN32) && !defined(TARGET_LIB_FOR_WINCHI) ) */ -} - - -/****************************************************************************/ -void eat_keyboard_input(void) -{ - int ret_val; /* djb-rwth: adding return value */ /* djb-rwth: ignoring LLVM warning */ -#ifndef TARGET_LIB_FOR_WINCHI - - while (_kbhit()) - { - if (0xE0 == _getch()) - { - ret_val = _getch(); /* djb-rwth: return value variable added */ - } - } - -#endif -} - -#endif /* end of !COMPILE_ANSI_ONLY */ - - -#ifndef TARGET_LIB_FOR_WINCHI -/* COVERS THE CODE FROM HERE TO THE END OF FILE */ - - -/* Enable/disable internal tests */ - -/* Uncomment for INCHI_LIB testing only */ -/*#define TEST_FPTRS*/ - -/* Windows-console-mode specific */ - -int bInterrupted = 0; - -#if ( defined( _WIN32 ) && defined( _CONSOLE ) ) -#ifndef COMPILE_ANSI_ONLY - - -/****************************************************************************/ -BOOL WINAPI MyHandlerRoutine(DWORD dwCtrlType /* control signal type */) -{ - if (dwCtrlType == CTRL_C_EVENT || - dwCtrlType == CTRL_BREAK_EVENT || - dwCtrlType == CTRL_CLOSE_EVENT || - dwCtrlType == CTRL_LOGOFF_EVENT) - { - bInterrupted = 1; - return TRUE; - } - return FALSE; -} - - -/****************************************************************************/ -int WasInterrupted(void) -{ -#ifdef _DEBUG - if (bInterrupted) - { - int stop = 1; /* for debug only */ - } -#endif - return bInterrupted; -} -#if ( BUILD_WITH_AMI == 1 ) -#define CTRL_STOP_EVENT 101 -#endif -#endif /* ifndef COMPILE_ANSI_ONLY */ -#endif /* if( defined( _WIN32 ) && defined( _CONSOLE ) ) */ - - - -/****************************************************************************/ -int main(int argc, char* argv[]) -{ -#ifdef GHI100_FIX -#if ((SPRINTF_FLAG != 1) && (SPRINTF_FLAG != 2)) - setlocale(LC_ALL, "en-US"); /* djb-rwth: setting all locales to "en-US" */ -#endif -#endif - - /*************************/ -#if ( BUILD_WITH_AMI == 1 ) -/*************************/ - -/**** IF IN AMI MODE, main() STARTS HERE ****/ - int i, ret = 0, ami = 0; /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - - /* Check if multiple inputs expected */ - for (i = 1; i < argc; i++) - { - if (argv[i][0] == INCHI_OPTION_PREFX) - { - if (!inchi_stricmp(argv[i] + 1, "AMI")) - { - ami = 1; - break; - } - } - } - - if (ami) - { - ret = ProcessMultipleInputFiles(argc, argv); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - } - else - { - ret = ProcessSingleInputFile(argc, argv); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - } - - return 0; -} - - -/****************************************************************************/ -int ProcessMultipleInputFiles(int argc, char* argv[]) -{ - int i, ret = 0, nfn_ins = 0, - AMIOutStd = 0, AMILogStd = 0, AMIPrbNone = 0; - char* fn_out, * fn_log, * fn_prb; - char pNUL[] = "NUL"; - char** fn_ins = NULL, ** targv = NULL; - int ret_val; /* djb-rwth: adding return value */ /* djb-rwth: ignoring LLVM warning */ - -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) -#ifdef _WIN64 - typedef __int64 intptr_t; /* x64 */ -#else - typedef long int intptr_t; /* VC 6.0 has no intptr_t and no x64 */ -#endif - struct _finddata_t file_info; - intptr_t hFile = -1; - int retFile, lenPath; - char* pName, * pOutPath = NULL; /* djb-rwth: ignoring LLVM warning */ - char pathname[_MAX_PATH]; - char szBlank[] = ""; /* djb-rwth: ignoring LLVM warning */ - int numFiles = 0; /* counts processed files */ -#else - int p; -#endif - - fn_ins = (char**)inchi_calloc(argc, sizeof(char*)); - if (!fn_ins) - { - fprintf(stderr, "Not enough memory.\n"); - goto exit_ami; - } - - /* Check for other options and collect inputs. */ - for (i = 1; i < argc; i++) - { - if (argv[i][0] == INCHI_OPTION_PREFX) - { - if (!inchi_stricmp(argv[i] + 1, "STDIO")) - { - fprintf(stderr, "Options AMI and STDIO are not compatible.\n"); - goto exit_ami; - } - else if (!inchi_stricmp(argv[i] + 1, "AMIOutStd")) - { - AMIOutStd = 1; - } - else if (!inchi_stricmp(argv[i] + 1, "AMILogStd")) - { - AMILogStd = 1; - } - else if (!inchi_stricmp(argv[i] + 1, "AMIPrbNone")) - { - AMIPrbNone = 1; - } -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) - else if (!inchi_memicmp(argv[i] + 1, "OP:", 3)) - { - pOutPath = argv[i] + 4; /* output path */ - } -#endif - } - else - { - fn_ins[nfn_ins] = argv[i]; - nfn_ins++; - } - } - - if (!nfn_ins) - { - fprintf(stderr, "At least one input file is expected in AMI mode.\n"); - goto exit_ami; - } - - targv = (char**)inchi_calloc((long long)argc + 3, sizeof(char*)); /* djb-rwth: cast operator added */ - - if (!targv) - { - fprintf(stderr, "Not enough memory.\n"); - goto exit_ami; - } - -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) - if ((pName = strrchr(fn_ins[0], INCHI_PATH_DELIM))) /* djb-rwth: addressing LLVM warning */ - { - pName++; - lenPath = pName - fn_ins[0]; - } - else - { - pName = fn_ins[0]; - lenPath = 0; - } - for (hFile = _findfirst(fn_ins[0], &file_info), retFile = 0; - !retFile && -1 != hFile; - retFile = _findnext(hFile, &file_info), numFiles++) -#else - for (p = 0; p < nfn_ins; p++) -#endif - { - int targc; -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) - const char* fn_in; - int inlen = lenPath + strlen(file_info.name); - if (!file_info.size || (file_info.attrib & _A_SUBDIR) || inlen >= _MAX_PATH) - { - continue; - } - memcpy(pathname, fn_ins[0], lenPath); - strcpy(pathname + lenPath, file_info.name); - fn_in = pathname; - if (0 == numFiles % 5000) - { - ret_val = _heapmin(); /* reduce heap fragmentation */ /* djb-rwth: return value variable added */ - } -#else - const char* fn_in = fn_ins[p]; - int inlen = strlen(fn_in); -#endif - fn_out = fn_log = fn_prb = NULL; - - targv[0] = argv[0]; - targv[1] = (char*)fn_in; - targc = 1; - - if (AMIOutStd) - { - targv[++targc] = pNUL; - } -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) - else if (pOutPath) - { - targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ - } -#endif - else - { - /* make output name as input name plus ext. */ - fn_out = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ - if (fn_out) - { - strcpy(fn_out, fn_in); - strcat(fn_out, ".txt"); - } - targv[++targc] = fn_out; - } - - if (AMILogStd) - { - targv[++targc] = pNUL; - } -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) - else if (pOutPath) - { - targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ - } -#endif - else - { - /* Make log name as input name plus ext. */ - fn_log = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ - if (fn_log) - { - strcpy(fn_log, fn_in); - strcat(fn_log, ".log"); - } - targv[++targc] = fn_log; - } - if (AMIPrbNone) - { - targv[++targc] = pNUL; - } -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 && ALLOW_EMPTY_PATHS == 1 ) - else if (pOutPath) - { - targv[++targc] = szBlank; /* output name will be created in process_single_input(...) */ - } -#endif - else - { - /* Make problem file name as input file name plus ext. */ - fn_prb = (char*)inchi_calloc((long long)inlen + 6, sizeof(char)); /* djb-rwth: cast operator added */ - if (fn_prb) - { - strcpy(fn_prb, fn_in); - strcat(fn_prb, ".prb"); - } - targv[++targc] = fn_prb; - } - - for (i = 1; i < argc; i++) - { - if (argv[i][0] == INCHI_OPTION_PREFX) - { - /* avoid strnicmp/strncasecmp */ - if ((strlen(argv[i]) > 3) && - (toupper(argv[i][1]) == 'A') && (toupper(argv[i][2]) == 'M') && (toupper(argv[i][3]) == 'I')) - { - continue; - } - targv[++targc] = argv[i]; - } - } - /* djb-rwth: fixing undefined index value / buffer overflow */ - ++targc; - if (targc < argc + 3) - { - targv[targc] = NULL; - } - - ret = ProcessSingleInputFile(targc, targv); /* ProcessSingleInputFile() is a former main() */ - - if (fn_out) - { - inchi_free(fn_out); - } - if (fn_log) - { - inchi_free(fn_log); - } - if (fn_prb) - { - inchi_free(fn_prb); - } - -#if ( defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) - if (ret == CTRL_STOP_EVENT) - { - goto exit_ami; - } -#endif - } - - -exit_ami: -#if( BUILD_WITH_AMI == 1 && defined( _MSC_VER ) && MSC_AMI == 1 ) - if (hFile != -1) - { - _findclose(hFile); - } -#endif - if (targv) - { - inchi_free(targv); - } - if (fn_ins) - { - inchi_free(fn_ins); - } - - return 0; -} - - - -/****************************************************************************/ -int ProcessSingleInputFile(int argc, char* argv[]) -{ - /**************************************/ -#endif /* #if ( BUILD_WITH_AMI == 1 ) */ -/**************************************/ - -/**** IF NOT IN AMI MODE, main() STARTS HERE ****/ - - int bReleaseVersion = bRELEASE_VERSION; - const int nStrLen = INCHI_SEGM_BUFLEN; - int nRet = 0; - int i; - long num_err, num_output, num_inp; - /* long rcPict[4] = {0,0,0,0}; */ - unsigned long ulDisplTime = 0; /* infinite, milliseconds */ - unsigned long ulTotalProcessingTime = 0; - - CANON_GLOBALS CG; - INCHI_CLOCK ic; - - char szTitle[MAX_SDF_HEADER + MAX_SDF_VALUE + 256]; - char szSdfDataValue[MAX_SDF_VALUE + 1]; - - INPUT_PARMS inp_parms; - INPUT_PARMS* ip = &inp_parms; - - STRUCT_DATA struct_data; - STRUCT_DATA* sd = &struct_data; - - ORIG_ATOM_DATA OrigAtData; /* 0=> disconnected, 1=> original */ - ORIG_ATOM_DATA* orig_inp_data = &OrigAtData; - ORIG_ATOM_DATA PrepAtData[2]; /* 0=> disconnected, 1=> original */ - ORIG_ATOM_DATA* prep_inp_data = PrepAtData; - - PINChI2* pINChI[INCHI_NUM]; - PINChI_Aux2* pINChI_Aux[INCHI_NUM]; - - char* pLF, * pTAB; - INCHI_IOS_STRING temp_string_container; - INCHI_IOS_STRING* strbuf = &temp_string_container; - INCHI_IOSTREAM outputstr, logstr, prbstr, instr; - INCHI_IOSTREAM* pout = &outputstr, * plog = &logstr, * pprb = &prbstr, * inp_file = &instr; - -#ifdef TARGET_EXE_STANDALONE - int inchi_ios_type = INCHI_IOS_TYPE_STRING; -#else - int inchi_ios_type = INCHI_IOS_TYPE_FILE; -#endif -#if ( READ_INCHI_STRING == 1 ) - const int may_get_inchi_string_input = 1; -#else - const int may_get_inchi_string_input = 0; -#endif - int bInChI2Structure = 0; - int output_error_inchi = 0; - - - /* internal tests --- */ -#ifndef TEST_FPTRS - STRUCT_FPTRS* pStructPtrs = NULL; -#else - STRUCT_FPTRS struct_fptrs, * pStructPtrs = &struct_fptrs; /* INCHI_LIB debug only */ -#endif - -#if ( defined(_WIN32) && defined(_MSC_VER) ) -#if WINVER >= 0x0501 /* XP or newer */ /* 0x0600 Vista or newer */ - DWORD tick_inchi_start, tick_inchi_stop; - tick_inchi_start = GetTickCount64(); /* djb-rwth: GetTickCount64() should be used */ -#endif -#endif - -#ifdef _WIN32 -#if ( TRACE_MEMORY_LEAKS == 1 ) - _CrtSetDbgFlag(_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF); - /* for execution outside the VC++ debugger uncomment one of the following two */ - /*#define MY_REPORT_FILE _CRTDBG_FILE_STDERR */ - /*#define MY_REPORT_FILE _CRTDBG_FILE_STDOUT */ -#ifdef MY_REPORT_FILE - _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_WARN, MY_REPORT_FILE); - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ERROR, MY_REPORT_FILE); - _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ASSERT, MY_REPORT_FILE); -#else - _CrtSetReportMode(_CRT_WARN | _CRT_ERROR, _CRTDBG_MODE_DEBUG); -#endif - /* turn on floating point exceptions */ - { - /* Get the default control word. */ - int cw = _controlfp(0, 0); - - /* Set the exception masks OFF, turn exceptions on. */ - /*cw &=~(EM_OVERFLOW|EM_UNDERFLOW|EM_INEXACT|EM_ZERODIVIDE|EM_DENORMAL);*/ - cw &= ~(EM_OVERFLOW | EM_UNDERFLOW | EM_ZERODIVIDE | EM_DENORMAL); - - /* Set the control word. */ - _controlfp(cw, MCW_EM); -} -#endif -#endif - - sd->bUserQuit = 0; - /* djb-rwth: fixing coverity CID #499552 */ - sd->num_components[0] = 0; - sd->num_components[1] = 0; -#if ( defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) - if (SetConsoleCtrlHandler(MyHandlerRoutine, 1)) - { - ConsoleQuit = WasInterrupted; - } -#endif - - num_inp = 0; - num_err = 0; - num_output = 0; - - inchi_ios_init(inp_file, INCHI_IOS_TYPE_FILE, NULL); - inchi_ios_init(pout, inchi_ios_type, NULL); - inchi_ios_init(plog, inchi_ios_type, stdout); - inchi_ios_init(pprb, inchi_ios_type, NULL); - memset(strbuf, 0, sizeof(*strbuf)); /* djb-rwth: memset_s C11/Annex K variant?; dereferencing strbuf */ - - if (argc == 1 || (argc == 2 && (argv[1][0] == INCHI_OPTION_PREFX) && - ((!strcmp(argv[1] + 1, "?") || !inchi_stricmp(argv[1] + 1, "help"))))) /* djb-rwth: addressing LLVM warning */ - { - HelpCommandLineParms(plog); - inchi_ios_flush(plog); - return 0; - } - - /* djb-rwth: printing out InChI version */ - if (argc == 2 && ((argv[1][0] == INCHI_OPTION_PREFX)) && (!strcmp(argv[1] + 1, "v") || !strcmp(argv[1] + 1, "V"))) - { - printf("%s\n", APP_DESCRIPTION); - return 0; - } - - /* djb-rwth: disallowing endless execution if no file(s) is given as the first argument */ - if (argc >= 2 && ((argv[1][0] == INCHI_OPTION_PREFX)) && (strcmp(argv[1] + 1, "v") || strcmp(argv[1] + 1, "V") || strcmp(argv[1] + 1, "?") || inchi_stricmp(argv[1] + 1, "help"))) - { - HelpCommandLineParms(plog); - inchi_ios_flush(plog); - return 0; - } - - /* original input structure */ - memset(orig_inp_data, 0, sizeof(*orig_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ - memset(prep_inp_data, 0, 2 * sizeof(*prep_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ - memset(pINChI, 0, sizeof(pINChI)); /* djb-rwth: memset_s C11/Annex K variant? */ - memset(pINChI_Aux, 0, sizeof(pINChI_Aux)); /* djb-rwth: memset_s C11/Annex K variant? */ - memset(szSdfDataValue, 0, sizeof(szSdfDataValue)); /* djb-rwth: memset_s C11/Annex K variant? */ - - memset(&CG, 0, sizeof(CG)); /* djb-rwth: memset_s C11/Annex K variant? */ - memset(&ic, 0, sizeof(ic)); /* djb-rwth: memset_s C11/Annex K variant? */ - - plog->f = stderr; - - if (0 > ReadCommandLineParms(argc, (const char**)argv, ip, - szSdfDataValue, &ulDisplTime, - bReleaseVersion, plog)) - { - goto exit_function; - } - - if (!OpenFiles(&(inp_file->f), &(pout->f), &(plog->f), &(pprb->f), ip)) - { - goto exit_function; - } - - - if (ip->bNoStructLabels) - { - ip->pSdfLabel = NULL; - ip->pSdfValue = NULL; - } - else if (ip->nInputType == INPUT_INCHI_PLAIN || - ip->nInputType == INPUT_INCHI) - { - /* the input may contain both the header and the label of the structure */ - if (!ip->pSdfLabel) - { - ip->pSdfLabel = ip->szSdfDataHeader; - } - if (!ip->pSdfValue) - { - ip->pSdfValue = szSdfDataValue; - } - } - - set_line_separators(ip->bINChIOutputOptions, &pLF, &pTAB); - - save_command_line(argc, argv, plog); - - PrintInputParms(plog, ip); - - inchi_ios_flush2(plog, stderr); - - if (0 >= inchi_strbuf_init(strbuf, INCHI_STRBUF_INITIAL_SIZE, INCHI_STRBUF_SIZE_INCREMENT)) - { - inchi_ios_eprint(plog, "Cannot allocate internal string buffer. Terminating\n"); - inchi_ios_flush2(plog, stderr); - goto exit_function; - } - - - /* Process InChI string as input; output may be */ - /* a) InChI string or b) structure */ - /*#if ( READ_INCHI_STRING == 1 )*/ - if (may_get_inchi_string_input && ip->nInputType == INPUT_INCHI) - { - bInChI2Structure = 0 != (ip->bReadInChIOptions & READ_INCHI_TO_STRUCTURE); - memset(sd, 0, sizeof(*sd)); /* djb-rwth: memset_s C11/Annex K variant? */ - if (bInChI2Structure) - { - /* loop through file lines here */ - INCHI_IOSTREAM tmpinpustream; - INCHI_IOS_STRING* pTmpIn = &tmpinpustream.s; - int crlf2lf = 0, preserve_lf = 1, read_result = 0; - inchi_ios_init(&tmpinpustream, INCHI_IOS_TYPE_STRING, NULL); - while (1) - { - char* p, * pi; - - read_result = inchi_strbuf_getline(pTmpIn, inp_file->f, crlf2lf, preserve_lf); - - if (read_result == -1) -#if (FIX_ONE_LINE_INCHI_INPUT_CONVERSION_ISSUE==1) - { - if (!pTmpIn->pStr) - { - break; - } - if (strlen(pTmpIn->pStr) < 8) /* 7 = strlen("InChI=1") */ - { - break; - } - } -#else - break; /* EOF or read error */ -#endif - - p = pTmpIn->pStr; - if (!p) - { - continue; - } - pi = strstr(p, "InChI=1"); - if (pi != p) - { - continue; - } - - num_inp++; - ip->lMolfileNumber = num_inp; - - ReadWriteInChI(&ic, &CG, &tmpinpustream, pout, plog, ip, sd, NULL, 0, 0, NULL, NULL, NULL, 0, NULL); - - /*fprintf( stderr, "%ld", num_inp );*/ - inchi_strbuf_reset(pTmpIn); - inchi_ios_flush2(plog, stderr); - } - fprintf(stderr, "\r"); - inchi_strbuf_close(pTmpIn); - } - else - { - /* loop through file lines within ReadWriteInChI */ - ReadWriteInChI(&ic, &CG, inp_file, pout, plog, ip, sd, NULL, 0, 0, NULL, NULL, NULL, 0, NULL); - - num_inp = sd->fPtrStart; - num_err = sd->fPtrEnd; - } - - inchi_ios_flush2(plog, stderr); - ulTotalProcessingTime = sd->ulStructTime; - /*num_inp = sd->fPtrStart; - num_err = sd->fPtrEnd; - */ - goto exit_function; - } - - - ulTotalProcessingTime = 0; - if (pStructPtrs) - { - memset(pStructPtrs, 0, sizeof(pStructPtrs[0])); /* djb-rwth: memset_s C11/Annex K variant? */ - } - output_error_inchi = ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR; - - - /*************************************************************/ - /* Main cycle : read input structures and create their INChI */ - /*************************************************************/ - - - while (!sd->bUserQuit && !bInterrupted) - { - int do_renumbering = 0; - int next_action; - int have_err_in_GetOneStructure = 0; - int dup_fail = 0; - ORIG_ATOM_DATA SavedOrigAtData; /* 0=> disconnected, 1=> original */ - ORIG_ATOM_DATA* saved_orig_inp_data = &SavedOrigAtData; - char ikey0[28]; - ikey0[0] = '\0'; - - - next_action = GetTheNextRecordOfInputFile(&ic, sd, ip, szTitle, - inp_file, plog, pout, pprb, - orig_inp_data, &num_inp, pStructPtrs, - &nRet, &have_err_in_GetOneStructure, - &num_err, output_error_inchi); - if (next_action == DO_EXIT_FUNCTION) - { - goto exit_function; - } - else if (next_action == DO_BREAK_MAIN_LOOP) - { - break; - } - else if (next_action == DO_CONTINUE_MAIN_LOOP) - { - if (nRet == _IS_ERROR) /* may also be _IS_SKIP ... */ - { - if (output_error_inchi) - { - Output_RecordInfo(pout, num_inp, ip->bNoStructLabels, ip->pSdfLabel, ip->pSdfValue, ip->lSdfId, - pLF, pTAB); - emit_empty_inchi(ip, num_inp, pLF, pTAB, pout); - } - } - continue; - } - - - /* Create INChI for each connected component of the structure; - optionally display them; - output INChI for the whole structure */ - -#if (RENUMBER_ATOMS_AND_RECALC_V106 == 1 ) - if (ip->bRenumber == 1) - { - do_renumbering = 1; - } -#endif - if (do_renumbering == 0) - { - /* Normal calculations */ - next_action = CalcAndPrintINCHIAndINCHIKEY(&ic, &CG, sd, ip, szTitle, - pINChI, pINChI_Aux, - inp_file, plog, pout, pprb, - orig_inp_data, prep_inp_data, &num_inp, pStructPtrs, - &nRet, have_err_in_GetOneStructure, - &num_err, output_error_inchi, - strbuf, &ulTotalProcessingTime, - pLF, pTAB, ikey0, - 0 /* not silent */); - - FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); - FreeOrigAtData(orig_inp_data); - FreeOrigAtData(prep_inp_data); - FreeOrigAtData(prep_inp_data + 1); - } - else - { - /* Internal test mode: renumber atoms and recalculate repeatedly */ - long int nrepeat = 1; - /* 2! = 2 3! = 6 4! = 24 5! = 120 6! = 520 7! = 5040 8! = 40320 */ - if (orig_inp_data->num_inp_atoms == 1) - { - nrepeat = 1; - } - else if (orig_inp_data->num_inp_atoms == 2) - { - nrepeat = 2; - } - else if (orig_inp_data->num_inp_atoms == 3) - { - nrepeat = 6; - } - else - { - nrepeat = 1000; /* 100000;*/ /*16;*/ - } - /* correct (decrease repeat number) for relatively large molecules */ - if (orig_inp_data->num_inp_atoms > 128) - { - nrepeat = 100; /* 100000;*/ /*16;*/ - } - if (orig_inp_data->num_inp_atoms > 256) - { - nrepeat = 50; /* 100000;*/ /*16;*/ - } - if (orig_inp_data->num_inp_atoms > 512) - { - nrepeat = 25; /* 100000;*/ /*16;*/ - } - if (orig_inp_data->num_inp_atoms > 1024) - { - nrepeat = 10; /* 100000;*/ /*16;*/ - } - - /*inchi_ios_eprint(plog, "Number of random atom renumberings up to: %-ld\n", nrepeat); - inchi_ios_flush2(plog, stderr);*/ - -#if 0 - else if (orig_inp_data->num_inp_atoms == 4) - { - nrepeat = 24; - } - else - { - nrepeat = 10; - } - - else if (orig_inp_data->num_inp_atoms == 4) - { - nrepeat = 24; - } - else if (orig_inp_data->num_inp_atoms == 5) - { - nrepeat = 120; - } - else if (orig_inp_data->num_inp_atoms == 6) - { - nrepeat = 520; - } - else if (orig_inp_data->num_inp_atoms == 7) - { - nrepeat = 1000; - } - else - { - nrepeat = 10000; - } -#endif - - next_action = RepeatedlyRenumberAtomsAndRecalcINCHI(&ic, &CG, sd, ip, szTitle, - pINChI, pINChI_Aux, - inp_file, plog, pout, pprb, - orig_inp_data, prep_inp_data, &num_inp, pStructPtrs, - &nRet, have_err_in_GetOneStructure, - &num_err, output_error_inchi, - strbuf, &ulTotalProcessingTime, - pLF, pTAB, nrepeat); - } /* if (ip->bRenumber == 1) */ - - if (next_action == DO_EXIT_FUNCTION) - { - goto exit_function; - } - else if (next_action == DO_BREAK_MAIN_LOOP) - { - break; - } - else if (next_action == DO_CONTINUE_MAIN_LOOP) - { - continue; - } - } /* end of main cycle - while ( !sd->bUserQuit && !bInterrupted ) */ - - -exit_function: - /* Avoid memory leaks in case of fatal error */ - if (pStructPtrs && pStructPtrs->fptr) - { - inchi_free(pStructPtrs->fptr); - } - /* Free INChI memory */ - FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); - /* Free structure data */ - FreeOrigAtData(orig_inp_data); - FreeOrigAtData(prep_inp_data); - FreeOrigAtData(prep_inp_data + 1); - /* Close files */ - inchi_ios_close(inp_file); - inchi_ios_close(pout); - inchi_ios_close(pprb); - { - int hours, minutes, seconds, mseconds; - - SplitTime(ulTotalProcessingTime, &hours, &minutes, &seconds, &mseconds); - - inchi_ios_eprint(plog, "Finished processing %ld structure%s: %ld error%s, processing time %d:%02d:%02d.%02d\n", - num_inp, num_inp == 1 ? "" : "s", - num_err, num_err == 1 ? "" : "s", - hours, minutes, seconds, mseconds / 10); - inchi_ios_flush2(plog, stderr); - } -#if ( defined(_WIN32) && defined(_MSC_VER) ) -#if WINVER >= 0x0501 /* XP or newer */ /* 0x0600 Vista or newer */ - tick_inchi_stop = GetTickCount64(); /* djb-rwth: GetTickCount64() should be used */ - inchi_ios_eprint(plog, "\nElapsed walltime: %d msec.\n", tick_inchi_stop - tick_inchi_start); - inchi_ios_flush2(plog, stderr); -#endif -#endif - /* Final cleanup */ - inchi_ios_close(plog); - inchi_strbuf_close(strbuf); - for (i = 0; i < MAX_NUM_PATHS; i++) - { - if (ip->path[i]) - { - inchi_free((void*)ip->path[i]); /* cast deliberately discards 'const' qualifier */ - ip->path[i] = NULL; - } - } - SetBitFree(&CG); -#if ( ( BUILD_WITH_AMI==1 ) && defined( _WIN32 ) && defined( _CONSOLE ) && !defined( COMPILE_ANSI_ONLY ) ) - if (bInterrupted) - { - return CTRL_STOP_EVENT; - } -#endif - - return 0; -} - - -/****************************************************************************/ -void save_command_line(int argc, char* argv[], INCHI_IOSTREAM* plog) -{ - int k; - - inchi_ios_eprint(plog, "The command line used:\n\""); - for (k = 0; k < argc - 1; k++) - { -#if( ALLOW_EMPTY_PATHS == 1 ) - inchi_ios_eprint(plog, "%-s ", argv[k][0] ? argv[k] : "\"\""); -#else - inchi_ios_eprint(plog, "%-s ", argv[k]); -#endif - } - - inchi_ios_eprint(plog, "%-s\"\n", argv[argc - 1]); - - return; -} - - -/*****************************************************************************/ -void emit_empty_inchi(INPUT_PARMS* ip, - long num_inp, - char* pLF, - char* pTAB, - INCHI_IOSTREAM* pout) -{ - if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) - { - inchi_ios_eprint(pout, "InChI=1S//\n"); /* emit empty Std InChI */ - } - else - { - inchi_ios_eprint(pout, "InChI=1//\n"); /* emit empty InChI */ - } - inchi_ios_flush(pout); -} -#endif /* ifndef TARGET_LIB_FOR_WINCHI */ - - -/*****************************************************************************/ -int GetTheNextRecordOfInputFile(struct tagINCHI_CLOCK* ic, - STRUCT_DATA* sd, INPUT_PARMS* ip, - char* szTitle, - INCHI_IOSTREAM* inp_file, - INCHI_IOSTREAM* plog, - INCHI_IOSTREAM* pout, - INCHI_IOSTREAM* pprb, - ORIG_ATOM_DATA* orig_inp_data, - long* num_inp, - STRUCT_FPTRS* pStructPtrs, - int* nRet, - int* have_err_in_GetOneStructure, - long* num_err, - int output_error_inchi) -{ - if (ip->last_struct_number && *num_inp >= ip->last_struct_number) - { - *nRet = _IS_EOF; /* simulate end of file */ - return DO_EXIT_FUNCTION; - } - - - *nRet = GetOneStructure(ic, sd, ip, szTitle, inp_file, - plog, pout, pprb, orig_inp_data, - num_inp, pStructPtrs); - - inchi_ios_flush2(plog, stderr); - - if (pStructPtrs) - pStructPtrs->cur_fptr++; - - if (sd->bUserQuit) - { - { - return DO_BREAK_MAIN_LOOP; - } - } - - *have_err_in_GetOneStructure = 0; - switch (*nRet) - { - case _IS_FATAL: - (*num_err)++; - if (output_error_inchi == 0) - { - return DO_EXIT_FUNCTION; - } - else - sd->pStrErrStruct[0] = '\0'; /* depress re-appearance of error as warning in ProcessOneStr */ - break; - case _IS_EOF: - return DO_EXIT_FUNCTION; - case _IS_ERROR: - (*num_err)++; - *have_err_in_GetOneStructure = 1; - if (output_error_inchi == 0) - { - return DO_CONTINUE_MAIN_LOOP; - } - else - sd->pStrErrStruct[0] = '\0'; /* depress re-appearance of error as warning in ProcessOneStr */ - break; - case _IS_SKIP: - return DO_CONTINUE_MAIN_LOOP; - default: - sd->pStrErrStruct[0] = '\0'; - } - - return DO_NEXT_STEP; -} - - -/****************************************************************************/ -int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, - CANON_GLOBALS* CG, - STRUCT_DATA* sd, - INPUT_PARMS* ip, - char* szTitle, - PINChI2* pINChI[INCHI_NUM], - PINChI_Aux2* pINChI_Aux[INCHI_NUM], - INCHI_IOSTREAM* inp_file, - INCHI_IOSTREAM* plog, - INCHI_IOSTREAM* pout, - INCHI_IOSTREAM* pprb, - ORIG_ATOM_DATA* orig_inp_data, - ORIG_ATOM_DATA* prep_inp_data, - long* num_inp, - STRUCT_FPTRS* pStructPtrs, - int* nRet, - int have_err_in_GetOneStructure, - long* num_err, - int output_error_inchi, - INCHI_IOS_STRING* strbuf, - unsigned long* pulTotalProcessingTime, - char* pLF, - char* pTAB, - char* ikey, - int silent) -{ - int nRet1; - int next_act = DO_NEXT_STEP; - /* related to hash of InChI */ - char ik_string[256]; /*^^^ Resulting InChIKey string */ - int ik_ret = 0; /*^^^ InChIKey-calc result code */ - int xhash1, xhash2; - char szXtra1[65], szXtra2[65]; - /* related to printing structure header */ - int print_record_info = 0; - INCHI_IOSTREAM temp_out; - INCHI_IOSTREAM* pout0 = &temp_out; - inchi_ios_init(pout0, INCHI_IOS_TYPE_STRING, NULL); - - - /* Calculate InChI */ - - nRet1 = ProcessOneStructureEx(ic, - CG, - sd, - ip, - szTitle, - pINChI, - pINChI_Aux, - inp_file, - plog, - pout0, /* note this */ - pprb, - orig_inp_data, - prep_inp_data, - *num_inp, strbuf, - 0 /* save_opt_bits */); - - inchi_ios_flush2(plog, stderr); - - - /* Output InChI */ - - /* print header for structure if applicable (no error arose, or have a request for empty InChI at error) */ - print_record_info = ((nRet1 == _IS_OKAY) || - (nRet1 == _IS_WARNING) || - ((nRet1 == _IS_ERROR || nRet1 == _IS_FATAL) && output_error_inchi)); - if (print_record_info) - { - Output_RecordInfo(pout, *num_inp, ip->bNoStructLabels, - ip->pSdfLabel, ip->pSdfValue, ip->lSdfId, pLF, pTAB); - } - if (pout0->s.pStr) - { - /* post-process output to correctly treat 'tabbed with InChIKey' mode */ - if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) - { - if (ip->bCalcInChIHash != INCHIHASH_NONE) - { - if (pout0->s.pStr) - { - if (pout0->s.nUsedLength > 0) - { - if (pout0->s.pStr[pout0->s.nUsedLength - 1] == '\n') - { - pout0->s.pStr[pout0->s.nUsedLength - 1] = '\t'; - } - } - } - } - } - /* print InChI string (may be string for empty InChI) */ - if (!ip->bHideInChI) - { - inchi_ios_print(pout, "%-s", pout0->s.pStr); - } - } - /*inchi_ios_close(pout0);*/ /* free temporary out */ - - - *pulTotalProcessingTime += sd->ulStructTime; - - if (nRet1 == _IS_SKIP) - { - next_act = DO_CONTINUE_MAIN_LOOP; - goto exit_function; - } - - *nRet = inchi_max(*nRet, nRet1); - switch (*nRet) - { - case _IS_FATAL: - if (!have_err_in_GetOneStructure) - { - /* increment error counter only if error did not appear earlier */ - (*num_err)++; - } - if (!(ip->bINChIOutputOptions & INCHI_OUT_NO_AUX_INFO) && - (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT)) - { - inchi_ios_print(pout, "\t"); - } - if (ip->bCalcInChIHash != INCHIHASH_NONE) - { - if (ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR) - { - if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) - { - inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYSA-N"); - } - else - { - inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYNA-N"); - } - } - } - inchi_ios_flush(pout); - next_act = DO_EXIT_FUNCTION; - goto exit_function; - - case _IS_ERROR: - if (!have_err_in_GetOneStructure) - { - /* increment error counter only if error did not appear earlier */ - (*num_err)++; - } - if (!(ip->bINChIOutputOptions & INCHI_OUT_NO_AUX_INFO) && - (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT)) - { - inchi_ios_print(pout, "\t"); - } - if (ip->bCalcInChIHash != INCHIHASH_NONE) - { - if (ip->bINChIOutputOptions2 & INCHI_OUT_INCHI_GEN_ERROR) - { - if (ip->bINChIOutputOptions & INCHI_OUT_STDINCHI) - { - inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYSA-N"); - } - else - { - inchi_ios_print(pout, "InChIKey=%-s\n", "MOSFIJXAXDLOML-UHFFFAOYNA-N"); - } - } - } - inchi_ios_flush(pout); - next_act = DO_CONTINUE_MAIN_LOOP; - goto exit_function; - - case _IS_SKIP: - next_act = DO_CONTINUE_MAIN_LOOP; - goto exit_function; - } - - - /* Calculate hash[es] of InChI */ - - if (ip->bCalcInChIHash != INCHIHASH_NONE) - { - char* buf = NULL; - size_t slen = pout0->s.nUsedLength; - - extract_inchi_substring(&buf, pout0->s.pStr, slen); - - if (NULL == buf) - { - ik_ret = INCHIKEY_INVALID_INCHI; - } - else - { - xhash1 = xhash2 = 0; - if ((ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1) || - (ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1_XTRA2)) - { - xhash1 = 1; - } - if ((ip->bCalcInChIHash == INCHIHASH_KEY_XTRA2) || - (ip->bCalcInChIHash == INCHIHASH_KEY_XTRA1_XTRA2)) - { - xhash2 = 1; - } - ik_ret = GetINCHIKeyFromINCHI(buf, xhash1, xhash2, ik_string, szXtra1, szXtra2); - inchi_free(buf); - } - - - /* Print hash[es] */ - - if (ik_ret == INCHIKEY_OK) - { - /* NB: correctly treat tabbed output with InChIKey & hash extensions */ - char csep = '\n'; - - if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) - { - csep = '\t'; - } - if (!ip->bMergeHash) - { - inchi_ios_print(pout, "InChIKey=%-s", ik_string); - } - else - { - inchi_ios_print(pout, "InChIHash=%-s", ik_string); - } - strcpy(ikey, ik_string); - - if (szXtra1[0] && ip->bMergeHash) - { - inchi_ios_print(pout, "-%-s", szXtra1); - } - else if (szXtra1[0] && !ip->bMergeHash) - { - inchi_ios_print(pout, "%cXHash1=%-s", csep, szXtra1); - } - else if (!szXtra1[0] && ip->bMergeHash) - { - inchi_ios_print(pout, "-"); - } - - if (szXtra2[0] && ip->bMergeHash) - { - inchi_ios_print(pout, "-%-s", szXtra2); - } - else if (szXtra2[0] && !ip->bMergeHash) - { - inchi_ios_print(pout, "%cXHash2=%-s", csep, szXtra2); - } - else if (!szXtra2[0] && ip->bMergeHash) - { - inchi_ios_print(pout, "-"); - } - - inchi_ios_print(pout, "\n"); - } - else - { - inchi_ios_print(plog, "Warning (Could not compute InChIKey: ", num_inp); - switch (ik_ret) - { - case INCHIKEY_UNKNOWN_ERROR: - inchi_ios_print(plog, "unresolved error)"); - break; - case INCHIKEY_EMPTY_INPUT: - inchi_ios_print(plog, "got an empty string)"); - break; - case INCHIKEY_INVALID_INCHI_PREFIX: - case INCHIKEY_INVALID_INCHI: - case INCHIKEY_INVALID_STD_INCHI: - inchi_ios_print(plog, "no valid InChI string found)"); - break; - case INCHIKEY_NOT_ENOUGH_MEMORY: - inchi_ios_print(plog, "not enough memory to treat the string)"); - break; - default: inchi_ios_print(plog, "internal program error)"); - break; - } - inchi_ios_print(plog, " structure #%-lu.\n", *num_inp); - if (ip->bINChIOutputOptions & INCHI_OUT_TABBED_OUTPUT) - { - inchi_ios_print(pout, "\n"); - } - } - - if (!silent) - { - inchi_ios_flush(pout); - inchi_ios_flush2(plog, stderr); - } - else - { - inchi_ios_free_str(pout); - inchi_ios_free_str(plog); - } - } - else - { - inchi_ios_flush(pout); - } - -exit_function: - inchi_ios_close(pout0); /* free temporary out */ - - return next_act; -} - - -#ifdef RENUMBER_ATOMS_AND_RECALC_V106 - -/*****************************************************************************/ - -int numbers_rrar[PERMAXATOMS]; /* djb-rwth: placed as a global variable to avoid function buffer issues */ -int RepeatedlyRenumberAtomsAndRecalcINCHI(struct tagINCHI_CLOCK* ic, - CANON_GLOBALS* CG, - STRUCT_DATA* sd, - INPUT_PARMS* ip, - char* szTitle, - PINChI2* pINChI[INCHI_NUM], - PINChI_Aux2* pINChI_Aux[INCHI_NUM], - INCHI_IOSTREAM* inp_file, - INCHI_IOSTREAM* plog, - INCHI_IOSTREAM* pout, - INCHI_IOSTREAM* pprb, - ORIG_ATOM_DATA* orig_inp_data, - ORIG_ATOM_DATA* prep_inp_data, - long* num_inp, - STRUCT_FPTRS* pStructPtrs, - int* nRet, - int have_err_in_GetOneStructure, - long* num_err, - int output_error_inchi, - INCHI_IOS_STRING* strbuf, - unsigned long* pulTotalProcessingTime, - char* pLF, - char* pTAB, - long int nrepeat) -{ - int next_action = DO_NEXT_STEP; - int dup_fail = 0; - ORIG_ATOM_DATA SavedOrigAtData; /* 0=> disconnected, 1=> original */ - ORIG_ATOM_DATA* saved_orig_inp_data = &SavedOrigAtData; - char ikey0[28]; - - const int very_silent = 2; /* 3 0;*/ - - /* Internal test mode: renumber atoms and recalculate repeatedly */ - - /* do not forget to use /key and to not use /auxnone */ - - - ikey0[0] = '\0'; - { - int k; - for (k = 0; k < orig_inp_data->num_inp_atoms; k++) - { - numbers_rrar[k] = k; - } - for (k = orig_inp_data->num_inp_atoms; k < PERMAXATOMS; k++) - { - numbers_rrar[k] = -1; - } - } - - - - -#if BIG_POLY_DEBUG - { int k; ITRACE_("\nAtoms = {"); for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) ITRACE_(" %-03d,", numbers_rrar[k]); ITRACE_(" %-03d }", numbers_rrar[orig_inp_data->num_inp_atoms - 1]); } - OrigAtData_DebugTrace(orig_inp_data); - OrigAtDataPolymer_DebugTrace(orig_inp_data->polymer); -#endif - - memset(saved_orig_inp_data, 0, sizeof(*saved_orig_inp_data)); /* djb-rwth: memset_s C11/Annex K variant? */ - dup_fail = OrigAtData_Duplicate(saved_orig_inp_data, orig_inp_data); - - next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, - pINChI, pINChI_Aux, - inp_file, plog, pout, pprb, - orig_inp_data, prep_inp_data, num_inp, pStructPtrs, - nRet, have_err_in_GetOneStructure, - num_err, output_error_inchi, - strbuf, pulTotalProcessingTime, - pLF, pTAB, ikey0, very_silent); - FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); - FreeOrigAtData(orig_inp_data); - FreeOrigAtData(prep_inp_data); - FreeOrigAtData(prep_inp_data + 1); - - - if (ikey0[0]) - { - if (very_silent < 2) - { - inchi_ios_eprint(plog, "#%-ld-%08ld\t...\t%-s\t%s%s%s%s\n", *num_inp, 1, ikey0, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue)); - } - } - - - if (!dup_fail) - { - int irepeat = 0; - int ndiff = 0; - int n_written_problems = 0; - char ikey[28]; - ikey[0] = '\0'; - for (irepeat = 0; irepeat < nrepeat - 1; irepeat++) - { - dup_fail = OrigAtData_Duplicate(orig_inp_data, saved_orig_inp_data); - if (!dup_fail) - { - shuffle((void*)numbers_rrar, orig_inp_data->num_inp_atoms, sizeof(int)); - OrigAtData_Permute(orig_inp_data, saved_orig_inp_data, numbers_rrar); -#if BIG_POLY_DEBUG - { int k; ITRACE_("\nAtoms = {"); for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) ITRACE_(" %-03d,", numbers_rrar[k]); ITRACE_(" %-03d }", numbers_rrar[orig_inp_data->num_inp_atoms - 1]); } - OrigAtData_DebugTrace(saved_orig_inp_data); - OrigAtData_DebugTrace(orig_inp_data); - OrigAtDataPolymer_DebugTrace(saved_orig_inp_data->polymer); - OrigAtDataPolymer_DebugTrace(orig_inp_data->polymer); -#endif - next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, - pINChI, pINChI_Aux, - inp_file, plog, pout, pprb, - orig_inp_data, - prep_inp_data, num_inp, pStructPtrs, - nRet, have_err_in_GetOneStructure, - num_err, output_error_inchi, - strbuf, pulTotalProcessingTime, - pLF, pTAB, ikey, - 0 /* 1 be silent */); - - - if (ikey0[0] && ikey[0]) - { - if (strcmp(ikey, ikey0)) - { - int result, bINChIOutputOptions = ip->bINChIOutputOptions; /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - ndiff++; - /*inchi_ios_eprint( plog, "!!! #%-ld-%05ld %s%s%s%s\tcurr %-s != %-s orig\n", *num_inp, irepeat + 2, SDF_LBL_VAL( ip->pSdfLabel, ip->pSdfValue ), ikey, ikey0 );*/ - /*inchi_ios_eprint( plog, "!!! %s%s%s%s renum#%05ld\t%-s != %-s\n", SDF_LBL_VAL( ip->pSdfLabel, ip->pSdfValue ), irepeat + 2, ikey, ikey0 );*/ - inchi_ios_eprint(plog, "!!! #%-ld %s%s%s%s\t%-s --> %-s @ renum#%06d/%06ld\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue), ikey0, ikey, irepeat + 2, nrepeat); - if (!very_silent) - { - int k; - inchi_ios_eprint(plog, "Atoms = {"); - for (k = 0; k < orig_inp_data->num_inp_atoms - 1; k++) - { - inchi_ios_eprint(plog, " %-d,", numbers_rrar[k] + 1); - } - inchi_ios_eprint(plog, " %-d }\n\n", numbers_rrar[orig_inp_data->num_inp_atoms - 1] + 1); - } - ip->bINChIOutputOptions |= INCHI_OUT_SDFILE_ONLY; - result = OrigAtData_SaveMolfile(orig_inp_data, sd, ip, *num_inp, pprb); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ - inchi_ios_flush(pprb); - ip->bINChIOutputOptions = bINChIOutputOptions; - if (result == 0) - { - n_written_problems++; - } -#if 0 - /* second pass, non-silent one */ - FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); - FreeOrigAtData(orig_inp_data); - FreeOrigAtData(prep_inp_data); - FreeOrigAtData(prep_inp_data + 1); - dup_fail = OrigAtData_Duplicate(orig_inp_data, saved_orig_inp_data); - if (!dup_fail) - { - OrigAtData_Permute(orig_inp_data, saved_orig_inp_data, numbers_rrar); - next_action = CalcAndPrintINCHIAndINCHIKEY(ic, CG, sd, ip, szTitle, - pINChI, pINChI_Aux, - inp_file, plog, pout, pprb, - orig_inp_data, - prep_inp_data, num_inp, pStructPtrs, - nRet, have_err_in_GetOneStructure, - num_err, output_error_inchi, - strbuf, pulTotalProcessingTime, - pLF, pTAB, ikey, 0); - } -#endif - } - - if (irepeat == nrepeat - 2) - { - if (very_silent < 2) - { - inchi_ios_eprint(plog, "...........\n#%-ld-%08ld\t...\t%-s\t%s%s%s%s\n", *num_inp, irepeat + 2, ikey0, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue)); - } - } - - } - } - FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); - FreeOrigAtData(orig_inp_data); - FreeOrigAtData(prep_inp_data); - FreeOrigAtData(prep_inp_data + 1); - -#ifdef STOP_AFTER_FIRST_CHANGE_ON_RENUMBERING - if (ndiff == 1) - { - next_action = DO_CONTINUE_MAIN_LOOP; - break; - } -#endif - } - if (ndiff == 0) - { - if (very_silent < 3) - { - /*inchi_ios_eprint( plog, "#%-ld-%05ld\t...\tOK ALL\n", *num_inp, nrepeat );*/ - /*inchi_ios_eprint( plog, "OK #%-ld %s%s%s%s\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue));*/ - /*inchi_ios_eprint(plog, "#%-ld\n", *num_inp);*/ - inchi_ios_eprint(plog, "OK #%-ld %s%s%s%s\t%-s\t Same for %-d/%-d renums\n", *num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue), ikey0, nrepeat, nrepeat); - } - } - else - { -#ifdef STOP_AFTER_FIRST_CHANGE_ON_RENUMBERING - /*inchi_ios_eprint( plog, "#%-ld-%05ld\t...\tDIFF %-d\n", num_inp, nrepeat, ndiff );*/ -#else - inchi_ios_eprint(plog, "#%-ld-%05ld\t...\tDIFF %-d\n", num_inp, nrepeat, ndiff); -#endif - } - - FreeOrigAtData(saved_orig_inp_data); - } - - return next_action; -} - - -#endif From 03f3451b8bdaf1d3a06a0ecaa2d77392702b6af1 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 8 Dec 2025 14:48:07 +0000 Subject: [PATCH 21/41] added unit test for ProcessSingleInputFile --- .gitignore | 1 + INCHI-1-SRC/INCHI_BASE/src/ichimain.c | 1 - INCHI-1-SRC/INCHI_BASE/src/ichimain.h | 5 +- .../tests/test_unit/fixtures/caffeine.mol | 55 + .../tests/test_unit/fixtures/test_mols.sdf | 1976 +++++++++++++++++ .../tests/test_unit/fixtures/test_mols_2.sdf | 320 +++ .../tests/test_unit/test_ichimain.cpp | 241 +- 7 files changed, 2583 insertions(+), 16 deletions(-) create mode 100644 INCHI-1-TEST/tests/test_unit/fixtures/caffeine.mol create mode 100644 INCHI-1-TEST/tests/test_unit/fixtures/test_mols.sdf create mode 100644 INCHI-1-TEST/tests/test_unit/fixtures/test_mols_2.sdf diff --git a/.gitignore b/.gitignore index ae1a6c21..8e8a17cd 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ build/ Testing/ googletest/ *.egg-info/ +inchi_mol_test_*/ .clang-format # Ignore core dump files core.*[0-9] diff --git a/INCHI-1-SRC/INCHI_BASE/src/ichimain.c b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c index ccdc9aeb..326dfb7b 100644 --- a/INCHI-1-SRC/INCHI_BASE/src/ichimain.c +++ b/INCHI-1-SRC/INCHI_BASE/src/ichimain.c @@ -2,7 +2,6 @@ * International Chemical Identifier (InChI) * Version 1 * Software version 1.07 - * April 30, 2024 * * MIT License * diff --git a/INCHI-1-SRC/INCHI_BASE/src/ichimain.h b/INCHI-1-SRC/INCHI_BASE/src/ichimain.h index 02f999eb..779d6b3e 100644 --- a/INCHI-1-SRC/INCHI_BASE/src/ichimain.h +++ b/INCHI-1-SRC/INCHI_BASE/src/ichimain.h @@ -2,7 +2,6 @@ * International Chemical Identifier (InChI) * Version 1 * Software version 1.07 - * April 30, 2024 * * MIT License * @@ -164,7 +163,7 @@ typedef struct tagINCHI_OUT_CTL char szTag2[PRINT_INCHI_MAX_TAG_LEN]; char szTag3[PRINT_INCHI_MAX_TAG_LEN]; - int n_pzz; + int n_pzz; int n_zy; INCHI_SORT **pINChISortTautAndNonTaut; @@ -521,7 +520,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, OAD_StructureEdits *ed, int *ret); void OAD_CollectFragmentBondsAndAtoms( ORIG_ATOM_DATA *at_data, - int nforbidden, + int nforbidden, int *forbidden_orig, int *n_fragbonds, int **fragbonds, diff --git a/INCHI-1-TEST/tests/test_unit/fixtures/caffeine.mol b/INCHI-1-TEST/tests/test_unit/fixtures/caffeine.mol new file mode 100644 index 00000000..9373920c --- /dev/null +++ b/INCHI-1-TEST/tests/test_unit/fixtures/caffeine.mol @@ -0,0 +1,55 @@ +C8H10N4O2 +APtclcactv08142501153D 0 0.00000 0.00000 + + 24 25 0 0 0 0 0 0 0 0999 V2000 + 1.3120 -1.0479 0.0025 N 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2465 -2.1762 0.0031 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7906 0.2081 0.0010 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9938 0.3838 0.0002 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9714 1.2767 -0.0001 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5339 2.6294 -0.0017 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4026 1.0989 -0.0001 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4446 1.9342 -0.0010 N 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5608 1.2510 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2862 -0.0680 0.0015 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.2614 -1.1612 0.0029 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9114 -0.1939 0.0014 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0163 -1.2853 -0.0022 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4380 -2.4279 -0.0068 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2697 -1.8004 0.0022 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0830 -2.7828 0.8938 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0821 -2.7846 -0.8862 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.6223 2.5703 -0.0019 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1987 3.1611 -0.8923 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1990 3.1632 0.8877 H 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5520 1.6797 -0.0001 H 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5037 -1.4333 -1.0244 H 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8389 -2.0244 0.5173 H 0 0 0 0 0 0 0 0 0 0 0 0 + -4.1672 -0.8395 0.5168 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 1 3 1 0 0 0 0 + 3 4 2 0 0 0 0 + 3 5 1 0 0 0 0 + 5 6 1 0 0 0 0 + 5 7 1 0 0 0 0 + 7 8 1 0 0 0 0 + 8 9 2 0 0 0 0 + 9 10 1 0 0 0 0 + 10 11 1 0 0 0 0 + 10 12 1 0 0 0 0 + 7 12 2 0 0 0 0 + 12 13 1 0 0 0 0 + 1 13 1 0 0 0 0 + 13 14 2 0 0 0 0 + 2 15 1 0 0 0 0 + 2 16 1 0 0 0 0 + 2 17 1 0 0 0 0 + 6 18 1 0 0 0 0 + 6 19 1 0 0 0 0 + 6 20 1 0 0 0 0 + 9 21 1 0 0 0 0 + 11 22 1 0 0 0 0 + 11 23 1 0 0 0 0 + 11 24 1 0 0 0 0 +M END + diff --git a/INCHI-1-TEST/tests/test_unit/fixtures/test_mols.sdf b/INCHI-1-TEST/tests/test_unit/fixtures/test_mols.sdf new file mode 100644 index 00000000..d3d970d8 --- /dev/null +++ b/INCHI-1-TEST/tests/test_unit/fixtures/test_mols.sdf @@ -0,0 +1,1976 @@ +Compound 20652 +Actelion Java MolfileCreator 1.0 + +101110 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0153 1.5192 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2737 2.2865 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3351 2.2865 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9029 0.4297 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2277 3.8057 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3504 3.8057 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8875 -1.0589 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0614 4.5730 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3147 3.4528 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1766 -1.7955 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5678 -1.7955 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.8518 4.8799 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6344 2.7162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4656 -1.0282 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1612 -3.2840 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5524 -3.2840 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9541 3.4835 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6498 1.2277 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4503 0.4911 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4503 -4.0206 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8415 -4.0206 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7673 -4.0206 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2739 2.7469 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9695 0.4911 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3607 0.4911 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1305 1.2583 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7393 1.2583 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4349 -5.5091 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.0870 -3.2533 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7826 -5.5091 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2892 1.2583 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -8.5936 3.5142 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3761 -0.9975 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1152 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0283 0.5218 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7240 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7240 -6.2457 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1152 -6.2457 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1024 -1.7341 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1024 -6.2457 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5064 -6.2457 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -8.6090 5.0334 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -9.9133 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6958 -1.7341 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4042 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8568 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3174 1.2890 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0130 3.5449 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0130 -5.4784 -0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7086 -7.7342 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2686 -7.6422 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8133 -0.9668 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.4911 -7.7342 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.9287 5.8007 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.2331 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7111 -3.2226 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3889 5.0641 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7955 5.0641 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 9.6064 0.5524 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3020 2.8083 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3889 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7801 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8287 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.2484 5.0641 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -12.5528 2.8083 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4221 -3.9592 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0309 -3.9592 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 10.8955 1.3197 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 9.5911 3.5756 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3735 -9.9594 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.7315 -7.8724 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8415 -9.7292 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.0282 -10.0054 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1484 -7.7036 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.8801 2.8390 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.1845 0.5831 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.3277 4.8953 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 8.8238 4.8953 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.6626 -10.6960 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0538 -10.6960 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1484 -10.6960 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4681 -8.4402 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.1692 3.6062 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0385 -12.1845 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1637 -12.1845 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4681 -9.9287 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3275 -12.9211 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7187 -12.9211 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4835 -12.9211 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8747 -12.9211 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7879 -10.6653 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3990 -12.1538 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.8032 -12.1538 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4988 -14.4096 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8901 -14.4096 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3836 -10.6346 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2098 -15.1462 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5806 -10.1282 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5831 -9.7906 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2251 -16.6348 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 2 3 2 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 5 8 1 0 0 0 0 + 6 9 2 0 0 0 0 + 7 10 1 0 0 0 0 + 8 11 2 0 0 0 0 + 8 12 1 0 0 0 0 + 10 13 1 6 0 0 0 + 10 14 1 0 0 0 0 + 11 15 1 0 0 0 0 + 11 16 1 0 0 0 0 + 12 17 2 0 0 0 0 + 14 18 1 6 0 0 0 + 14 19 1 0 0 0 0 + 20 15 1 6 0 0 0 + 16 21 1 0 0 0 0 + 16 22 2 0 0 0 0 + 17 23 1 0 0 0 0 + 18 24 1 0 0 0 0 + 19 25 2 0 0 0 0 + 19 26 1 0 0 0 0 + 20 27 1 0 0 0 0 + 20 28 1 0 0 0 0 + 21 29 1 0 0 0 0 + 23 30 1 6 0 0 0 + 23 31 1 0 0 0 0 + 24 32 2 0 0 0 0 + 24 33 1 0 0 0 0 + 26 34 1 0 0 0 0 + 27 35 1 0 0 0 0 + 28 36 1 1 0 0 0 + 28 37 1 0 0 0 0 + 29 38 2 0 0 0 0 + 29 39 1 0 0 0 0 + 30 40 1 0 0 0 0 + 31 41 2 0 0 0 0 + 31 42 1 0 0 0 0 + 33 43 1 1 0 0 0 + 33 44 1 0 0 0 0 + 34 45 1 6 0 0 0 + 35 46 1 0 0 0 0 + 35 47 1 0 0 0 0 + 48 36 1 1 0 0 0 + 37 49 1 6 0 0 0 + 38 50 1 0 0 0 0 + 38 51 1 0 0 0 0 + 39 52 2 0 0 0 0 + 40 53 2 0 0 0 0 + 54 42 1 1 0 0 0 + 43 55 1 0 0 0 0 + 44 56 1 0 0 0 0 + 45 57 1 0 0 0 0 + 46 58 1 1 0 0 0 + 47 59 1 0 0 0 0 + 48 60 1 0 0 0 0 + 48 61 1 0 0 0 0 + 51 62 2 0 0 0 0 + 54 63 1 0 0 0 0 + 54 64 1 0 0 0 0 + 56 65 1 0 0 0 0 + 56 66 1 0 0 0 0 + 57 67 2 0 0 0 0 + 57 68 1 0 0 0 0 + 60 69 1 0 0 0 0 + 61 70 1 0 0 0 0 + 62 71 1 0 0 0 0 + 63 72 2 0 0 0 0 + 63 73 1 0 0 0 0 + 64 74 2 0 0 0 0 + 64 75 1 0 0 0 0 + 69 76 1 0 0 0 0 + 69 77 1 6 0 0 0 + 70 78 1 6 0 0 0 + 70 79 1 0 0 0 0 + 71 80 1 1 0 0 0 + 71 81 1 0 0 0 0 + 74 82 1 0 0 0 0 + 75 83 2 0 0 0 0 + 76 84 1 6 0 0 0 + 81 85 1 0 0 0 0 + 82 86 1 0 0 0 0 + 82 87 2 0 0 0 0 + 85 88 2 0 0 0 0 + 85 89 1 0 0 0 0 + 86 90 2 0 0 0 0 + 86 91 1 0 0 0 0 + 87 92 1 0 0 0 0 + 89 93 1 0 0 0 0 + 90 94 1 0 0 0 0 + 90 95 1 0 0 0 0 + 91 96 2 0 0 0 0 + 93 97 1 1 0 0 0 + 95 98 2 0 0 0 0 + 97 99 2 0 0 0 0 + 97100 1 0 0 0 0 + 98101 1 0 0 0 0 + 7 9 1 0 0 0 0 + 17 22 1 0 0 0 0 + 34 40 1 0 0 0 0 + 37 46 1 0 0 0 0 + 52 62 1 0 0 0 0 + 70 76 1 0 0 0 0 + 81 73 1 1 0 0 0 + 83 87 1 0 0 0 0 + 91 93 1 0 0 0 0 + 96 98 1 0 0 0 0 +M END +> +Compound 20652 + +> +BIO-423 + +> +VANCOMYCIN HYDROCHLORIDE + +> +Products for Life Science + +> +1404-93-9 + +> +1485.7 + +> +'93.5% (Vanomycin base) + +> +MFCD03613611 + +$$$$ +Compound 20656 +Actelion Java MolfileCreator 1.0 + + 75 78 0 0 1 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4488 -0.4553 -0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3036 1.4902 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7799 -1.9179 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8279 2.5112 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0631 -2.2628 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5243 4.0013 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2352 2.0559 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3804 -3.8496 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.3739 -1.3384 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.4974 0.3311 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4218 3.0907 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -5.0500 -4.4153 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.5467 -1.5453 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.8910 0.2070 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.9258 2.6630 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.8088 -3.2563 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -5.5329 -5.6019 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.9396 1.3522 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.9803 0.8141 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3259 0.9244 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0158 3.6564 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.7057 -6.0158 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2359 -6.7471 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.6229 1.2280 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2635 2.5112 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0079 2.2490 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.4429 0.0690 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5677 0.5657 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -5.7123 5.1466 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.1131 -5.1190 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.5671 -8.2097 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.3266 -0.1656 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.5060 2.3732 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.9541 -0.7727 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.8437 6.1676 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2911 5.6295 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.3687 -5.6295 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.7405 -3.5322 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0158 -8.6650 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4632 -9.2031 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -9.0237 2.2352 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.4304 -1.1866 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0020 -1.8627 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5401 7.6577 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9875 7.1196 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.7616 -2.6630 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.2504 -2.9251 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.6584 0.8693 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.9206 3.4770 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.6032 -0.2070 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.3056 -3.3391 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.1190 8.1407 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3949 -4.1807 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.6650 -0.2070 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -11.1762 0.7313 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -9.3135 4.8706 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.8844 -4.2083 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.4232 -3.9600 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.8154 9.6308 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.8496 -3.5460 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.8109 -0.6347 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.2103 6.1124 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.1328 -5.6985 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.6439 -5.2845 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6564 -2.4146 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5526 -4.7188 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -13.3286 -0.7727 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7281 5.9744 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.7333 -6.4849 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.9633 -2.1386 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -14.2255 0.4691 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -12.6249 7.2162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -12.0178 8.6098 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -14.1427 7.0782 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 1 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 5 7 1 1 0 0 0 + 5 8 1 0 0 0 0 + 6 9 1 0 0 0 0 + 6 10 1 6 0 0 0 + 8 11 2 0 0 0 0 + 8 12 1 0 0 0 0 + 9 13 1 0 0 0 0 + 10 14 2 0 0 0 0 + 10 15 1 0 0 0 0 + 12 16 1 0 0 0 0 + 13 17 2 0 0 0 0 + 13 18 1 0 0 0 0 + 15 19 1 0 0 0 0 + 15 20 1 0 0 0 0 + 16 21 1 0 0 0 0 + 16 22 1 6 0 0 0 + 18 23 1 0 0 0 0 + 18 24 1 6 0 0 0 + 19 25 1 6 0 0 0 + 19 26 1 0 0 0 0 + 20 27 1 0 0 0 0 + 21 28 2 0 0 0 0 + 21 29 1 0 0 0 0 + 22 30 1 0 0 0 0 + 23 31 1 0 0 0 0 + 24 32 1 0 0 0 0 + 25 33 2 0 0 0 0 + 25 34 1 0 0 0 0 + 29 35 1 0 0 0 0 + 30 36 2 0 0 0 0 + 30 37 1 0 0 0 0 + 31 38 2 0 0 0 0 + 31 39 1 0 0 0 0 + 32 40 2 0 0 0 0 + 32 41 1 0 0 0 0 + 42 34 1 6 0 0 0 + 35 43 1 0 0 0 0 + 35 44 1 1 0 0 0 + 36 45 1 0 0 0 0 + 37 46 2 0 0 0 0 + 39 47 1 0 0 0 0 + 39 48 1 1 0 0 0 + 42 49 1 0 0 0 0 + 42 50 1 0 0 0 0 + 43 51 2 0 0 0 0 + 44 52 1 0 0 0 0 + 45 53 2 0 0 0 0 + 48 54 1 0 0 0 0 + 49 55 2 0 0 0 0 + 49 56 1 0 0 0 0 + 50 57 1 0 0 0 0 + 52 58 2 0 0 0 0 + 52 59 1 0 0 0 0 + 53 60 1 0 0 0 0 + 54 61 1 0 0 0 0 + 56 62 1 0 0 0 0 + 57 63 1 0 0 0 0 + 58 64 1 0 0 0 0 + 59 65 2 0 0 0 0 + 61 66 2 0 0 0 0 + 61 67 1 0 0 0 0 + 62 68 1 0 0 0 0 + 63 69 1 0 0 0 0 + 64 70 2 0 0 0 0 + 68 71 2 0 0 0 0 + 68 72 1 0 0 0 0 + 69 73 2 0 0 0 0 + 73 74 1 0 0 0 0 + 73 75 1 0 0 0 0 + 26 27 1 0 0 0 0 + 43 47 1 0 0 0 0 + 46 53 1 0 0 0 0 + 65 70 1 0 0 0 0 +M END +> +Compound 20656 + +> +BIO-992 + +> +VASOPRESSIN + +> +Products for Life Science + +> + + +> + + +> +' + +> +MFCD03839092 + +$$$$ +Compound 20659 +Actelion Java MolfileCreator 1.0 + + 33 34 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2913 0.7582 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0118 -1.4927 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5825 0.0118 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2794 2.2745 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5707 -1.4808 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8738 0.7700 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5707 3.0327 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8620 -2.2271 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8620 2.2864 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5588 4.5491 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8501 3.8027 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2439 5.3072 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8501 5.3072 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1414 3.0564 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0711 4.5609 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2320 6.8236 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1414 4.5609 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.4327 5.3191 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.7239 4.5728 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 9.0152 5.3309 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.7121 3.0801 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.3065 4.5846 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 11.5977 5.3428 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.8890 4.5964 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 11.5859 6.8591 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 14.1803 5.3546 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.8772 7.6173 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 15.4715 4.6083 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 14.1684 6.8710 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 16.7628 5.3665 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 15.4597 7.6292 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 15.4478 9.1455 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 1 3 1 0 0 0 0 + 2 4 2 0 0 0 0 + 2 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 4 7 1 0 0 0 0 + 5 8 2 0 0 0 0 + 6 9 1 0 0 0 0 + 7 10 2 0 0 0 0 + 8 11 1 0 0 0 0 + 11 12 1 6 0 0 0 + 11 13 1 0 0 0 0 + 11 14 1 0 0 0 0 + 12 15 3 0 0 0 0 + 13 16 1 0 0 0 0 + 13 17 1 0 0 0 0 + 14 18 1 0 0 0 0 + 18 19 1 0 0 0 0 + 19 20 1 0 0 0 0 + 20 21 1 0 0 0 0 + 20 22 1 0 0 0 0 + 21 23 1 0 0 0 0 + 23 24 1 0 0 0 0 + 24 25 2 0 0 0 0 + 24 26 1 0 0 0 0 + 25 27 1 0 0 0 0 + 26 28 2 0 0 0 0 + 27 29 1 0 0 0 0 + 27 30 2 0 0 0 0 + 29 31 1 0 0 0 0 + 30 32 1 0 0 0 0 + 32 33 1 0 0 0 0 + 8 10 1 0 0 0 0 + 28 30 1 0 0 0 0 +M END +> +Compound 20659 + +> +BIO-424 + +> +VERAPAMIL HYDROCHLORIDE + +> +Products for Life Science + +> +152-11-4 + +> +491.1 + +> +'>99% + +> +MFCD00055208 + +$$$$ +Compound 20668 +Actelion Java MolfileCreator 1.0 + + 37 42 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.8775 -1.1977 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3598 -1.0198 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 0.2609 -2.5614 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2374 -2.2175 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2255 0.2135 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.6404 -1.3400 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1384 -3.7592 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.2451 -2.7156 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.6207 -3.5813 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.6604 -1.7313 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.6485 -0.2253 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5218 -5.1229 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1464 -1.4942 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.8618 -4.0793 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.4983 -4.7790 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9843 -5.2770 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7195 -6.0004 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3085 -4.5418 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.8736 -6.4866 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9092 -7.4827 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3085 -6.0360 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6248 -3.7829 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.6958 -7.9689 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9843 -8.6686 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9646 -8.5263 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.3441 -7.0677 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6248 -6.7831 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9411 -4.5300 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5099 -8.8702 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0121 -8.7042 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9411 -6.0241 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0239 -10.1983 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2574 -6.7712 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7313 -10.9336 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.3402 -10.9336 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2574 -8.2654 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 1 0 0 0 0 + 4 8 1 0 0 0 0 + 4 9 1 0 0 0 0 + 5 10 1 0 0 0 0 + 5 11 1 0 0 0 0 + 6 12 1 0 0 0 0 + 8 13 1 0 0 0 0 + 9 14 1 0 0 0 0 + 9 15 1 0 0 0 0 + 10 16 2 0 0 0 0 + 13 17 1 0 0 0 0 + 13 18 1 0 0 0 0 + 15 19 1 0 0 0 0 + 17 20 1 0 0 0 0 + 18 21 1 0 0 0 0 + 19 22 2 0 0 0 0 + 19 23 1 0 0 0 0 + 20 24 1 0 0 0 0 + 21 25 1 0 0 0 0 + 21 26 1 0 0 0 0 + 21 27 1 0 0 0 0 + 22 28 1 0 0 0 0 + 23 29 2 0 0 0 0 + 24 30 1 0 0 0 0 + 24 31 1 0 0 0 0 + 28 32 2 0 0 0 0 + 31 33 2 0 0 0 0 + 32 34 1 0 0 0 0 + 33 35 1 0 0 0 0 + 33 36 1 0 0 0 0 + 34 37 1 0 0 0 0 + 8 10 1 0 0 0 0 + 11 12 1 0 0 0 0 + 15 17 2 0 0 0 0 + 20 22 1 0 0 0 0 + 25 30 1 0 0 0 0 + 29 32 1 0 0 0 0 +M END +> +Compound 20668 + +> +BIO-1002 + +> +VERRUCULOGEN FROM PENICILLIUM VERRUCULOSUM + +> +Products for Life Science + +> +12771-72-1 + +> + + +> +' + +> +MFCD00079645 + +$$$$ +Compound 20680 +Actelion Java MolfileCreator 1.0 + + 67 75 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2923 -0.7469 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2804 -2.2407 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5846 0.0119 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0356 -2.9877 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5727 -2.9877 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8768 -0.7351 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5727 1.5294 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3516 -2.2289 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0474 -4.4815 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8650 -2.2289 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5609 -4.4815 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1691 0.0237 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8650 2.2882 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2449 -5.2284 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3634 -5.2284 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1573 -2.9758 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1573 -1.4701 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.4614 -0.7232 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1573 1.5413 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6794 -4.4696 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3753 -6.7222 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.4495 -2.2170 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 7.7537 0.0356 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1454 3.0588 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.4495 2.3000 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9954 -5.2165 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6913 -7.4691 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.7418 1.5531 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0073 -6.7104 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3114 -4.4578 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.7031 -8.9630 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 9.0341 2.3119 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 9.0341 0.8062 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3232 -7.4573 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 10.3264 1.5650 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3351 -8.9511 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.3145 0.0711 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 11.6187 2.3237 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.6511 -9.6980 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0428 -9.6980 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 11.6068 -0.6758 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.9110 1.5768 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.6630 -11.1919 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0547 -11.1919 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.8991 0.0830 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 11.5950 -2.1696 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3707 -11.9388 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.9789 -11.9388 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 14.1914 -0.6639 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -5.3825 -13.4326 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 15.4837 0.0948 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0902 -14.1795 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 16.7759 -0.6521 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 15.4718 1.6124 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.1021 -15.6734 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.7980 -13.4208 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 18.0682 0.1067 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 16.7641 2.3712 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8098 -16.4203 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5057 -14.1677 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 18.0564 1.6242 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 19.3605 -0.6402 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5175 -15.6615 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8217 -17.9141 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 19.3486 2.3830 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2253 -16.4084 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 2 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 4 8 1 0 0 0 0 + 5 9 1 0 0 0 0 + 5 10 1 0 0 0 0 + 6 11 1 0 0 0 0 + 6 12 2 0 0 0 0 + 7 13 1 0 0 0 0 + 8 14 2 0 0 0 0 + 10 15 2 0 0 0 0 + 16 10 1 1 0 0 0 + 11 17 2 0 0 0 0 + 13 18 1 1 0 0 0 + 13 19 1 0 0 0 0 + 13 20 1 0 0 0 0 + 16 21 1 0 0 0 0 + 16 22 1 0 0 0 0 + 19 23 2 0 0 0 0 + 19 24 1 0 0 0 0 + 20 25 1 1 0 0 0 + 20 26 1 0 0 0 0 + 21 27 1 0 0 0 0 + 22 28 1 0 0 0 0 + 24 29 1 0 0 0 0 + 27 30 1 0 0 0 0 + 27 31 1 0 0 0 0 + 28 32 1 0 0 0 0 + 29 33 1 0 0 0 0 + 29 34 1 6 0 0 0 + 30 35 1 6 0 0 0 + 33 36 1 0 0 0 0 + 37 35 1 1 0 0 0 + 36 38 1 0 0 0 0 + 36 39 1 0 0 0 0 + 37 40 1 0 0 0 0 + 37 41 1 0 0 0 0 + 38 42 1 0 0 0 0 + 39 43 1 0 0 0 0 + 40 44 1 0 0 0 0 + 41 45 1 0 0 0 0 + 42 46 1 0 0 0 0 + 42 47 1 6 0 0 0 + 44 48 1 0 0 0 0 + 44 49 1 6 0 0 0 + 46 50 1 0 0 0 0 + 48 51 1 6 0 0 0 + 50 52 1 0 0 0 0 + 53 51 1 1 0 0 0 + 52 54 1 0 0 0 0 + 52 55 1 0 0 0 0 + 53 56 1 0 0 0 0 + 53 57 1 0 0 0 0 + 54 58 1 0 0 0 0 + 55 59 2 0 0 0 0 + 56 60 1 0 0 0 0 + 57 61 2 0 0 0 0 + 58 62 1 0 0 0 0 + 58 63 1 6 0 0 0 + 60 64 1 0 0 0 0 + 60 65 1 6 0 0 0 + 62 66 2 0 0 0 0 + 64 67 2 0 0 0 0 + 7 11 1 0 0 0 0 + 12 15 1 0 0 0 0 + 14 20 1 0 0 0 0 + 26 29 1 0 0 0 0 + 28 30 1 0 0 0 0 + 43 46 1 0 0 0 0 + 45 48 1 0 0 0 0 + 59 62 1 0 0 0 0 + 61 64 1 0 0 0 0 +M END +> +Compound 20680 + +> +BIO-718 + +> +VINEOMYCIN A1 + +> +Products for Life Science + +> +78164-00-8 + +> +934.98 + +> +'>80% + +> +MFCD00079639 + +$$$$ +Compound 20681 +Actelion Java MolfileCreator 1.0 + + 67 74 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3071 0.7536 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3188 2.2609 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6141 0.0118 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0353 3.0145 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6259 3.0145 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9212 0.7654 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6259 -1.4719 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2482 2.2727 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0471 4.5218 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9330 2.2727 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6377 4.5218 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2283 0.0236 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9330 -2.2138 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3542 5.2754 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2364 5.2754 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2401 3.0263 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5354 0.7772 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2401 -1.4602 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5199 4.5335 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2246 6.7826 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5471 -2.2020 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8035 5.2872 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5082 7.5363 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5589 -3.6857 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7917 6.7944 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0870 4.5453 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.4964 9.0435 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8660 -4.4276 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2754 -4.4276 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2754 -2.9321 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0752 7.5480 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1731 -3.6739 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2872 -5.9113 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0634 9.0553 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1848 -2.1667 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4801 -4.4158 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5942 -6.6531 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0036 -6.6531 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.3470 9.8089 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7564 9.8089 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4919 -1.4131 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7872 -3.6622 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.3352 11.3162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7446 11.3162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7990 -2.1549 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.5037 0.0942 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0281 12.0698 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.6187 12.0698 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.1061 -1.4013 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0163 13.5771 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -14.4131 -2.1431 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7093 14.3307 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -14.4249 -3.6268 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -15.7202 -1.3895 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6975 15.8380 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.4022 13.5888 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -15.7320 -4.3687 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -17.0273 -2.1314 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3904 16.5916 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.0951 14.3425 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -17.0390 -3.6151 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -15.7437 -5.8524 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.0833 15.8497 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3786 18.0988 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -18.3461 -4.3569 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2237 16.6034 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 2 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 4 8 1 0 0 0 0 + 5 9 1 0 0 0 0 + 5 10 1 0 0 0 0 + 6 11 1 0 0 0 0 + 6 12 2 0 0 0 0 + 7 13 1 0 0 0 0 + 8 14 2 0 0 0 0 + 10 15 2 0 0 0 0 + 16 10 1 1 0 0 0 + 11 17 2 0 0 0 0 + 13 18 1 0 0 0 0 + 13 19 2 0 0 0 0 + 16 20 1 0 0 0 0 + 16 21 1 0 0 0 0 + 19 22 1 0 0 0 0 + 20 23 1 0 0 0 0 + 21 24 1 0 0 0 0 + 22 25 1 0 0 0 0 + 23 26 1 0 0 0 0 + 23 27 1 1 0 0 0 + 24 28 1 1 0 0 0 + 25 29 1 0 0 0 0 + 25 30 1 0 0 0 0 + 25 31 1 1 0 0 0 + 26 32 1 6 0 0 0 + 33 29 1 1 0 0 0 + 30 34 1 0 0 0 0 + 35 32 1 6 0 0 0 + 33 36 1 0 0 0 0 + 33 37 1 0 0 0 0 + 34 38 2 0 0 0 0 + 34 39 1 0 0 0 0 + 35 40 1 0 0 0 0 + 35 41 1 0 0 0 0 + 36 42 1 0 0 0 0 + 37 43 1 0 0 0 0 + 40 44 1 0 0 0 0 + 41 45 1 0 0 0 0 + 42 46 1 0 0 0 0 + 42 47 1 6 0 0 0 + 44 48 1 0 0 0 0 + 44 49 1 1 0 0 0 + 46 50 1 6 0 0 0 + 48 51 1 1 0 0 0 + 52 50 1 6 0 0 0 + 53 51 1 1 0 0 0 + 52 54 1 0 0 0 0 + 52 55 1 0 0 0 0 + 53 56 1 0 0 0 0 + 53 57 1 0 0 0 0 + 54 58 1 0 0 0 0 + 55 59 2 0 0 0 0 + 56 60 1 0 0 0 0 + 57 61 2 0 0 0 0 + 58 62 1 0 0 0 0 + 58 63 1 1 0 0 0 + 60 64 1 0 0 0 0 + 60 65 1 6 0 0 0 + 62 66 2 0 0 0 0 + 64 67 2 0 0 0 0 + 7 11 1 0 0 0 0 + 12 15 1 0 0 0 0 + 14 19 1 0 0 0 0 + 24 26 1 0 0 0 0 + 43 46 1 0 0 0 0 + 45 48 1 0 0 0 0 + 59 62 1 0 0 0 0 + 61 64 1 0 0 0 0 +M END +> +Compound 20681 + +> +BIO-719 + +> +VINEOMYCIN B2 + +> +Products for Life Science + +> +80928-52-5 + +> +934.98 + +> +' + +> +MFCD09752773 + +$$$$ +Compound 20685 +Actelion Java MolfileCreator 1.0 + + 57 65 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2264 -1.4844 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.6982 -2.3020 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9435 -2.4027 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.8743 -3.5222 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5032 -2.8555 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9121 -3.5348 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.0441 -0.8806 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.6731 -1.6605 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8302 -4.3147 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.3208 -4.9186 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 3.4090 -3.6355 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2895 0.1258 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3334 -0.3396 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.0820 -2.2769 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2769 -4.7676 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.4530 -5.8872 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7487 -5.0947 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5412 -2.6417 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9562 1.4844 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0945 -1.1321 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.4656 0.6793 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4090 -3.7361 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.9058 -6.1388 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.4781 -7.3841 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0569 -5.7991 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5915 -1.0315 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4531 1.5724 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7299 -4.4783 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.4154 -5.9627 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5348 -7.5099 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4215 -6.2897 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7864 -8.0886 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0821 -7.2961 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.2582 0.3271 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1198 2.9310 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0633 -3.8493 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.8117 -6.2646 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.4278 -8.5037 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.5160 -8.5414 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.1196 -7.7489 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.2896 4.2141 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.5224 -4.8557 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.0067 -5.3085 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.8243 -7.7615 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1637 -9.8874 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7802 -9.9629 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.8998 -9.1704 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.4156 -5.7614 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.8181 -3.7990 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.1451 -8.5037 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4593 -10.6674 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0381 -10.6674 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.9879 -2.8430 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.4660 -7.7364 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.4911 -6.3904 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -9.7868 -8.4785 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 4 2 1 1 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 4 7 1 0 0 0 0 + 4 8 1 0 0 0 0 + 6 9 2 0 0 0 0 + 6 10 1 0 0 0 0 + 7 11 1 0 0 0 0 + 7 12 2 0 0 0 0 + 8 13 1 0 0 0 0 + 9 14 1 0 0 0 0 + 9 15 1 0 0 0 0 + 10 16 2 0 0 0 0 + 11 17 1 0 0 0 0 + 12 18 1 0 0 0 0 + 12 19 1 0 0 0 0 + 13 20 1 0 0 0 0 + 13 21 1 0 0 0 0 + 14 22 1 0 0 0 0 + 15 23 2 0 0 0 0 + 24 16 1 1 0 0 0 + 17 25 1 0 0 0 0 + 18 26 1 0 0 0 0 + 19 27 1 0 0 0 0 + 20 28 2 0 0 0 0 + 23 29 1 0 0 0 0 + 24 30 1 0 0 0 0 + 24 31 1 0 0 0 0 + 24 32 1 0 0 0 0 + 25 33 2 0 0 0 0 + 26 34 2 0 0 0 0 + 27 35 1 0 0 0 0 + 28 36 1 0 0 0 0 + 29 37 1 0 0 0 0 + 30 38 1 0 0 0 0 + 31 39 1 6 0 0 0 + 31 40 1 0 0 0 0 + 32 41 1 0 0 0 0 + 36 42 1 0 0 0 0 + 38 43 1 6 0 0 0 + 38 44 1 0 0 0 0 + 38 45 1 0 0 0 0 + 39 46 1 0 0 0 0 + 40 47 1 0 0 0 0 + 40 48 1 1 0 0 0 + 44 49 2 0 0 0 0 + 44 50 1 0 0 0 0 + 45 51 1 6 0 0 0 + 46 52 1 0 0 0 0 + 48 53 1 0 0 0 0 + 50 54 1 0 0 0 0 + 51 55 1 0 0 0 0 + 55 56 2 0 0 0 0 + 55 57 1 0 0 0 0 + 16 23 1 0 0 0 0 + 17 18 2 0 0 0 0 + 21 27 1 0 0 0 0 + 28 35 1 0 0 0 0 + 30 29 1 1 0 0 0 + 33 34 1 0 0 0 0 + 39 41 1 0 0 0 0 + 40 45 1 0 0 0 0 + 47 52 2 0 0 0 0 +M END +> +Compound 20685 + +> +BIO-802 + +> +VINORELBINE DITARTRATE SALT + +> +Products for Life Science + +> +125317-39-7 + +> +1079.12 + +> +'98% + +> +MFCD07367166 + +$$$$ +Compound 20693 +Actelion Java MolfileCreator 1.0 + + 38 40 0 0 1 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.6991 -1.2863 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5173 -2.1531 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0832 -0.7410 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4401 -3.3135 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.5512 -0.5872 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1.4820 0.6431 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.0133 -4.6837 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.7403 -2.5586 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0053 -0.8389 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8728 0.8808 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5865 1.6358 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7896 -6.1377 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5093 -4.5019 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.7543 -1.0486 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0406 -3.2856 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.4247 0.6012 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.6690 -1.5379 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.9713 -7.6058 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.7669 -3.0060 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 8.0252 -0.9507 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3562 -8.9479 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.2069 -3.3415 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.9759 -2.0692 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6285 -9.7309 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4055 -10.0664 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 8.6264 -5.1031 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.8109 -10.8774 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.6404 -6.5712 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2789 -10.9333 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.1084 -6.7249 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 8.2629 -7.9972 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6770 -11.3807 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.5079 -9.2695 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.9633 -10.6537 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.6683 -10.1643 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.4313 -10.2901 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4181 -9.2416 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 5 8 1 0 0 0 0 + 5 9 1 1 0 0 0 + 6 10 1 0 0 0 0 + 6 11 1 0 0 0 0 + 7 12 1 0 0 0 0 + 8 13 1 0 0 0 0 + 8 14 1 1 0 0 0 + 9 15 1 0 0 0 0 + 9 16 1 0 0 0 0 + 10 17 2 0 0 0 0 + 10 18 1 0 0 0 0 + 13 19 2 0 0 0 0 + 18 20 1 0 0 0 0 + 18 21 2 0 0 0 0 + 19 22 1 0 0 0 0 + 20 23 2 0 0 0 0 + 21 24 1 0 0 0 0 + 22 25 2 0 0 0 0 + 22 26 1 0 0 0 0 + 23 27 1 0 0 0 0 + 26 28 1 0 0 0 0 + 27 29 1 0 0 0 0 + 28 30 1 0 0 0 0 + 29 31 2 0 0 0 0 + 29 32 1 0 0 0 0 + 30 33 2 0 0 0 0 + 32 34 1 0 0 0 0 + 33 35 1 0 0 0 0 + 34 36 1 6 0 0 0 + 34 37 1 0 0 0 0 + 35 38 1 0 0 0 0 + 11 12 1 0 0 0 0 + 23 24 1 0 0 0 0 + 35 37 2 0 0 0 0 +M END +> +Compound 20693 + +> +BIO-425 + +> +VIRGINIAMYCIN M1 + +> +Products for Life Science + +> +21411-53-0 + +> +525.59 + +> +' + +> +MFCD00869411 + +$$$$ +Compound 20694 +Actelion Java MolfileCreator 1.0 + + 60 65 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.0711 1.5058 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3991 1.8497 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5533 1.6837 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6915 2.6441 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8931 2.3358 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9446 0.2490 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6520 3.8180 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6875 1.5296 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.9603 3.3911 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.8893 -0.8181 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.3911 -0.1067 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.9562 3.0828 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.1855 5.2290 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1578 2.5137 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 4.6242 4.7428 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2806 -2.2528 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7824 -1.5414 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.2605 3.8417 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.6440 4.9681 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2330 6.7348 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 4.8140 6.2368 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7981 3.8298 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.7271 -2.6085 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.2842 5.3594 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.5648 3.1065 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.7943 8.1814 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5175 7.7189 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.1894 6.8178 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.1735 4.4108 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.8691 3.8654 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -7.5767 1.6244 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.9168 9.4026 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.1460 8.8691 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.9048 8.2525 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7587 9.0232 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.3632 5.9048 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3474 3.4978 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -10.1733 3.1303 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.2961 0.8893 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -8.8809 0.8893 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9721 10.4935 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.6956 10.2682 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.4147 8.0628 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.6204 10.0192 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 4.9088 9.9836 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.1852 1.6481 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2609 10.6832 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5374 11.5250 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2213 10.6002 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.3793 11.2642 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.6480 11.4776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2134 12.1890 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.6244 12.7108 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5414 12.0705 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7981 12.4380 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2370 12.0112 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.5372 13.9320 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9761 13.5052 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.1263 14.4656 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 4 7 1 0 0 0 0 + 5 8 1 0 0 0 0 + 5 9 1 0 0 0 0 + 6 10 1 0 0 0 0 + 7 11 2 0 0 0 0 + 7 12 1 0 0 0 0 + 8 13 1 0 0 0 0 + 8 14 1 0 0 0 0 + 10 15 2 0 0 0 0 + 10 16 1 0 0 0 0 + 11 17 1 0 0 0 0 + 12 18 2 0 0 0 0 + 13 19 1 0 0 0 0 + 14 20 2 0 0 0 0 + 14 21 1 0 0 0 0 + 16 22 1 0 0 0 0 + 16 23 1 0 0 0 0 + 17 24 2 0 0 0 0 + 19 25 2 0 0 0 0 + 19 26 1 0 0 0 0 + 21 27 1 0 0 0 0 + 22 28 1 0 0 0 0 + 22 29 1 0 0 0 0 + 23 30 1 0 0 0 0 + 26 31 2 0 0 0 0 + 26 32 1 0 0 0 0 + 27 33 1 0 0 0 0 + 27 34 1 0 0 0 0 + 28 35 2 0 0 0 0 + 28 36 1 0 0 0 0 + 29 37 1 0 0 0 0 + 30 38 2 0 0 0 0 + 31 39 1 0 0 0 0 + 32 40 1 0 0 0 0 + 32 41 2 0 0 0 0 + 33 42 2 0 0 0 0 + 33 43 1 0 0 0 0 + 34 44 1 0 0 0 0 + 36 45 1 0 0 0 0 + 36 46 1 0 0 0 0 + 39 47 2 0 0 0 0 + 43 48 1 0 0 0 0 + 43 49 1 0 0 0 0 + 45 50 1 0 0 0 0 + 45 51 1 0 0 0 0 + 46 52 1 0 0 0 0 + 48 53 1 0 0 0 0 + 49 54 1 0 0 0 0 + 50 55 2 0 0 0 0 + 52 56 2 0 0 0 0 + 52 57 1 0 0 0 0 + 56 58 1 0 0 0 0 + 57 59 2 0 0 0 0 + 58 60 2 0 0 0 0 + 18 24 1 0 0 0 0 + 30 37 1 0 0 0 0 + 41 47 1 0 0 0 0 + 48 50 1 0 0 0 0 + 53 54 1 0 0 0 0 + 59 60 1 0 0 0 0 +M END +> +Compound 20694 + +> +BIO-1003 + +> +VIRGINIAMYCIN S1 + +> +Products for Life Science + +> +23152-29-6 + +> +823.9 + +> +' + +> +MFCD00864857 + +$$$$ +Compound 20697 +Actelion Java MolfileCreator 1.0 + + 33 34 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2839 0.7539 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5678 0.0118 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2721 2.2616 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8518 0.7656 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5561 -1.4724 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5561 3.0154 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0353 3.0154 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8400 2.2734 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1357 0.0236 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8400 -2.2145 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5443 4.5232 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3428 2.2734 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1239 3.0272 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1239 -1.4606 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6503 3.0272 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9578 2.2851 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6621 4.5349 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2652 3.0390 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5727 2.2969 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8802 3.0508 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1877 2.3087 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8920 4.5585 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4952 3.0626 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.8026 2.3205 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.1101 3.0743 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -14.4176 2.3323 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.1219 4.5821 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -15.7251 3.0861 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -17.0325 2.3440 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -18.3400 3.0979 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -18.3518 4.6056 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -19.6475 2.3558 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 2 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 4 8 1 0 0 0 0 + 5 9 1 0 0 0 0 + 5 10 1 0 0 0 0 + 6 11 2 0 0 0 0 + 7 12 1 0 0 0 0 + 8 13 1 0 0 0 0 + 9 14 2 0 0 0 0 + 10 15 2 0 0 0 0 + 13 16 2 0 0 0 0 + 16 17 1 0 0 0 0 + 16 18 1 0 0 0 0 + 17 19 1 0 0 0 0 + 19 20 1 0 0 0 0 + 20 21 1 0 0 0 0 + 21 22 1 0 0 0 0 + 21 23 1 6 0 0 0 + 22 24 1 0 0 0 0 + 24 25 1 0 0 0 0 + 25 26 1 0 0 0 0 + 26 27 1 0 0 0 0 + 26 28 1 6 0 0 0 + 27 29 1 0 0 0 0 + 29 30 1 0 0 0 0 + 30 31 1 0 0 0 0 + 31 32 1 0 0 0 0 + 31 33 1 0 0 0 0 + 7 9 1 0 0 0 0 + 11 15 1 0 0 0 0 +M END +> +Compound 20697 + +> +BIO-1005 + +> +VITAMIN K1 + +> +Products for Life Science + +> +84-80-0 + +> +450.7 + +> +' + +> +MFCD00214063 + +$$$$ +Compound 20716 +Actelion Java MolfileCreator 1.0 + + 11 12 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3095 -0.7432 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6189 0.0118 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3213 -2.2296 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9284 -0.7314 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6307 -2.9729 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2379 0.0236 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9402 -2.2178 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.9493 -4.4239 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -5.0609 -3.2088 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.4475 -4.5655 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 5 7 2 0 0 0 0 + 5 8 1 0 0 0 0 + 6 9 1 0 0 0 0 + 8 10 1 0 0 0 0 + 9 11 1 0 0 0 0 + 6 8 2 0 0 0 0 + 10 11 2 0 0 0 0 +M END +> +Compound 20716 + +> +BIO-1006 + +> +XANTHINE + +> +Products for Life Science + +> +69-89-6 + +> +152.11 + +> +' + +> +MFCD00078453 + +$$$$ +Compound 20727 +Actelion Java MolfileCreator 1.0 + + 44 47 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + 0.1420 -1.4795 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.1657 1.5031 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.4795 0.1657 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5031 -0.1420 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.4027 1.0889 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1541 -1.4676 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7990 2.4737 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9058 0.9469 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.6336 -1.6452 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.3196 2.6394 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6985 3.7046 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.5331 -0.4143 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2609 -3.0063 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0362 -0.5563 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -5.7403 -3.3022 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5152 -4.2964 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.9357 0.6746 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9060 -4.7816 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.5331 -5.3971 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -2.0357 -4.4384 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2198 -5.5273 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.1599 -3.2075 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4321 -5.7995 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2316 -7.0186 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -8.5336 -4.7580 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.7162 -1.8819 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3196 -3.3495 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.0473 -5.9415 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.8473 -5.5036 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8995 -0.6510 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9232 -4.7106 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.6510 -7.3027 -0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + -11.1611 -4.7343 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.8592 -6.9949 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.4027 -4.8527 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0121 -6.6754 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7338 -7.9063 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2546 -8.6638 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -12.4749 -5.4799 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.1729 -7.7406 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2785 -3.6217 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0063 -6.2138 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -12.4867 -6.9713 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 1 3 2 0 0 0 0 + 1 4 1 0 0 0 0 + 1 5 1 0 0 0 0 + 5 6 2 0 0 0 0 + 5 7 1 0 0 0 0 + 6 8 1 0 0 0 0 + 6 9 1 0 0 0 0 + 7 10 2 0 0 0 0 + 8 11 2 0 0 0 0 + 8 12 1 0 0 0 0 + 9 13 2 0 0 0 0 + 10 14 1 0 0 0 0 + 13 15 1 0 0 0 0 + 14 16 2 0 0 0 0 + 14 17 1 0 0 0 0 + 15 18 1 0 0 0 0 + 16 19 1 0 0 0 0 + 17 20 1 0 0 0 0 + 17 21 1 0 0 0 0 + 19 22 1 0 0 0 0 + 21 23 2 0 0 0 0 + 21 24 1 0 0 0 0 + 22 25 2 0 0 0 0 + 22 26 1 0 0 0 0 + 23 27 1 0 0 0 0 + 23 28 1 0 0 0 0 + 24 29 2 0 0 0 0 + 26 30 1 0 0 0 0 + 27 31 1 0 0 0 0 + 28 32 2 0 0 0 0 + 29 33 1 0 0 0 0 + 30 34 2 0 0 0 0 + 30 35 1 0 0 0 0 + 32 36 1 0 0 0 0 + 33 37 2 0 0 0 0 + 33 38 2 0 0 0 0 + 33 39 1 0 0 0 0 + 34 40 1 0 0 0 0 + 35 41 2 0 0 0 0 + 36 42 2 0 0 0 0 + 36 43 1 0 0 0 0 + 40 44 2 0 0 0 0 + 10 13 1 0 0 0 0 + 19 20 2 0 0 0 0 + 29 32 1 0 0 0 0 + 41 44 1 0 0 0 0 +M CHG 5 8 1 12 -1 14 1 36 1 43 -1 +M END +> +Compound 20727 + +> +BIO-1007 + +> +XTT SODIUM SALT + +> +Products for Life Science + +> +111072-31-2 + +> +673.53 + +> +' + +> +MFCD00083517 + +$$$$ +Compound 20743 +Actelion Java MolfileCreator 1.0 + + 23 24 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0118 -1.4873 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3221 -2.2310 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2749 -2.2310 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6323 -1.4755 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2631 -3.7183 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5615 -1.4755 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6441 0.0354 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9426 -2.2192 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0472 -4.4620 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5497 -4.4620 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5497 0.0354 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8482 -2.2192 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9544 0.7909 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.8364 -3.7065 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2394 0.7909 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9662 2.3018 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1230 -4.4502 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2276 2.3018 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6796 3.0573 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0826 3.0573 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6914 4.5682 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3929 2.3136 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 2 3 1 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 2 0 0 0 0 + 4 7 1 0 0 0 0 + 5 8 1 0 0 0 0 + 5 9 1 1 0 0 0 + 6 10 1 0 0 0 0 + 6 11 1 0 0 0 0 + 7 12 1 0 0 0 0 + 7 13 2 0 0 0 0 + 8 14 1 0 0 0 0 + 11 15 2 0 0 0 0 + 12 16 2 0 0 0 0 + 14 17 1 0 0 0 0 + 15 18 1 0 0 0 0 + 16 19 1 0 0 0 0 + 17 20 1 0 0 0 0 + 19 21 1 0 0 0 0 + 20 22 2 0 0 0 0 + 20 23 1 0 0 0 0 + 13 15 1 0 0 0 0 + 21 23 1 0 0 0 0 +M END +> +Compound 20743 + +> +BIO-1009 + +> +ZEARALENONE + +> +Products for Life Science + +> +17924-92-4 + +> +318.37 + +> +' + +> +MFCD00133085 + +$$$$ +Compound 20744 +Actelion Java MolfileCreator 1.0 + + 16 17 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3057 0.7529 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6115 0.0118 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9172 0.7646 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6232 -1.4704 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2230 0.0235 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5287 0.7764 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8344 0.0353 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8462 -1.4469 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1402 0.7881 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1519 -2.1880 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.4578 2.2586 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4459 0.0471 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4577 -1.4351 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -10.9517 2.4233 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.5634 1.0587 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 2 3 1 0 0 0 0 + 3 4 2 0 0 0 0 + 3 5 1 0 0 0 0 + 4 6 1 0 0 0 0 + 6 7 1 0 0 0 0 + 7 8 1 0 0 0 0 + 8 9 2 0 0 0 0 + 8 10 1 0 0 0 0 + 9 11 1 0 0 0 0 + 10 12 1 0 0 0 0 + 10 13 2 0 0 0 0 + 11 14 2 0 0 0 0 + 12 15 2 0 0 0 0 + 13 16 1 0 0 0 0 + 13 14 1 0 0 0 0 + 15 16 1 0 0 0 0 +M END +> +Compound 20744 + +> +BIO-428 + +> +"ZEATIN, trans ISOMER" + +> +Products for Life Science + +> +1637-39-4 + +> +219.25 + +> +'>99% trans isomer + +> +MFCD00213654 + +$$$$ +Compound 20745 +Actelion Java MolfileCreator 1.0 + + 25 27 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4974 -0.1415 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.6013 -1.3559 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5114 0.9786 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.8157 -1.5917 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5188 -2.3463 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0516 -1.6507 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2166 2.4524 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.0088 0.8371 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.1952 -2.1930 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.3773 -3.8201 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0420 -0.5306 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9315 3.2070 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5254 3.2070 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6337 2.2166 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9432 4.7162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5372 4.7162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2520 5.4708 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.8459 5.4708 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.1547 4.7280 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.4634 5.4826 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.7722 4.7398 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.0809 5.4944 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -8.7840 3.2542 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.3897 4.7516 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 1 3 1 0 0 0 0 + 2 4 1 1 0 0 0 + 2 5 1 0 0 0 0 + 3 6 1 0 0 0 0 + 3 7 1 1 0 0 0 + 4 8 1 0 0 0 0 + 4 9 1 0 0 0 0 + 5 10 1 6 0 0 0 + 6 11 1 6 0 0 0 + 7 12 1 0 0 0 0 + 8 13 2 0 0 0 0 + 8 14 1 0 0 0 0 + 9 15 2 0 0 0 0 + 13 16 1 0 0 0 0 + 14 17 2 0 0 0 0 + 16 18 2 0 0 0 0 + 17 19 1 0 0 0 0 + 19 20 1 0 0 0 0 + 20 21 1 0 0 0 0 + 21 22 2 0 0 0 0 + 22 23 1 0 0 0 0 + 22 24 1 0 0 0 0 + 23 25 1 0 0 0 0 + 5 6 1 0 0 0 0 + 14 15 1 0 0 0 0 + 17 18 1 0 0 0 0 +M END +> +Compound 20745 + +> +BIO-429 + +> +"ZEATIN RIBOSIDE, trans ISOMER" + +> +Products for Life Science + +> +6025-53-2 + +> +351.37 + +> +'>98% HPLC + +> +MFCD00036809 + +$$$$ +Compound 20751 +Actelion Java MolfileCreator 1.0 + + 31 33 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0 + 0.7415 -1.2829 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7533 1.3065 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2829 0.7533 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3065 -0.7415 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6129 0.0118 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3182 -2.2245 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9194 -0.7297 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6247 -2.9660 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2258 0.0235 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.9312 -2.2127 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5323 -0.7180 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -5.2376 -2.9542 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8388 0.0353 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1452 -0.7062 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8505 1.5419 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -10.4517 0.0471 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5676 2.2951 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1570 2.2951 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7581 -0.6944 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -6.5794 3.8017 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.1688 3.8017 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.0646 0.0588 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7699 -2.1774 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.8858 4.5550 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.0764 1.5654 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -14.3711 -0.6827 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -13.0764 -2.9189 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.7935 2.3187 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -14.3828 2.3187 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -14.3828 -2.1657 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 2 0 0 0 0 + 1 3 2 0 0 0 0 + 1 4 1 0 0 0 0 + 1 5 1 0 0 0 0 + 5 6 2 0 0 0 0 + 5 7 1 0 0 0 0 + 6 8 1 0 0 0 0 + 7 9 2 0 0 0 0 + 8 10 1 0 0 0 0 + 8 11 2 0 0 0 0 + 10 12 2 0 0 0 0 + 11 13 1 0 0 0 0 + 12 14 1 0 0 0 0 + 14 15 2 0 0 0 0 + 14 16 1 0 0 0 0 + 15 17 1 0 0 0 0 + 16 18 2 0 0 0 0 + 16 19 1 0 0 0 0 + 17 20 1 0 0 0 0 + 18 21 1 0 0 0 0 + 19 22 2 0 0 0 0 + 20 23 2 0 0 0 0 + 20 24 1 0 0 0 0 + 21 25 2 0 0 0 0 + 23 26 1 0 0 0 0 + 23 27 1 0 0 0 0 + 24 28 2 0 0 0 0 + 26 29 2 0 0 0 0 + 26 30 1 0 0 0 0 + 27 31 2 0 0 0 0 + 9 11 1 0 0 0 0 + 22 25 1 0 0 0 0 + 28 31 1 0 0 0 0 +M END +> +Compound 20751 + +> +BIO-700 + +> +ZINCON + +> +Products for Life Science + +> +62625-22-3 + +> + + +> +' + +> +MFCD00007507 + +$$$$ \ No newline at end of file diff --git a/INCHI-1-TEST/tests/test_unit/fixtures/test_mols_2.sdf b/INCHI-1-TEST/tests/test_unit/fixtures/test_mols_2.sdf new file mode 100644 index 00000000..4e335bd9 --- /dev/null +++ b/INCHI-1-TEST/tests/test_unit/fixtures/test_mols_2.sdf @@ -0,0 +1,320 @@ +Compound 20652 +Actelion Java MolfileCreator 1.0 + +101110 0 0 0 0 0 0 0 0999 V2000 + 0.0000 -0.0000 -0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0153 1.5192 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2737 2.2865 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3351 2.2865 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9029 0.4297 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2277 3.8057 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3504 3.8057 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8875 -1.0589 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0614 4.5730 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3147 3.4528 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1766 -1.7955 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5678 -1.7955 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.8518 4.8799 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6344 2.7162 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4656 -1.0282 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1612 -3.2840 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5524 -3.2840 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9541 3.4835 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6498 1.2277 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4503 0.4911 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4503 -4.0206 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8415 -4.0206 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7673 -4.0206 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2739 2.7469 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -5.9695 0.4911 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3607 0.4911 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1305 1.2583 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7393 1.2583 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4349 -5.5091 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.0870 -3.2533 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7826 -5.5091 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -7.2892 1.2583 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -8.5936 3.5142 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.3761 -0.9975 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1152 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0283 0.5218 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7240 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7240 -6.2457 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1152 -6.2457 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1024 -1.7341 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1024 -6.2457 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5064 -6.2457 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -8.6090 5.0334 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -9.9133 2.7776 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6958 -1.7341 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.4042 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8568 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3174 1.2890 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0130 3.5449 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0130 -5.4784 -0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7086 -7.7342 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2686 -7.6422 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8133 -0.9668 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.4911 -7.7342 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -9.9287 5.8007 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.2331 3.5449 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7111 -3.2226 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3889 5.0641 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7955 5.0641 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 9.6064 0.5524 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3020 2.8083 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3889 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7801 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8287 -8.4708 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -11.2484 5.0641 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -12.5528 2.8083 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4221 -3.9592 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -6.0309 -3.9592 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 10.8955 1.3197 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 9.5911 3.5756 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3735 -9.9594 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.7315 -7.8724 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8415 -9.7292 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -1.0282 -10.0054 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1484 -7.7036 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.8801 2.8390 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.1845 0.5831 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 10.3277 4.8953 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + 8.8238 4.8953 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.6626 -10.6960 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0538 -10.6960 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1484 -10.6960 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4681 -8.4402 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 12.1692 3.6062 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.0385 -12.1845 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1637 -12.1845 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4681 -9.9287 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3275 -12.9211 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7187 -12.9211 -0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4835 -12.9211 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8747 -12.9211 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.7879 -10.6653 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3990 -12.1538 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.8032 -12.1538 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4988 -14.4096 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8901 -14.4096 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.3836 -10.6346 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2098 -15.1462 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5806 -10.1282 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5831 -9.7906 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2251 -16.6348 -0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 2 3 2 0 0 0 0 + 2 4 1 0 0 0 0 + 3 5 1 0 0 0 0 + 3 6 1 0 0 0 0 + 4 7 2 0 0 0 0 + 5 8 1 0 0 0 0 + 6 9 2 0 0 0 0 + 7 10 1 0 0 0 0 + 8 11 2 0 0 0 0 + 8 12 1 0 0 0 0 + 10 13 1 6 0 0 0 + 10 14 1 0 0 0 0 + 11 15 1 0 0 0 0 + 11 16 1 0 0 0 0 + 12 17 2 0 0 0 0 + 14 18 1 6 0 0 0 + 14 19 1 0 0 0 0 + 20 15 1 6 0 0 0 + 16 21 1 0 0 0 0 + 16 22 2 0 0 0 0 + 17 23 1 0 0 0 0 + 18 24 1 0 0 0 0 + 19 25 2 0 0 0 0 + 19 26 1 0 0 0 0 + 20 27 1 0 0 0 0 + 20 28 1 0 0 0 0 + 21 29 1 0 0 0 0 + 23 30 1 6 0 0 0 + 23 31 1 0 0 0 0 + 24 32 2 0 0 0 0 + 24 33 1 0 0 0 0 + 26 34 1 0 0 0 0 + 27 35 1 0 0 0 0 + 28 36 1 1 0 0 0 + 28 37 1 0 0 0 0 + 29 38 2 0 0 0 0 + 29 39 1 0 0 0 0 + 30 40 1 0 0 0 0 + 31 41 2 0 0 0 0 + 31 42 1 0 0 0 0 + 33 43 1 1 0 0 0 + 33 44 1 0 0 0 0 + 34 45 1 6 0 0 0 + 35 46 1 0 0 0 0 + 35 47 1 0 0 0 0 + 48 36 1 1 0 0 0 + 37 49 1 6 0 0 0 + 38 50 1 0 0 0 0 + 38 51 1 0 0 0 0 + 39 52 2 0 0 0 0 + 40 53 2 0 0 0 0 + 54 42 1 1 0 0 0 + 43 55 1 0 0 0 0 + 44 56 1 0 0 0 0 + 45 57 1 0 0 0 0 + 46 58 1 1 0 0 0 + 47 59 1 0 0 0 0 + 48 60 1 0 0 0 0 + 48 61 1 0 0 0 0 + 51 62 2 0 0 0 0 + 54 63 1 0 0 0 0 + 54 64 1 0 0 0 0 + 56 65 1 0 0 0 0 + 56 66 1 0 0 0 0 + 57 67 2 0 0 0 0 + 57 68 1 0 0 0 0 + 60 69 1 0 0 0 0 + 61 70 1 0 0 0 0 + 62 71 1 0 0 0 0 + 63 72 2 0 0 0 0 + 63 73 1 0 0 0 0 + 64 74 2 0 0 0 0 + 64 75 1 0 0 0 0 + 69 76 1 0 0 0 0 + 69 77 1 6 0 0 0 + 70 78 1 6 0 0 0 + 70 79 1 0 0 0 0 + 71 80 1 1 0 0 0 + 71 81 1 0 0 0 0 + 74 82 1 0 0 0 0 + 75 83 2 0 0 0 0 + 76 84 1 6 0 0 0 + 81 85 1 0 0 0 0 + 82 86 1 0 0 0 0 + 82 87 2 0 0 0 0 + 85 88 2 0 0 0 0 + 85 89 1 0 0 0 0 + 86 90 2 0 0 0 0 + 86 91 1 0 0 0 0 + 87 92 1 0 0 0 0 + 89 93 1 0 0 0 0 + 90 94 1 0 0 0 0 + 90 95 1 0 0 0 0 + 91 96 2 0 0 0 0 + 93 97 1 1 0 0 0 + 95 98 2 0 0 0 0 + 97 99 2 0 0 0 0 + 97100 1 0 0 0 0 + 98101 1 0 0 0 0 + 7 9 1 0 0 0 0 + 17 22 1 0 0 0 0 + 34 40 1 0 0 0 0 + 37 46 1 0 0 0 0 + 52 62 1 0 0 0 0 + 70 76 1 0 0 0 0 + 81 73 1 1 0 0 0 + 83 87 1 0 0 0 0 + 91 93 1 0 0 0 0 + 96 98 1 0 0 0 0 +M END +> +Compound 20652 + +> +BIO-423 + +> +VANCOMYCIN HYDROCHLORIDE + +> +Products for Life Science + +> +1404-93-9 + +> +1485.7 + +> +'93.5% (Vanomycin base) + +> +MFCD03613611 + +$$$$ +caffeine +APtclcactv08142501153D 0 0.00000 0.00000 + + 24 25 0 0 0 0 0 0 0 0999 V2000 + 1.3120 -1.0479 0.0025 N 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2465 -2.1762 0.0031 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7906 0.2081 0.0010 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9938 0.3838 0.0002 O 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9714 1.2767 -0.0001 N 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5339 2.6294 -0.0017 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4026 1.0989 -0.0001 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4446 1.9342 -0.0010 N 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5608 1.2510 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2862 -0.0680 0.0015 N 0 0 0 0 0 0 0 0 0 0 0 0 + -3.2614 -1.1612 0.0029 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9114 -0.1939 0.0014 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0163 -1.2853 -0.0022 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.4380 -2.4279 -0.0068 O 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2697 -1.8004 0.0022 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0830 -2.7828 0.8938 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0821 -2.7846 -0.8862 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.6223 2.5703 -0.0019 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1987 3.1611 -0.8923 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1990 3.1632 0.8877 H 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5520 1.6797 -0.0001 H 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5037 -1.4333 -1.0244 H 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8389 -2.0244 0.5173 H 0 0 0 0 0 0 0 0 0 0 0 0 + -4.1672 -0.8395 0.5168 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 1 3 1 0 0 0 0 + 3 4 2 0 0 0 0 + 3 5 1 0 0 0 0 + 5 6 1 0 0 0 0 + 5 7 1 0 0 0 0 + 7 8 1 0 0 0 0 + 8 9 2 0 0 0 0 + 9 10 1 0 0 0 0 + 10 11 1 0 0 0 0 + 10 12 1 0 0 0 0 + 7 12 2 0 0 0 0 + 12 13 1 0 0 0 0 + 1 13 1 0 0 0 0 + 13 14 2 0 0 0 0 + 2 15 1 0 0 0 0 + 2 16 1 0 0 0 0 + 2 17 1 0 0 0 0 + 6 18 1 0 0 0 0 + 6 19 1 0 0 0 0 + 6 20 1 0 0 0 0 + 9 21 1 0 0 0 0 + 11 22 1 0 0 0 0 + 11 23 1 0 0 0 0 + 11 24 1 0 0 0 0 +M END +> +caffeine + +> +XXXX + +> +CAFFEINE + +> +something something + +> + + +> + + +> +' + +> +??? + +$$$$ \ No newline at end of file diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 912eed02..abf7ec25 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -1,12 +1,212 @@ #include #include +#include +#include +#include +#include extern "C" { +#include "../../../INCHI-1-SRC/INCHI_BASE/src/ichitime.h" #include "../../../INCHI-1-SRC/INCHI_BASE/src/ichi_io.h" #include "../../../INCHI-1-SRC/INCHI_BASE/src/ichimain.h" } +static char* make_arg(const char* s) { + size_t len = strlen(s) + 1; + char* p = (char*)malloc(len); + memcpy(p, s, len); + return p; +} + +// TEST(ichimain_testing, test_ProcessSingleInputFile) +// { + + +// const char *test_file_2mols = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/test_mol2.sdf"; + +// char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; +// char *tmpd = mkdtemp(tmpl); +// ASSERT_NE(tmpd, nullptr); + +// std::string dst_path = std::string(tmpd) + "/caffeine.mol"; +// std::ifstream src(test_file_caffeine, std::ios::binary); +// ASSERT_TRUE(src.is_open()); +// std::ofstream dst(dst_path, std::ios::binary); +// ASSERT_TRUE(dst.is_open()); +// dst << src.rdbuf(); +// src.close(); +// dst.close(); + +// int argc = 2; +// char *a0 = make_arg("test_ichimain"); +// char *a1 = make_arg(dst_path.c_str()); +// char* argv[] = { a0, a1 }; + + + +// } + +TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) +{ + + const char *filename_caffeine = "caffeine.mol"; + + const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char *tmpd = mkdtemp(tmpl); + ASSERT_NE(tmpd, nullptr); + + std::string src_path = std::string(path_fixtures) + "/" + filename_caffeine; + std::string dst_path = std::string(tmpd) + "/" + filename_caffeine; + std::ifstream src(src_path, std::ios::binary); + ASSERT_TRUE(src.is_open()); + std::ofstream dst(dst_path, std::ios::binary); + ASSERT_TRUE(dst.is_open()); + dst << src.rdbuf(); + src.close(); + dst.close(); + + int argc = 2; + char *a0 = make_arg("test_ichimain"); + char *a1 = make_arg(dst_path.c_str()); + char* argv[] = { a0, a1 }; + + // int ProcessSingleInputFile(int argc, char* argv[]) + + int result = ProcessSingleInputFile(argc, argv); + + // Assert the expected result + EXPECT_EQ(result, 0); + + free(a0); + free(a1); + + std::string out_txt = dst_path + ".txt"; + std::string out_log = dst_path + ".log"; + std::string out_prb = dst_path + ".prb"; + + struct stat st; + // check existence and non-zero size + ASSERT_EQ(stat(out_txt.c_str(), &st), 0); + EXPECT_GT(st.st_size, 0); + ASSERT_EQ(stat(out_log.c_str(), &st), 0); + EXPECT_GT(st.st_size, 0); + ASSERT_EQ(stat(out_prb.c_str(), &st), 0); + // EXPECT_GT(st.st_size, 0); + EXPECT_EQ(st.st_size, 0); + + std::ifstream txt_in(out_txt); + ASSERT_TRUE(txt_in.is_open()); + std::string line; + std::string found_inchi; + while (std::getline(txt_in, line)) { + // trim leading/trailing whitespace + size_t start = line.find_first_not_of(" \t\r\n"); + if (start == std::string::npos) continue; + size_t end = line.find_last_not_of(" \t\r\n"); + std::string trimmed = line.substr(start, end - start + 1); + if (trimmed.rfind("InChI=", 0) == 0) { + found_inchi = trimmed; + break; + } + } + txt_in.close(); + + const std::string expected_inchi = "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3"; + ASSERT_FALSE(found_inchi.empty()); + EXPECT_EQ(found_inchi, expected_inchi); + + // cleanup + unlink(out_txt.c_str()); + unlink(out_log.c_str()); + unlink(out_prb.c_str()); + unlink(dst_path.c_str()); + rmdir(tmpd); +} +TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) +{ + + const char *filename_2mols = "test_mols_2.sdf"; + + const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char *tmpd = mkdtemp(tmpl); + ASSERT_NE(tmpd, nullptr); + + std::string src_path = std::string(path_fixtures) + "/" + filename_2mols; + std::string dst_path = std::string(tmpd) + "/" + filename_2mols; + std::ifstream src(src_path, std::ios::binary); + ASSERT_TRUE(src.is_open()); + std::ofstream dst(dst_path, std::ios::binary); + ASSERT_TRUE(dst.is_open()); + dst << src.rdbuf(); + src.close(); + dst.close(); + + int argc = 2; + char *a0 = make_arg("test_ichimain"); + char *a1 = make_arg(dst_path.c_str()); + char* argv[] = { a0, a1 }; + + // int ProcessSingleInputFile(int argc, char* argv[]) + + int result = ProcessSingleInputFile(argc, argv); + + // Assert the expected result + EXPECT_EQ(result, 0); + + free(a0); + free(a1); + + std::string out_txt = dst_path + ".txt"; + std::string out_log = dst_path + ".log"; + std::string out_prb = dst_path + ".prb"; + + struct stat st; + // check existence and non-zero size + ASSERT_EQ(stat(out_txt.c_str(), &st), 0); + EXPECT_GT(st.st_size, 0); + ASSERT_EQ(stat(out_log.c_str(), &st), 0); + EXPECT_GT(st.st_size, 0); + ASSERT_EQ(stat(out_prb.c_str(), &st), 0); + // EXPECT_GT(st.st_size, 0); + EXPECT_EQ(st.st_size, 0); + + std::ifstream txt_in(out_txt); + ASSERT_TRUE(txt_in.is_open()); + std::string line; + std::vector found_inchis; + while (std::getline(txt_in, line)) { + // trim leading/trailing whitespace + size_t start = line.find_first_not_of(" \t\r\n"); + if (start == std::string::npos) continue; + size_t end = line.find_last_not_of(" \t\r\n"); + std::string trimmed = line.substr(start, end - start + 1); + if (trimmed.rfind("InChI=", 0) == 0) { + found_inchis.push_back(trimmed); + } + } + txt_in.close(); + + std::vector expected_inchis = { + "InChI=1S/C66H75Cl2N9O24/c1-23(2)12-34(71-5)58(88)76-49-51(83)26-7-10-38(32(67)14-26)97-40-16-28-17-41(55(40)101-65-56(54(86)53(85)42(22-78)99-65)100-44-21-66(4,70)57(87)24(3)96-44)98-39-11-8-27(15-33(39)68)52(84)50-63(93)75-48(64(94)95)31-18-29(79)19-37(81)45(31)30-13-25(6-9-36(30)80)46(60(90)77-50)74-61(91)47(28)73-59(89)35(20-43(69)82)72-62(49)92/h6-11,13-19,23-24,34-35,42,44,46-54,56-57,65,71,78-81,83-87H,12,20-22,70H2,1-5H3,(H2,69,82)(H,72,92)(H,73,89)(H,74,91)(H,75,93)(H,76,88)(H,77,90)(H,94,95)/t24-,34+,35-,42?,44-,46+,47+,48-,49+,50-,51+,52+,53+,54-,56+,57+,65-,66-/m0/s1", + "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3" + }; + + ASSERT_EQ(found_inchis.size(), expected_inchis.size()); + for (size_t i = 0; i < expected_inchis.size(); ++i) { + EXPECT_EQ(found_inchis[i], expected_inchis[i]); + } + + // cleanup + unlink(out_txt.c_str()); + unlink(out_log.c_str()); + unlink(out_prb.c_str()); + unlink(dst_path.c_str()); + rmdir(tmpd); +} + TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) { @@ -86,24 +286,41 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) // long *num_err, // int output_error_inchi ); - tagINCHI_CLOCK *ic; - STRUCT_DATA *sd; - INPUT_PARMS *ip; + INCHI_CLOCK ic = {}; + memset(&ic, 0, sizeof(ic)); + + STRUCT_DATA *sd = new STRUCT_DATA; + INPUT_PARMS *ip = new INPUT_PARMS; + char *szTitle; INCHI_IOSTREAM *inp_file; - INCHI_IOSTREAM *plog; - INCHI_IOSTREAM *pout; - INCHI_IOSTREAM *pprb; + INCHI_IOSTREAM *plog = new INCHI_IOSTREAM; + INCHI_IOSTREAM *pout = new INCHI_IOSTREAM; + INCHI_IOSTREAM *pprb = new INCHI_IOSTREAM; ORIG_ATOM_DATA orig_at_data = {}; - long *num_inp; - STRUCT_FPTRS *pStructPtrs; - int *nRet; - int *have_err_in_GetOneStructure; + long *num_inp = new long(0); + + STRUCT_FPTRS *pStructPtrs = NULL; + + int *nRet = 0; + int *have_err_in_GetOneStructure = 0; long *num_err; int output_error_inchi; + + memset(ip, 0, sizeof(*ip)); + ip->last_struct_number = 1; + ip->nInputType = INPUT_MOLFILE; + + inchi_ios_init(pout, INCHI_IOS_TYPE_STRING, nullptr); + inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); + inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); + + // PrintInputParms(plog, ip); + // inchi_ios_flush2(plog, stderr); + // int ret = GetTheNextRecordOfInputFile( - // ic, + // &ic, // sd, // ip, // szTitle, @@ -119,7 +336,7 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) // num_err, // output_error_inchi); - // EXPECT_EQ(ret, 18); + // EXPECT_EQ(ret, DO_NEXT_STEP); inchi_ios_free_str(&input_stream); FreeOrigAtData(&orig_at_data); From 4948da70f96996b836c8aa2d841973f9d17304ea Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 8 Dec 2025 15:10:53 +0000 Subject: [PATCH 22/41] Added prototype for ProcessMultipleInputFiles --- .../tests/test_unit/fixtures/naloxon.mol | 99 +++++++++++++++++++ .../tests/test_unit/test_ichimain.cpp | 26 +---- _deps/googletest-src | 1 + 3 files changed, 105 insertions(+), 21 deletions(-) create mode 100644 INCHI-1-TEST/tests/test_unit/fixtures/naloxon.mol create mode 160000 _deps/googletest-src diff --git a/INCHI-1-TEST/tests/test_unit/fixtures/naloxon.mol b/INCHI-1-TEST/tests/test_unit/fixtures/naloxon.mol new file mode 100644 index 00000000..6768159d --- /dev/null +++ b/INCHI-1-TEST/tests/test_unit/fixtures/naloxon.mol @@ -0,0 +1,99 @@ +naloxon + -OEChem-12082509532D + + 45 49 0 1 0 0 0 0 0999 V2000 + 2.2314 -0.2572 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 5.3794 -1.7611 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0000 -2.7122 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0000 2.0922 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0 + 6.1607 -1.2611 0.0000 N 0 0 3 0 0 0 0 0 0 0 0 0 + 3.6897 -0.7855 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0 + 4.5133 -1.2611 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0 + 5.3370 -0.7855 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0 + 2.8660 -1.2611 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0 + 4.2392 -0.0881 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6897 0.1655 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5133 -2.2122 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.3370 0.1655 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.5918 -0.0881 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5133 0.6411 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6897 -2.6877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8660 -2.2122 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8660 0.6411 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.8418 -1.9932 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.5133 1.5922 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8660 1.5922 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6897 2.0677 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 7.8164 -1.7694 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 8.4976 -2.5015 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.8739 -0.4755 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0496 -1.4975 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 4.3760 0.5166 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6795 0.1787 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 4.7254 -2.7948 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1239 -2.1045 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.9476 0.0579 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.5490 0.7481 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 6.1840 0.0957 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.4989 0.5249 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 3.2912 -3.1626 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 4.0882 -3.1626 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.3794 -2.3811 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 6.3215 -2.3303 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 7.0834 -2.5642 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 5.0503 1.9022 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 3.6897 2.6877 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 7.9984 -1.1766 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0000 2.7122 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 8.3157 -3.0942 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 9.1019 -2.3627 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 + 1 9 1 0 0 0 0 + 1 18 1 0 0 0 0 + 7 2 1 1 0 0 0 + 2 37 1 0 0 0 0 + 3 17 2 0 0 0 0 + 4 21 1 0 0 0 0 + 4 43 1 0 0 0 0 + 5 8 1 0 0 0 0 + 5 14 1 0 0 0 0 + 5 19 1 0 0 0 0 + 6 7 1 0 0 0 0 + 6 9 1 0 0 0 0 + 6 10 1 1 0 0 0 + 6 11 1 0 0 0 0 + 7 8 1 0 0 0 0 + 7 12 1 0 0 0 0 + 8 13 1 0 0 0 0 + 8 25 1 0 0 0 0 + 9 17 1 0 0 0 0 + 9 26 1 1 0 0 0 + 10 14 1 0 0 0 0 + 10 27 1 0 0 0 0 + 10 28 1 0 0 0 0 + 11 15 2 0 0 0 0 + 11 18 1 0 0 0 0 + 12 16 1 0 0 0 0 + 12 29 1 0 0 0 0 + 12 30 1 0 0 0 0 + 13 15 1 0 0 0 0 + 13 31 1 0 0 0 0 + 13 32 1 0 0 0 0 + 14 33 1 0 0 0 0 + 14 34 1 0 0 0 0 + 15 20 1 0 0 0 0 + 16 17 1 0 0 0 0 + 16 35 1 0 0 0 0 + 16 36 1 0 0 0 0 + 18 21 2 0 0 0 0 + 19 23 1 0 0 0 0 + 19 38 1 0 0 0 0 + 19 39 1 0 0 0 0 + 20 22 2 0 0 0 0 + 20 40 1 0 0 0 0 + 21 22 1 0 0 0 0 + 22 41 1 0 0 0 0 + 23 24 2 0 0 0 0 + 23 42 1 0 0 0 0 + 24 44 1 0 0 0 0 + 24 45 1 0 0 0 0 +M END \ No newline at end of file diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index abf7ec25..8295f68f 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -19,33 +19,17 @@ static char* make_arg(const char* s) { return p; } -// TEST(ichimain_testing, test_ProcessSingleInputFile) -// { - - -// const char *test_file_2mols = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/test_mol2.sdf"; +TEST(ichimain_testing, test_ProcessMultipleInputFiles) +{ -// char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; -// char *tmpd = mkdtemp(tmpl); -// ASSERT_NE(tmpd, nullptr); + const char *test_file_mol1 = "caffeine.mol"; + const char *test_file_mol2 = "naloxon.mol"; -// std::string dst_path = std::string(tmpd) + "/caffeine.mol"; -// std::ifstream src(test_file_caffeine, std::ios::binary); -// ASSERT_TRUE(src.is_open()); -// std::ofstream dst(dst_path, std::ios::binary); -// ASSERT_TRUE(dst.is_open()); -// dst << src.rdbuf(); -// src.close(); -// dst.close(); -// int argc = 2; -// char *a0 = make_arg("test_ichimain"); -// char *a1 = make_arg(dst_path.c_str()); -// char* argv[] = { a0, a1 }; -// } +} TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) { diff --git a/_deps/googletest-src b/_deps/googletest-src new file mode 160000 index 00000000..52eb8108 --- /dev/null +++ b/_deps/googletest-src @@ -0,0 +1 @@ +Subproject commit 52eb8108c5bdec04579160ae17225d66034bd723 From 7b93ffbc9294ef8ba92bed41eb92aa461ab59249 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Tue, 9 Dec 2025 10:54:52 +0000 Subject: [PATCH 23/41] added missing free --- INCHI-1-SRC/INCHI_BASE/src/ichimake.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/INCHI-1-SRC/INCHI_BASE/src/ichimake.c b/INCHI-1-SRC/INCHI_BASE/src/ichimake.c index 80652e13..e478e55b 100644 --- a/INCHI-1-SRC/INCHI_BASE/src/ichimake.c +++ b/INCHI-1-SRC/INCHI_BASE/src/ichimake.c @@ -4550,6 +4550,10 @@ int Create_INChI(CANON_GLOBALS* pCG, { inchi_free(t_group_info->nIsotopicEndpointAtomNumber); } + if (t_group_info->t_group) + { + inchi_free(t_group_info->t_group); + } memset(t_group_info, 0, sizeof(*t_group_info)); /* djb-rwth: memset_s C11/Annex K variant? */ } } From 640a53b2db45f0372f8d171af434cd5201d53949 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Tue, 9 Dec 2025 13:27:51 +0000 Subject: [PATCH 24/41] Added unit tests for CalcAndPrintINCHIAndINCHIKEY, ProcessMultipleInputFiles --- CMakeLists.txt | 4 +- .../tests/test_unit/test_ichimain.cpp | 458 +++++++++++++++--- .../tests/test_unit/test_permutation_util.cpp | 7 + 3 files changed, 403 insertions(+), 66 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b324705..737bfafd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,8 @@ set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 11) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") include(FetchContent) FetchContent_Declare( diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 8295f68f..83fea5e3 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -8,6 +8,7 @@ extern "C" { #include "../../../INCHI-1-SRC/INCHI_BASE/src/ichitime.h" +#include "../../../INCHI-1-SRC/INCHI_BASE/src/ichicant.h" #include "../../../INCHI-1-SRC/INCHI_BASE/src/ichi_io.h" #include "../../../INCHI-1-SRC/INCHI_BASE/src/ichimain.h" } @@ -19,16 +20,344 @@ static char* make_arg(const char* s) { return p; } -TEST(ichimain_testing, test_ProcessMultipleInputFiles) +char *read_inchi_from_file(const char *filename) { + + std::ifstream txt_in(filename); + txt_in.is_open(); + std::string line; + std::string found_inchi; + while (std::getline(txt_in, line)) { + // trim leading/trailing whitespace + size_t start = line.find_first_not_of(" \t\r\n"); + if (start == std::string::npos) continue; + size_t end = line.find_last_not_of(" \t\r\n"); + std::string trimmed = line.substr(start, end - start + 1); + if (trimmed.rfind("InChI=", 0) == 0) { + found_inchi = trimmed; + break; + } + } + txt_in.close(); + + return make_arg(found_inchi.c_str()); +} + +TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { + + + INCHI_IOSTREAM input_stream; + + const char *molblock = + "enhanc_stereo1 \n" + " ACD/LABS08242216132D \n" + " \n" + " 0 0 0 0 0 0 0 0 0 0999 V3000 \n" + "M V30 BEGIN CTAB \n" + "M V30 COUNTS 18 17 0 0 1 \n" + "M V30 BEGIN ATOM \n" + "M V30 1 C 3424.1946 -1936.7935 0 0 \n" + "M V30 2 C 3352.3145 -1895.2935 0 0 \n" + "M V30 3 C 3280.4346 -1936.7935 0 0 \n" + "M V30 4 C 3208.5542 -1895.2935 0 0 \n" + "M V30 5 C 3136.6743 -1936.7935 0 0 \n" + "M V30 6 C 3064.7944 -1895.2935 0 0 \n" + "M V30 7 Br 3136.6743 -2019.7935 0 0 \n" + "M V30 8 Cl 3208.5542 -1812.2935 0 0 \n" + "M V30 9 Cl 3280.4346 -2019.7935 0 0 \n" + "M V30 10 Cl 3352.3145 -1812.2935 0 0 \n" + "M V30 11 Cl 3424.1946 -2019.7935 0 0 \n" + "M V30 12 C 3496.075 -1895.2935 0 0 \n" + "M V30 13 C 3567.9548 -1936.7942 0 0 \n" + "M V30 14 C 3639.835 -1895.2944 0 0 \n" + "M V30 15 C 3711.7148 -1936.7942 0 0 \n" + "M V30 16 Cl 3639.835 -1812.2944 0 0 \n" + "M V30 17 Cl 3567.9548 -2019.7942 0 0 \n" + "M V30 18 Cl 3496.075 -1812.2937 0 0 \n" + "M V30 END ATOM \n" + "M V30 BEGIN BOND \n" + "M V30 1 1 1 2 \n" + "M V30 2 1 1 11 CFG=3 \n" + "M V30 3 1 1 12 \n" + "M V30 4 1 2 3 \n" + "M V30 5 1 2 10 CFG=1 \n" + "M V30 6 1 3 4 \n" + "M V30 7 1 3 9 CFG=1 \n" + "M V30 8 1 4 5 \n" + "M V30 9 1 4 8 CFG=1 \n" + "M V30 10 1 5 6 \n" + "M V30 11 1 5 7 CFG=1 \n" + "M V30 12 1 12 13 \n" + "M V30 13 1 12 18 CFG=3 \n" + "M V30 14 1 13 14 \n" + "M V30 15 1 13 17 CFG=1 \n" + "M V30 16 1 14 15 \n" + "M V30 17 1 14 16 CFG=1 \n" + "M V30 END BOND \n" + "M V30 BEGIN COLLECTION \n" + "M V30 MDLV30/STERAC2 ATOMS=(1 1) \n" + "M V30 MDLV30/STERAC1 ATOMS=(2 2 3) \n" + "M V30 MDLV30/STEABS ATOMS=(2 4 5) \n" + "M V30 MDLV30/STEREL1 ATOMS=(2 12 13) \n" + "M V30 MDLV30/STEREL2 ATOMS=(1 14) \n" + "M V30 END COLLECTION \n" + "M V30 END CTAB \n" + "M END \n"; + + inchi_ios_init(&input_stream, INCHI_IOS_TYPE_STRING, nullptr); + inchi_ios_print_nodisplay(&input_stream, molblock); + + // int GetTheNextRecordOfInputFile( struct tagINCHI_CLOCK *ic, + // STRUCT_DATA *sd, INPUT_PARMS *ip, + // char *szTitle, + // INCHI_IOSTREAM *inp_file, + // INCHI_IOSTREAM *plog, + // INCHI_IOSTREAM *pout, + // INCHI_IOSTREAM *pprb, + // ORIG_ATOM_DATA *orig_inp_data, + // long *num_inp, + // STRUCT_FPTRS *pStructPtrs, + // int *nRet, + // int *have_err_in_GetOneStructure, + // long *num_err, + // int output_error_inchi ); + + INCHI_CLOCK ic = {}; + memset(&ic, 0, sizeof(ic)); + + STRUCT_DATA *sd = new STRUCT_DATA; + // sd->ulStructTime = 0; + INPUT_PARMS *ip = new INPUT_PARMS; + + char *szTitle; + INCHI_IOSTREAM *inp_file; + INCHI_IOSTREAM *plog = new INCHI_IOSTREAM; + INCHI_IOSTREAM *pout = new INCHI_IOSTREAM; + INCHI_IOSTREAM *pprb = new INCHI_IOSTREAM; + ORIG_ATOM_DATA orig_at_data = {}; + long *num_inp = new long(0); + + STRUCT_FPTRS *pStructPtrs = nullptr; + + int nRet = 0; + int have_err_in_GetOneStructure = 0; + long num_err = 0; + int output_error_inchi; + + + memset(ip, 0, sizeof(*ip)); + ip->last_struct_number = 1; + ip->nInputType = INPUT_MOLFILE; + + inchi_ios_init(pout, INCHI_IOS_TYPE_STRING, nullptr); + inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); + inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); + + // PrintInputParms(plog, ip); + inchi_ios_flush2(plog, stderr); + + int ret = GetTheNextRecordOfInputFile( + &ic, + sd, + ip, + szTitle, + &input_stream, + plog, + pout, + pprb, + &orig_at_data, + num_inp, + pStructPtrs, + &nRet, + &have_err_in_GetOneStructure, + &num_err, + output_error_inchi); + + EXPECT_EQ(ret, DO_NEXT_STEP); + + CANON_GLOBALS CG = {}; + // STRUCT_DATA* sd; + // INPUT_PARMS* ip; + // char* szTitle; + PINChI2* pINChI[INCHI_NUM]; + PINChI_Aux2* pINChI_Aux[INCHI_NUM]; + // INCHI_IOSTREAM* inp_file; + // INCHI_IOSTREAM* plog; + // INCHI_IOSTREAM* pout; + // INCHI_IOSTREAM* pprb; + // ORIG_ATOM_DATA* orig_inp_data; + ORIG_ATOM_DATA prep_inp_data = {}; + // long* num_inp; + // STRUCT_FPTRS* pStructPtrs; + // int* nRet; + // int have_err_in_GetOneStructure; + // long* num_err; + // int output_error_inchi; + INCHI_IOS_STRING* strbuf; + unsigned long pulTotalProcessingTime = 0; + char* pLF; + char* pTAB; + char* ikey; + int silent; + + set_line_separators(ip->bINChIOutputOptions, &pLF, &pTAB); + + ret = CalcAndPrintINCHIAndINCHIKEY( + &ic, + &CG, + sd, + ip, + szTitle, + pINChI, + pINChI_Aux, + &input_stream, + plog, + pout, + pprb, + &orig_at_data, + &prep_inp_data, + num_inp, + pStructPtrs, + &nRet, + have_err_in_GetOneStructure, + &num_err, + output_error_inchi, + strbuf, + &pulTotalProcessingTime, + pLF, + pTAB, + ikey, + silent + ); + + + + + inchi_ios_free_str(&input_stream); + FreeOrigAtData(&orig_at_data); + + for (int i = 0; i < MAX_NUM_PATHS; i++) + { + if (ip->path[i]) + { + inchi_free((void*)ip->path[i]); /* cast deliberately discards 'const' qualifier */ + ip->path[i] = NULL; + } + } + delete ip; + delete sd; + + delete plog; + delete pout; + delete pprb; + delete num_inp; + + + // int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, + // CANON_GLOBALS* CG, + // STRUCT_DATA* sd, + // INPUT_PARMS* ip, + // char* szTitle, + // PINChI2* pINChI[INCHI_NUM], + // PINChI_Aux2* pINChI_Aux[INCHI_NUM], + // INCHI_IOSTREAM* inp_file, + // INCHI_IOSTREAM* plog, + // INCHI_IOSTREAM* pout, + // INCHI_IOSTREAM* pprb, + // ORIG_ATOM_DATA* orig_inp_data, + // ORIG_ATOM_DATA* prep_inp_data, + // long* num_inp, + // STRUCT_FPTRS* pStructPtrs, + // int* nRet, + // int have_err_in_GetOneStructure, + // long* num_err, + // int output_error_inchi, + // INCHI_IOS_STRING* strbuf, + // unsigned long* pulTotalProcessingTime, + // char* pLF, + // char* pTAB, + // char* ikey, + // int silent) + +} + +TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) { - const char *test_file_mol1 = "caffeine.mol"; - const char *test_file_mol2 = "naloxon.mol"; + std::vector expected_inchis = { + "InChI=1S/C19H21NO4/c1-2-8-20-9-7-18-15-11-3-4-12(21)16(15)24-17(18)13(22)5-6-19(18,23)14(20)10-11/h2-4,14,17,21,23H,1,5-10H2/t14?,17-,18-,19+/m0/s1", + "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3" + }; + std::vector input_mols = { + "naloxon.mol", + "caffeine.mol" + }; + + const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; + + char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char *tmpd = mkdtemp(tmpl); + ASSERT_NE(tmpd, nullptr); + + std::vector dist_paths; + for (auto cur_filename : input_mols) { + std::string src_path = std::string(path_fixtures) + "/" + cur_filename; + std::string dst_path = std::string(tmpd) + "/" + cur_filename; + std::ifstream src(src_path, std::ios::binary); + ASSERT_TRUE(src.is_open()); + std::ofstream dst(dst_path, std::ios::binary); + ASSERT_TRUE(dst.is_open()); + dst << src.rdbuf(); + src.close(); + dst.close(); + + dist_paths.push_back(dst_path); + } + int argc = input_mols.size() + 2; + + char *inchi_filename = make_arg("test_ichimain"); + + std::vector argv_vec; + argv_vec.push_back(inchi_filename); + for (const auto &p : dist_paths) { + argv_vec.push_back(make_arg(p.c_str())); + } + argv_vec.push_back(make_arg("-AMI")); + char** argv = argv_vec.data(); + //int ProcessMultipleInputFiles(int argc, char* argv[]) + int ret = ProcessMultipleInputFiles(argc, argv); + // Assert the expected result + ASSERT_EQ(ret, 0); + + for (int i = 0; i < expected_inchis.size(); i++) { + std::string out_txt = dist_paths[i] + ".txt"; + char *inchi = read_inchi_from_file(out_txt.c_str()); + ASSERT_STREQ(inchi, expected_inchis[i].c_str()); + free(inchi); + } + + // Clean up + + for (auto p : dist_paths) { + + std::string out_txt = p + ".txt"; + std::string out_log = p + ".log"; + std::string out_prb = p + ".prb"; + + remove(p.c_str()); + remove(out_txt.c_str()); + remove(out_log.c_str()); + remove(out_prb.c_str()); + } + rmdir(tmpd); + + for (auto p : argv_vec) { + free(p); + } } TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) @@ -52,9 +381,9 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) dst.close(); int argc = 2; - char *a0 = make_arg("test_ichimain"); - char *a1 = make_arg(dst_path.c_str()); - char* argv[] = { a0, a1 }; + char *inchi_filename = make_arg("test_ichimain"); + char *input_file = make_arg(dst_path.c_str()); + char* argv[] = { inchi_filename, input_file }; // int ProcessSingleInputFile(int argc, char* argv[]) @@ -63,8 +392,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) // Assert the expected result EXPECT_EQ(result, 0); - free(a0); - free(a1); + free(inchi_filename); + free(input_file); std::string out_txt = dst_path + ".txt"; std::string out_log = dst_path + ".log"; @@ -77,35 +406,20 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) ASSERT_EQ(stat(out_log.c_str(), &st), 0); EXPECT_GT(st.st_size, 0); ASSERT_EQ(stat(out_prb.c_str(), &st), 0); - // EXPECT_GT(st.st_size, 0); EXPECT_EQ(st.st_size, 0); - std::ifstream txt_in(out_txt); - ASSERT_TRUE(txt_in.is_open()); - std::string line; - std::string found_inchi; - while (std::getline(txt_in, line)) { - // trim leading/trailing whitespace - size_t start = line.find_first_not_of(" \t\r\n"); - if (start == std::string::npos) continue; - size_t end = line.find_last_not_of(" \t\r\n"); - std::string trimmed = line.substr(start, end - start + 1); - if (trimmed.rfind("InChI=", 0) == 0) { - found_inchi = trimmed; - break; - } - } - txt_in.close(); + char *found_inchi = read_inchi_from_file(out_txt.c_str()); + std::string expected_inchi = "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3"; - const std::string expected_inchi = "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3"; - ASSERT_FALSE(found_inchi.empty()); + ASSERT_NE(found_inchi, nullptr); EXPECT_EQ(found_inchi, expected_inchi); // cleanup - unlink(out_txt.c_str()); - unlink(out_log.c_str()); - unlink(out_prb.c_str()); - unlink(dst_path.c_str()); + free(found_inchi); + remove(out_txt.c_str()); + remove(out_log.c_str()); + remove(out_prb.c_str()); + remove(dst_path.c_str()); rmdir(tmpd); } TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) @@ -129,9 +443,9 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) dst.close(); int argc = 2; - char *a0 = make_arg("test_ichimain"); - char *a1 = make_arg(dst_path.c_str()); - char* argv[] = { a0, a1 }; + char *inchi_filename = make_arg("test_ichimain"); + char *input_file = make_arg(dst_path.c_str()); + char* argv[] = { inchi_filename, input_file }; // int ProcessSingleInputFile(int argc, char* argv[]) @@ -140,8 +454,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) // Assert the expected result EXPECT_EQ(result, 0); - free(a0); - free(a1); + free(inchi_filename); + free(input_file); std::string out_txt = dst_path + ".txt"; std::string out_log = dst_path + ".log"; @@ -184,10 +498,10 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) } // cleanup - unlink(out_txt.c_str()); - unlink(out_log.c_str()); - unlink(out_prb.c_str()); - unlink(dst_path.c_str()); + remove(out_txt.c_str()); + remove(out_log.c_str()); + remove(out_prb.c_str()); + remove(dst_path.c_str()); rmdir(tmpd); } @@ -277,17 +591,17 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) INPUT_PARMS *ip = new INPUT_PARMS; char *szTitle; - INCHI_IOSTREAM *inp_file; + // INCHI_IOSTREAM *inp_file; INCHI_IOSTREAM *plog = new INCHI_IOSTREAM; INCHI_IOSTREAM *pout = new INCHI_IOSTREAM; INCHI_IOSTREAM *pprb = new INCHI_IOSTREAM; ORIG_ATOM_DATA orig_at_data = {}; long *num_inp = new long(0); - STRUCT_FPTRS *pStructPtrs = NULL; + STRUCT_FPTRS *pStructPtrs = nullptr; - int *nRet = 0; - int *have_err_in_GetOneStructure = 0; + int nRet = 0; + int have_err_in_GetOneStructure = 0; long *num_err; int output_error_inchi; @@ -301,27 +615,43 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); // PrintInputParms(plog, ip); - // inchi_ios_flush2(plog, stderr); - - // int ret = GetTheNextRecordOfInputFile( - // &ic, - // sd, - // ip, - // szTitle, - // &input_stream, - // plog, - // pout, - // pprb, - // &orig_at_data, - // num_inp, - // pStructPtrs, - // nRet, - // have_err_in_GetOneStructure, - // num_err, - // output_error_inchi); - - // EXPECT_EQ(ret, DO_NEXT_STEP); + inchi_ios_flush2(plog, stderr); + + int ret = GetTheNextRecordOfInputFile( + &ic, + sd, + ip, + szTitle, + &input_stream, + plog, + pout, + pprb, + &orig_at_data, + num_inp, + pStructPtrs, + &nRet, + &have_err_in_GetOneStructure, + num_err, + output_error_inchi); + + EXPECT_EQ(ret, DO_NEXT_STEP); inchi_ios_free_str(&input_stream); FreeOrigAtData(&orig_at_data); + + for (int i = 0; i < MAX_NUM_PATHS; i++) + { + if (ip->path[i]) + { + inchi_free((void*)ip->path[i]); /* cast deliberately discards 'const' qualifier */ + ip->path[i] = NULL; + } + } + delete ip; + delete sd; + + delete plog; + delete pout; + delete pprb; + delete num_inp; } diff --git a/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp b/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp index 174bf847..ad98e559 100644 --- a/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp @@ -107,4 +107,11 @@ TEST(permutation_util_testing, test_OrigAtData_Permute) EXPECT_STREQ(molblock, output_file->s.pStr); EXPECT_STRNE(output_file->s.pStr, permuted_output_file->s.pStr); + + inchi_ios_free_str(&input_stream); + inchi_ios_free_str(&output_stream); + inchi_ios_free_str(&permuted_output_stream); + + FreeOrigAtData(&atom_data); + FreeOrigAtData(&permuted_atom_data); } From 18dafe91ac919c1ff331b8a491e8b88eb1092065 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Wed, 10 Dec 2025 14:40:19 +0000 Subject: [PATCH 25/41] Added unit test flags for initializing input params --- .../tests/test_unit/test_ichimain.cpp | 92 +++++++++++++------ 1 file changed, 62 insertions(+), 30 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 83fea5e3..7b8b77f9 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -48,9 +48,9 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { INCHI_IOSTREAM input_stream; const char *molblock = - "enhanc_stereo1 \n" + "enhanc_stereo1 \n" " ACD/LABS08242216132D \n" - " \n" + " \n" " 0 0 0 0 0 0 0 0 0 0999 V3000 \n" "M V30 BEGIN CTAB \n" "M V30 COUNTS 18 17 0 0 1 \n" @@ -147,6 +147,23 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { memset(ip, 0, sizeof(*ip)); ip->last_struct_number = 1; ip->nInputType = INPUT_MOLFILE; + ip->bINChIOutputOptions = INCHI_OUT_PLAIN_TEXT; + // ip->bINChIOutputOptions2 = INCHI_OUT_PLAIN_TEXT; + // ip->nMode = REQ_MODE_TAUT; // REQ_MODE_BASIC; + // ip->bTautFlags |= (TG_FLAG_DISCONNECT_COORD | TG_FLAG_RECONNECT_COORD); + // ip->nMode |= (REQ_MODE_BASIC | REQ_MODE_TAUT | REQ_MODE_STEREO | REQ_MODE_ISO_STEREO | REQ_MODE_ISO); + + int bReleaseVersion = bRELEASE_VERSION; + unsigned long ulDisplTime = 0; /* infinite, milliseconds */ + unsigned long ulTotalProcessingTime = 0; + + int argc = 0; + char *argv[1]; + char *szSdfDataValue = nullptr; + + ReadCommandLineParms(argc, (const char**)argv, ip, + szSdfDataValue, &ulDisplTime, + bReleaseVersion, plog); inchi_ios_init(pout, INCHI_IOS_TYPE_STRING, nullptr); inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); @@ -174,6 +191,9 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { EXPECT_EQ(ret, DO_NEXT_STEP); + EXPECT_EQ(orig_at_data.num_inp_atoms, 18); + EXPECT_EQ(orig_at_data.num_inp_bonds, 17); + CANON_GLOBALS CG = {}; // STRUCT_DATA* sd; // INPUT_PARMS* ip; @@ -192,7 +212,10 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { // int have_err_in_GetOneStructure; // long* num_err; // int output_error_inchi; - INCHI_IOS_STRING* strbuf; + INCHI_IOS_STRING *strbuf = new INCHI_IOS_STRING; + memset(strbuf, 0, sizeof(*strbuf)); + inchi_strbuf_init(strbuf, INCHI_STRBUF_INITIAL_SIZE, INCHI_STRBUF_SIZE_INCREMENT); + unsigned long pulTotalProcessingTime = 0; char* pLF; char* pTAB; @@ -201,6 +224,33 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { set_line_separators(ip->bINChIOutputOptions, &pLF, &pTAB); + + // int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, + // CANON_GLOBALS* CG, + // STRUCT_DATA* sd, + // INPUT_PARMS* ip, + // char* szTitle, + // PINChI2* pINChI[INCHI_NUM], + // PINChI_Aux2* pINChI_Aux[INCHI_NUM], + // INCHI_IOSTREAM* inp_file, + // INCHI_IOSTREAM* plog, + // INCHI_IOSTREAM* pout, + // INCHI_IOSTREAM* pprb, + // ORIG_ATOM_DATA* orig_inp_data, + // ORIG_ATOM_DATA* prep_inp_data, + // long* num_inp, + // STRUCT_FPTRS* pStructPtrs, + // int* nRet, + // int have_err_in_GetOneStructure, + // long* num_err, + // int output_error_inchi, + // INCHI_IOS_STRING* strbuf, + // unsigned long* pulTotalProcessingTime, + // char* pLF, + // char* pTAB, + // char* ikey, + // int silent) + ret = CalcAndPrintINCHIAndINCHIKEY( &ic, &CG, @@ -229,11 +279,17 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { silent ); + EXPECT_EQ(ret, DO_NEXT_STEP); + char *inchi = "InChI=1S/C10H14BrCl7/c1-3(11)5(13)7(15)9(17)10(18)8(16)6(14)4(2)12/h3-10H,1-2H3/t3-,4-,5+,6+,7-,8+,9+,10-/m0/s1"; + //ios->s.pStr + EXPECT_STREQ(inchi, pout->s.pStr); + FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); inchi_ios_free_str(&input_stream); FreeOrigAtData(&orig_at_data); + FreeOrigAtData(&prep_inp_data); for (int i = 0; i < MAX_NUM_PATHS; i++) { @@ -251,33 +307,6 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { delete pprb; delete num_inp; - - // int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, - // CANON_GLOBALS* CG, - // STRUCT_DATA* sd, - // INPUT_PARMS* ip, - // char* szTitle, - // PINChI2* pINChI[INCHI_NUM], - // PINChI_Aux2* pINChI_Aux[INCHI_NUM], - // INCHI_IOSTREAM* inp_file, - // INCHI_IOSTREAM* plog, - // INCHI_IOSTREAM* pout, - // INCHI_IOSTREAM* pprb, - // ORIG_ATOM_DATA* orig_inp_data, - // ORIG_ATOM_DATA* prep_inp_data, - // long* num_inp, - // STRUCT_FPTRS* pStructPtrs, - // int* nRet, - // int have_err_in_GetOneStructure, - // long* num_err, - // int output_error_inchi, - // INCHI_IOS_STRING* strbuf, - // unsigned long* pulTotalProcessingTime, - // char* pLF, - // char* pTAB, - // char* ikey, - // int silent) - } TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) @@ -636,6 +665,9 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) EXPECT_EQ(ret, DO_NEXT_STEP); + EXPECT_EQ(orig_at_data.num_inp_atoms, 18); + EXPECT_EQ(orig_at_data.num_inp_bonds, 17); + inchi_ios_free_str(&input_stream); FreeOrigAtData(&orig_at_data); From 80ba6a5b4e0f54488c1f297d3566cdfbb27337ad Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 10:56:17 +0000 Subject: [PATCH 26/41] Added unit test for CalcAndPrintInchi... --- .../tests/test_unit/test_ichimain.cpp | 48 ++++++++++++------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 7b8b77f9..f06648b1 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -34,6 +34,15 @@ char *read_inchi_from_file(const char *filename) { std::string trimmed = line.substr(start, end - start + 1); if (trimmed.rfind("InChI=", 0) == 0) { found_inchi = trimmed; + break; + } else if (trimmed.find("InChI=", 0) != std::string::npos) { + size_t start_pos = trimmed.find("InChI="); + if(start_pos != 0) { + found_inchi = trimmed.substr(start_pos); + } else { + found_inchi = trimmed; + } + break; } } @@ -165,7 +174,13 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { szSdfDataValue, &ulDisplTime, bReleaseVersion, plog); - inchi_ios_init(pout, INCHI_IOS_TYPE_STRING, nullptr); + + const char* inchi_filename = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; + + FILE *file_inchi; + file_inchi = fopen(inchi_filename, "w"); + + inchi_ios_init(pout, INCHI_IOS_TYPE_FILE, file_inchi); //nullptr INCHI_IOS_TYPE_STRING inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); @@ -195,23 +210,9 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { EXPECT_EQ(orig_at_data.num_inp_bonds, 17); CANON_GLOBALS CG = {}; - // STRUCT_DATA* sd; - // INPUT_PARMS* ip; - // char* szTitle; PINChI2* pINChI[INCHI_NUM]; PINChI_Aux2* pINChI_Aux[INCHI_NUM]; - // INCHI_IOSTREAM* inp_file; - // INCHI_IOSTREAM* plog; - // INCHI_IOSTREAM* pout; - // INCHI_IOSTREAM* pprb; - // ORIG_ATOM_DATA* orig_inp_data; ORIG_ATOM_DATA prep_inp_data = {}; - // long* num_inp; - // STRUCT_FPTRS* pStructPtrs; - // int* nRet; - // int have_err_in_GetOneStructure; - // long* num_err; - // int output_error_inchi; INCHI_IOS_STRING *strbuf = new INCHI_IOS_STRING; memset(strbuf, 0, sizeof(*strbuf)); inchi_strbuf_init(strbuf, INCHI_STRBUF_INITIAL_SIZE, INCHI_STRBUF_SIZE_INCREMENT); @@ -281,15 +282,25 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { EXPECT_EQ(ret, DO_NEXT_STEP); - char *inchi = "InChI=1S/C10H14BrCl7/c1-3(11)5(13)7(15)9(17)10(18)8(16)6(14)4(2)12/h3-10H,1-2H3/t3-,4-,5+,6+,7-,8+,9+,10-/m0/s1"; - //ios->s.pStr - EXPECT_STREQ(inchi, pout->s.pStr); + fclose(file_inchi); + + char *found_inchi = read_inchi_from_file(inchi_filename); + + const char *inchi = "InChI=1S/C10H14BrCl7/c1-3(11)5(13)7(15)9(17)10(18)8(16)6(14)4(2)12/h3-10H,1-2H3/t3-,4-,5+,6+,7-,8+,9+,10-/m0/s1"; + + EXPECT_STREQ(inchi, found_inchi); //pout->s.pStr); + + free(found_inchi); + + remove(inchi_filename); FreeAllINChIArrays(pINChI, pINChI_Aux, sd->num_components); + inchi_strbuf_close(strbuf); inchi_ios_free_str(&input_stream); FreeOrigAtData(&orig_at_data); FreeOrigAtData(&prep_inp_data); + SetBitFree(&CG); for (int i = 0; i < MAX_NUM_PATHS; i++) { @@ -306,6 +317,7 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { delete pout; delete pprb; delete num_inp; + delete strbuf; } From e3db9cc6f4f296912355d12e126bacc940a9a566 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 10:56:43 +0000 Subject: [PATCH 27/41] Formatting whitespace removal --- INCHI-1-SRC/INCHI_BASE/src/runichi.c | 97 ++++++++++++++-------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/INCHI-1-SRC/INCHI_BASE/src/runichi.c b/INCHI-1-SRC/INCHI_BASE/src/runichi.c index a5dc9e1c..d8630a59 100644 --- a/INCHI-1-SRC/INCHI_BASE/src/runichi.c +++ b/INCHI-1-SRC/INCHI_BASE/src/runichi.c @@ -267,7 +267,6 @@ int ProcessOneStructure( INCHI_CLOCK *ic, memset( composite_norm_data, 0, sizeof( composite_norm_data ) ); /* djb-rwth: memset_s C11/Annex K variant? */ memset( pncFlags, 0, sizeof( *pncFlags ) ); /* djb-rwth: memset_s C11/Annex K variant? */ - /* For experimental purposes only */ /*ret1 = DoOneStructureEarlyPreprocessing( num_inp, sd, ip, inp_file, log_file, out_file, prb_file, @@ -1156,7 +1155,7 @@ int CreateOneStructureINChI( CANON_GLOBALS *pCG, /* allocate pINChI[iINChI] and pINChI_Aux2[iINChI] -- arrays of pointers to INChI and INChI_Aux */ /* assign values to sd->num_components[] */ - + /* djb-rwth: MYREALLOC2 has been replaced and the whole block rewritten to address memory leaks and reading from freed memory locations */ do { if( (sd->num_components[iINChI]) <= ((long long)cur_prep_inp_data->num_components) ) { @@ -1327,7 +1326,7 @@ int CreateOneStructureINChI( CANON_GLOBALS *pCG, } #endif - /*#ifndef COMPILE_ANSI_ONLY + /*#ifndef COMPILE_ANSI_ONLY { */ /* b) Display the extracted original component structure */ @@ -2039,7 +2038,7 @@ int ProcessOneStructureEx( struct tagINCHI_CLOCK *ic, { int ret = _IS_OKAY; char *sinchi_noedits=NULL, *saux_noedits=NULL; - + /* PREPROCESS */ @@ -2048,7 +2047,7 @@ int ProcessOneStructureEx( struct tagINCHI_CLOCK *ic, if (ip->bFilterSS) { int present, ok = 0; - + present = OrigAtData_CheckForSubstructure(orig_inp_data); if (ip->bFilterSS == 1 && present) ok = 1; @@ -2073,11 +2072,11 @@ int ProcessOneStructureEx( struct tagINCHI_CLOCK *ic, &sinchi_noedits, &saux_noedits); /* djb-rwth: ignoring LLVM warning: variable used to store function return value */ /* CALCULATE INCHI */ - - /* Perform calculation as usual either for untouched (modes POLYMERS_LEGACY and POLYMERS_LEGACY_PLUS) + + /* Perform calculation as usual either for untouched (modes POLYMERS_LEGACY and POLYMERS_LEGACY_PLUS) or just edited, probably (mode POLYMERS_MODERN) structure as passed in orig_inp_data */ - ret = ProcessOneStructureExCore( ic, CG, sd, ip, szTitle, + ret = ProcessOneStructureExCore( ic, CG, sd, ip, szTitle, pINChI2, pINChI_Aux2, inp_file, log_file, out_file, prb_file, orig_inp_data, prep_inp_data, @@ -2118,7 +2117,7 @@ int ProcessOneStructureEx( struct tagINCHI_CLOCK *ic, inchi_free(sinchi_noedits); inchi_free(saux_noedits); - + #ifdef TARGET_LIB_FOR_WINCHI push_to_winchi_text_window(out_file); @@ -2135,7 +2134,7 @@ int ProcessOneStructureEx( struct tagINCHI_CLOCK *ic, /**************************************************************************** - Special treatment for polymers: perform CRU frame shift analysis + Special treatment for polymers: perform CRU frame shift analysis and make related edits in orig_inp_data whenever applicable ****************************************************************************/ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, @@ -2161,7 +2160,7 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, char *sinchi_105p = NULL, *saux_105p = NULL; OAD_StructureEdits edits_unit_frame_shift, *ed_fs = &edits_unit_frame_shift; OAD_StructureEdits edits_unit_folding, *ed_fold = &edits_unit_folding; - + OAD_StructureEdits_Init(ed_fold); OAD_StructureEdits_Init(ed_fs); @@ -2192,7 +2191,7 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, sinchi_noedits, saux_noedits); if (ret == _IS_FATAL || ret == _IS_ERROR) { - ret = _IS_WARNING; + ret = _IS_WARNING; if (!ip->bNoWarnings) { AddErrorMessage(sd->pStrErrStruct, "CRU folding and frame shift analysis failed"); @@ -2205,10 +2204,10 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, /* CRU having both caps of indefinite nature, Zz */ goto exit_function; } - + /* Prepare and perform CRU folding related edits */ - if (ip->bFoldPolymerSRU != 0) + if (ip->bFoldPolymerSRU != 0) { /* Get interim 105+ flavour of InChI and AuxInfo and prepare */ int old_bFrameShiftScheme = ip->bFrameShiftScheme; @@ -2228,7 +2227,7 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, /* AddErrorMessage(sd->pStrErrStruct, "CRU fold analysis failed");*/ ; } - goto frame_shift; + goto frame_shift; } ret = OAD_Polymer_PrepareFoldCRUEdits( orig_inp_data, *sinchi_noedits, *saux_noedits, sinchi_105p, saux_105p, ed_fold); @@ -2244,7 +2243,7 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, if (ret == _IS_WARNING) { /* inchi_ios_eprint(log_file, "Warning (CRU fold analysis failed) structure #%ld.%s%s%s%s\n", - num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue));*/ + num_inp, SDF_LBL_VAL(ip->pSdfLabel, ip->pSdfValue));*/ ; } /* else */ @@ -2283,7 +2282,7 @@ int PreprocessPolymerCRUData( struct tagINCHI_CLOCK *ic, frame_shift: ; /* Prepare and perform frame shift related edits */ - if (ip->bFrameShiftScheme != FSS_NONE) + if (ip->bFrameShiftScheme != FSS_NONE) { /* Clear buffers */ if (sinchi_105p) @@ -2314,7 +2313,7 @@ frame_shift: ; } ret = OAD_Polymer_PrepareFrameShiftEdits( orig_inp_data, sinchi_105p, saux_105p, ed_fs); - + if (ret == _IS_FATAL || ret == _IS_ERROR) /* djb-rwth: logical operator corrected */ { ret = _IS_WARNING; @@ -2386,7 +2385,7 @@ frame_shift: ; OAD_StructureEdits_Clear(ed_fold); /* Clear edits collection */ OAD_StructureEdits_Clear(ed_fs); /* Clear edits collection */ - + return ret; } @@ -2395,17 +2394,17 @@ frame_shift: ; void swap_atoms_xyz( ORIG_ATOM_DATA *orig_at_data, int ia1, int ia2 ) { double x, y, z; - + if (ia1 != ia2) { - x = orig_at_data->at[ia1].x; - y = orig_at_data->at[ia1].y; + x = orig_at_data->at[ia1].x; + y = orig_at_data->at[ia1].y; z = orig_at_data->at[ia1].z; orig_at_data->at[ia1].x = orig_at_data->at[ia2].x; orig_at_data->at[ia1].y = orig_at_data->at[ia2].y; orig_at_data->at[ia1].z = orig_at_data->at[ia2].z; - + orig_at_data->at[ia2].x = x; orig_at_data->at[ia2].y = y; orig_at_data->at[ia2].z = z; @@ -2418,10 +2417,10 @@ void swap_atoms_xyz( ORIG_ATOM_DATA *orig_at_data, int ia1, int ia2 ) /**************************************************************************** OAD_StructureEdits_Edit ****************************************************************************/ -int OAD_StructureEdits_Apply( STRUCT_DATA *sd, - INPUT_PARMS *ip, - ORIG_ATOM_DATA *orig_at_data, - OAD_StructureEdits *ed, +int OAD_StructureEdits_Apply( STRUCT_DATA *sd, + INPUT_PARMS *ip, + ORIG_ATOM_DATA *orig_at_data, + OAD_StructureEdits *ed, int *ret) { int ok = 0, fail; @@ -2469,7 +2468,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, n_edits++; } } - + /* Add bonds */ if (n_new_bond) { @@ -2488,7 +2487,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, n_edits++; } } - + /* Modify bonds */ if (n_mod_bond) { @@ -2551,7 +2550,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, } } - + /* Delete atoms */ if (n_del_atom) { @@ -2572,7 +2571,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, goto exit_function; } - fail = mark_atoms_to_delete_or_renumber(orig_at_data, ed, at_renum); + fail = mark_atoms_to_delete_or_renumber(orig_at_data, ed, at_renum); if (fail) { *ret = _IS_ERROR; @@ -2594,20 +2593,20 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, AT_NUMB nbr0[MAXVAL]; U_CHAR btype0[MAXVAL]; int m, macc, valen; - int new_num = at_renum[i]; + int new_num = at_renum[i]; if (new_num == -1) { /* Skip removed atom */ continue; } - /* Atom to keep; copy it */ + /* Atom to keep; copy it */ new_at0 = new_at + nacc; ++nacc; memcpy(new_at0, orig_at_data->at + i, sizeof(new_at[0])); /* Correct its own number(s) */ new_at0->orig_at_number = new_num + 1; - + /* Correct its nbr number(s) */ valen = new_at0->valence; memcpy(nbr0, new_at0->neighbor, valen * sizeof(AT_NUMB)); @@ -2620,7 +2619,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, if (renum2 == num2) { /* keep old */ - new_at0->neighbor[macc++] = num2; + new_at0->neighbor[macc++] = num2; } else if (renum2 == -1) { @@ -2628,7 +2627,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, new_at0->chem_bonds_valence -= btype0[m]; new_at0->valence--; } - else + else { /* set renumbered */ new_at0->neighbor[macc++] = renum2; @@ -2746,7 +2745,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, } /* if (n_del_atom) */ - + exit_function: if (ibuf) @@ -2759,7 +2758,7 @@ int OAD_StructureEdits_Apply( STRUCT_DATA *sd, } return n_edits; } - + /**************************************************************************** Set each element of number to renum[element] or delete it if renum==(base -1) @@ -2868,7 +2867,7 @@ int ProcessOneStructureExCore( struct tagINCHI_CLOCK *ic, /**************************************************************************** - Treat pseudoelement and polymers: parse, validate and set details + Treat pseudoelement and polymers: parse, validate and set details ****************************************************************************/ int ValidateAndPreparePolymerAndPseudoatoms( struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *CG, @@ -2891,7 +2890,7 @@ int ValidateAndPreparePolymerAndPseudoatoms( struct tagINCHI_CLOCK *ic, int res = _IS_OKAY; int mind_pseudoelements = 0; - + *mind_polymers = orig_inp_data && orig_inp_data->polymer && orig_inp_data->polymer->n > 0; *mind_polymers = *mind_polymers && orig_inp_data->valid_polymer && (ip->nInputType == INPUT_MOLFILE || ip->nInputType == INPUT_SDFILE); @@ -2923,8 +2922,8 @@ int ValidateAndPreparePolymerAndPseudoatoms( struct tagINCHI_CLOCK *ic, ip->bPolymers != POLYMERS_MODERN && (ip->bFrameShiftScheme == FSS_STARS_CYCLED || ip->bFrameShiftScheme == FSS_STARS_CYCLED_SORTED)) { - /* Analyze and cyclize frame-shift eligible CRUs using InChI canonical numbers - (do this only at older polymer treatment modes 1.05, 1.05+) + /* Analyze and cyclize frame-shift eligible CRUs using InChI canonical numbers + (do this only at older polymer treatment modes 1.05, 1.05+) */ res = OAD_Polymer_CyclizeCloseableUnits( orig_inp_data, ip->bPolymers, @@ -2951,7 +2950,7 @@ int ValidateAndPreparePolymerAndPseudoatoms( struct tagINCHI_CLOCK *ic, /**************************************************************************** Get InChI and AuxInfo of totally unedited original structure. The intent is to preserve AuxInfo for the very original structure - in order to keep a final ability to restore that structure. + in order to keep a final ability to restore that structure. ****************************************************************************/ int OAD_ProcessOneStructureNoEdits( struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *CG, @@ -2970,7 +2969,7 @@ int OAD_ProcessOneStructureNoEdits( struct tagINCHI_CLOCK *ic, INCHI_IOS_STRING *strbuf, unsigned char save_opt_bits, int *n_pzz, - char **sinchi, + char **sinchi, char **saux) { size_t slen; @@ -3013,7 +3012,7 @@ int OAD_ProcessOneStructureNoEdits( struct tagINCHI_CLOCK *ic, { goto exit_function; } - + *n_pzz = dup->orig_inp_data->polymer->n_pzz; /* Extract InChI */ slen = dup->out_file->s.nUsedLength; @@ -3150,9 +3149,9 @@ int mark_atoms_to_delete_or_renumber( ORIG_ATOM_DATA *orig_at_data, size_t *atnums = NULL; /* djb-rwth: needs to be size_t type */ size_t max_atoms = orig_at_data->num_inp_atoms; - /* NB: new/old ORIG_ATOM_DATA atom numbers are 0-based (==orig_number-1) + /* NB: new/old ORIG_ATOM_DATA atom numbers are 0-based (==orig_number-1) while those in ed->... are just 1-based orig_numbers */ - + for (i = 0; (size_t)i < max_atoms; i++) { at_renum[i] = i; @@ -3219,7 +3218,7 @@ int mark_atoms_to_delete_or_renumber( ORIG_ATOM_DATA *orig_at_data, for (i = max_atoms - 1; i >= 0; i--) { int orig_num = i + 1; /* NB: ed->del_atom->item contains orig# which are (OAD# + 1) */ - if (is_in_the_ilist(ed->del_atom->item, orig_num, ed->del_atom->used)) + if (is_in_the_ilist(ed->del_atom->item, orig_num, ed->del_atom->used)) { /* mark as deleted atnum */ at_renum[i] = -1; @@ -3262,7 +3261,7 @@ int check_presence_of_the_encoded_substructure(ORIG_ATOM_DATA *oad) /* Place sub-structure filtering code below. Return 1 if structure matches some hard-coded pattern - + In this example pattern is a presence of a pseudo atom. */ From bb6fc2940bf10c91fe177725570de48a53be7910 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 11:10:40 +0000 Subject: [PATCH 28/41] removed sanitizing flags --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 737bfafd..2b324705 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,8 @@ set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 11) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") +# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") +# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") include(FetchContent) FetchContent_Declare( From 1988646eba29214881e1f1f83afbbaec92fa6e32 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 11:29:57 +0000 Subject: [PATCH 29/41] fixed missing initialization --- INCHI-1-TEST/tests/test_unit/test_ichimain.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index f06648b1..c3c8729e 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -210,8 +210,8 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { EXPECT_EQ(orig_at_data.num_inp_bonds, 17); CANON_GLOBALS CG = {}; - PINChI2* pINChI[INCHI_NUM]; - PINChI_Aux2* pINChI_Aux[INCHI_NUM]; + PINChI2* pINChI[INCHI_NUM] = {}; + PINChI_Aux2* pINChI_Aux[INCHI_NUM] = {}; ORIG_ATOM_DATA prep_inp_data = {}; INCHI_IOS_STRING *strbuf = new INCHI_IOS_STRING; memset(strbuf, 0, sizeof(*strbuf)); @@ -282,7 +282,9 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { EXPECT_EQ(ret, DO_NEXT_STEP); - fclose(file_inchi); + if (file_inchi != nullptr) { + fclose(file_inchi); + } char *found_inchi = read_inchi_from_file(inchi_filename); From 935e58310b8e9f2b26a73831454b84ece5fda930 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 12:43:42 +0000 Subject: [PATCH 30/41] Added write permissions to workflow in ci pipeline --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9e27ffd..85a316d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,9 @@ jobs: - id: setup run: ./.devcontainer/post_create_commands.sh + - name: Fix file permissions + run: chmod -R +rw ${{ github.workspace }} + - name: Run unit tests run: cd CMake_build/full_build/INCHI-1-TEST/tests/test_unit && ctest --output-on-failure From 6505cc934b447c3e65f94c639d8f9106f0bb710e Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 13:06:16 +0000 Subject: [PATCH 31/41] Reverted file permissions --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85a316d6..b9e27ffd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,6 @@ jobs: - id: setup run: ./.devcontainer/post_create_commands.sh - - name: Fix file permissions - run: chmod -R +rw ${{ github.workspace }} - - name: Run unit tests run: cd CMake_build/full_build/INCHI-1-TEST/tests/test_unit && ctest --output-on-failure From 8053314a97194aaec29c118319f004881a3e8d10 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 13:22:12 +0000 Subject: [PATCH 32/41] Path fix for ci pipeline --- INCHI-1-TEST/tests/test_unit/test_ichimain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index c3c8729e..8afe3243 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -175,7 +175,7 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { bReleaseVersion, plog); - const char* inchi_filename = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; + const char* inchi_filename = "../../../INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; FILE *file_inchi; file_inchi = fopen(inchi_filename, "w"); From 0fcbdfcbe96b98872e9dcc81095573b4eed6b50f Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 13:32:51 +0000 Subject: [PATCH 33/41] Path fix for ci pipeline --- INCHI-1-TEST/tests/test_unit/test_ichimain.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 8afe3243..55d60776 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -335,10 +335,11 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) "naloxon.mol", "caffeine.mol" }; + // ../../../ + // /workspaces/InChI/ + const char *path_fixtures = "../../../INCHI-1-TEST/tests/test_unit/fixtures"; - const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; - - char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char tmpl[] = "../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); From 86c8804b74ea43061a5fd4d2476b74fc7a786dee Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 15 Dec 2025 13:43:23 +0000 Subject: [PATCH 34/41] Path fix for ci pipeline --- INCHI-1-TEST/tests/test_unit/test_ichimain.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 55d60776..04315ba6 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -175,7 +175,7 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { bReleaseVersion, plog); - const char* inchi_filename = "../../../INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; + const char* inchi_filename = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; FILE *file_inchi; file_inchi = fopen(inchi_filename, "w"); @@ -337,9 +337,9 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) }; // ../../../ // /workspaces/InChI/ - const char *path_fixtures = "../../../INCHI-1-TEST/tests/test_unit/fixtures"; + const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); @@ -409,8 +409,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) const char *filename_caffeine = "caffeine.mol"; - const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); @@ -471,8 +471,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) const char *filename_2mols = "test_mols_2.sdf"; - const char *path_fixtures = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "/workspaces/InChI/INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); From 32939dad241c715edb7bdf3aa35e6c198c1595d5 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Tue, 16 Dec 2025 10:22:16 +0000 Subject: [PATCH 35/41] Fixed directory for fixtures --- .../tests/test_unit/test_ichimain.cpp | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 04315ba6..7e06de36 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include extern "C" @@ -53,7 +54,6 @@ char *read_inchi_from_file(const char *filename) { TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { - INCHI_IOSTREAM input_stream; const char *molblock = @@ -174,11 +174,10 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { szSdfDataValue, &ulDisplTime, bReleaseVersion, plog); - - const char* inchi_filename = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; - - FILE *file_inchi; + const char* inchi_filename = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures/output.txt"; + FILE *file_inchi = nullptr; file_inchi = fopen(inchi_filename, "w"); + EXPECT_NE(file_inchi, nullptr); inchi_ios_init(pout, INCHI_IOS_TYPE_FILE, file_inchi); //nullptr INCHI_IOS_TYPE_STRING inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); @@ -205,7 +204,6 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { output_error_inchi); EXPECT_EQ(ret, DO_NEXT_STEP); - EXPECT_EQ(orig_at_data.num_inp_atoms, 18); EXPECT_EQ(orig_at_data.num_inp_bonds, 17); @@ -225,7 +223,6 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { set_line_separators(ip->bINChIOutputOptions, &pLF, &pTAB); - // int CalcAndPrintINCHIAndINCHIKEY(struct tagINCHI_CLOCK* ic, // CANON_GLOBALS* CG, // STRUCT_DATA* sd, @@ -288,6 +285,8 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { char *found_inchi = read_inchi_from_file(inchi_filename); + EXPECT_NE(found_inchi, nullptr); + const char *inchi = "InChI=1S/C10H14BrCl7/c1-3(11)5(13)7(15)9(17)10(18)8(16)6(14)4(2)12/h3-10H,1-2H3/t3-,4-,5+,6+,7-,8+,9+,10-/m0/s1"; EXPECT_STREQ(inchi, found_inchi); //pout->s.pStr); @@ -312,9 +311,9 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { ip->path[i] = NULL; } } + delete ip; delete sd; - delete plog; delete pout; delete pprb; @@ -337,9 +336,9 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) }; // ../../../ // /workspaces/InChI/ - const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; + const char *path_fixtures = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + char tmpl[] = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); @@ -409,8 +408,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) const char *filename_caffeine = "caffeine.mol"; - const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + const char *path_fixtures = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); @@ -466,13 +465,14 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) remove(dst_path.c_str()); rmdir(tmpd); } + TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) { const char *filename_2mols = "test_mols_2.sdf"; - const char *path_fixtures = "../../../../INCHI-1-TEST/tests/test_unit/fixtures"; - char tmpl[] = "../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; + const char *path_fixtures = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures"; + char tmpl[] = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; char *tmpd = mkdtemp(tmpl); ASSERT_NE(tmpd, nullptr); From b4fa666277cff6aaa357797cda8a4b185bd6687e Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Tue, 16 Dec 2025 15:38:28 +0000 Subject: [PATCH 36/41] Removed commented lines --- .../tests/test_unit/test_ichimain.cpp | 60 ++++--------------- _deps/googletest-src | 1 - 2 files changed, 12 insertions(+), 49 deletions(-) delete mode 160000 _deps/googletest-src diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index 7e06de36..d50a451d 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -115,21 +115,6 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { inchi_ios_init(&input_stream, INCHI_IOS_TYPE_STRING, nullptr); inchi_ios_print_nodisplay(&input_stream, molblock); - // int GetTheNextRecordOfInputFile( struct tagINCHI_CLOCK *ic, - // STRUCT_DATA *sd, INPUT_PARMS *ip, - // char *szTitle, - // INCHI_IOSTREAM *inp_file, - // INCHI_IOSTREAM *plog, - // INCHI_IOSTREAM *pout, - // INCHI_IOSTREAM *pprb, - // ORIG_ATOM_DATA *orig_inp_data, - // long *num_inp, - // STRUCT_FPTRS *pStructPtrs, - // int *nRet, - // int *have_err_in_GetOneStructure, - // long *num_err, - // int output_error_inchi ); - INCHI_CLOCK ic = {}; memset(&ic, 0, sizeof(ic)); @@ -137,6 +122,11 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { // sd->ulStructTime = 0; INPUT_PARMS *ip = new INPUT_PARMS; + memset(ip, 0, sizeof(*ip)); + ip->last_struct_number = 1; + ip->nInputType = INPUT_MOLFILE; + ip->bINChIOutputOptions = INCHI_OUT_PLAIN_TEXT; + char *szTitle; INCHI_IOSTREAM *inp_file; INCHI_IOSTREAM *plog = new INCHI_IOSTREAM; @@ -152,18 +142,8 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { long num_err = 0; int output_error_inchi; - - memset(ip, 0, sizeof(*ip)); - ip->last_struct_number = 1; - ip->nInputType = INPUT_MOLFILE; - ip->bINChIOutputOptions = INCHI_OUT_PLAIN_TEXT; - // ip->bINChIOutputOptions2 = INCHI_OUT_PLAIN_TEXT; - // ip->nMode = REQ_MODE_TAUT; // REQ_MODE_BASIC; - // ip->bTautFlags |= (TG_FLAG_DISCONNECT_COORD | TG_FLAG_RECONNECT_COORD); - // ip->nMode |= (REQ_MODE_BASIC | REQ_MODE_TAUT | REQ_MODE_STEREO | REQ_MODE_ISO_STEREO | REQ_MODE_ISO); - int bReleaseVersion = bRELEASE_VERSION; - unsigned long ulDisplTime = 0; /* infinite, milliseconds */ + unsigned long ulDisplTime = 0; unsigned long ulTotalProcessingTime = 0; int argc = 0; @@ -179,11 +159,10 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { file_inchi = fopen(inchi_filename, "w"); EXPECT_NE(file_inchi, nullptr); - inchi_ios_init(pout, INCHI_IOS_TYPE_FILE, file_inchi); //nullptr INCHI_IOS_TYPE_STRING + inchi_ios_init(pout, INCHI_IOS_TYPE_FILE, file_inchi); inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); - // PrintInputParms(plog, ip); inchi_ios_flush2(plog, stderr); int ret = GetTheNextRecordOfInputFile( @@ -334,8 +313,7 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) "naloxon.mol", "caffeine.mol" }; - // ../../../ - // /workspaces/InChI/ + const char *path_fixtures = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures"; char tmpl[] = "../../../../../INCHI-1-TEST/tests/test_unit/fixtures/inchi_mol_test_XXXXXX"; @@ -373,7 +351,6 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) int ret = ProcessMultipleInputFiles(argc, argv); - // Assert the expected result ASSERT_EQ(ret, 0); for (int i = 0; i < expected_inchis.size(); i++) { @@ -383,8 +360,6 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) free(inchi); } - // Clean up - for (auto p : dist_paths) { std::string out_txt = p + ".txt"; @@ -432,18 +407,13 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) int result = ProcessSingleInputFile(argc, argv); - // Assert the expected result EXPECT_EQ(result, 0); - free(inchi_filename); - free(input_file); - std::string out_txt = dst_path + ".txt"; std::string out_log = dst_path + ".log"; std::string out_prb = dst_path + ".prb"; struct stat st; - // check existence and non-zero size ASSERT_EQ(stat(out_txt.c_str(), &st), 0); EXPECT_GT(st.st_size, 0); ASSERT_EQ(stat(out_log.c_str(), &st), 0); @@ -458,6 +428,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) EXPECT_EQ(found_inchi, expected_inchi); // cleanup + free(inchi_filename); + free(input_file); free(found_inchi); remove(out_txt.c_str()); remove(out_log.c_str()); @@ -492,27 +464,20 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) char* argv[] = { inchi_filename, input_file }; // int ProcessSingleInputFile(int argc, char* argv[]) - int result = ProcessSingleInputFile(argc, argv); - // Assert the expected result EXPECT_EQ(result, 0); - free(inchi_filename); - free(input_file); - std::string out_txt = dst_path + ".txt"; std::string out_log = dst_path + ".log"; std::string out_prb = dst_path + ".prb"; struct stat st; - // check existence and non-zero size ASSERT_EQ(stat(out_txt.c_str(), &st), 0); EXPECT_GT(st.st_size, 0); ASSERT_EQ(stat(out_log.c_str(), &st), 0); EXPECT_GT(st.st_size, 0); ASSERT_EQ(stat(out_prb.c_str(), &st), 0); - // EXPECT_GT(st.st_size, 0); EXPECT_EQ(st.st_size, 0); std::ifstream txt_in(out_txt); @@ -520,7 +485,6 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) std::string line; std::vector found_inchis; while (std::getline(txt_in, line)) { - // trim leading/trailing whitespace size_t start = line.find_first_not_of(" \t\r\n"); if (start == std::string::npos) continue; size_t end = line.find_last_not_of(" \t\r\n"); @@ -542,6 +506,8 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) } // cleanup + free(inchi_filename); + free(input_file); remove(out_txt.c_str()); remove(out_log.c_str()); remove(out_prb.c_str()); @@ -649,7 +615,6 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) long *num_err; int output_error_inchi; - memset(ip, 0, sizeof(*ip)); ip->last_struct_number = 1; ip->nInputType = INPUT_MOLFILE; @@ -658,7 +623,6 @@ TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) inchi_ios_init(plog, INCHI_IOS_TYPE_STRING, stdout); inchi_ios_init(pprb, INCHI_IOS_TYPE_STRING, nullptr); - // PrintInputParms(plog, ip); inchi_ios_flush2(plog, stderr); int ret = GetTheNextRecordOfInputFile( diff --git a/_deps/googletest-src b/_deps/googletest-src deleted file mode 160000 index 52eb8108..00000000 --- a/_deps/googletest-src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 52eb8108c5bdec04579160ae17225d66034bd723 From 5067af038d3f1f78b74ad909bb9eb7aa905d802d Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Fri, 19 Dec 2025 09:46:04 +0000 Subject: [PATCH 37/41] Added free function for inchi_output --- INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp b/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp index e0f7fdf9..1118c7fd 100644 --- a/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp @@ -87,4 +87,6 @@ TEST(inchi_dll_b_testing, test_MakeINCHIFromMolfileText) // Works with other V3000 molfile. ASSERT_EQ(MakeINCHIFromMolfileText(ethanol, options, poutput), 0); + + FreeINCHI(poutput); } From 8840be363350fbd924f7fc9399d429754831f544 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Fri, 19 Dec 2025 12:36:39 +0000 Subject: [PATCH 38/41] Bugfix for double free of logs and messages --- INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp b/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp index 1118c7fd..d0a311fd 100644 --- a/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp @@ -88,5 +88,7 @@ TEST(inchi_dll_b_testing, test_MakeINCHIFromMolfileText) // Works with other V3000 molfile. ASSERT_EQ(MakeINCHIFromMolfileText(ethanol, options, poutput), 0); + poutput->szLog = nullptr; + poutput->szMessage = nullptr; FreeINCHI(poutput); } From c533e3a01bb896d00ddb2402cc8ff4068b3a07f8 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 22 Dec 2025 09:09:29 +0000 Subject: [PATCH 39/41] Fixed memory leakage in unit-test --- INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp b/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp index a0fff86c..3c670e31 100644 --- a/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp @@ -53,4 +53,6 @@ TEST(inchi_dll_b_testing, test_MakeINCHIFromMolfileText) ASSERT_EQ(MakeINCHIFromMolfileText(ferrocene, options, poutput), 1); ASSERT_STREQ(poutput->szInChI, expected_inchi); + + FreeINCHI(poutput); } From fbf2a302677b7efe0e8cb196353d9a8e77ad4282 Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Mon, 22 Dec 2025 09:57:21 +0000 Subject: [PATCH 40/41] Rename gtest test suite names to file names --- .../tests/test_unit/test_ichimain.cpp | 10 +-- .../tests/test_unit/test_inchi_dll_b.cpp | 2 +- INCHI-1-TEST/tests/test_unit/test_inpdef.cpp | 2 +- INCHI-1-TEST/tests/test_unit/test_mol_fmt.cpp | 24 +++--- .../tests/test_unit/test_permutation_util.cpp | 2 +- INCHI-1-TEST/tests/test_unit/test_strutil.cpp | 10 +-- INCHI-1-TEST/tests/test_unit/test_util.cpp | 78 +++++++++---------- 7 files changed, 64 insertions(+), 64 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp index d50a451d..b6f266bb 100644 --- a/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_ichimain.cpp @@ -52,7 +52,7 @@ char *read_inchi_from_file(const char *filename) { return make_arg(found_inchi.c_str()); } -TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { +TEST(test_ichimain, test_CalcAndPrintINCHIAndINCHIKEY) { INCHI_IOSTREAM input_stream; @@ -301,7 +301,7 @@ TEST(ichimain_testing, test_CalcAndPrintINCHIAndINCHIKEY) { } -TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) +TEST(test_ichimain, test_ProcessMultipleInputFiles_2mol_files) { std::vector expected_inchis = { @@ -378,7 +378,7 @@ TEST(ichimain_testing, test_ProcessMultipleInputFiles_2mol_files) } } -TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) +TEST(test_ichimain, test_ProcessSingleInputFile_caffeine) { const char *filename_caffeine = "caffeine.mol"; @@ -438,7 +438,7 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_caffeine) rmdir(tmpd); } -TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) +TEST(test_ichimain, test_ProcessSingleInputFile_2mols_sdf) { const char *filename_2mols = "test_mols_2.sdf"; @@ -515,7 +515,7 @@ TEST(ichimain_testing, test_ProcessSingleInputFile_2mols_sdf) rmdir(tmpd); } -TEST(ichimain_testing, test_GetTheNextRecordOfInputFile) +TEST(test_ichimain, test_GetTheNextRecordOfInputFile) { INCHI_IOSTREAM input_stream; diff --git a/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp b/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp index 3c670e31..2f2ce08f 100644 --- a/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_inchi_dll_b.cpp @@ -5,7 +5,7 @@ extern "C" #include "../../../INCHI-1-SRC/INCHI_BASE/src/inchi_api.h" } -TEST(inchi_dll_b_testing, test_MakeINCHIFromMolfileText) +TEST(test_inchi_dll_b, test_MakeINCHIFromMolfileText) { const char *ferrocene = "Ferrocene\n" diff --git a/INCHI-1-TEST/tests/test_unit/test_inpdef.cpp b/INCHI-1-TEST/tests/test_unit/test_inpdef.cpp index 16fd138b..62df9f7d 100644 --- a/INCHI-1-TEST/tests/test_unit/test_inpdef.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_inpdef.cpp @@ -7,7 +7,7 @@ extern "C" #include "../../../INCHI-1-SRC/INCHI_BASE/src/inpdef.h" } -TEST(inpdef_testing, test_CreateOrigInpDataFromMolfile_v3000_sgroup) +TEST(test_inpdef, test_CreateOrigInpDataFromMolfile_v3000_sgroup) { INCHI_IOSTREAM input_stream; diff --git a/INCHI-1-TEST/tests/test_unit/test_mol_fmt.cpp b/INCHI-1-TEST/tests/test_unit/test_mol_fmt.cpp index d663e83e..23003716 100644 --- a/INCHI-1-TEST/tests/test_unit/test_mol_fmt.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_mol_fmt.cpp @@ -7,7 +7,7 @@ extern "C" #include "../../../INCHI-1-SRC/INCHI_BASE/src/ichi_io.h" } -TEST(mol_fmt_testing, test_MolfileStrnread) +TEST(test_mol_fmt, test_MolfileStrnread) { int string_len = 100; char dest[string_len]; @@ -26,7 +26,7 @@ TEST(mol_fmt_testing, test_MolfileStrnread) EXPECT_EQ(first_space[0], ' '); // space terminator } -TEST(mol_fmt_testing, test_MolfileReadField) +TEST(test_mol_fmt, test_MolfileReadField) { // int MolfileReadField(void *data, int field_len, int data_type, char **line_ptr) @@ -108,7 +108,7 @@ TEST(mol_fmt_testing, test_MolfileReadField) EXPECT_EQ(line_ptr8, source_data8 + 4); } -TEST(mol_fmt_testing, test_MolfileV3000ReadField) +TEST(test_mol_fmt, test_MolfileV3000ReadField) { // int MolfileV3000ReadField(void *data, @@ -126,7 +126,7 @@ TEST(mol_fmt_testing, test_MolfileV3000ReadField) EXPECT_EQ(n_coll, 2); } -TEST(mol_fmt_testing, test_MolfileExtractStrucNum) +TEST(test_mol_fmt, test_MolfileExtractStrucNum) { // long MolfileExtractStrucNum(MOL_FMT_HEADER_BLOCK *pHdr); @@ -181,7 +181,7 @@ TEST(mol_fmt_testing, test_MolfileExtractStrucNum) EXPECT_EQ(num, 0); } -TEST(mol_fmt_testing, test_MolfileV3000ReadStereoCollection) +TEST(test_mol_fmt, test_MolfileV3000ReadStereoCollection) { // int MolfileV3000ReadStereoCollection(MOL_FMT_CTAB *ctab, @@ -228,7 +228,7 @@ TEST(mol_fmt_testing, test_MolfileV3000ReadStereoCollection) inchi_free(num_list); } -TEST(mol_fmt_testing, test_MolfileV3000ReadCollections) +TEST(test_mol_fmt, test_MolfileV3000ReadCollections) { INCHI_IOSTREAM input_stream; @@ -316,7 +316,7 @@ TEST(mol_fmt_testing, test_MolfileV3000ReadCollections) inchi_ios_free_str(&input_stream); } -TEST(mol_fmt_testing, test_MolfileHasNoChemStruc) +TEST(test_mol_fmt, test_MolfileHasNoChemStruc) { MOL_FMT_DATA mfdata; MOL_FMT_CTAB ctab; @@ -360,7 +360,7 @@ TEST(mol_fmt_testing, test_MolfileHasNoChemStruc) free(atoms); } -TEST(mol_fmt_testing, test_FreeMolfileData) +TEST(test_mol_fmt, test_FreeMolfileData) { MOL_FMT_DATA *mfdata; @@ -407,7 +407,7 @@ TEST(mol_fmt_testing, test_FreeMolfileData) inchi_free(sgroups); } -TEST(mol_fmt_testing, test_ReadMolfile_v2000) +TEST(test_mol_fmt, test_ReadMolfile_v2000) { INCHI_IOSTREAM input_stream; @@ -528,7 +528,7 @@ TEST(mol_fmt_testing, test_ReadMolfile_v2000) FreeMolfileData(result); } -TEST(mol_fmt_testing, test_ReadMolfile_v3000) +TEST(test_mol_fmt, test_ReadMolfile_v3000) { INCHI_IOSTREAM input_stream; @@ -655,7 +655,7 @@ TEST(mol_fmt_testing, test_ReadMolfile_v3000) FreeMolfileData(result); } -TEST(mol_fmt_testing, test_ReadMolfile_v3000_collection_1) +TEST(test_mol_fmt, test_ReadMolfile_v3000_collection_1) { INCHI_IOSTREAM input_stream; @@ -765,7 +765,7 @@ TEST(mol_fmt_testing, test_ReadMolfile_v3000_collection_1) FreeMolfileData(result); } -TEST(mol_fmt_testing, test_ReadMolfile_v3000_collection_2) +TEST(test_mol_fmt, test_ReadMolfile_v3000_collection_2) { INCHI_IOSTREAM input_stream; diff --git a/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp b/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp index ad98e559..75da2565 100644 --- a/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_permutation_util.cpp @@ -8,7 +8,7 @@ extern "C" #include "../../../INCHI-1-SRC/INCHI_BASE/src/permutation_util.h" } -TEST(permutation_util_testing, test_OrigAtData_Permute) +TEST(test_permutation_util, test_OrigAtData_Permute) { // 1. Populate atom data diff --git a/INCHI-1-TEST/tests/test_unit/test_strutil.cpp b/INCHI-1-TEST/tests/test_unit/test_strutil.cpp index d154fa4b..f09afffe 100644 --- a/INCHI-1-TEST/tests/test_unit/test_strutil.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_strutil.cpp @@ -5,7 +5,7 @@ extern "C" #include "../../../INCHI-1-SRC/INCHI_BASE/src/strutil.h" } -TEST(strutil_testing, test_ExtractConnectedComponent) +TEST(test_strutil, test_ExtractConnectedComponent) { int num_atoms = 3; @@ -27,7 +27,7 @@ TEST(strutil_testing, test_ExtractConnectedComponent) FreeInpAtom(&cmp_mol); } -TEST(strutil_testing, test_SetConnectedComponentNumber) +TEST(test_strutil, test_SetConnectedComponentNumber) { int num_atoms = 1; @@ -44,7 +44,7 @@ TEST(strutil_testing, test_SetConnectedComponentNumber) FreeInpAtom(&new_mol); } -TEST(strutil_testing, test_UnMarkRingSystemsInp) +TEST(test_strutil, test_UnMarkRingSystemsInp) { int num_atoms = 5; @@ -65,7 +65,7 @@ TEST(strutil_testing, test_UnMarkRingSystemsInp) FreeInpAtom(&new_mol); } -TEST(strutil_testing, test_CreateAndFreeInpAtom) +TEST(test_strutil, test_CreateAndFreeInpAtom) { int num_atoms = 10; @@ -96,7 +96,7 @@ TEST(strutil_testing, test_CreateAndFreeInpAtom) EXPECT_EQ(new_mol2, nullptr); } -TEST(strutil_testing, test_CreateAndFreeInpAtomData) +TEST(test_strutil, test_CreateAndFreeInpAtomData) { int num_atoms = 10; diff --git a/INCHI-1-TEST/tests/test_unit/test_util.cpp b/INCHI-1-TEST/tests/test_unit/test_util.cpp index fa9e88a8..037caa99 100644 --- a/INCHI-1-TEST/tests/test_unit/test_util.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_util.cpp @@ -5,7 +5,7 @@ extern "C" #include "../../../INCHI-1-SRC/INCHI_BASE/src/util.h" } -TEST(util_testing, test_get_chemical_symbols) +TEST(test_util, test_get_chemical_symbols) { char szElement[4]; @@ -30,7 +30,7 @@ TEST(util_testing, test_get_chemical_symbols) EXPECT_STREQ(szElement, "??"); } -TEST(util_testing, test_get_element_or_pseudoelement_symbol) +TEST(test_util, test_get_element_or_pseudoelement_symbol) { char szElement[4]; @@ -53,7 +53,7 @@ TEST(util_testing, test_get_element_or_pseudoelement_symbol) EXPECT_STREQ(szElement, "??"); } -TEST(util_testing, test_get_periodic_table_number) +TEST(test_util, test_get_periodic_table_number) { char szElement[4]; @@ -69,7 +69,7 @@ TEST(util_testing, test_get_periodic_table_number) EXPECT_EQ(get_periodic_table_number("Zz"), 120); } -TEST(util_testing, test_if_skip_add_H) +TEST(test_util, test_if_skip_add_H) { EXPECT_EQ(if_skip_add_H(-1), 0); @@ -80,7 +80,7 @@ TEST(util_testing, test_if_skip_add_H) // EXPECT_EQ(if_skip_add_H(300), 0); --> SEG FAULT } -TEST(util_testing, test_get_el_valence) +TEST(test_util, test_get_el_valence) { // nPeriodicNum, charge, val_num EXPECT_EQ(get_el_valence(0, -3, 0), 0); @@ -98,7 +98,7 @@ TEST(util_testing, test_get_el_valence) EXPECT_EQ(get_el_valence(82, -2, 2), 6); } -TEST(util_testing, test_get_atomic_mass) +TEST(test_util, test_get_atomic_mass) { EXPECT_EQ(get_atomic_mass(""), 0); EXPECT_EQ(get_atomic_mass(" "), 0); @@ -119,7 +119,7 @@ TEST(util_testing, test_get_atomic_mass) EXPECT_EQ(get_atomic_mass("Pb"), 207); } -TEST(util_testing, test_get_atomic_mass_from_elnum) +TEST(test_util, test_get_atomic_mass_from_elnum) { EXPECT_EQ(get_atomic_mass_from_elnum(-1), 0); EXPECT_EQ(get_atomic_mass_from_elnum(0), 0); @@ -140,7 +140,7 @@ TEST(util_testing, test_get_atomic_mass_from_elnum) EXPECT_EQ(get_atomic_mass_from_elnum(23423423), 0); } -TEST(util_testing, test_get_el_type) +TEST(test_util, test_get_el_type) { EXPECT_EQ(get_el_type(-1), 0); EXPECT_EQ(get_el_type(0), 0); @@ -163,7 +163,7 @@ TEST(util_testing, test_get_el_type) // EXPECT_EQ(get_el_type(23423423), 0); --> seg fault } -TEST(util_testing, test_is_el_a_metal) +TEST(test_util, test_is_el_a_metal) { EXPECT_EQ(is_el_a_metal(-1), false); EXPECT_EQ(is_el_a_metal(0), false); @@ -187,7 +187,7 @@ TEST(util_testing, test_is_el_a_metal) // --------------------------- // lrtrim -TEST(util_testing, test_lrtrim) +TEST(test_util, test_lrtrim) { char test_string1[7] = " InChI"; @@ -209,7 +209,7 @@ TEST(util_testing, test_lrtrim) // --------------------------- // extract_H_atoms( char *elname, S_CHAR num_iso_H[] ) -TEST(util_testing, test_extract_H_atoms) +TEST(test_util, test_extract_H_atoms) { S_CHAR num_iso_H[NUM_H_ISOTOPES] = {0}; @@ -247,7 +247,7 @@ TEST(util_testing, test_extract_H_atoms) EXPECT_EQ(extract_H_atoms(elname, num_iso_H), 0); } -TEST(util_testing, test_get_num_H) +TEST(test_util, test_get_num_H) { // const char *elname, int inp_num_H, S_CHAR *num_iso_H, int charge, int radical, // int chem_bonds_valence, int atom_input_valence, int bAliased, int bDoNotAddH, int bHasMetalNeighbor @@ -257,7 +257,7 @@ TEST(util_testing, test_get_num_H) EXPECT_EQ(get_num_H("C", 0, num_iso_H, 0, 0, 0, 0, 0, 0, 0), 4); } -TEST(util_testing, test_get_unusual_el_valence) +TEST(test_util, test_get_unusual_el_valence) { EXPECT_EQ(get_unusual_el_valence(0, 0, 0, 0, 0, 0), 0); EXPECT_EQ(get_unusual_el_valence(6, 0, 0, 4, 0, 0), 0); @@ -267,7 +267,7 @@ TEST(util_testing, test_get_unusual_el_valence) EXPECT_EQ(get_unusual_el_valence(82, -2, 2, 6, 3, 3), 9); } -TEST(util_testing, test_detect_unusual_el_valence) +TEST(test_util, test_detect_unusual_el_valence) { // nPeriodicNum, charge, radical, bonds_valence, num_H, num_bonds EXPECT_EQ(detect_unusual_el_valence(0, 0, 0, 0, 0, 0), 0); @@ -278,7 +278,7 @@ TEST(util_testing, test_detect_unusual_el_valence) EXPECT_EQ(detect_unusual_el_valence(82, -2, 2, 6, 3, 3), 9); } -TEST(util_testing, test_normalize_string) +TEST(test_util, test_normalize_string) { char test_string1[7] = " InChI"; EXPECT_EQ(normalize_string(test_string1), 5); @@ -297,7 +297,7 @@ TEST(util_testing, test_normalize_string) EXPECT_STREQ(test_string4, "sdfds sfsfd ew"); } -TEST(util_testing, test_read_upto_delim) +TEST(test_util, test_read_upto_delim) { // read_upto_delim(char **pstring, char *field, int maxlen, char *delims) @@ -349,7 +349,7 @@ TEST(util_testing, test_read_upto_delim) EXPECT_STREQ(test_string6_inp, "field1,field2,field3"); } -TEST(util_testing, test_is_matching_any_delim) +TEST(test_util, test_is_matching_any_delim) { char delims1[] = "abc"; @@ -366,7 +366,7 @@ TEST(util_testing, test_is_matching_any_delim) EXPECT_FALSE(is_matching_any_delim('a', delims2)); } -TEST(util_testing, test_dotify_non_printable_chars) +TEST(test_util, test_dotify_non_printable_chars) { // dotify_non_printable_chars(char *line) char test_string1[] = "Hello\x01World"; @@ -382,7 +382,7 @@ TEST(util_testing, test_dotify_non_printable_chars) EXPECT_STREQ(test_string3, "NoChange"); } -TEST(util_testing, test_remove_trailing_spaces) +TEST(test_util, test_remove_trailing_spaces) { // remove_trailing_spaces(char *p) char test_string1[] = "Hello World "; @@ -394,7 +394,7 @@ TEST(util_testing, test_remove_trailing_spaces) EXPECT_STREQ(test_string3, "NoTrailingSpaces"); } -TEST(util_testing, test_remove_one_lf) +TEST(test_util, test_remove_one_lf) { // remove_one_lf(char *p) char test_string1[] = "Hello World\n"; @@ -422,7 +422,7 @@ TEST(util_testing, test_remove_one_lf) EXPECT_STREQ(test_string6, ""); } -TEST(util_testing, test_mystrncpy) +TEST(test_util, test_mystrncpy) { // mystrncpy(char *target, const char *source, unsigned maxlen) char target[20]; @@ -440,7 +440,7 @@ TEST(util_testing, test_mystrncpy) EXPECT_EQ(mystrncpy(NULL, source, 10), 0); // target is NULL } -TEST(util_testing, test_inchi_memicmp) +TEST(test_util, test_inchi_memicmp) { // inchi_memicmp(const void *p1, const void *p2, size_t length) @@ -471,7 +471,7 @@ TEST(util_testing, test_inchi_memicmp) EXPECT_TRUE(inchi_memicmp(str9, str10, 20) > 0); } -TEST(util_testing, test_inchi_stricmp) +TEST(test_util, test_inchi_stricmp) { // inchi_stricmp(const char *s1, const char *s2) @@ -485,7 +485,7 @@ TEST(util_testing, test_inchi_stricmp) EXPECT_TRUE(inchi_stricmp("123", "12455454") < 0); } -TEST(util_testing, test_inchi_strnset) +TEST(test_util, test_inchi_strnset) { // char *inchi__strnset(char *s, int val, size_t length) @@ -499,7 +499,7 @@ TEST(util_testing, test_inchi_strnset) EXPECT_STREQ(inchi__strnset(test_string3, 'Z', 0), "NoChange"); } -TEST(util_testing, test_inchi_strdup) +TEST(test_util, test_inchi_strdup) { // char *inchi__strdup(const char *string) @@ -512,7 +512,7 @@ TEST(util_testing, test_inchi_strdup) free(dup2); } -TEST(util_testing, test_inchi_strtol) +TEST(test_util, test_inchi_strtol) { // long inchi_strtol(const char *str, const char **p, int base) @@ -525,7 +525,7 @@ TEST(util_testing, test_inchi_strtol) EXPECT_EQ(result2, 0); } -TEST(util_testing, test_inchi_strtod) +TEST(test_util, test_inchi_strtod) { // double inchi_strtod(const char *str, const char **p) @@ -539,7 +539,7 @@ TEST(util_testing, test_inchi_strtod) EXPECT_EQ(*endptr, 'a'); } -TEST(util_testing, test_is_in_the_list) +TEST(test_util, test_is_in_the_list) { // AT_NUMB *is_in_the_list(AT_NUMB *pathAtom, AT_NUMB nNextAtom, int nPathLen) @@ -559,7 +559,7 @@ TEST(util_testing, test_is_in_the_list) EXPECT_FALSE(is_in_the_list(pathAtom3, nNextAtom3, nPathLen3)); } -TEST(util_testing, test_is_in_the_ilist) +TEST(test_util, test_is_in_the_ilist) { // int *is_in_the_ilist(int *pathAtom, int nNextAtom, int nPathLen) @@ -580,7 +580,7 @@ TEST(util_testing, test_is_in_the_ilist) EXPECT_FALSE(is_in_the_ilist(pathAtom3, nNextAtom3, nPathLen3)); } -TEST(util_testing, test_is_ilist_inside) +TEST(test_util, test_is_ilist_inside) { // int is_ilist_inside(int *ilist, int nlist, int *ilist2, int nlist2) @@ -599,7 +599,7 @@ TEST(util_testing, test_is_ilist_inside) EXPECT_TRUE(is_ilist_inside(pathAtom4, 0, pathAtom5, 0)); } -TEST(util_testing, test_nBondsValToMetal) +TEST(test_util, test_nBondsValToMetal) { // int nBondsValToMetal(inp_ATOM *at, int iat) @@ -656,7 +656,7 @@ TEST(util_testing, test_nBondsValToMetal) FreeInpAtom(&atoms2); } -TEST(util_testing, test_num_of_H) +TEST(test_util, test_num_of_H) { // int num_of_H(inp_ATOM *at, int iat) @@ -734,7 +734,7 @@ TEST(util_testing, test_num_of_H) FreeInpAtom(&atoms2); } -TEST(util_testing, test_ion_el_group) +TEST(test_util, test_ion_el_group) { // U_CHAR ion_el_group(int el) @@ -744,7 +744,7 @@ TEST(util_testing, test_ion_el_group) EXPECT_EQ(ion_el_group(get_periodic_table_number("Mn")), 0); } -TEST(util_testing, test_has_other_ion_neigh) +TEST(test_util, test_has_other_ion_neigh) { // int has_other_ion_neigh(inp_ATOM *at, int iat, int iat_ion_neigh) @@ -765,7 +765,7 @@ TEST(util_testing, test_has_other_ion_neigh) FreeInpAtom(&atoms1); } -TEST(util_testing, test_extract_charges_and_radicals) +TEST(test_util, test_extract_charges_and_radicals) { // int extract_charges_and_radicals(char *elname, int *pnRadical, int *pnCharge) @@ -849,7 +849,7 @@ TEST(util_testing, test_extract_charges_and_radicals) EXPECT_EQ(nCharge, 0); } -TEST(util_testing, test_extract_inchi_substring) +TEST(test_util, test_extract_inchi_substring) { // void extract_inchi_substring(char **buf, const char *str, size_t slen) @@ -882,7 +882,7 @@ TEST(util_testing, test_extract_inchi_substring) free(buf2); } -TEST(util_testing, test_extract_auxinfo_substring) +TEST(test_util, test_extract_auxinfo_substring) { // void extract_auxinfo_substring(char **buf, const char *str, size_t slen) @@ -928,7 +928,7 @@ TEST(util_testing, test_extract_auxinfo_substring) free(buf4); } -TEST(util_testing, test_extract_stereo_info_from_inchi_string) +TEST(test_util, test_extract_stereo_info_from_inchi_string) { // int extract_stereo_info_from_inchi_string(char *sinchi, int nat, int *orig, int *at_stereo_mark); @@ -979,7 +979,7 @@ TEST(util_testing, test_extract_stereo_info_from_inchi_string) EXPECT_EQ(found_stereo2, 0); } -// TEST(util_testing, test_extract_all_backbone_bonds_from_inchi_string) +// TEST(test_util, test_extract_all_backbone_bonds_from_inchi_string) // { // // int extract_all_backbone_bonds_from_inchi_string(char *sinchi, int *n_all_bkb_orig, int *orig, int *all_bkb_orig); From f90d21b5fa973556ce1e378a9ced760927d882da Mon Sep 17 00:00:00 2001 From: Christoph Mueller Date: Thu, 18 Dec 2025 09:29:06 +0000 Subject: [PATCH 41/41] added or infos to comments --- INCHI-1-TEST/tests/test_unit/test_inpdef.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INCHI-1-TEST/tests/test_unit/test_inpdef.cpp b/INCHI-1-TEST/tests/test_unit/test_inpdef.cpp index 62df9f7d..986b6c6d 100644 --- a/INCHI-1-TEST/tests/test_unit/test_inpdef.cpp +++ b/INCHI-1-TEST/tests/test_unit/test_inpdef.cpp @@ -147,13 +147,13 @@ TEST(test_inpdef, test_CreateOrigInpDataFromMolfile_v3000_sgroup) EXPECT_EQ(orig_at_data.v3000->n_sterel, 2); - // STEREL1 ATOMS=(2 12 13) + // STEREL1 ATOMS=(2 12 13) or1 EXPECT_EQ(orig_at_data.v3000->lists_sterel[0][0], 1); // n from "STERELn" tag EXPECT_EQ(orig_at_data.v3000->lists_sterel[0][1], 2); // number of members in collection EXPECT_EQ(orig_at_data.v3000->lists_sterel[0][2], 12); // member atom numbers EXPECT_EQ(orig_at_data.v3000->lists_sterel[0][3], 13); // member atom numbers - // STEREL2 ATOMS=(1 14) + // STEREL2 ATOMS=(1 14) or2 EXPECT_EQ(orig_at_data.v3000->lists_sterel[1][0], 2); // n from "STERELn" tag EXPECT_EQ(orig_at_data.v3000->lists_sterel[1][1], 1); // number of members in collection EXPECT_EQ(orig_at_data.v3000->lists_sterel[1][2], 14); // member atom numbers