Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

cfput.c

Go to the documentation of this file.
00001 /*
00002  * $Id: cfput.c,v 1.2 2009/02/16 08:04:35 schubert Exp $
00003  *
00004  * Revision 1.1.1.1  2002/07/24 15:56:28  rdm
00005  * initial import into CVS
00006  *
00007  * Revision 1.1.1.1  2002/06/16 15:18:46  hristov
00008  * Separate distribution  of Geant3
00009  *
00010  * Revision 1.1.1.1  1999/05/18 15:55:29  fca
00011  * AliRoot sources
00012  *
00013  * Revision 1.4  1997/10/23 16:33:19  mclareni
00014  * NT mods
00015  *
00016  * Revision 1.3  1997/02/04 17:35:12  mclareni
00017  * Merge Winnt and 97a versions
00018  *
00019  * Revision 1.2  1997/01/15 16:25:33  cernlib
00020  * fix from F.Hemmer to return rfio return code
00021  *
00022  * Revision 1.1.1.1.2.1  1997/01/21 11:30:11  mclareni
00023  * All mods for Winnt 96a on winnt branch
00024  *
00025  * Revision 1.1.1.1  1996/02/15 17:49:36  mclareni
00026  * Kernlib
00027  *
00028  */
00029 #include "kerngen/pilot.h"
00030 #include "kerngen/fortranc.h"
00031 #include "stdio.h"
00032 
00033 /*>    ROUTINE CFPUT
00034   CERN PROGLIB# Z310    CFPUT           .VERSION KERNFOR  4.29  910718
00035   ORIG. 12/01/91, JZ
00036       CALL CFPUT (LUNDES, MEDIUM, NWREC, MBUF, ISTAT)
00037       write to the file :
00038        LUNDES  file descriptor
00039        MEDIUM  = 0,1,2,3 : primary disk/tape, secondary disk/tape
00040        NWREC   record size, number of words to be written
00041        MBUF    vector to be written
00042       *ISTAT   status, =zero if success
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 /*        write the file     */
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 /*> END <----------------------------------------------------------*/
00090 #ifdef CERNLIB_TCGEN_CFPUT
00091 #undef CERNLIB_TCGEN_CFPUT
00092 #endif

Generated on Mon Feb 15 11:06:31 2010 for loon by  doxygen 1.3.9.1