1/* tilde.h: Externally available variables and function in libtilde.a.
2   $Id: tilde.h,v 1.3 2004/04/11 17:56:46 karl Exp $
3
4   This file has appeared in prior works by the Free Software Foundation;
5   thus it carries copyright dates from 1988 through 1993.
6
7   Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 2004 Free Software
8   Foundation, Inc.
9
10   This program is free software; you can redistribute it and/or modify
11   it under the terms of the GNU General Public License as published by
12   the Free Software Foundation; either version 2, or (at your option)
13   any later version.
14
15   This program is distributed in the hope that it will be useful,
16   but WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18   GNU General Public License for more details.
19
20   You should have received a copy of the GNU General Public License
21   along with this program; if not, write to the Free Software
22   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24   Written by Brian Fox (bfox@ai.mit.edu). */
25
26#ifndef TILDE_H
27#define TILDE_H
28
29#include "info.h"
30
31/* If non-null, this contains the address of a function to call if the
32   standard meaning for expanding a tilde fails.  The function is called
33   with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
34   which is the expansion, or a NULL pointer if there is no expansion. */
35extern CFunction *tilde_expansion_failure_hook;
36
37/* When non-null, this is a NULL terminated array of strings which
38   are duplicates for a tilde prefix.  Bash uses this to expand
39   `=~' and `:~'. */
40extern char **tilde_additional_prefixes;
41
42/* When non-null, this is a NULL terminated array of strings which match
43   the end of a username, instead of just "/".  Bash sets this to
44   `:' and `=~'. */
45extern char **tilde_additional_suffixes;
46
47/* Return a new string which is the result of tilde expanding STRING. */
48extern char *tilde_expand (char *string);
49
50/* Do the work of tilde expansion on FILENAME.  FILENAME starts with a
51   tilde.  If there is no expansion, call tilde_expansion_failure_hook. */
52extern char *tilde_expand_word (char *filename);
53
54#endif /* not TILDE_H */
55