]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MINICERN/packlib/kernlib/kerngen/ccgencf/cfseek.c
Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / MINICERN / packlib / kernlib / kerngen / ccgencf / cfseek.c
CommitLineData
fe4da5cc 1/*
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.2 1997/02/04 17:35:13 mclareni
6 * Merge Winnt and 97a versions
7 *
8 * Revision 1.1.1.1.2.1 1997/01/21 11:30:12 mclareni
9 * All mods for Winnt 96a on winnt branch
10 *
11 * Revision 1.1.1.1 1996/02/15 17:49:36 mclareni
12 * Kernlib
13 *
14 */
15#include "kerngen/pilot.h"
16/*> ROUTINE CFSEEK
17 CERN PROGLIB# Z310 CFSEEK .VERSION KERNFOR 4.29 910718
18 ORIG. 12/01/91, JZ
19 CALL CFSEEK (LUNDES, MEDIUM, NWREC, JCREC, ISTAT)
20 reposition the file :
21 LUNDES file descriptor
22 MEDIUM = 0,1,2,3 : primary disk/tape, secondary disk/tape
23 NWREC number of words per record
24 JCREC number of records before current
25 *ISTAT status, =zero if success
26*/
27#include "kerngen/cf_seek.h"
28#include "kerngen/cf_xaft.h"
29#include "kerngen/wordsizc.h"
30#include "kerngen/fortranc.h"
31
32#if defined(CERNLIB_QX_SC)
33void type_of_call cfseek_(lundes, medium, nwrec, jcrec, stat)
34#endif
35#if defined(CERNLIB_QXNO_SC)
36void type_of_call cfseek(lundes, medium, nwrec, jcrec, stat)
37#endif
38#if defined(CERNLIB_QXCAPT)
39void type_of_call CFSEEK(lundes, medium, nwrec, jcrec, stat)
40#endif
41 int *lundes, *medium, *nwrec, *jcrec, *stat;
42{
43 int fildes;
44 int nbdo;
45 int isw;
46
47/* position the file */
48
49 fildes = *lundes;
50 nbdo = *jcrec * *nwrec * NBYTPW;
51 isw = lseek (fildes, nbdo, 0);
52 if (isw < 0) goto trouble;
53 *stat = 0;
54 return;
55
56trouble: *stat = -1;
57 perror (" error in CFSEEK");
58 return;
59}
60/*> END <----------------------------------------------------------*/
61#ifdef CERNLIB_TCGEN_CFSEEK
62#undef CERNLIB_TCGEN_CFSEEK
63#endif