1
/* @(#)ag_stdo.c 19.1 (ES0-DMD) 02/25/03 13:53:01 */
2
/*===========================================================================
3
Copyright (C) 1995 European Southern Observatory (ESO)
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License as
7
published by the Free Software Foundation; either version 2 of
8
the License, or (at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public
16
License along with this program; if not, write to the Free
17
Software Foundation, Inc., 675 Massachusetss Ave, Cambridge,
20
Corresponding concerning ESO-MIDAS should be addressed as follows:
21
Internet e-mail: midas@eso.org
22
Postal address: European Southern Observatory
23
Data Management Division
24
Karl-Schwarzschild-Strasse 2
25
D 85748 Garching bei Muenchen
27
===========================================================================*/
29
/* @(#)ag_stdo.c 19.1 (OAA-ASTRONET) 02/25/03 13:53:01 */
31
* HEADER : ag_stdo.c - Vers 3.6.000 - Oct 1991 - L. Fini, OAA
43
/*****************************************************************************/
44
/*CC AG_STDO (C callable) */
46
/* AG_STDO Open given file for read on hierarchy of directories */
49
/* This function opens a given file for read on a fixed set of directories */
50
/* In the following order: */
53
FILE *AG_STDO (fname,ext,flag)
54
/* returns file pointer or NULL on failure */
56
char *fname; /* File name */
57
char *ext; /* File extension. This string is concatenated */
58
/* to file name above to get the full name */
59
int flag; /* Directory search disable flag. It is the */
60
/* sum of the following values */
62
/* 1 - Disable search on current directory */
63
/* 2 - Disable search on HOME directory (*) */
64
/* 4 - Disable search on AGL standard dir. */
65
/* Note: the AGL standard directory name is */
66
/* searched among environment variable in*/
67
/* order to allow a runtime definition */
69
/* (*): not yet implemented */
74
static char *try = "Opening file:";
75
static char *done = "... done";
76
static char *notdone = "... not found";
81
if(!(flag&1)) { /* Search on current directory */
92
AG_DMSG(AGLSTDIR,"Translated");
93
AGL_trns(AGLSTDIR,PHNAMLNG,aux); /* Search into environment */
94
AG_DMSG("..into",aux);