ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/src/mengine/src/read_sdf.c
(Generate patch)
# Line 1 | Line 1
1 + /* NOTICE: this source code file has been modified for use with FreeMOL */
2   #define EXTERN extern
3  
4   #include "pcwin.h"
# Line 74 | Line 75
75         }
76       }
77      /*     now write the concord file */
78 + /*
79      if (files.append)
80          wfile = fopen_path(Savebox.path,Savebox.fname,"a");
81      else
82          wfile = fopen_path(Savebox.path,Savebox.fname,"w");
83 + */
84 +        wfile = stdout;
85  
86      j = strlen(Struct_Title);
87      for (i=0; i < j; i++)
# Line 146 | Line 150
150  
151      fprintf(wfile,"\n");
152      fprintf(wfile,"$$$$\n");
153 <    fclose(wfile);
153 > //    fclose(wfile);
154   }
155   /* ===================================  */
156   // fast read - assume file is open and positioned
# Line 168 | Line 172
172       Ret_Val = TRUE;
173       got_title = FALSE;
174       xPlus = yPlus = zPlus = FALSE;
175 <     FetchRecord(rfile,inputline);
176 <     sscanf(inputline,"SDF %s",Struct_Title);
175 >     if ( 0 == FetchRecord(rfile,inputline) )return -1;
176 > //   sscanf(inputline,"SDF %s",Struct_Title);
177 >     strncpy(Struct_Title, inputline, sizeof(Struct_Title));
178       got_title = TRUE;
179       /*     if (strlen(inputline) > 4)
180       {
# Line 251 | Line 256
256          {
257              ibond = 1;
258              has_Aromatic = TRUE;
259 + // TJO
260 +            Ret_Val = FALSE;
261          }
262          make_bond(ia1, ia2, ibond);
263          if (istereo == 1 && planar)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines