/* @(#)qreqa.c 17.1.1.1 (ESO-DMD) 01/25/02 17:37:43 */ /*=========================================================================== 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 ===========================================================================*/ /*+++++++++++++++++++++++++++++++ QREQA +++++++++++++++++++++++++++++++ .LANGUAGE C .IDENTIFICATION MIDAS front end (main module QREQA) for executing MIDAS applications fvrom the UNIX command line .AUTHOR K. Banse / IPG ESO - Garching .KEYWORDS MIDAS front end .ENVIRONMENT UNIX .PURPOSE get the MIDAS command string from command line + take action accordingly .ALGORITHM execute command and execute upon return from PREPX .RETURNS Midas return status .VERSION [1.00] 990107: built up from prepa.c 010424 last modif ------------------------------------------------------------------------*/ # include # include #include #include #include #include #include #include int is_a_tty = 1; /* Is this a terminal, (yes=1) */ /* */ void intermail() { return; } /* */ int main(argc,argv) int argc; char *argv[]; { int kk, jj, iwa, pxinfo[6]; char *argptr, cxp[4]; for (jj=0; jj<4; jj++) cxp[jj] = 'N'; help_sect: if (argc < 2) { /* display contents of drs help file */ char work[84]; int reclen, fp; /* we cannot use CGN_DISPFIL, because */ /* no keywords there, yet */ fp = CGN_OPEN("MID_HELP:drs.help",0); if (fp == -1) { (void) printf("Could not open drs helpfile `MID_HELP:drs.help'...\n"); return(-99); } reclen = osaread(fp,work,80); /* skip SCCS header of helpfile */ read_loop: reclen = osaread(fp,work,80); if (reclen == 0) goto read_loop; else if (reclen == -1) { (void) osaclose(fp); return (-99); } (void) printf("%s\n",work); goto read_loop; } qinit_here(); /* initialize */ iwa = 1; kk = argc - 1; testa: if (*argv[iwa] == '-') { argptr = argv[iwa] + 1; if (*argptr == 'd') /* -debug */ { cxp[0] = 'Y'; iwa ++; kk --; goto testa; } if (*argptr == 'u') /* -update (of FITS files) */ { cxp[1] = 'Y'; iwa ++; kk --; goto testa; } if (*argptr == 'f') /* -fits (format of new files) */ { cxp[2] = 'Y'; iwa ++; kk --; goto testa; } argc = 1; /* for all other options display help text */ goto help_sect; } for (jj=0; jj