/* @(#)ofname.c 17.1.1.1 (ESO-DMD) 01/25/02 17:39:12 */ /*=========================================================================== Copyright (C) 1995 European Southern Observatory (ESO) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. Correspondence concerning ESO-MIDAS should be addressed as follows: Internet e-mail: midas@eso.org Postal address: European Southern Observatory Data Management Division Karl-Schwarzschild-Strasse 2 D 85748 Garching bei Muenchen GERMANY ===========================================================================*/ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .COPYRIGHT (c) 1994 European Southren Observatory .IDENT ofname.c .LAUGUAGE C .AUTHOR P.Grosbol ESO/IPG .KEYWORDS file names, output frames .COMMENT Generates output file names for 'intape' program .VERSION 1.0 1988-Aug-20 : Creation, PJG .VERSION 1.1 1990-Jul-02 : Upgrade and use index, PJG .VERSION 1.2 1990-Sep-28 : Lower case ext. letters, PJG .VERSION 1.3 1991-Mar-19 : Include FIT files, PJG .VERSION 1.4 1994-Oct-19 : Just prefix name if no<0, PJG 000729 K. Banse ---------------------------------------------------------------------*/ #define MXNAME 128 /* max. length of new file name */ static int idx,ino,tno,fno; /* image and table extension no. */ static int xflag, xno; static char fname[MXNAME]; /* internal buffer for file name */ int outname(name,no) /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .PURPOSE initiate name of output file in intape program .RETURN status 0:OK, -1: error ---------------------------------------------------------------------*/ char *name; /* pointer to prefix label */ int no; /* relative no. of file */ { int ww, n; char c; xno = ino = tno = fno = 0; /* init counter */ xflag = 0; /* flag, we came via `outname' */ for (n=0; n