22 if (write(fd, i,
sizeof(
double) * nofNum) !=
sizeof(
double) * nofNum) {
23 G3d_error(
"G3d_writeDoubles: writing to file failed");
33 xdrmem_create(&xdrEncodeStream, xdrDoubleBuf,
43 if (!xdr_setpos(&xdrEncodeStream, 0)) {
44 G3d_error(
"G3d_writeDoubles: positioning xdr failed");
48 if (!xdr_vector(&xdrEncodeStream, (
char *)i, n,
sizeof(
double),
49 (xdrproc_t) xdr_double)) {
50 G3d_error(
"G3d_writeDoubles: writing xdr failed");
56 G3d_error(
"G3d_writeDoubles: writing xdr to file failed");
80 if (read(fd, i,
sizeof(
double) * nofNum) !=
sizeof(
double) * nofNum) {
81 G3d_error(
"G3d_readDoubles: reading from file failed");
90 xdrmem_create(&xdrDecodeStream, xdrDoubleBuf,
102 G3d_error(
"G3d_readDoubles: reading xdr from file failed");
106 if (!xdr_setpos(&xdrDecodeStream, 0)) {
107 G3d_error(
"G3d_readDoubles: positioning xdr failed");
111 if (!xdr_vector(&xdrDecodeStream, (
char *)i, n,
sizeof(
double),
112 (xdrproc_t) xdr_double)) {
113 G3d_error(
"G3d_readDoubles: reading xdr failed");
int G3d_readDoubles(int fd, int useXdr, double *i, int nofNum)
void G3d_error(const char *msg,...)
int G3d_writeDoubles(int fd, int useXdr, const double *i, int nofNum)
#define G3D_XDR_DOUBLE_LENGTH
void G3d_fatalError(const char *,...)
This function prints the error message msg, and terminates the program with an error status...