|
DLLSPEC void | hnb_fill_header (hnb_header_t *h, hnb_class_t fclass, hnb_format_t format, hnb_coord_t coord, double epoch, double G, double c, double M, double E0, const double L0[], double tinit, double stepsize, double rate, int id, int digits, const double offset[], const hnb_option_tag order[], int ncol) |
| Fills a header structure with specific values. More...
|
|
DLLSPEC size_t | hnb_read_file (double *ddata[], float *fdata[], size_t *nalloc, size_t nkeep, size_t nrec, size_t nresv, int raw, const hnb_header_t *h, FILE *f) |
|
DLLSPEC size_t | hnb_write_file (double *const ddata[], float *const fdata[], size_t nrec, int header, int raw, const hnb_header_t *h, FILE *f) |
| Writes data arrays to an HNBody output file. More...
|
|
DLLSPEC int | hnb_read_dataline (double data[], hnb_format_t format, int ncol, int size, const double offset[], FILE *f) |
|
DLLSPEC int | hnb_read_header (hnb_header_t *h, FILE *f) |
|
DLLSPEC int | hnb_seek_file (size_t rec, FILE *f) |
|
DLLSPEC int | hnb_tag2ctype (hnb_option_tag tag) |
|
DLLSPEC int | hnb_trim_file (const char *datafile, size_t nrec) |
|
DLLSPEC int | hnb_write_binary (const double data[], int nelem, int dprec, FILE *f) |
|
DLLSPEC int | hnb_write_dataline (const double data[], hnb_class_t fclass, hnb_format_t format, int ncol, int digits, const double offset[], FILE *f) |
|
DLLSPEC int | hnb_write_header (const hnb_header_t *h, FILE *f) |
|
DLLSPEC int | hnb_write_text (const double data[], int nelem, int digits, FILE *f) |
|
DLLSPEC hnb_option_tag | hnb_ctype2tag (int ctype) |
|
DLLSPEC FILE * | hnb_fopen (const char *file, const char *mode) |
| Opens an HNBody output file in a standardized manner. More...
|
|
DLLSPEC size_t hnb_write_file |
( |
double *const |
ddata[], |
|
|
float *const |
fdata[], |
|
|
size_t |
nrec, |
|
|
int |
header, |
|
|
int |
raw, |
|
|
const hnb_header_t * |
h, |
|
|
FILE * |
f |
|
) |
| |
This method writes a specified number of records to an open stream, optionally preceded by a standard HNBody output header. Either single or double precision data columns can be supplied and will be converted to the appropriate output format (double precision takes precedence).
- Parameters
-
ddata | is the array of data columns to output (double precision format; set to NULL if unavailable). |
fdata | is the array of data columns to output (single precision format; set to NULL if unavailable). |
nrec | is the number of data records to output. |
header | is non-zero if and only if an HNBody file header should be written. |
raw | is non-zero if and only if SMARTFLOAT offsets have already been subtracted from the input data columns (meaningful only for SMARTFLOAT output format). |
h | is the header corresponding the file f. |
f | is a stream pointing to HNBody output file records. |
- Returns
- The number of records successfully written.
References hnb_header_struct::fclass, hnb_header_struct::format, HNB_ORDER_MAX, hnb_header_struct::ncol, hnb_header_struct::offset, and hnb_header_struct::size.