#include "kerngen/pilot.h"#include "kerngen/fortranc.h"#include "stdio.h"#include "kerngen/cf_reaw.h"#include <errno.h>#include "kerngen/cf_xaft.h"#include "kerngen/wordsizc.h"Go to the source code of this file.
Functions | |
| void type_of_call | cfget_ (int *lundes, int *medium, int *nwrec, int *nwtak, char *mbuf, int *stat) |
|
||||||||||||||||||||||||||||
|
Definition at line 65 of file cfget.c. References NBYTPW, and type_of_call. 00082 {
00083 int fildes;
00084 int nbdn, nbdo;
00085
00086 *stat = 0;
00087 if (*nwtak <= 0) return;
00088
00089 /* read the file */
00090
00091 fildes = *lundes;
00092 nbdo = *nwrec * NBYTPW;
00093 nbdn = read (fildes, mbuf, nbdo);
00094 if (nbdn == 0) goto heof;
00095 if (nbdn < 0) goto herror;
00096 *nwtak = (nbdn - 1) / NBYTPW + 1;
00097 return;
00098
00099 /* Handle exceptions */
00100
00101 heof: *stat = -1;
00102 return;
00103
00104 #if defined(CERNLIB_PROJSHIFT)
00105 herror: *stat = (serrno ? serrno : (rfio_errno ? rfio_errno : errno));
00106 #else
00107 herror: *stat = errno;
00108 #endif
00109 perror (" error in CFGET");
00110 return;
00111 }
|
1.3.9.1