00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "kerngen/pilot.h"
00038 #include "kerngen/fortranc.h"
00039 #include "stdio.h"
00040
00041 #if defined(CERNLIB_QMOS9)
00042 #include "os9gs/cfget.c"
00043 #else
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 #include "kerngen/cf_reaw.h"
00057 #ifndef WIN32
00058 # include <errno.h>
00059 #else
00060 # include <stdlib.h>
00061 #endif
00062 #include "kerngen/cf_xaft.h"
00063 #include "kerngen/wordsizc.h"
00064 #if defined(CERNLIB_QX_SC)
00065 void type_of_call cfget_(lundes, medium, nwrec, nwtak, mbuf, stat)
00066 #endif
00067 #if defined(CERNLIB_QXNO_SC)
00068 void type_of_call cfget(lundes, medium, nwrec, nwtak, mbuf, stat)
00069 #endif
00070 #if defined(CERNLIB_QXCAPT)
00071 void type_of_call CFGET(lundes, medium, nwrec, nwtak, mbuf,
00072 # ifdef CERNLIB_CFGET_CHARACTER
00073 lmbuf,
00074 # endif
00075 stat)
00076 # ifdef CERNLIB_CFGET_CHARACTER
00077 int lmbuf;
00078 # endif
00079 #endif
00080 char *mbuf;
00081 int *lundes, *medium, *nwrec, *nwtak, *stat;
00082 {
00083 int fildes;
00084 int nbdn, nbdo;
00085
00086 *stat = 0;
00087 if (*nwtak <= 0) return;
00088
00089
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
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 }
00112
00113 #endif