summaryrefslogtreecommitdiff
path: root/rc.h
blob: 8269968083ebf7d5d4398fa0f7f33b1827b99220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*  dctrl-tools - Debian control file inspection tools
    Copyright (C) 1999, 2003 Antti-Juhani Kaijanaho

    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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef RC_H__
#define RC_H__

extern char const * const ifile_modes[];

struct ifile {
	enum ifile_mode { m_error, m_read, m_exec } mode;
	char const * s;
};

/* Search for exename (only basename, though) in rcfname (or if it is
   null, in default rc files) and return the found corresponding
   default input file name.  The mode will be m_error, if not found or
   other error occurred, m_read, if it is intended to be interpreted
   as a file name, and m_exec, if the string is to be interpreted as a
   shell command whose stdout should be used.  The returned pointer
   will be invalidated by the next call to this function.  */
struct ifile
find_ifile_by_exename (const char * exename, const char * rcfname);

#endif