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