4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Green Red Orange Magenta Azure Cyan Skyblue
29 static char *SRCID_binio_c
= "$Id$";
38 void _blockwrite(FILE *fp
,int nelem
,int size
,void *data
,char *what
,char *file
,
44 (void) fprintf(stderr
,"blockwrite %s (file %s,line %d,size=%d, nelem=%d)\n",
45 what
,file
,line
,size
,nelem
);
48 if ((len
=fwrite(data
,size
,nelem
,fp
))!=nelem
)
49 fatal_error(errno
,"writing %s (%dx%d, len=%d, pos=%d) from file %s, "
50 "line %d",what
,nelem
,size
,len
,ftell(fp
),file
,line
);
53 void _blockread(FILE *fp
,int nelem
,int size
,void *data
,char *what
,char *file
,
59 (void) fprintf(stderr
,"blockread %s (file %s,line %d,size=%d, nelem=%d)\n",
60 what
,file
,line
,size
,nelem
);
63 if ((len
=fread(data
,size
,nelem
,fp
))!=nelem
)
64 fatal_error(errno
,"reading %s (%dx%d, len=%d, pos=%d) from file %s, "
65 "line %d",what
,nelem
,size
,len
,ftell(fp
),file
,line
);