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 #include "kerngen/pilot.h"
00030 #include "kerngen/fortranc.h"
00031 #include "stdio.h"
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #include "kerngen/cf_reaw.h"
00045 #include <errno.h>
00046 #include "kerngen/cf_xaft.h"
00047 #include "kerngen/wordsizc.h"
00048 #if defined(CERNLIB_QX_SC)
00049 void type_of_call cfput_(lundes, medium, nwrec, mbuf, stat)
00050 #endif
00051 #if defined(CERNLIB_QXNO_SC)
00052 void type_of_call cfput(lundes, medium, nwrec, mbuf, stat)
00053 #endif
00054 #if defined(CERNLIB_QXCAPT)
00055 void type_of_call CFPUT(lundes, medium, nwrec, mbuf,
00056 # ifdef CERNLIB_CFPUT_CHARACTER
00057 lmbuf,
00058 # endif
00059 stat)
00060 # ifdef CERNLIB_CFPUT_CHARACTER
00061 int lmbuf;
00062 # endif
00063 #endif
00064 char *mbuf;
00065 int *lundes, *medium, *nwrec, *stat;
00066 {
00067 int fildes;
00068 int nbdn, nbdo;
00069
00070 *stat = 0;
00071 if (*nwrec <= 0) return;
00072
00073
00074
00075 fildes = *lundes;
00076 nbdo = *nwrec * NBYTPW;
00077 nbdn = write (fildes, mbuf, nbdo);
00078 if (nbdn < 0) goto trouble;
00079 return;
00080
00081 #if defined(CERNLIB_PROJSHIFT)
00082 trouble: *stat = (serrno ? serrno : (rfio_errno ? rfio_errno : errno));
00083 #else
00084 trouble: *stat = errno;
00085 #endif
00086 perror (" error in CFPUT");
00087 return;
00088 }
00089
00090 #ifdef CERNLIB_TCGEN_CFPUT
00091 #undef CERNLIB_TCGEN_CFPUT
00092 #endif