/* @(#)stka.fc 17.1.1.1 (ES0-DMD) 01/25/02 17:34:09 */ /*=========================================================================== 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 Massachusetss Ave, Cambridge, MA 02139, USA. Corresponding 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 ===========================================================================*/ /*++++++++++++++++++++++++ STKA.FC +++++++++++++++++++++++++++++++++++++++ .LANGUAGE C .IDENTIFICATION Module STKA.FC .COMMENTS Module contains layer between the keyword related FORTRAN STxxxx interfaces and the SC_interfaces written in (hopefully independent) C .AUTHOR K. Banse ESO - Garching .KEYWORDS standard interfaces. .ENVIRONMENT FORTRAN and C standards .VERSION [1.00] 871207: created from SXFTOC.C .VERSION [2.60] 880411: modified new version - the last one .VERSION [2.70] 900316: fix problems with TEXT_LEN+2 .VERSION [2.80] 920210: split up sck.fc into sck.fc + scka.fc -----------------------------------------------------------------------------*/ #include #include SUBROUTINE STKFND(key,type,noelem,bytelem,status) CHARACTER key; /* IN: keyword name */ CHARACTER type; /* OUT: type of key - I, R, C, D or ' ' */ fint2c *noelem; /* OUT: no. of elements */ fint2c *bytelem; /* OUT: no. of bytes per element */ fint2c *status; { *status = SCKFND(STRIPPED_STRING(key),CHAR_LOC(type),noelem,bytelem); } SUBROUTINE STKINF(npos,field,buf,numbuf,status) fint2c *npos; /* IN : position of keyword */ fint2c *field; /* IN :specifies desired info, */ /* 1 = NAME, 2 = TYPE, 3 = SIZE */ CHARACTER buf; /* OUT : buffer for NAME + TYPE info */ fint2c *numbuf; /* IN : max. length of buffer above */ fint2c *status; { *status = SCKINF(*npos,*field,CHAR_LOC(buf),KEYNAME_LEN,numbuf); } SUBROUTINE STKPRC(prompt,key,noelm,felem,maxvals,actvals,values, kunit,knull,status) CHARACTER prompt; /* IN : prompt string (null terminated) */ CHARACTER key; /* IN : name of keyword */ fint2c *noelm; /* IN : for character array, CHAR*noelm */ fint2c *felem; /* IN : 1st data item to be read */ fint2c *maxvals; /* IN : no. of elements to get */ fint2c *actvals; /* OUT: actual no. of elements returned */ CHARACTER values; /* OUT: buffer for data values */ fint2c *kunit; /* OUT: address of unit-pointer */ fint2c *knull; /* OUT: no. of null values in keyword */ fint2c *status; { *status = SCKPRC(STRIPPED_STRING(prompt),STRIPPED_STRING(key), *noelm,*felem,*maxvals,actvals, CHAR_LOC(values),kunit,knull); } SUBROUTINE STKPRD(prompt,key,felem,maxvals,actvals,values,kunit,knull,status) CHARACTER prompt; /* IN : prompt string (null terminated) */ CHARACTER key; /* IN : name of keyword */ fint2c *felem; /* IN : 1st data item to be read */ fint2c *maxvals; /* IN : no. of elements to get */ fint2c *actvals; /* OUT: actual no. of elements returned */ double *values; /* OUT: buffer for data values */ fint2c *kunit; /* OUT: address of unit-pointer */ fint2c *knull; /* OUT: no. of null values in keyword */ fint2c *status; { *status = SCKPRD(STRIPPED_STRING(prompt),STRIPPED_STRING(key), *felem,*maxvals,actvals,values,kunit,knull); } SUBROUTINE STKPRI(prompt,key,felem,maxvals,actvals,values,kunit,knull,status) CHARACTER prompt; /* IN : prompt string (null terminated) */ CHARACTER key; /* IN : name of keyword */ fint2c *felem; /* IN : 1st data item to be read */ fint2c *maxvals; /* IN : no. of elements to get */ fint2c *actvals; /* OUT: actual no. of elements returned */ fint2c *values; /* OUT: buffer for data values */ fint2c *kunit; /* OUT: address of unit-pointer */ fint2c *knull; /* OUT: no. of null values in keyword */ fint2c *status; { *status = SCKPRI(STRIPPED_STRING(prompt),STRIPPED_STRING(key), *felem,*maxvals,actvals,values,kunit,knull); } SUBROUTINE STKPRR(prompt,key,felem,maxvals,actvals,values,kunit,knull,status) CHARACTER prompt; /* IN : prompt string (null terminated) */ CHARACTER key; /* IN : name of keyword */ fint2c *felem; /* IN : 1st data item to be read */ fint2c *maxvals; /* IN : no. of elements to get */ fint2c *actvals; /* OUT: actual no. of elements returned */ float *values; /* OUT: buffer for data values */ fint2c *kunit; /* OUT: address of unit-pointer */ fint2c *knull; /* OUT: no. of null values in keyword */ fint2c *status; { *status = SCKPRR(STRIPPED_STRING(prompt),STRIPPED_STRING(key), *felem,*maxvals,actvals,values,kunit,knull); }