]>
Commit | Line | Data |
---|---|---|
726f6388 JA |
1 | /* tilde.h: Externally available variables and function in libtilde.a. */ |
2 | ||
74091dd4 | 3 | /* Copyright (C) 1992-2009,2021 Free Software Foundation, Inc. |
ccc6cda3 | 4 | |
3185942a | 5 | This file contains the Readline Library (Readline), a set of |
ccc6cda3 JA |
6 | routines for providing Emacs style line input to programs that ask |
7 | for it. | |
8 | ||
3185942a | 9 | Readline is free software: you can redistribute it and/or modify |
ccc6cda3 | 10 | it under the terms of the GNU General Public License as published by |
3185942a JA |
11 | the Free Software Foundation, either version 3 of the License, or |
12 | (at your option) any later version. | |
ccc6cda3 | 13 | |
3185942a JA |
14 | Readline is distributed in the hope that it will be useful, |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | GNU General Public License for more details. | |
ccc6cda3 | 18 | |
3185942a JA |
19 | You should have received a copy of the GNU General Public License |
20 | along with Readline. If not, see <http://www.gnu.org/licenses/>. | |
21 | */ | |
ccc6cda3 JA |
22 | |
23 | #if !defined (_TILDE_H_) | |
24 | # define _TILDE_H_ | |
726f6388 | 25 | |
bb70624e JA |
26 | #ifdef __cplusplus |
27 | extern "C" { | |
28 | #endif | |
29 | ||
74091dd4 | 30 | typedef char *tilde_hook_func_t (char *); |
726f6388 | 31 | |
d166f048 JA |
32 | /* If non-null, this contains the address of a function that the application |
33 | wants called before trying the standard tilde expansions. The function | |
34 | is called with the text sans tilde, and returns a malloc()'ed string | |
35 | which is the expansion, or a NULL pointer if the expansion fails. */ | |
28ef6c31 | 36 | extern tilde_hook_func_t *tilde_expansion_preexpansion_hook; |
d166f048 | 37 | |
726f6388 JA |
38 | /* If non-null, this contains the address of a function to call if the |
39 | standard meaning for expanding a tilde fails. The function is called | |
40 | with the text (sans tilde, as in "foo"), and returns a malloc()'ed string | |
41 | which is the expansion, or a NULL pointer if there is no expansion. */ | |
28ef6c31 | 42 | extern tilde_hook_func_t *tilde_expansion_failure_hook; |
726f6388 JA |
43 | |
44 | /* When non-null, this is a NULL terminated array of strings which | |
45 | are duplicates for a tilde prefix. Bash uses this to expand | |
46 | `=~' and `:~'. */ | |
47 | extern char **tilde_additional_prefixes; | |
48 | ||
49 | /* When non-null, this is a NULL terminated array of strings which match | |
50 | the end of a username, instead of just "/". Bash sets this to | |
51 | `:' and `=~'. */ | |
52 | extern char **tilde_additional_suffixes; | |
53 | ||
54 | /* Return a new string which is the result of tilde expanding STRING. */ | |
74091dd4 | 55 | extern char *tilde_expand (const char *); |
726f6388 JA |
56 | |
57 | /* Do the work of tilde expansion on FILENAME. FILENAME starts with a | |
58 | tilde. If there is no expansion, call tilde_expansion_failure_hook. */ | |
74091dd4 | 59 | extern char *tilde_expand_word (const char *); |
bb70624e | 60 | |
95732b49 | 61 | /* Find the portion of the string beginning with ~ that should be expanded. */ |
74091dd4 | 62 | extern char *tilde_find_word (const char *, int, int *); |
95732b49 | 63 | |
bb70624e JA |
64 | #ifdef __cplusplus |
65 | } | |
66 | #endif | |
726f6388 | 67 | |
ccc6cda3 | 68 | #endif /* _TILDE_H_ */ |