]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MINICERN/packlib/kernlib/kerngen/ccgen/renami.c
This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / MINICERN / packlib / kernlib / kerngen / ccgen / renami.c
1 /*
2  * $Id$
3  *
4  * $Log$
5  * Revision 1.2  1997/02/04 17:34:38  mclareni
6  * Merge Winnt and 97a versions
7  *
8  * Revision 1.1.1.1.2.1  1997/01/21 11:29:39  mclareni
9  * All mods for Winnt 96a on winnt branch
10  *
11  * Revision 1.1.1.1  1996/02/15 17:49:25  mclareni
12  * Kernlib
13  *
14  */
15 #include "kerngen/pilot.h"
16 #include "kerngen/fortranc.h"
17
18 /*>    ROUTINE RENAMI
19   CERN PROGLIB# Z265    RENAMI          .VERSION KERNFOR  4.31  911111
20   ORIG. 22/02/91, JZ
21   Fortran interface routine to rename
22
23       ISTAT = RENAMEF (FROM, TO)
24
25           FROM  old file name
26             TO  new file name
27          ISTAT  zero if successful
28 */
29 #include <stdio.h>
30 #include "kerngen/fortchar.h"
31 #if defined(CERNLIB_QX_SC)
32 int type_of_call renami_(frpath, topath, lgfr, lgto)
33 #endif
34 #if defined(CERNLIB_QXNO_SC)
35 int type_of_call renami(frpath, topath, lgfr, lgto)
36 #endif
37 #if defined(CERNLIB_QXCAPT)
38 int type_of_call RENAMI(frpath, topath, lgfr, lgto)
39 #endif
40 #if defined(CERNLIB_QMCRY)
41       _fcd  frpath,  topath;
42 #endif
43 #if !defined(CERNLIB_QMCRY)
44       char *frpath, *topath;
45 #endif
46       int  *lgfr, *lgto;
47 {
48       char *ptfr, *ptto, *fchtak();
49       int  istat, rename();
50
51       istat = -1;
52       ptfr  = fchtak(frpath,*lgfr);
53       if (ptfr == NULL)            goto bad;
54
55       ptto  = fchtak(topath,*lgto);
56       if (ptto == NULL)            goto pre;
57
58       istat = rename (ptfr, ptto);
59
60       free (ptto);
61 pre:  free (ptfr);
62 bad:  return istat;
63 }
64 /*> END <----------------------------------------------------------*/