InChI
 
Loading...
Searching...
No Matches
mol_fmt2.c File Reference
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include "mode.h"
#include "mol_fmt.h"
#include "ichierr.h"
#include "util.h"
#include "ichi_io.h"
#include "bcf_s.h"
+ Include dependency graph for mol_fmt2.c:

Macros

#define MIN_STDATA_X_COORD   0.0
 
#define MAX_STDATA_X_COORD   256.0
 
#define MIN_STDATA_Y_COORD   0.0
 
#define MAX_STDATA_Y_COORD   256.0
 
#define MIN_STDATA_Z_COORD   0.0
 
#define MAX_STDATA_Z_COORD   256.0
 
#define MAX_STDATA_AVE_BOND_LENGTH   20.0
 
#define MIN_STDATA_AVE_BOND_LENGTH   10.0
 

Functions

int MolfileStrnread (char *dest, char *source, int len, char **first_space)
 Read a string from a source buffer into a destination buffer.
 
int MolfileReadField (void *data, int field_len, int data_type, char **line_ptr)
 Extract the 'data' in the MOL file field at given text position 'line_ptr'.
 
long MolfileExtractStrucNum (MOL_FMT_HEADER_BLOCK *pHdr)
 Extract the MOL file number from the header name line like "Structure #22".
 
int MolfileHasNoChemStruc (MOL_FMT_DATA *mfdata)
 
int MolfileSaveCopy (INCHI_IOSTREAM *inp_file, long fPtrStart, long fPtrEnd, FILE *outfile, long num)
 
int MolfileGetXYZDimAndNormFactors (MOL_FMT_DATA *mfdata, int find_norm_factors, double *x0, double *y0, double *z0, double *xmin, double *ymin, double *zmin, double *scaler, int *err, char *pStrErr)
 
MOL_FMT_DATAFreeMolfileData (MOL_FMT_DATA *mfdata)
 

Macro Definition Documentation

◆ MAX_STDATA_AVE_BOND_LENGTH

#define MAX_STDATA_AVE_BOND_LENGTH   20.0

◆ MAX_STDATA_X_COORD

#define MAX_STDATA_X_COORD   256.0

◆ MAX_STDATA_Y_COORD

#define MAX_STDATA_Y_COORD   256.0

◆ MAX_STDATA_Z_COORD

#define MAX_STDATA_Z_COORD   256.0

◆ MIN_STDATA_AVE_BOND_LENGTH

#define MIN_STDATA_AVE_BOND_LENGTH   10.0

◆ MIN_STDATA_X_COORD

#define MIN_STDATA_X_COORD   0.0

◆ MIN_STDATA_Y_COORD

#define MIN_STDATA_Y_COORD   0.0

◆ MIN_STDATA_Z_COORD

#define MIN_STDATA_Z_COORD   0.0

Function Documentation

◆ FreeMolfileData()

MOL_FMT_DATA * FreeMolfileData ( MOL_FMT_DATA mfdata)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileExtractStrucNum()

long MolfileExtractStrucNum ( MOL_FMT_HEADER_BLOCK pHdr)

Extract the MOL file number from the header name line like "Structure #22".

Parameters
pHdrPointer to the header block.
Returns
The structure number.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileGetXYZDimAndNormFactors()

int MolfileGetXYZDimAndNormFactors ( MOL_FMT_DATA mfdata,
int  find_norm_factors,
double *  x0,
double *  y0,
double *  z0,
double *  xmin,
double *  ymin,
double *  zmin,
double *  scaler,
int *  err,
char *  pStrErr 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileHasNoChemStruc()

int MolfileHasNoChemStruc ( MOL_FMT_DATA mfdata)
+ Here is the caller graph for this function:

◆ MolfileReadField()

int MolfileReadField ( void *  data,
int  field_len,
int  data_type,
char **  line_ptr 
)

Extract the 'data' in the MOL file field at given text position 'line_ptr'.

Parameters
dataPointer to the destination buffer.
field_lenLength of the field to read. For MOL_FMT_STRING_DATA does not include trailing zero, that is actual length of the string pointed by 'data' should be at least field_len+1 bytes. For numerical data 'field_len' is length of input data field For numerical integral data field_len <= 0 means read up to first non-numeric character as strtod() does ("free format")
data_typeType of the data to read. E.g. MOL_FMT_STRING_DATA, MOL_FMT_CHAR_INT_DATA, etc.
line_ptrPointer to a variable that will receive the address of the next line.
Returns
for MOL_FMT_STRING_DATA: number of bytes excluding trailing zero for all others: 1=success; 0 = empty; -1 = error

on exit *line_ptr points to the next byte after the last entered

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileSaveCopy()

int MolfileSaveCopy ( INCHI_IOSTREAM inp_file,
long  fPtrStart,
long  fPtrEnd,
FILE *  outfile,
long  num 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileStrnread()

int MolfileStrnread ( char *  dest,
char *  source,
int  len,
char **  first_space 
)

Read a string from a source buffer into a destination buffer.

Parameters
destPointer to the destination buffer.
sourcePointer to the source buffer.
lenLength of the string to read.
first_spacePointer to a variable that will receive the address of the first space character in the source buffer.
Returns
number of actually processed bytes excluding zero terminator.
+ Here is the caller graph for this function: