39 #define MAXELEMENTS 1024
108 printf(
"Illegal line record in getlinerec\n");
120 for ( i=0; (i<linlth) && !feof(
inputfile); i++ )
157 for (i = 3; i >= 0; i--)
166 for (i = 3; i >= 0; i--)
182 printf(
"Illegal array record\n");
188 long int arrylth, maxpts;
191 int i, lastel, nxtarry;
195 for ( i=1; i<=lastel; i++ ) {
206 while ( (nxtarry < arrylth) && !feof(
inputfile) );
207 return arrylth != nxtarry;
214 int i, elemnts, nxtel;
217 elemnts = arrylth - nxtel;
220 for ( i=0; i < elemnts; i++ )
putreal( array+(nxtel++) );
223 while (nxtel < arrylth);
231 printf(
"%s\n",errstring);
238 double xarry[], yarry[];
239 long int *npoints, *ncmts, *maxpts;
241 int cmtlns, i, iret, ncol;
244 while ((filename[i++] !=
' ') && (i <=
MAXLINLTH));
248 printf(
"file open error %4d for file \'%s\'\n",
errno,filename);
253 if ( (iret) || strncmp(
info,
"VERSION GENPLT 4.0", 18 ) )
254 return array_err(
"Not a GENPLOT binary file");
261 return array_err(
"Bad comment line record");
263 ( strncmp(comment[cmtlns++],
"\001",1) && !feof(
inputfile) );
264 *ncmts = (long) -- cmtlns;
277 if (iret)
return array_err(
"Bad X comment");
282 return array_err(
"Bad X factor, offset record");
284 return array_err(
"Could not get X array");
289 if (iret)
return array_err(
"Bad Y comment");
295 if (
getarray( yarry, *npoints, *maxpts ) )
296 return array_err(
"Could not get Y array");
303 long int putbin( filename,
xarry, yarry, npoints, comment, ncmts )
305 double xarry[], yarry[];
306 long int *npoints, *ncmts;
310 while ((filename[i++] !=
' ') && (i <= MAXLINLTH));
315 printf(
"file open error %4d\n",
errno);
320 for ( i = 0; i < *ncmts; i++ )
putlinerec( comment[i] );
void putrecsize(int recsize)
long int FORTRAN() getbin(filename, xarry, yarry, long int *npoints, comment, long int *ncmts, long int *maxpts)
long int putbin(filename, xarry, yarry, long int *npoints, comment, long int *ncmts)
void putreal(double *rout)
int array_err(char *errstring)
int getarray(array, long int arrylth, long int maxpts)
void putarray(array, long int arrylth)