00001 #ifndef HNBODY_OUTPUT_H
00002 #define HNBODY_OUTPUT_H
00003
00013 #include "hnbody/opts.h"
00014
00015 #ifdef __cplusplus
00016 extern "C" {
00017 namespace HNBODY {
00018 #endif
00019
00020
00022 #define HNB_MAGIC 462639
00023
00024
00026 typedef struct hnb_header_struct {
00027 double G, c, M, epoch, tinit, stepsize, rate, offset[HNB_ORDER_MAX];
00028 int magic, id, size, ncol, ctype[HNB_ORDER_MAX];
00029 hnb_class_t fclass;
00030 hnb_format_t format;
00031 hnb_coord_t coord;
00032 } hnb_header_t;
00033
00034
00035 DLLSPEC extern void
00036 hnb_fill_header(hnb_header_t *h, hnb_class_t fclass, hnb_format_t format,
00037 hnb_coord_t coord, double epoch, double G, double c, double M,
00038 double E0, const double L0[], double tinit, double stepsize, double rate,
00039 int id, int digits, const double offset[],
00040 const hnb_option_tag order[], int ncol);
00041
00042 DLLSPEC extern size_t
00043 hnb_read_file(double *ddata[], float *fdata[], size_t *nalloc,
00044 size_t nkeep, size_t nrec, size_t nresv, int raw,
00045 const hnb_header_t *h, FILE *f),
00046 hnb_write_file(double *const ddata[], float *const fdata[], size_t nrec,
00047 int header, int raw, const hnb_header_t *h, FILE *f);
00048
00049 DLLSPEC extern int
00050 hnb_read_dataline(double data[], hnb_format_t format, int ncol, int size,
00051 const double offset[], FILE *f),
00052 hnb_read_header(hnb_header_t *h, FILE *f),
00053 hnb_seek_file(size_t rec, FILE *f),
00054 hnb_tag2ctype(hnb_option_tag tag),
00055 hnb_trim_file(const char *datafile, size_t nrec),
00056 hnb_write_binary(const double data[], int nelem, int dprec, FILE *f),
00057 hnb_write_dataline(const double data[], hnb_class_t fclass,
00058 hnb_format_t format, int ncol, int digits, const double offset[], FILE *f),
00059 hnb_write_header(const hnb_header_t *h, FILE *f),
00060 hnb_write_text(const double data[], int nelem, int digits, FILE *f);
00061
00062 DLLSPEC extern hnb_option_tag
00063 hnb_ctype2tag(int ctype);
00064
00065 DLLSPEC extern FILE
00066 *hnb_fopen(const char *file, const char *mode);
00067
00068 #ifdef __cplusplus
00069 }
00070 }
00071 #endif
00072
00073 #endif