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