/* @(#)fsyunix.c 17.1.1.1 (ESO-DMD) 01/25/02 17:36:20 */ /*=========================================================================== 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 ===========================================================================*/ /*++++++++++++++++++++++++++ Module FSY ++++++++++++++++++++++++++++++++ .TYPE Module .NAME FSY .LANGUAGE C .AUTHOR K. Banse ESO - Garching .CATEGORY Image files handling. .COMMENTS holds FSY_EXTBDF, FSY_MODBDF .VERSION 011113 last modif ---------------------------------------------------------------------------*/ #include /* to be used in extbdf !!! temporarily */ #include #include #include #include #include static char block[BLOCK_SIZE]; static struct stat buf; static int first = 0; static long int filsize; /* */ void FSY_EXTBDF(fileid, exalq, nvb, status) /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .PURPOSE Extend Bulk Data File .METHOD This routine is used to extend an EXISTING Bulk Data File. The file is opened using osdseek and osdwrite; the calling program supplies the file identification and the number of bytes to write. (i.e. it is assumed that the file has been opened previously) If the file is opened successfully, the initial file size (measured in virtual blocks) is saved and the file extended by the specified number of blocks; the new file size is then calculated and returned to the calling program. .RETURNS nothing -------------------------------------------------------------------------*/ int fileid /* file identification */; int exalq /* extension allocation quantity */; int *nvb /* number of virtual blocks actually allocated */; int *status /* return status (1 if correct, else 0!) */; { int jstat; register int i; unsigned int nblocksz; if (first == 0) { for (i=0; i