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