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