1432
|
1 /* tilde.h: Externally available variables and function in libtilde.a. */ |
|
2 |
|
3 #if !defined (__TILDE_H__) |
|
4 # define __TILDE_H__ |
|
5 |
1464
|
6 #ifdef __cplusplus |
|
7 extern "C" { |
|
8 #endif |
|
9 |
1432
|
10 /* Function pointers can be declared as (Function *)foo. */ |
|
11 #if !defined (__FUNCTION_DEF) |
|
12 # define __FUNCTION_DEF |
|
13 typedef int Function (); |
|
14 typedef void VFunction (); |
|
15 typedef char *CPFunction (); |
|
16 typedef char **CPPFunction (); |
|
17 #endif /* _FUNCTION_DEF */ |
|
18 |
|
19 /* If non-null, this contains the address of a function to call if the |
|
20 standard meaning for expanding a tilde fails. The function is called |
|
21 with the text (sans tilde, as in "foo"), and returns a malloc()'ed string |
|
22 which is the expansion, or a NULL pointer if there is no expansion. */ |
|
23 extern CPFunction *tilde_expansion_failure_hook; |
|
24 |
|
25 /* When non-null, this is a NULL terminated array of strings which |
|
26 are duplicates for a tilde prefix. Bash uses this to expand |
|
27 `=~' and `:~'. */ |
|
28 extern char **tilde_additional_prefixes; |
|
29 |
|
30 /* When non-null, this is a NULL terminated array of strings which match |
|
31 the end of a username, instead of just "/". Bash sets this to |
|
32 `:' and `=~'. */ |
|
33 extern char **tilde_additional_suffixes; |
|
34 |
|
35 /* Return a new string which is the result of tilde expanding STRING. */ |
|
36 extern char *tilde_expand (); |
|
37 |
|
38 /* Do the work of tilde expansion on FILENAME. FILENAME starts with a |
|
39 tilde. If there is no expansion, call tilde_expansion_failure_hook. */ |
|
40 extern char *tilde_expand_word (); |
|
41 |
1464
|
42 #ifdef __cplusplus |
|
43 } |
|
44 #endif |
|
45 |
1432
|
46 #endif /* __TILDE_H__ */ |