22 if (write(fd, i,
sizeof(
int) * nofNum) !=
sizeof(
int) * nofNum) {
23 G3d_error(
"G3d_writeInts: writing to file failed");
42 if (!xdr_setpos(&xdrEncodeStream, 0)) {
43 G3d_error(
"G3d_writeInts: positioning xdr failed");
47 if (!xdr_vector(&xdrEncodeStream, (
char *)i, n,
sizeof(
int),
48 (xdrproc_t) xdr_int)) {
49 G3d_error(
"G3d_writeInts: writing xdr failed");
55 G3d_error(
"G3d_writeInts: writing xdr to file failed");
79 if (read(fd, i,
sizeof(
int) * nofNum) !=
sizeof(
int) * nofNum) {
80 G3d_error(
"G3d_readInts: reading from file failed");
101 G3d_error(
"G3d_readInts: reading xdr from file failed");
105 if (!xdr_setpos(&xdrDecodeStream, 0)) {
106 G3d_error(
"G3d_readInts: positioning xdr failed");
110 if (!xdr_vector(&xdrDecodeStream, (
char *)i, n,
sizeof(
int),
111 (xdrproc_t) xdr_int)) {
112 G3d_error(
"G3d_readInts: reading xdr failed");
void G3d_error(const char *msg,...)
int G3d_writeInts(int fd, int useXdr, const int *i, int nofNum)
#define G3D_XDR_INT_LENGTH
void G3d_fatalError(const char *,...)
This function prints the error message msg, and terminates the program with an error status...
int G3d_readInts(int fd, int useXdr, int *i, int nofNum)