#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"
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_DATA * | FreeMolfileData (MOL_FMT_DATA *mfdata) |
#define MAX_STDATA_AVE_BOND_LENGTH 20.0 |
#define MAX_STDATA_X_COORD 256.0 |
#define MAX_STDATA_Y_COORD 256.0 |
#define MAX_STDATA_Z_COORD 256.0 |
#define MIN_STDATA_AVE_BOND_LENGTH 10.0 |
#define MIN_STDATA_X_COORD 0.0 |
#define MIN_STDATA_Y_COORD 0.0 |
#define MIN_STDATA_Z_COORD 0.0 |
MOL_FMT_DATA * FreeMolfileData | ( | MOL_FMT_DATA * | mfdata | ) |
long MolfileExtractStrucNum | ( | MOL_FMT_HEADER_BLOCK * | pHdr | ) |
Extract the MOL file number from the header name line like "Structure #22".
pHdr | Pointer to the header block. |
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 | ||
) |
int MolfileHasNoChemStruc | ( | MOL_FMT_DATA * | mfdata | ) |
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'.
data | Pointer to the destination buffer. |
field_len | Length 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_type | Type of the data to read. E.g. MOL_FMT_STRING_DATA, MOL_FMT_CHAR_INT_DATA, etc. |
line_ptr | Pointer to a variable that will receive the address of the next line. |
on exit *line_ptr points to the next byte after the last entered
int MolfileSaveCopy | ( | INCHI_IOSTREAM * | inp_file, |
long | fPtrStart, | ||
long | fPtrEnd, | ||
FILE * | outfile, | ||
long | num | ||
) |
int MolfileStrnread | ( | char * | dest, |
char * | source, | ||
int | len, | ||
char ** | first_space | ||
) |
Read a string from a source buffer into a destination buffer.
dest | Pointer to the destination buffer. |
source | Pointer to the source buffer. |
len | Length of the string to read. |
first_space | Pointer to a variable that will receive the address of the first space character in the source buffer. |