#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) |
| Check if the MOL file has no chemical structure. | |
| int | MolfileSaveCopy (INCHI_IOSTREAM *inp_file, long fPtrStart, long fPtrEnd, FILE *outfile, long num) |
| Copy MOL-formatted data of SDF record or Molfile to another file. | |
| 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) |
| Get xyz dimensionality and normalization factors in the MOL file. | |
| MOL_FMT_DATA * | FreeMolfileData (MOL_FMT_DATA *mfdata) |
| Free MOL file data structure. | |
| #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 | ) |
Free MOL file data structure.
| mfdata | Pointer to the MOL file data structure to free. |
Here is the call graph for this function:
Here is the caller graph for this function:| 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. |
Here is the call graph for this function:
Here is the caller graph for this function:| 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 | ||
| ) |
Get xyz dimensionality and normalization factors in the MOL file.
| mfdata | Pointer to the MOL file data structure. |
| find_norm_factors | Flag indicating whether to find normalization/scaling factors. |
| x0 | Pointer to the minimum x-coordinate of the molecule. |
| y0 | Pointer to the minimum y-coordinate of the molecule. |
| z0 | Pointer to the minimum z-coordinate of the molecule. |
| xmin | Pointer to the x-coordinate (is set to 0). |
| ymin | Pointer to the y-coordinate (is set to 0). |
| zmin | Pointer to the z-coordinate (is set to 0). |
| scaler | Pointer to the scaling factor. |
| err | Pointer to the error code. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileHasNoChemStruc | ( | MOL_FMT_DATA * | mfdata | ) |
Check if the MOL file has no chemical structure.
| mfdata | Pointer to the MOL file data structure. |
Here is the caller graph for this function:| 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
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileSaveCopy | ( | INCHI_IOSTREAM * | inp_file, |
| long | fPtrStart, | ||
| long | fPtrEnd, | ||
| FILE * | outfile, | ||
| long | num | ||
| ) |
Copy MOL-formatted data of SDF record or Molfile to another file.
| inp_file | Pointer to the input file stream. |
| fPtrStart | File pointer position to start copying from. |
| fPtrEnd | File pointer position to stop copying at. |
| outfile | Pointer to the output file stream. |
| num | Structure number to write in the header line. |
Here is the call graph for this function:
Here is the caller graph for this function:| 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. |
Here is the caller graph for this function: